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


C# XmlNode.WriteTo方法代碼示例

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


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

示例1: GetXElement

 private XElement GetXElement(XmlNode node)
 {
     XDocument xDoc = new XDocument();
     using (XmlWriter xmlWriter = xDoc.CreateWriter())
         node.WriteTo(xmlWriter);
     return xDoc.Root;
 }
開發者ID:gtkrug,項目名稱:gfipm-ws-ms.net,代碼行數:7,代碼來源:WspClaimsAuthorizationManager.cs

示例2: GetXElement

 private static XElement GetXElement(XmlNode node) {
     var xDoc = new XDocument();
     using (XmlWriter xmlWriter = xDoc.CreateWriter()) {
         node.WriteTo(xmlWriter);
     }
     return xDoc.Root;
 }
開發者ID:radi4music,項目名稱:NakedObjectsFramework,代碼行數:7,代碼來源:NakedObjectsClaimsAuthorizationManager.cs

示例3: XmlConverter

        public XmlConverter(XmlNode e)
            : this()
        {
            Contract.Requires(e != null);


            e.WriteTo(_writer);
        }
開發者ID:RyanLiu99,項目名稱:Thinktecture.IdentityModel,代碼行數:8,代碼來源:XmlConverter.cs

示例4: GetXmlFragment

 static string GetXmlFragment(XmlNode node)
 {
     using (var stringWriter = new StringWriter())
     using (var xmlFragmentWriter = new XmlFragmentWriter(stringWriter))
     {
         xmlFragmentWriter.Formatting = Formatting.Indented;
         node.WriteTo(xmlFragmentWriter);
         return stringWriter.GetStringBuilder().ToString();
     }
 }
開發者ID:steveski,項目名稱:crispin,代碼行數:10,代碼來源:InternalHelpers.cs

示例5: GetXml

 internal static string GetXml(XmlNode node)
 {
     using (var stringWriter = new StringWriter())
     using (var xmlTextWriter = XmlWriter.Create(stringWriter))
     {
         node.WriteTo(xmlTextWriter);
         xmlTextWriter.Flush();
         return stringWriter.GetStringBuilder().ToString();
     }
 }
開發者ID:steveski,項目名稱:crispin,代碼行數:10,代碼來源:InternalHelpers.cs

示例6: Create

 /// Standard callback
 public object Create(object parent, object configContext, XmlNode section)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         using (XmlWriter xw = XmlWriter.Create(ms))
             section.WriteTo(xw);
         ms.Position = 0;
         return ms.ToArray();
     }
 }
開發者ID:xsharper,項目名稱:xsharper,代碼行數:11,代碼來源:Utils.Various.cs

示例7: WriteXmlOutput

        private void WriteXmlOutput(XmlNode resultNode, XmlWriter xmlWriter)
        {
            this.xmlWriter = xmlWriter;

            InitializeXmlFile(resultNode);

            resultNode.WriteTo(xmlWriter);

            TerminateXmlFile();
        }
開發者ID:haf,項目名稱:nunit-framework,代碼行數:10,代碼來源:NUnit3TestResultWriter.cs

示例8: FormattedXml

 private static string FormattedXml(XmlNode node)
 {
     using (TextWriter textwriter = new StringWriter())
     {
         XmlTextWriter writer = new XmlTextWriter(textwriter);
         writer.Formatting = Formatting.Indented;
         node.WriteTo(writer);
         return textwriter.ToString();
     }
 }
開發者ID:marcinczekaj,項目名稱:v1-jira-integration,代碼行數:10,代碼來源:AssertXml.cs

示例9: WriteResultFile

        public void WriteResultFile(XmlNode resultNode, TextWriter writer)
        {
            var settings = new XmlWriterSettings();
            settings.Indent = true;

            using (XmlWriter xmlWriter = XmlWriter.Create(writer, settings))
            {
                xmlWriter.WriteStartDocument(false);
                resultNode.WriteTo(xmlWriter);
            }
        }
開發者ID:JohanLarsson,項目名稱:nunit,代碼行數:11,代碼來源:NUnit3XmlResultWriter.cs

示例10: StudyXmlNode

			public StudyXmlNode(XmlNode node)
			{
				using (TextWriter writer = new Utf8StringWriter())
				{
					using (XmlWriter xmlWriter = XmlWriter.Create(writer,new XmlWriterSettings(){ConformanceLevel = ConformanceLevel.Fragment}))
					{
						node.WriteTo(xmlWriter);
					}
					XmlElementFragment = writer.ToString();
				}
			}
開發者ID:m-berkani,項目名稱:ClearCanvas,代碼行數:11,代碼來源:StudyXmlMemento.cs

示例11: GetStream

        public static Stream GetStream(XmlNode node)
        {
            MemoryStream stream = new MemoryStream();
            XmlWriter writer = XmlWriter.Create(stream);
            node.WriteTo(writer);
            writer.Flush();

            stream.Seek(0, SeekOrigin.Begin);

            return stream;
        }
開發者ID:juanplopes,項目名稱:simple,代碼行數:11,代碼來源:XmlHelper.cs

示例12: FormatRawMessage

        private static String FormatRawMessage(XmlNode document)
        {
            var sb = new StringBuilder();

            using (var stringWriter = new StringWriter(sb))
            using (var xmlTextWriter = new XmlTextWriter(stringWriter))
            {
                xmlTextWriter.Formatting = Formatting.Indented;

                document.WriteTo(xmlTextWriter);
            }

            return sb.ToString();
        }
開發者ID:SHSE,項目名稱:Harvester,代碼行數:14,代碼來源:Log4JParserForRemoteMessage.cs

示例13: FormatXml

        private static string FormatXml(XmlNode node)
        {
            var settings = new XmlWriterSettings();
              settings.OmitXmlDeclaration = true;
              settings.Indent = true;
              settings.IndentChars = "  ";

              using (var output = new StringWriter())
              {
            using (var writer = XmlTextWriter.Create(output, settings))
            {
              node.WriteTo(writer);
            }
            return output.ToString();
              }
        }
開發者ID:Barnickle,項目名稱:InnovatorAdmin,代碼行數:16,代碼來源:ErrorWindow.cs

示例14: WriteXmlNode

		void WriteXmlNode (XmlNode node)
		{
			if (node is XmlDocument)
				node = ((XmlDocument) node).DocumentElement;

			node.WriteTo (Writer);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:XmlSerializationWriter.cs

示例15: WriteNodeTo

			public void WriteNodeTo (XmlNode node)
			{
				node.WriteTo (output);
			}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:ecma2wiki.cs


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