• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Xml.XmlDictionaryWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Xml.XmlDictionaryWriter的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryWriter类的具体用法?C# XmlDictionaryWriter怎么用?C# XmlDictionaryWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlDictionaryWriter类属于System.Xml命名空间,在下文中一共展示了XmlDictionaryWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddPrefixIfNeeded

		protected virtual void AddPrefixIfNeeded(XmlDictionaryWriter writer, string prefix, string ns)
		{
			if (writer.LookupPrefix(ns) == null)
			{
				writer.WriteXmlnsAttribute(prefix, ns);
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:AdwsRequestMsg.cs


示例2: WriteObject

 public override void WriteObject(XmlDictionaryWriter writer, object graph)
 {
     if (_isSerializerSetExplicit)
         _serializer.Serialize(writer, new object[] { graph });
     else
         _serializer.Serialize(writer, graph);
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:7,代码来源:XmlSerializerObjectSerializer.cs


示例3: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     using (XmlWriterBackedStream stream = new XmlWriterBackedStream(writer))
     {
         OnWriteBodyContents(stream);
     }
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:StreamBodyWriter.cs


示例4: WriteChunkCallback

 void WriteChunkCallback(XmlDictionaryWriter writer, object state)
 {
     ChunkState chunkState = (ChunkState)state;
     writer.WriteStartElement(ChunkingUtils.ChunkElement, ChunkingUtils.ChunkNs);
     writer.WriteBase64(chunkState.Buffer, 0, chunkState.Count);
     writer.WriteEndElement();
 }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:7,代码来源:ChunkingWriter.cs


示例5: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     if (_data != null && _data.Length > 0)
     {
         writer.WriteElementString("BODY", _data);
     }
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:7,代码来源:ContentOnlyMessage.cs


示例6: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartElement("Binary");
     byte[] buffer = JSONPSupportInspector.encoding.GetBytes(this.content);
     writer.WriteBase64(buffer, 0, buffer.Length);
     writer.WriteEndElement();
 }
开发者ID:SK-Marten,项目名称:SimpleCQRS,代码行数:7,代码来源:JSONPSupportBehavior.cs


示例7: SerializeAsync

 internal async Task SerializeAsync(XmlDictionaryWriter writer, object[] parameters, object returnValue)
 {
     Stream streamValue = await GetStreamAndWriteStartWrapperIfNecessaryAsync(writer, parameters, returnValue);
     var streamProvider = new OperationStreamProvider(streamValue);
     await StreamFormatterHelper.WriteValueAsync(writer, streamProvider);
     await WriteEndWrapperIfNecessaryAsync(writer);
 }
开发者ID:dmetzgar,项目名称:wcf,代码行数:7,代码来源:StreamFormatter.cs


示例8: WriteAckRanges

 internal static void WriteAckRanges(XmlDictionaryWriter writer, ReliableMessagingVersion reliableMessagingVersion, UniqueId sequenceId, SequenceRangeCollection ranges)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
     writer.WriteStartElement(dictionary.Identifier, namespaceUri);
     writer.WriteValue(sequenceId);
     writer.WriteEndElement();
     if (ranges.Count == 0)
     {
         if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
         {
             ranges = ranges.MergeWith((long) 0L);
         }
         else if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
         {
             writer.WriteStartElement(DXD.Wsrm11Dictionary.None, namespaceUri);
             writer.WriteEndElement();
         }
     }
     for (int i = 0; i < ranges.Count; i++)
     {
         writer.WriteStartElement(dictionary.AcknowledgementRange, namespaceUri);
         writer.WriteStartAttribute(dictionary.Lower, null);
         SequenceRange range = ranges[i];
         writer.WriteValue(range.Lower);
         writer.WriteEndAttribute();
         writer.WriteStartAttribute(dictionary.Upper, null);
         SequenceRange range2 = ranges[i];
         writer.WriteValue(range2.Upper);
         writer.WriteEndAttribute();
         writer.WriteEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:WsrmAcknowledgmentHeader.cs


示例9: OnWriteAddressHeaderContents

        protected override void OnWriteAddressHeaderContents (XmlDictionaryWriter writer)
        {
            writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.LocalTransactionId,
                                     XD.DotNetAtomicTransactionExternalDictionary.Namespace);

            writer.WriteValue(this.transactionId);
            writer.WriteEndElement();

            if (this.contextId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.ContextId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.contextId);
                writer.WriteEndElement();
            }

            if (this.tokenId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.TokenId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.tokenId);
                writer.WriteEndElement();
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:WsatRegistrationHeader.cs


示例10: WriteObject

 public override void WriteObject(XmlDictionaryWriter writer, object graph)
 {
     var data = EncodeObject(graph);
     writer.WriteStartElement("Data");
     writer.WriteBase64(data, 0, data.Length);
     writer.WriteEndElement();
 }
开发者ID:cg123,项目名称:xenko,代码行数:7,代码来源:XenkoXmlObjectSerializer.cs


示例11: WriteAdditionalAttributes

 protected override void WriteAdditionalAttributes(XmlDictionaryWriter writer)
 {
     if (this.recipient != null)
     {
         writer.WriteAttributeString(RecipientAttribute, null, this.recipient);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:EncryptedKey.cs


示例12: WriteEndObject

 public override void WriteEndObject(XmlDictionaryWriter writer)
 {
     if (!skipName)
     {
         writer.WriteEndElement();
     }
 }
开发者ID:alexcassol,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:7,代码来源:DiffSerializer.cs


示例13: OnWriteStartAddressHeader

 protected override void OnWriteStartAddressHeader(XmlDictionaryWriter writer)
 {
     XmlDictionaryReader addressHeaderReader = this.GetAddressHeaderReader();
     writer.WriteStartElement(addressHeaderReader.Prefix, addressHeaderReader.LocalName, addressHeaderReader.NamespaceURI);
     writer.WriteAttributes(addressHeaderReader, false);
     addressHeaderReader.Close();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:BufferedAddressHeader.cs


示例14: WriteJson

            public void WriteJson(XmlDictionaryWriter writer)
            {
                writer.WriteStartElement(MetadataStrings.TypeString);
                writer.WriteAttributeString("type", "string");
                writer.WriteString(String.Format("{0}{1}{2}", this.TypeName, MetadataStrings.NamespaceMarker, this.TypeNamespace));
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.KeyString);
                writer.WriteAttributeString("type", "array");
                foreach (string keyitem in this.Key)
                {
                    writer.WriteStartElement("item");
                    writer.WriteAttributeString("type", "string");
                    writer.WriteValue(keyitem);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.FieldsString);
                writer.WriteAttributeString("type", "object");
                foreach (TypePropertyMetadata field in this.Properties)
                {
                    field.WriteJson(writer);
                }
                writer.WriteEndElement();

                this.WriteValidationRulesMetadata(writer);
            }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:28,代码来源:ServiceMetadataGenerator.cs


示例15: Serialize

		internal static void Serialize(MessageDictionary messageDictionary, XmlDictionaryWriter writer) {
			Requires.NotNull(messageDictionary, "messageDictionary");
			Requires.NotNull(writer, "writer");

			writer.WriteStartElement("root");
			writer.WriteAttributeString("type", "object");
			foreach (var pair in messageDictionary) {
				bool include = false;
				string type = "string";
				MessagePart partDescription;
				if (messageDictionary.Description.Mapping.TryGetValue(pair.Key, out partDescription)) {
					Contract.Assume(partDescription != null);
					if (partDescription.IsRequired || partDescription.IsNondefaultValueSet(messageDictionary.Message)) {
						include = true;
						if (IsNumeric(partDescription.MemberDeclaredType)) {
							type = "number";
						} else if (partDescription.MemberDeclaredType.IsAssignableFrom(typeof(bool))) {
							type = "boolean";
						}
					}
				} else {
					// This is extra data.  We always write it out.
					include = true;
				}

				if (include) {
					writer.WriteStartElement(pair.Key);
					writer.WriteAttributeString("type", type);
					writer.WriteString(pair.Value);
					writer.WriteEndElement();
				}
			}

			writer.WriteEndElement();
		}
开发者ID:rafek,项目名称:dotnetopenid,代码行数:35,代码来源:MessageSerializer.cs


示例16: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     lock (this.ThisLock)
     {
         this.serializer.WriteObject(writer, this.body);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:XmlObjectSerializerBodyWriter.cs


示例17: WriteKeyIdentifierClauseCore

 public override void WriteKeyIdentifierClauseCore(XmlDictionaryWriter writer, SecurityKeyIdentifierClause keyIdentifierClause)
 {
     EncryptedKeyIdentifierClause clause = keyIdentifierClause as EncryptedKeyIdentifierClause;
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.EncryptedKey, this.NamespaceUri);
     if (clause.EncryptionMethod != null)
     {
         writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.EncryptionMethod, this.NamespaceUri);
         writer.WriteAttributeString(XD.XmlEncryptionDictionary.AlgorithmAttribute, null, clause.EncryptionMethod);
         if (clause.EncryptionMethod == XD.SecurityAlgorithmDictionary.RsaOaepKeyWrap.Value)
         {
             writer.WriteStartElement("", XD.XmlSignatureDictionary.DigestMethod, XD.XmlSignatureDictionary.Namespace);
             writer.WriteAttributeString(XD.XmlSignatureDictionary.Algorithm, null, "http://www.w3.org/2000/09/xmldsig#sha1");
             writer.WriteEndElement();
         }
         writer.WriteEndElement();
     }
     if (clause.EncryptingKeyIdentifier != null)
     {
         this.tokenSerializer.WriteKeyIdentifier(writer, clause.EncryptingKeyIdentifier);
     }
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CipherData, this.NamespaceUri);
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CipherValue, this.NamespaceUri);
     byte[] encryptedKey = clause.GetEncryptedKey();
     writer.WriteBase64(encryptedKey, 0, encryptedKey.Length);
     writer.WriteEndElement();
     writer.WriteEndElement();
     if (clause.CarriedKeyName != null)
     {
         writer.WriteElementString(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CarriedKeyName, this.NamespaceUri, clause.CarriedKeyName);
     }
     writer.WriteEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XmlEncApr2001.cs


示例18: OnWriteBodyContents

		protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
		{
			writer.WriteStartElement("Renew", "http://schemas.xmlsoap.org/ws/2004/09/enumeration");
			XmlUtility.SerializeEnumerationContext(writer, this._enumerationContext);
			XmlUtility.SerializeExpires(writer, this._expirationDateTime, this._expirationTimeSpan);
			writer.WriteEndElement();
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ADRenewRequest.cs


示例19: Serialize

 internal void Serialize(XmlDictionaryWriter writer, object[] parameters, object returnValue)
 {
     Stream streamValue = GetStreamAndWriteStartWrapperIfNecessary(writer, parameters, returnValue);
     var streamProvider = new OperationStreamProvider(streamValue);
     StreamFormatterHelper.WriteValue(writer, streamProvider);
     WriteEndWrapperIfNecessary(writer);
 }
开发者ID:dmetzgar,项目名称:wcf,代码行数:7,代码来源:StreamFormatter.cs


示例20: OnWriteBodyContents

        /// <summary>Called when the message body is written to an XML file.</summary>
        /// <param name="writer">
        /// An <see cref="XmlDictionaryWriter"/> that is used to write this 
        /// message body to an XML file.
        /// </param>
        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            WebUtil.CheckArgumentNull(writer, "writer");

            try
            {
                writer.WriteStartElement(XmlConstants.WcfBinaryElementName);
                using (XmlWriterStream stream = new XmlWriterStream(writer))
                {
                    this.writerAction(stream);
                }

                writer.WriteEndElement();
            }
            finally
            {
                if (this.service != null)
                {
                    HttpContextServiceHost host = this.service.OperationContext.RequestMessage.HttpContextServiceHost;

                    this.service.DisposeDataSource();
                    if (host != null)
                    {
                        if (host.ErrorFound)
                        {
                            var ctx = System.ServiceModel.OperationContext.Current;
                            if (ctx != null)
                            {
                                ctx.Channel.Abort();
                            }
                        }
                    }
                }
            }
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:40,代码来源:DelegateBodyWriter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Xml.XmlDocument类代码示例发布时间:2022-05-26
下一篇:
C# Xml.XmlDictionaryString类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap