當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。