-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertyForm.cs
More file actions
118 lines (94 loc) · 3.63 KB
/
Copy pathPropertyForm.cs
File metadata and controls
118 lines (94 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Copyright (C), 2007, Mathieu Kooiman < xdc@scriptorama.nl>
* $Id: PropertyForm.cs 10 2007-04-29 13:39:20Z mathieuk $
*
* This file is part of XDebugClient.
*
* XDebugClient is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
* XDebugClient is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with XDebugClient; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
using xdc.XDebug;
using xdc.GUI;
using Aga.Controls.Tree;
namespace xdc.Forms
{
public partial class PropertyForm : Form
{
private TreeModel _Model;
private xdc.XDebug.Client _client;
public PropertyForm(xdc.XDebug.Client client)
{
InitializeComponent();
_client = client;
_Model = new TreeModel();
treeViewAdv1.Model = _Model;
treeViewAdv1.Expanding += new EventHandler<TreeViewAdvEventArgs>(treeViewAdv1_Expanding);
}
void treeViewAdv1_Expanding(object sender, TreeViewAdvEventArgs e)
{
if (_client.State != XdebugClientState.Break)
{
MessageBox.Show(
"This property is no longer available. Close the Property window and try running the script again.",
"Property invalidated",
MessageBoxButtons.OK
);
return;
}
DebugNode node = e.Node.Tag as DebugNode;
if ( node != null && !node.Property.isComplete)
{
Property p = _client.GetPropertyValue(node.Property.FullName, 0);
/* We don't want 'p' itself. It will be a copy of the node that
* was marked as inComplete. */
foreach (Property child in p.ChildProperties)
{
DebugNode newNode = this.BuildDebugNode(child, node);
node.Nodes.Add(newNode);
}
node.Property.isComplete = true;
}
}
public DebugNode BuildDebugNode(Property p, DebugNode Parent)
{
DebugNode newNode = new DebugNode(p);
if (Parent != null && Parent is DebugNode)
{
newNode.Parent = Parent;
}
foreach (Property Child in p.ChildProperties)
{
DebugNode tmpNode = this.BuildDebugNode(Child, newNode);
}
return newNode;
}
public void LoadProperty(Property p, DebugNode Parent)
{
DebugNode newNode = this.BuildDebugNode(p, Parent);
_Model.Nodes.Add(newNode);
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}