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


C# XmlTextWriter.WriteRaw方法代码示例

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


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

示例1: WriteRSSClosing

        public XmlTextWriter WriteRSSClosing(XmlTextWriter writer)
        {
            /*
                writer.WriteEndElement();
                writer.WriteEndElement();
                writer.WriteEndDocument();
            */

            writer.WriteRaw("\t</channel>" + en);
            writer.WriteRaw("</rss>");

            return writer;
        }
开发者ID:habeebtc,项目名称:Spam,代码行数:13,代码来源:RssFeed.cs

示例2: GenerateDescription

        private void GenerateDescription(string host = null)
        {
            MemoryStream memStream = new MemoryStream();
            using (XmlTextWriter descWriter = new XmlTextWriter(memStream, new UTF8Encoding(false)))
            {
                descWriter.Formatting = Formatting.Indented;
                descWriter.WriteRaw("<?xml version=\"1.0\"?>");

                descWriter.WriteStartElement("root", "urn:schemas-upnp-org:device-1-0");

                descWriter.WriteStartElement("specVersion");
                descWriter.WriteElementString("major", "1");
                descWriter.WriteElementString("minor", "0");
                descWriter.WriteEndElement();

                descWriter.WriteStartElement("device");
                rootDevice.WriteDescription(descWriter, host);
                descWriter.WriteEndElement();

                descWriter.WriteEndElement();

                descWriter.Flush();
                descArray = memStream.ToArray();
            }
        }
开发者ID:northspb,项目名称:p2pproxy,代码行数:25,代码来源:UpnpServer.cs

示例3: Save

        public void Save(string fileName)
        {
            if (this.Messages.Count == 0 || string.IsNullOrEmpty(fileName)) return;
            if (File.Exists(fileName)) File.Delete(fileName);

            var xml = new XmlDocument();
            xml.AppendChild(xml.CreateXmlDeclaration(this.Declaration.Version, this.Declaration.Encoding, this.Declaration.Standalone));
            xml.AppendChild(xml.CreateProcessingInstruction(this.Xsl.Target, this.Xsl.Data));

            var root = xml.CreateElement("Log");
            root.SetAttribute("FirstSessionID", this.Messages[0].SessionID.ToString());
            root.SetAttribute("LastSessionID", this.Messages[this.Messages.Count - 1].SessionID.ToString());

            xml.AppendChild(root);
            this.Messages.ForEach(messageNode =>
                {
                    var nodeName = messageNode.GetType().Name.Replace("Msn", string.Empty);
                    var newNode = xml.CreateElement(nodeName);
                    root.AppendChild(messageNode.GenerateXmlNode(newNode));
                });

            var writer = new XmlTextWriter(fileName, Encoding.UTF8);
            writer.WriteRaw(xml.OuterXml);
            writer.Flush();
            writer.Close();
        }
开发者ID:jerecui,项目名称:MSNChatHistoryCombiner,代码行数:26,代码来源:MsnLog.cs

示例4: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            string configName = context.Request.QueryString["configuration"];

            _configuration = CodeGenerationSettings.Instance.GetConfiguration(configName);
            context.Response.ContentType = "text/plain";
            using (XmlTextWriter writer = new XmlTextWriter(context.Response.OutputStream, Encoding.UTF8))
            {
                writer.Formatting = Formatting.Indented;
                writer.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n");
                writer.WriteStartElement("namespaces");
                _templates = _configuration.GetTemplateSettings().ToDictionary(t => t.Path);

                foreach (var nameSpace in _templates.Values.GroupBy(c => c.NameSpace))
                {
                    writer.WriteStartElement("namespace");
                    writer.WriteAttributeString("name", nameSpace.Key);

                    foreach (var template in nameSpace)
                        WriteTemplate(template, writer);

                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }
        }
开发者ID:jeppe-andreasen,项目名称:LinqIt-Libraries,代码行数:26,代码来源:T4XmlProvider.cs

示例5: WriteSalesReports

 public void WriteSalesReports(string reports)
 {
     using (var writer = new XmlTextWriter(this.Path, null))
     {
         writer.WriteStartDocument();
         writer.WriteRaw(Environment.NewLine + reports);
     }
 }
开发者ID:DbApps-Teamwork,项目名称:Db-Applications-Teamwork,代码行数:8,代码来源:XmlSalesReportsWriter.cs

示例6: StartLog

 internal void StartLog(string logFile, string xslPath)
 {
     m_logFile = logFile;
     m_xmlWriter = new XmlTextWriter(logFile, Encoding.UTF8);
     m_xmlWriter.Formatting = Formatting.Indented;
     m_xmlWriter.WriteStartDocument();
     m_xmlWriter.WriteRaw("<?xml-stylesheet type=\"text/xsl\" href=\"" + xslPath + "\"?>");
     m_xmlWriter.WriteStartElement("SPOT_Platform_Test");
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:9,代码来源:XmlLog.cs

示例7: Cut

        public static void Cut()
        {
            var xml = "";
            using (var reader = XmlReader.Create("company.xml"))
            {
                while (reader.Read())
                {
                    if (!String.IsNullOrEmpty(reader.Name))
                    {
                        var el = @"<";
                        switch (reader.NodeType)
                        {
                            case XmlNodeType.EndElement:
                                el += @"/" + reader.Name;
                                break;
                            case XmlNodeType.Element:
                            case XmlNodeType.XmlDeclaration:
                                el += reader.Name;
                                break;
                        }

                        if (reader.AttributeCount > 0)
                        {
                            el += " ";
                            while (reader.MoveToNextAttribute())
                            {
                                var a = string.Format("{0}={1}", reader.Name, reader.Value);
                                el += a;
                            }
                            xml += el + @">";
                        }
                        else
                        {
                            xml += el + reader.Value + @">";
                        }
                        if (reader.Name == "Salary")
                        {
                            if (reader.Read())
                            {
                                var s = reader.ReadContentAsDecimal() / 2;
                                xml += s + @"</Salary>";
                            }
                        }
                    }
                    else
                    {
                        xml += reader.Value;
                    }
                }
            }

            using (var tw = new XmlTextWriter("company1.xml", Encoding.UTF8))
            {
                tw.WriteRaw(xml);
            }
        }
开发者ID:nuzil,项目名称:101repo,代码行数:56,代码来源:Features.cs

示例8: OpenMetadataDoc

        public void OpenMetadataDoc(string urlMetadataDoc)
        {
            string tmpInput = GenerateTempFilename("Meta", "xml");
            XmlWriter pXWriter = new XmlTextWriter(tmpInput, Encoding.UTF8);
            pXWriter.WriteRaw(GetMetadataDoc(urlMetadataDoc));
            pXWriter.Close();

            string tmpOutput = XmlTransform(tmpInput);
            webBrowserMetadata.Navigate(tmpOutput);
        }
开发者ID:usgin,项目名称:arcmap-cswclient,代码行数:10,代码来源:FormViewMetadata.cs

示例9: WriteBody

        private void WriteBody(XmlTextWriter xml)
        {
            xml.WriteStartElement("Body");

            xml.WriteStartElement("Content");
            xml.WriteRaw(this.Definition.Body);
            xml.WriteEndElement();

            this.WriteGridViews(xml);
            xml.WriteEndElement();
        }
开发者ID:abinabrahamanchery,项目名称:mixerp,代码行数:11,代码来源:ReportBuilder.cs

示例10: DumpLayoutAndVisualTree

        /// <summary>
        /// Dump layout and visual tree starting from specified root.
        /// </summary>
        /// <param name="writer">Stream for dump output.</param>
        /// <param name="tagName">Name of the root XML element.</param>
        /// <param name="root">Root of the visual subtree.</param>
        internal static void DumpLayoutAndVisualTree(XmlTextWriter writer, string tagName, Visual root)
        {
            // Write root element
            writer.WriteStartElement(tagName);

            // Dump layout tree including all visuals
            DumpVisual(writer, root, root);

            // Write end root
            writer.WriteEndElement();
            writer.WriteRaw("\r\n");  // required for bbpack
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:LayoutDump.cs

示例11: RenderAsHtml

		public string RenderAsHtml ()
		{
			StringWriter sw = new StringWriter ();
			XmlWriter w = new XmlTextWriter (sw);
			if (HelpSource.use_css)
				w.WriteRaw ("<div class=\"header\" id=\"error_ref\">" +
				"	<div class=\"subtitle\">Compiler Error Reference</div> " +
				"	<div class=\"title\">Error " + ErrorName + " </div></div>");
			else
			w.WriteRaw (@"
				
				<table width='100%'>
					<tr bgcolor='#b0c4de'><td>
					<i>Compiler Error Reference</i>
					<h3>Error " + ErrorName + @"</h2>
					</td></tr>
				</table><br />");
			
			
			if (Details != null) {
				if (HelpSource.use_css)
					w.WriteRaw ("<div class=\"summary\">Summary</div>");
				else
				w.WriteRaw (@"<h3>Summary</h3>");
				Details.Summary.WriteTo (w);
				
				if (HelpSource.use_css)
					w.WriteRaw ("<div class=\"details\">Details</div>");
				else
				w.WriteRaw (@"<h3>Details</h3>");

				Details.Details.WriteTo (w);
			}
			
			foreach (string xmp in Examples) {
				if (HelpSource.use_css)
					w.WriteRaw ("<div class=\"code_example\">" +
						"<div class=\"code_ex_title\">Example</div>");
				else
				w.WriteRaw (@"<table bgcolor='#f5f5dd' border='1'>
						<tr><td><b><font size='-1'>Example</font></b></td></tr>
						<tr><td><font size='-1'><pre>");
				w.WriteRaw (Mono.Utilities.Colorizer.Colorize (xmp, "c#"));
				if (HelpSource.use_css)
					w.WriteRaw ("</div>");
				else
				w.WriteRaw (@"</pre></font></td></tr></table>");
			}
			
			w.Close ();
			
			return sw.ToString ();
		}
开发者ID:emtees,项目名称:old-code,代码行数:53,代码来源:error-provider.cs

示例12: WriteRSSPrologue

        public XmlTextWriter WriteRSSPrologue(XmlTextWriter writer, pages.ForumPage page)
        {
            /*
                writer.WriteStartDocument();
                writer.WriteStartElement("rss");
                writer.WriteAttributeString("version", "2.0");
                writer.WriteStartElement("channel");
                writer.WriteElementString("title", "RSS File for " + page.ForumURL);
                writer.WriteElementString("link", page.ForumURL);
                writer.WriteElementString("description", "Yet Another Forum Web Application");
                writer.WriteElementString("copyright", "Copyright 2002-2004 Bjørnar Henden");
            */

            writer.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + en);
            writer.WriteRaw("<?xml-stylesheet type=\"text/xsl\" href=\"rss.xsl\" media=\"screen\"?>");
            writer.WriteRaw("<rss version=\"2.0\">" + en);
            writer.WriteRaw("\t<channel>" + en);
            writer.WriteRaw("\t\t<title>RSS Feed for " + page.ServerURL + "</title>" + en);
            writer.WriteRaw("\t\t<link>" + Encode(page.ForumURL) + "</link>" + en);
            writer.WriteRaw("\t\t<description>Yet Another Forum Web Application RSS Feed</description>" + en);
            writer.WriteRaw("\t\t<copyright>Copyright 2002 - 2005 Bjørnar Henden</copyright>" + en);

            return writer;
        }
开发者ID:habeebtc,项目名称:Spam,代码行数:24,代码来源:RssFeed.cs

示例13: WriteXML

        private void WriteXML()
        {
            string xml = "<?xml version=\"1.0\" standalone=\"yes\"?>"+ Environment.NewLine +"<users>" + Environment.NewLine;
            foreach (XmlUser user in users)
            {
                xml += "<user>" + Environment.NewLine;
                xml += "<name>" + user.Name + "</name>" + Environment.NewLine;
                xml += "<email>" + user.Email + "</email>" + Environment.NewLine;
                xml += "</user>" + Environment.NewLine;
            }
            xml += "</users>" +Environment.NewLine;

            XmlTextWriter writer = new XmlTextWriter(Server.MapPath("/App_Data/XmlInjectionUsers.xml"), Encoding.UTF8);
            writer.WriteRaw(xml);
            writer.Close();
        }
开发者ID:ldemidov,项目名称:WebGoat.NET,代码行数:16,代码来源:XMLInjection.aspx.cs

示例14: ToXML

        public String ToXML()
        {
            System.IO.StringWriter XMLsw = new System.IO.StringWriter();
            XmlTextWriter XMLtw = new XmlTextWriter(XMLsw);

            XMLtw.Formatting = Formatting.Indented;
            XMLtw.WriteStartElement("hackset");
            XMLtw.WriteStartElement("hackvalues");
            for (int x=0; x < HackValues.Length; x++)
            {
                XMLtw.WriteRaw(HackValues[x].ToXML());
            }
            XMLtw.WriteEndElement();
            XMLtw.WriteEndElement();
            return XMLsw.ToString();
        }
开发者ID:wccrawford,项目名称:Game-Trainer,代码行数:16,代码来源:TFHackSet.cs

示例15: ToXML

        public static string ToXML(string path)
        {
            DirectoryInfo di = new DirectoryInfo(path);
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);

            XmlTextWriter writer = new XmlTextWriter(sw);
            writer.Formatting = Formatting.Indented;
            writer.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            writer.WriteStartElement("theme");

            DirectoryToXML(di,writer);

            writer.WriteEndElement();

            return sb.ToString();
        }
开发者ID:chartek,项目名称:graffiticms,代码行数:17,代码来源:ThemeConverter.cs


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