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


C# XmlDictionaryWriter.WriteRaw方法代碼示例

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


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

示例1: OnWriteBodyContents

        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            writer.WriteStartElement("html");
            writer.WriteStartElement("head");
            writer.WriteElementString("title", "Request Failed");
            writer.WriteRaw(@"<style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699; font-weight: bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; } A:active { color: #336699; font-weight: bold; text-decoration: underline; } h1 { background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word; } table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana; font-size: 1em;} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;}</style>");
            writer.WriteEndElement(); //head
            writer.WriteStartElement("body");
            writer.WriteRaw("<div id='content'>");

            writer.WriteElementString("h1", "Request Failed");
            writer.WriteElementString("h3", Message);

            writer.WriteRaw("</div>");
            writer.WriteEndElement(); //body
            writer.WriteEndElement(); //html
        }
開發者ID:qwert789,項目名稱:codegallery,代碼行數:17,代碼來源:HtmlFaultMessage.cs

示例2: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     XmlWriterSettings setting = new XmlWriterSettings();
     setting.NewLineHandling = NewLineHandling.Entitize;
     setting.CheckCharacters = false;
     if (!string.IsNullOrEmpty(body))
     {
         writer.WriteRaw(body);
     }
     if (doc != null)
     {
         doc.WriteContentTo(writer);
         writer.Flush();
     }
 }
開發者ID:hijushen,項目名稱:WindowDemo,代碼行數:15,代碼來源:MyBodyWriter.cs

示例3: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     writer.WriteRaw(_message);
 }
開發者ID:Xipas,項目名稱:Symplified.Auth,代碼行數:4,代碼來源:HttpSOAPBindingBuilder.cs

示例4: WriteObjectContent

        public override void WriteObjectContent(XmlDictionaryWriter writer, Object graph)
        {
            string authToken = string.Format("<UserId>00000000-0000-0000-0000-000000000000</UserId><UserName>{0}</UserName><Password>{1}</Password>", _userName, _password);

            writer.WriteRaw(authToken);
        }
開發者ID:asenval,項目名稱:LunarBase,代碼行數:6,代碼來源:AuthenticationTokenSerializer.cs

示例5: OnWriteHeaderContents

            protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
            {
                writer.WriteRaw(GetToken().OuterXml);

                writer.WriteStartElement("Timestamp");
                writer.WriteXmlnsAttribute("", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
                writer.WriteAttributeString("Id", "Timestamp-79");
                //Created
                writer.WriteStartElement("Created");
                writer.WriteString(this.token.ValidFrom.ToString("yyyy-MM-ddTHH:mm:ssZ"));
                writer.WriteEndElement();
                //Expires
                writer.WriteStartElement("Expires");
                writer.WriteString(this.token.ValidTo.ToString("yyyy-MM-ddTHH:mm:ssZ"));
                writer.WriteEndElement();
                writer.WriteEndElement();
            }
開發者ID:qraftlabs,項目名稱:webservices-adfs-actas,代碼行數:17,代碼來源:AttachTokenEndpointBehavior.cs

示例6: OnWriteBodyContents

        /// <summary>
        /// Override the method to write the content to the XML dictionary writer.
        /// </summary>
        /// <param name="writer">Specify the output destination of the content.</param>
        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            MemoryStream ms = new MemoryStream();
            XmlSerializer serializer = new XmlSerializer(typeof(EnvelopeBody));
            serializer.Serialize(ms, this.requestEnvelope);

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(System.Text.ASCIIEncoding.ASCII.GetString(ms.ToArray(), 0, ms.ToArray().Length));
            ms.Dispose();
            foreach (XmlNode node in doc.LastChild.ChildNodes)
            {
                if (node.Name == "RequestVersion")
                {
                    writer.WriteRaw(node.OuterXml);
                }
                else if (node.Name == "RequestCollection")
                {
                    this.WriteNode(node, writer);
                }
                else
                {
                    throw new InvalidOperationException(string.Format("this element [{0}] is not expected element", node.Name));
                }
            }
        }
開發者ID:OfficeDev,項目名稱:Interop-TestSuites,代碼行數:29,代碼來源:RequestMessageBodyWriter.cs


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