|
11 | 11 |
|
12 | 12 | namespace FlashDebugger.Controls
|
13 | 13 | {
|
14 |
| - public class WatchUI : DockPanelControl |
15 |
| - { |
16 |
| - private DataTreeControl treeControl; |
17 |
| - private List<String> watches; |
| 14 | + public class WatchUI : DockPanelControl |
| 15 | + { |
| 16 | + private DataTreeControl treeControl; |
| 17 | + private List<String> watches; |
18 | 18 |
|
19 |
| - public WatchUI() |
20 |
| - { |
21 |
| - watches = new List<string>(); |
22 |
| - treeControl = new DataTreeControl(true); |
23 |
| - this.treeControl.Tree.BorderStyle = BorderStyle.None; |
24 |
| - this.treeControl.Resize += new EventHandler(this.TreeControlResize); |
25 |
| - this.treeControl.Tree.Font = PluginBase.Settings.DefaultFont; |
26 |
| - this.treeControl.Dock = DockStyle.Fill; |
27 |
| - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
28 |
| - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
29 |
| - this.Controls.Add(this.treeControl); |
30 |
| - } |
| 19 | + public WatchUI() |
| 20 | + { |
| 21 | + watches = new List<string>(); |
| 22 | + treeControl = new DataTreeControl(true); |
| 23 | + this.treeControl.Tree.BorderStyle = BorderStyle.None; |
| 24 | + this.treeControl.Resize += new EventHandler(this.TreeControlResize); |
| 25 | + this.treeControl.Tree.Font = PluginBase.Settings.DefaultFont; |
| 26 | + this.treeControl.Dock = DockStyle.Fill; |
| 27 | + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
| 28 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
| 29 | + this.Controls.Add(this.treeControl); |
| 30 | + } |
31 | 31 |
|
32 |
| - private void TreeControlResize(Object sender, EventArgs e) |
33 |
| - { |
34 |
| - Int32 w = this.treeControl.Width / 2; |
35 |
| - this.treeControl.Tree.Columns[0].Width = w; |
36 |
| - this.treeControl.Tree.Columns[1].Width = w - 8; |
37 |
| - } |
| 32 | + private void TreeControlResize(Object sender, EventArgs e) |
| 33 | + { |
| 34 | + Int32 w = this.treeControl.Width / 2; |
| 35 | + this.treeControl.Tree.Columns[0].Width = w; |
| 36 | + this.treeControl.Tree.Columns[1].Width = w - 8; |
| 37 | + } |
38 | 38 |
|
39 |
| - public void AddElement(String item) |
40 |
| - { |
41 |
| - if (watches.Contains(item)) return; |
42 |
| - watches.Add(item); |
43 |
| - UpdateElements(); |
44 |
| - } |
45 |
| - |
46 |
| - public void RemoveElement(string item) |
47 |
| - { |
48 |
| - watches.Remove(item); |
49 |
| - UpdateElements(); |
50 |
| - } |
| 39 | + public void AddElement(String item) |
| 40 | + { |
| 41 | + if (watches.Contains(item)) return; |
| 42 | + watches.Add(item); |
| 43 | + UpdateElements(); |
| 44 | + } |
| 45 | + |
| 46 | + public void RemoveElement(string item) |
| 47 | + { |
| 48 | + watches.Remove(item); |
| 49 | + UpdateElements(); |
| 50 | + } |
51 | 51 |
|
52 |
| - public void RemoveElement(int itemN) |
53 |
| - { |
54 |
| - if (itemN<watches.Count) RemoveElement(watches[itemN]); |
55 |
| - } |
| 52 | + public void RemoveElement(int itemN) |
| 53 | + { |
| 54 | + if (itemN<watches.Count) RemoveElement(watches[itemN]); |
| 55 | + } |
56 | 56 |
|
57 |
| - public void Clear() |
58 |
| - { |
59 |
| - watches.Clear(); |
60 |
| - UpdateElements(); |
61 |
| - } |
| 57 | + public void Clear() |
| 58 | + { |
| 59 | + watches.Clear(); |
| 60 | + UpdateElements(); |
| 61 | + } |
62 | 62 |
|
63 |
| - public void UpdateElements() |
64 |
| - { |
65 |
| - treeControl.Tree.BeginUpdate(); |
66 |
| - treeControl.Nodes.Clear(); |
67 |
| - foreach (String item in watches) |
68 |
| - { |
69 |
| - DataNode node = new DataNode(item); // todo, introduce new Node types. |
70 |
| - try |
71 |
| - { |
| 63 | + public void UpdateElements() |
| 64 | + { |
| 65 | + treeControl.Tree.BeginUpdate(); |
| 66 | + treeControl.Nodes.Clear(); |
| 67 | + foreach (String item in watches) |
| 68 | + { |
| 69 | + DataNode node = new DataNode(item); // todo, introduce new Node types. |
| 70 | + try |
| 71 | + { |
72 | 72 | IASTBuilder builder = new ASTBuilder(false);
|
73 | 73 | ValueExp exp = builder.parse(new java.io.StringReader(item));
|
74 | 74 | var ctx = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session, PluginMain.debugManager.FlashInterface.GetFrames()[PluginMain.debugManager.CurrentFrame]);
|
75 | 75 | var obj = exp.evaluate(ctx);
|
76 | 76 | node = new DataNode((Variable)obj);
|
77 | 77 | node.Tag = item;
|
78 |
| - } |
79 |
| - catch { } |
80 |
| - node.Text = item; |
81 |
| - treeControl.AddNode(node); |
82 |
| - } |
83 |
| - treeControl.Tree.EndUpdate(); |
84 |
| - treeControl.Enabled = true; |
85 |
| - } |
| 78 | + } |
| 79 | + catch { } |
| 80 | + node.Text = item; |
| 81 | + treeControl.AddNode(node); |
| 82 | + } |
| 83 | + treeControl.Tree.EndUpdate(); |
| 84 | + treeControl.Enabled = true; |
| 85 | + } |
86 | 86 |
|
87 |
| - } |
| 87 | + } |
88 | 88 | }
|
0 commit comments