public void SetUp() { XmlCompletionDataProvider completionDataProvider = new XmlCompletionDataProvider(new XmlSchemaCompletionDataCollection(), null, String.Empty); treeViewContainerControl = new XmlTreeViewContainerControl(); treeView = treeViewContainerControl.TreeView; treeViewContainerControl.LoadXml(GetXml(), completionDataProvider); doc = treeViewContainerControl.Document; clipboardHandler = treeViewContainerControl as IClipboardHandler; htmlElement = doc.DocumentElement; bodyElement = htmlElement.FirstChild as XmlElement; paragraphElement = bodyElement.SelectSingleNode("p") as XmlElement; paragraphText = paragraphElement.SelectSingleNode("text()") as XmlText; bodyComment = bodyElement.SelectSingleNode("comment()") as XmlComment; htmlTreeNode = treeView.Nodes[0] as XmlElementTreeNode; htmlTreeNode.PerformInitialization(); bodyTreeNode = htmlTreeNode.FirstNode as XmlElementTreeNode; bodyTreeNode.PerformInitialization(); bodyCommentTreeNode = bodyTreeNode.FirstNode as XmlCommentTreeNode; paragraphTreeNode = bodyTreeNode.LastNode as XmlElementTreeNode; paragraphTreeNode.PerformInitialization(); paragraphTextTreeNode = paragraphTreeNode.FirstNode as XmlTextTreeNode; }
public void SetUp() { MockOpenedFile openedFile = new MockOpenedFile("test.xml"); XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection(); xmlView = new MockXmlViewContent(openedFile); view = new XmlTreeView(xmlView, schemas, null); treeViewContainer = (XmlTreeViewContainerControl)view.Control; treeView = treeViewContainer.TreeView; clipboardHandler = view as IClipboardHandler; xmlView.GetDocumentForFile(null).Text = "<html><body><p></p></body></html>"; openedFile.SwitchToView(view); htmlTreeNode = treeView.Nodes[0] as XmlElementTreeNode; htmlTreeNode.PerformInitialization(); bodyTreeNode = htmlTreeNode.Nodes[0] as XmlElementTreeNode; bodyTreeNode.PerformInitialization(); paragraphTreeNode = bodyTreeNode.Nodes[0] as XmlElementTreeNode; treeView.SelectedNode = null; }
public void SetUp() { MockOpenedFile openedFile = new MockOpenedFile("test.xml"); XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection(); xmlView = new XmlView(new DefaultTextEditorProperties(), schemas); xmlView.SetPrimaryFileUnitTestMode(openedFile); view = new XmlTreeView(xmlView, null, null); treeViewContainer = (XmlTreeViewContainerControl)view.Control; treeView = treeViewContainer.TreeView; clipboardHandler = view as IClipboardHandler; xmlView.XmlEditor.Text = "<html><body><p></p></body></html>"; openedFile.SwitchToView(view); htmlTreeNode = treeView.Nodes[0] as XmlElementTreeNode; htmlTreeNode.PerformInitialization(); bodyTreeNode = htmlTreeNode.Nodes[0] as XmlElementTreeNode; bodyTreeNode.PerformInitialization(); paragraphTreeNode = bodyTreeNode.Nodes[0] as XmlElementTreeNode; treeView.SelectedNode = null; }
public void SetUp() { treeViewContainerControl = new DerivedXmlTreeViewContainerControl(); treeView = treeViewContainerControl.TreeView; treeViewContainerControl.LoadXml(GetXml()); doc = treeViewContainerControl.Document; clipboardHandler = treeViewContainerControl as IClipboardHandler; htmlElement = doc.DocumentElement; bodyElement = htmlElement.FirstChild as XmlElement; paragraphElement = bodyElement.SelectSingleNode("p") as XmlElement; paragraphText = paragraphElement.SelectSingleNode("text()") as XmlText; bodyComment = bodyElement.SelectSingleNode("comment()") as XmlComment; htmlTreeNode = treeView.Nodes[0] as XmlElementTreeNode; htmlTreeNode.PerformInitialization(); bodyTreeNode = htmlTreeNode.FirstNode as XmlElementTreeNode; bodyTreeNode.PerformInitialization(); bodyCommentTreeNode = bodyTreeNode.FirstNode as XmlCommentTreeNode; paragraphTreeNode = bodyTreeNode.LastNode as XmlElementTreeNode; paragraphTreeNode.PerformInitialization(); paragraphTextTreeNode = paragraphTreeNode.FirstNode as XmlTextTreeNode; }