• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Xml.XmlComment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Xml.XmlComment的典型用法代码示例。如果您正苦于以下问题:C# XmlComment类的具体用法?C# XmlComment怎么用?C# XmlComment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlComment类属于System.Xml命名空间,在下文中一共展示了XmlComment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetUp

		public void SetUp()
		{
			SD.InitializeForUnitTests();
			treeViewContainer = new DerivedXmlTreeViewContainerControl();
			string xml = "<!-- Root comment --><root><!-- Child comment --><child></child></root>";
			treeViewContainer.LoadXml(xml);
			
			doc = treeViewContainer.Document;
			treeView = treeViewContainer.TreeView;
			
			// Get the root comment node in the tree.
			rootCommentNode = (XmlComment)doc.FirstChild;
			rootCommentTreeNode = treeView.Nodes[0] as XmlCommentTreeNode;
			
			// Get the child comment node in the tree.
			rootElementTreeNode = (XmlElementTreeNode)treeView.Nodes[1];
			rootElementTreeNode.Expanding();
			rootElement = rootElementTreeNode.XmlElement;
			
			childCommentTreeNode = rootElementTreeNode.Nodes[0] as XmlCommentTreeNode;
			childCommentNode = (XmlComment)rootElementTreeNode.XmlElement.FirstChild;
			
			childElementTreeNode = rootElementTreeNode.Nodes[1] as XmlElementTreeNode;
			childElement = childElementTreeNode.XmlElement;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:25,代码来源:EditCommentNodesInTreeControlTestFixture.cs


示例2: SetUp

		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;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:25,代码来源:PasteInTreeControlTestFixture.cs


示例3: XmlCommentName

		public void XmlCommentName ()
		{
			document.LoadXml ("<root><foo></foo></root>");
			comment = document.CreateComment ("Comment");
			AssertEquals (comment.NodeType + " Name property broken",
				comment.Name, "#comment");
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:XmlCommentTests.cs


示例4: XmlCommentIsReadOnly

		public void XmlCommentIsReadOnly ()
		{
			document.LoadXml ("<root><foo></foo></root>");
			comment = document.CreateComment ("Comment");
			AssertEquals ("XmlComment IsReadOnly property broken",
				comment.IsReadOnly, false);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:XmlCommentTests.cs


示例5: XmlCommentTreeNode

		public XmlCommentTreeNode(XmlComment comment)
			: base(comment)
		{
			this.comment = comment;
			ImageKey = XmlCommentTreeNodeImageKey;
			SelectedImageKey = ImageKey;
			Update();
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:XmlCommentTreeNode.cs


示例6: SetUpFixture

		public void SetUpFixture()
		{
			base.InitFixture();
			rootComment = (XmlComment)mockXmlTreeView.Document.FirstChild;
			childElement = (XmlElement)mockXmlTreeView.Document.SelectSingleNode("root/child");
			mockXmlTreeView.SelectedComment = rootComment;
			editor.SelectedNodeChanged();
		}
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:8,代码来源:EditCommentNodesTestFixture.cs


示例7: Init

		public void Init()
		{
			base.InitFixture();
			rootElement = editor.Document.DocumentElement;
			bodyElement = (XmlElement)rootElement.FirstChild;
			paragraphElement = (XmlElement)bodyElement.SelectSingleNode("p");
			bodyComment = (XmlComment)bodyElement.SelectSingleNode("comment()");
			paragraphText = (XmlText)paragraphElement.SelectSingleNode("text()");
		}
开发者ID:hanjackcyw,项目名称:SharpDevelop,代码行数:9,代码来源:PasteTestFixture.cs


示例8: ExecuteCore

        protected override void ExecuteCore(XmlComment comment)
        {
            if (comment.ParentNode is XmlDocument)
            {
                return;
            }

            Validate();
            var element = comment.OwnerDocument.CreateElement(Name);
            element.InnerText = comment.Value;
            comment.ParentNode.ReplaceChild(element, comment);
        }
开发者ID:rh,项目名称:mix,代码行数:12,代码来源:ConvertToElement.cs


示例9: ExecuteCore

        protected override void ExecuteCore(XmlComment comment)
        {
            Validate();

            var element = comment.ParentNode as XmlElement;

            if (element != null && element.Attributes[Name] == null)
            {
                var attribute = comment.OwnerDocument.CreateAttribute(Name);
                attribute.Value = comment.Value;
                element.Attributes.Append(attribute);
                element.RemoveChild(comment);
            }
        }
开发者ID:rh,项目名称:mix,代码行数:14,代码来源:ConvertToAttribute.cs


示例10: XmlCommentCloneNode

		public void XmlCommentCloneNode ()
		{
			document.LoadXml ("<root><foo></foo></root>");
			comment = document.CreateComment ("Comment");
			original = comment;

			shallow = comment.CloneNode (false); // shallow
			XmlNodeBaseProperties (original, shallow);
			
			deep = comment.CloneNode (true); // deep
			XmlNodeBaseProperties (original, deep);
			Assert.AreEqual (original.Value, deep.Value, "Value incorrectly cloned");

			Assert.AreEqual (deep.OuterXml, shallow.OuterXml, "deep cloning differs from shallow cloning");
		}
开发者ID:nobled,项目名称:mono,代码行数:15,代码来源:XmlCommentTests.cs


示例11: SetUp

		public void SetUp()
		{
			XmlCompletionDataProvider completionDataProvider = new XmlCompletionDataProvider(new XmlSchemaCompletionDataCollection(), null, String.Empty);
			treeViewContainer = new DerivedXmlTreeViewContainerControl();
			treeViewContainer.LoadXml("<!-- Root comment --><root><!-- Child comment --><child></child></root>", completionDataProvider);
			
			doc = treeViewContainer.Document;
			treeView = treeViewContainer.TreeView;
			
			// Get the root comment node in the tree.
			rootCommentNode = (XmlComment)doc.FirstChild;
			rootCommentTreeNode = treeView.Nodes[0] as XmlCommentTreeNode;
			
			// Get the child comment node in the tree.
			rootElementTreeNode = (XmlElementTreeNode)treeView.Nodes[1];
			rootElementTreeNode.Expanding();
			rootElement = rootElementTreeNode.XmlElement;
			
			childCommentTreeNode = rootElementTreeNode.Nodes[0] as XmlCommentTreeNode;
			childCommentNode = (XmlComment)rootElementTreeNode.XmlElement.FirstChild;
			
			childElementTreeNode = rootElementTreeNode.Nodes[1] as XmlElementTreeNode;
			childElement = childElementTreeNode.XmlElement;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:24,代码来源:EditCommentNodesInTreeControlTestFixture.cs


示例12: SetUp

		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;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:24,代码来源:PasteInTreeControlTestFixture.cs


示例13: AppendChildComment

		/// <summary>
		/// Appends a new child comment node to the currently selected element.
		/// </summary>
		public void AppendChildComment(XmlComment comment)
		{
			XmlElementTreeNode selectedNode = SelectedElementNode;
			if (selectedNode != null) {
				XmlCommentTreeNode newNode = new XmlCommentTreeNode(comment);
				newNode.AddTo(selectedNode);
				selectedNode.Expand();
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:12,代码来源:XmlTreeViewControl.cs


示例14: RemoveComment

		/// <summary>
		/// Removes the specified comment from the tree.
		/// </summary>
		public void RemoveComment(XmlComment comment)
		{
			XmlCommentTreeNode node = FindComment(comment);
			if (node != null) {
				node.Remove();
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:10,代码来源:XmlTreeViewControl.cs


示例15: AddXmlComment

 private void AddXmlComment(StringBuilder sb, int indentationLevel, XmlComment xmlComment)
 {
     Indent(sb, indentationLevel);
     sb.Append(string.Format(@"\cf{0}<!--{1}-->\par", (int)ColorKinds.Comment, XmlEncode(xmlComment.Value)));
 }
开发者ID:Green-Bug,项目名称:nunit-gui,代码行数:5,代码来源:Xml2RtfConverter.cs


示例16: UpdateComment

		/// <summary>
		/// Updates the corresponding tree node's text based on 
		/// the comment's value.
		/// </summary>
		public void UpdateComment(XmlComment comment)
		{
			XmlCommentTreeNode node = FindComment(comment);
			if (node != null) {
				node.Update();
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:11,代码来源:XmlTreeViewControl.cs


示例17: InsertCommentBefore

		/// <summary>
		/// Inserts the comment before the currently selected node.
		/// </summary>
		public void InsertCommentBefore(XmlComment comment)
		{
			xmlElementTreeView.InsertCommentBefore(comment);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:XmlTreeViewContainerControl.cs


示例18: InsertCommentAfter

		/// <summary>
		/// Inserts the comment after the currently selected node.
		/// </summary>
		public void InsertCommentAfter(XmlComment comment)
		{
			xmlElementTreeView.InsertCommentAfter(comment);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:XmlTreeViewContainerControl.cs


示例19: RemoveComment

		/// <summary>
		/// Removes the specified xml comment from the tree.
		/// </summary>
		public void RemoveComment(XmlComment comment)
		{
			xmlElementTreeView.RemoveComment(comment);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:XmlTreeViewContainerControl.cs


示例20: AppendChildComment

		/// <summary>
		/// Appends a new child comment node to the currently selected
		/// element.
		/// </summary>
		public void AppendChildComment(XmlComment comment)
		{
			xmlElementTreeView.AppendChildComment(comment);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:8,代码来源:XmlTreeViewContainerControl.cs



注:本文中的System.Xml.XmlComment类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Xml.XmlDataDocument类代码示例发布时间:2022-05-26
下一篇:
C# Xml.XmlBufferReader类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap