当前位置: 首页>>代码示例>>C#>>正文


C# XPathNavigator.DeleteSelf方法代码示例

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


在下文中一共展示了XPathNavigator.DeleteSelf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateNode

        /// <summary>
        /// Updates the node replacing inheritdoc node with comments found.
        /// </summary>
        /// <param name="inheritDocNodeNavigator">Navigator for inheritdoc node</param>
        /// <param name="contentNodeNavigator">Navigator for content</param>
        private void UpdateNode(XPathNavigator inheritDocNodeNavigator, XPathNavigator contentNodeNavigator)
        {
            // retrieve the selection filter if specified.
            string selectValue = inheritDocNodeNavigator.GetAttribute("select", string.Empty);

            if(!string.IsNullOrEmpty(selectValue))
                sourceExpression = XPathExpression.Compile(selectValue);

            inheritDocNodeNavigator.MoveToParent();

            if(inheritDocNodeNavigator.LocalName != "comments" && inheritDocNodeNavigator.LocalName != "element")
                sourceExpression = XPathExpression.Compile(inheritDocNodeNavigator.LocalName);
            else
                inheritDocNodeNavigator.MoveTo(this.sourceDocument.CreateNavigator().SelectSingleNode(inheritDocExpression));

            XPathNodeIterator sources = (XPathNodeIterator)contentNodeNavigator.CreateNavigator().Evaluate(sourceExpression);
            inheritDocNodeNavigator.DeleteSelf();

            // append the source nodes to the target node
            foreach(XPathNavigator source in sources)
                inheritDocNodeNavigator.AppendChild(source);
        }
开发者ID:armin-bauer,项目名称:SHFB,代码行数:27,代码来源:InheritDocumentationComponent.cs

示例2: DeleteNode

 /// <summary>
 /// Deletes the specified node and logs the message.
 /// </summary>
 /// <param name="inheritDocNodeNavigator">navigator for inheritdoc node</param>
 /// <param name="key">Id of the topic specified</param>
 private void DeleteNode(XPathNavigator inheritDocNodeNavigator, string key)
 {
     base.ParentBuildComponent.WriteMessage(MessageLevel.Info, "Comments not found for topic: {0}", key);
     inheritDocNodeNavigator.DeleteSelf();
 }
开发者ID:armin-bauer,项目名称:SHFB,代码行数:10,代码来源:InheritDocumentationComponent.cs

示例3: DeleteNil

 public void DeleteNil(XPathNavigator node)
 {
     if (node.MoveToAttribute(
        "nil", NamespaceManager.LookupNamespace("xsi")))
         node.DeleteSelf();
 }
开发者ID:iurcik,项目名称:Projects,代码行数:6,代码来源:FormCode2.cs

示例4: DeleteNode

 /// <summary>
 /// Deletes the specified node and logs the message.
 /// </summary>
 /// <param name="inheritDocNodeNavigator">navigator for inheritdoc node</param>
 /// <param name="key">Id of the topic specified</param>
 public static void DeleteNode(XPathNavigator inheritDocNodeNavigator, string key)
 {
     ConsoleApplication.WriteMessage(LogLevel.Info, string.Format(CultureInfo.InvariantCulture, "Comments are not found for topic:{0}", key));
     inheritDocNodeNavigator.DeleteSelf();
 }
开发者ID:hnlshzx,项目名称:DotNetOpenAuth,代码行数:10,代码来源:InheritDocumentationComponent.cs

示例5: DeleteNil

 public void DeleteNil(XPathNavigator node)
 {
     if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
         node.DeleteSelf();
 }
开发者ID:cambaz12,项目名称:FritoLay,代码行数:5,代码来源:FormCode.cs


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