當前位置: 首頁>>代碼示例>>C#>>正文


C# XPathNavigator.WriteSubtree方法代碼示例

本文整理匯總了C#中System.Xml.XPath.XPathNavigator.WriteSubtree方法的典型用法代碼示例。如果您正苦於以下問題:C# XPathNavigator.WriteSubtree方法的具體用法?C# XPathNavigator.WriteSubtree怎麽用?C# XPathNavigator.WriteSubtree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XPath.XPathNavigator的用法示例。


在下文中一共展示了XPathNavigator.WriteSubtree方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateAssemblyWriter

        private static XmlWriter CreateAssemblyWriter(string path, XPathNavigator assembly)
        {
            XmlWriterSettings settings = new XmlWriterSettings { Indent = true };
            XmlWriter writer = XmlWriter.Create(path, settings);

            writer.WriteStartElement("reflection");

            if(assembly != null)
            {
                writer.WriteStartElement("assemblies");
                assembly.WriteSubtree(writer);
                writer.WriteEndElement();
            }

            writer.WriteStartElement("apis");

            return writer;
        }
開發者ID:modulexcite,項目名稱:SHFB-1,代碼行數:18,代碼來源:Program.cs

示例2: ProcessXPathNavigator

        private void ProcessXPathNavigator(XPathNavigator xpathNavigator)
        {
            try
            {
                using (StringWriter stringWriter = new StringWriter())
                {
                    using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, XmlWriterSettings))
                    {
                        xpathNavigator.WriteSubtree(xmlWriter);
                    }

                    WriteObject(stringWriter.ToString());
                }
            }
            catch (PipelineStoppedException)
            {
                throw;
            }
            catch (Exception ex)
            {
                ErrorHandler.WriteXmlError(ex);
            }
        }
開發者ID:nickchal,項目名稱:pash,代碼行數:23,代碼來源:FormatXmlCommand.cs

示例3: WriteSubtree

		string WriteSubtree (XPathNavigator nav)
		{
			StringWriter sw = new StringWriter ();
			XmlWriterSettings settings = new XmlWriterSettings ();
			settings.OmitXmlDeclaration = true;
			settings.ConformanceLevel = ConformanceLevel.Fragment;
			using (XmlWriter w = XmlWriter.Create (sw, settings)) {
				nav.WriteSubtree(w);
			}
			return sw.ToString ();
		}
開發者ID:nobled,項目名稱:mono,代碼行數:11,代碼來源:XmlWriterTests.cs

示例4: XPathNavigatorToString

		// I avoided OuterXml which includes indentation.
		string XPathNavigatorToString (XPathNavigator nav)
		{
			var sw = new StringWriter ();
			using (var xw = XmlWriter.Create (sw, xml_writer_settings))
				nav.WriteSubtree (xw);
			return sw.ToString ();
		}
開發者ID:Xipas,項目名稱:Symplified.Auth,代碼行數:8,代碼來源:XmlWriterTraceListener.cs

示例5: SaveCacheFile

        private void SaveCacheFile(XPathNavigator nav)
        {
            if (String.IsNullOrEmpty(cacheFile))
                return;

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Indent = true;
            settings.NewLineHandling = NewLineHandling.None;

            try
            {
                using (XmlWriter writer = XmlWriter.Create(cacheFile, settings))
                {
                    nav.WriteSubtree(writer);
                }
            }
            catch (Exception)
            {
                // derp!
            }
        }
開發者ID:ISeeDEDPpl,項目名稱:Questor,代碼行數:21,代碼來源:APIReader.cs

示例6: Initialize

 private void Initialize(XPathNavigator navigator)
 {
   using (MemoryStream memStream = new MemoryStream())
   {
     using (XmlWriter writer = XmlWriter.Create(memStream))
     {
       navigator.WriteSubtree(writer);
       writer.Flush();
       memStream.Position = 0;
       Initialize(memStream);
     }
   }
 }
開發者ID:dlemstra,項目名稱:Magick.NET,代碼行數:13,代碼來源:MagickScript.cs

示例7: NavigatorToStream

 public static Stream NavigatorToStream(XPathNavigator nav){
     var sw = new MemoryStream();
     var w = new XmlTextWriter(sw, Encoding.UTF8);
     nav.WriteSubtree(w);
     w.Flush();
     sw.Position = 0;
     return sw;
 }
開發者ID:Qorpent,項目名稱:comdiv.oldcore,代碼行數:8,代碼來源:XmlUtil.cs

示例8: GetXElement

        protected static XElement GetXElement(XPathNavigator navigator)
        {
            XDocument xDoc = new XDocument();

            using (XmlWriter xmlWriter = xDoc.CreateWriter())

                navigator.WriteSubtree(xmlWriter);

            return xDoc.Root;
        }
開發者ID:DBailey635,項目名稱:C1-CMS,代碼行數:10,代碼來源:StandardExtension.cs


注:本文中的System.Xml.XPath.XPathNavigator.WriteSubtree方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。