Beispiel #1
0
		public DomInspector (Page p, MainForm m)
		{
			helper = p;
			main = m;

			nodeList = new ArrayList ();
			domTree = new TreeView ();
			popupmenu = new ContextMenu (new MenuItem[] { 
				new MenuItem ("Select this node", delegate (object sender, EventArgs e) {
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
				}),

				new MenuItem ("Children", delegate (object sender, EventArgs e) {
					helper.NewRootNode = nodeList[int.Parse (domTree.SelectedNode.Name)] as IElement;
				}),
				new MenuItem ("InnerText", delegate (object sender, EventArgs e) {
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as IElement;
					helper.getInnerText (); 	
				}),
				new MenuItem ("InnerHTML",	delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as IElement;
					helper.getInnerHTML (); 
				}),
				new MenuItem ("OuterText", delegate (object sender, EventArgs e) {
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as IElement;
					helper.getOuterText (); 	
				}),
				new MenuItem ("OuterHTML",	delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as IElement;
					helper.getOuterHTML (); 
				}),
				new MenuItem ("LocalName",	delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.getLocalName (); 
				}),
				new MenuItem ("Style",	delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.getStyle (); 
				}),
				new MenuItem ("TabIndex",	delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.getTabIndex (); 
				}),
				new MenuItem ("Value",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.getValue (); 
				}),
				new MenuItem ("Type",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.getType (); 
				}),
				new MenuItem ("Attach Click Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.Click += new NodeEventHandler (helper.Click);
				}),
				new MenuItem ("Detach Click Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.Click -= new NodeEventHandler (helper.Click);
				}),
				new MenuItem ("Attach KeyDown Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyDown += new NodeEventHandler (helper.KeyDown);
				}),
				new MenuItem ("Detach KeyDown Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyDown -= new NodeEventHandler (helper.KeyDown);
				}),
				new MenuItem ("Attach KeyPress Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyPress += new NodeEventHandler (helper.KeyPress);
				}),
				new MenuItem ("Detach KeyPress Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyPress -= new NodeEventHandler (helper.KeyPress);
				}),
				new MenuItem ("Attach KeyUp Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyUp += new NodeEventHandler (helper.KeyUp);
				}),
				new MenuItem ("Detach KeyUp Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.KeyUp -= new NodeEventHandler (helper.KeyUp);
				}),
				new MenuItem ("Attach DoubleClick Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.DoubleClick += new NodeEventHandler (helper.DoubleClick);
				}),
				new MenuItem ("Detach DoubleClick Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.DoubleClick -= new NodeEventHandler (helper.DoubleClick);
				}),
				new MenuItem ("Attach MouseDown Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseDown += new NodeEventHandler (helper.MouseDown);
				}),
				new MenuItem ("Detach MouseDown Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseDown -= new NodeEventHandler (helper.MouseDown);
				}),
				new MenuItem ("Attach MouseEnter Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseEnter += new NodeEventHandler (helper.MouseEnter);
				}),
				new MenuItem ("Detach MouseEnter Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseEnter -= new NodeEventHandler (helper.MouseEnter);
				}),
				new MenuItem ("Attach MouseLeave Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseLeave += new NodeEventHandler (helper.MouseLeave);
				}),
				new MenuItem ("Detach MouseLeave Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseLeave -= new NodeEventHandler (helper.MouseLeave);
				}),
				new MenuItem ("Attach MouseMove Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseMove += new NodeEventHandler (helper.MouseMove);
				}),
				new MenuItem ("Detach MouseMove Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseMove -= new NodeEventHandler (helper.MouseMove);
				}),
				new MenuItem ("Attach MouseOver Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseOver += new NodeEventHandler (helper.MouseOver);
				}),
				new MenuItem ("Detach MouseOver Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseOver -= new NodeEventHandler (helper.MouseOver);
				}),
				new MenuItem ("Attach MouseUp Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseUp += new NodeEventHandler (helper.MouseUp);
				}),
				new MenuItem ("Detach MouseUp Event",delegate (object sender, EventArgs e) { 
					helper.lastNodeFetched = nodeList[int.Parse (domTree.SelectedNode.Name)] as INode;
					helper.lastNodeFetched.MouseUp -= new NodeEventHandler (helper.MouseUp);
				})
			});

			domTree.Dock = DockStyle.Fill;
			this.Controls.Add (domTree);

		}
Beispiel #2
0
		public Page (MainForm parent) {
			this.parent = parent;
		}