本文整理汇总了C#中System.Xml.XmlDictionaryWriter.WriteValue方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryWriter.WriteValue方法的具体用法?C# XmlDictionaryWriter.WriteValue怎么用?C# XmlDictionaryWriter.WriteValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDictionaryWriter
的用法示例。
在下文中一共展示了XmlDictionaryWriter.WriteValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: 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();
}
}
示例3: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(this.reliableMessagingVersion);
writer.WriteStartElement(dictionary.CreateSequenceResponse, namespaceUri);
writer.WriteStartElement(dictionary.Identifier, namespaceUri);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
if (this.expires.HasValue)
{
writer.WriteStartElement(dictionary.Expires, namespaceUri);
writer.WriteValue(this.expires.Value);
writer.WriteEndElement();
}
if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
{
Wsrm11Dictionary dictionary2 = DXD.Wsrm11Dictionary;
writer.WriteStartElement(dictionary2.IncompleteSequenceBehavior, namespaceUri);
writer.WriteValue(this.ordered ? dictionary2.DiscardFollowingFirstGap : dictionary2.NoDiscard);
writer.WriteEndElement();
}
if (this.acceptAcksTo != null)
{
writer.WriteStartElement(dictionary.Accept, namespaceUri);
this.acceptAcksTo.WriteTo(this.addressingVersion, writer, dictionary.AcksTo, namespaceUri);
writer.WriteEndElement();
}
writer.WriteEndElement();
}
示例4: OnWriteAddressHeaderContents
protected override void OnWriteAddressHeaderContents(XmlDictionaryWriter writer)
{
if (this.protocol != ControlProtocol.None)
{
writer.WriteStartAttribute(XD.DotNetAtomicTransactionExternalDictionary.Protocol, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
writer.WriteValue((int) this.protocol);
writer.WriteEndAttribute();
}
writer.WriteValue(this.enlistment);
}
示例5: OnWriteHeaderContents
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
writer.WriteStartElement(dictionary.Identifier, dictionaryNamespace);
writer.WriteValue(this.sequenceID);
writer.WriteEndElement();
writer.WriteStartElement(dictionary.MessageNumber, dictionaryNamespace);
writer.WriteValue(this.sequenceNumber);
writer.WriteEndElement();
if ((base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005) && this.lastMessage)
{
writer.WriteStartElement(dictionary.LastMessage, dictionaryNamespace);
writer.WriteEndElement();
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:WsrmSequencedMessageHeader.cs
示例6: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
Wsrm11Dictionary dictionary = DXD.Wsrm11Dictionary;
writer.WriteStartElement(dictionary.CloseSequence, namespaceUri);
writer.WriteStartElement(XD.WsrmFeb2005Dictionary.Identifier, namespaceUri);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
if (this.lastMsgNumber > 0L)
{
writer.WriteStartElement(dictionary.LastMsgNumber, namespaceUri);
writer.WriteValue(this.lastMsgNumber);
writer.WriteEndElement();
}
writer.WriteEndElement();
}
示例7: 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);
}
示例8: WriteObjectContent
public override void WriteObjectContent(XmlDictionaryWriter writer, object graph)
{
var data = Serialize(graph);
if (UseEncryption())
data = Encrypt(data);
var content = Convert.ToBase64String(data);
writer.WriteValue(content);
}
示例9: OnWriteHeaderContents
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
writer.WriteStartElement(dictionary.Identifier, dictionaryNamespace);
writer.WriteValue(this.sequenceID);
writer.WriteEndElement();
}
示例10: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
writer.WriteStartElement(DXD.Wsrm11Dictionary.TerminateSequenceResponse, wsrmNs);
writer.WriteStartElement(XD.WsrmFeb2005Dictionary.Identifier, wsrmNs);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
writer.WriteEndElement();
}
示例11: OnWriteDetailContents
protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
{
ReliableMessagingVersion reliableMessagingVersion = base.GetReliableMessagingVersion();
WsrmUtilities.WriteIdentifier(writer, reliableMessagingVersion, base.SequenceID);
if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
{
writer.WriteStartElement("r", DXD.Wsrm11Dictionary.MaxMessageNumber, WsrmIndex.GetNamespace(reliableMessagingVersion));
writer.WriteValue((long) 0x7fffffffffffffffL);
writer.WriteEndElement();
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:MessageNumberRolloverFault.cs
示例12: OnWriteHeaderContents
protected override void OnWriteHeaderContents(
XmlDictionaryWriter writer,
MessageVersion messageVersion)
{
if (null == writer) {
throw new ArgumentNullException("writer");
}
writer.WriteStartElement("Property", this.Namespace);
writer.WriteAttributeString("name", null, "instanceId");
writer.WriteValue(Value);
writer.WriteEndElement();
}
示例13: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(this.reliableMessagingVersion);
writer.WriteStartElement(wsrmFeb2005Dictionary.TerminateSequence, wsrmNs);
writer.WriteStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
{
if (this.lastMsgNumber > 0)
{
writer.WriteStartElement(DXD.Wsrm11Dictionary.LastMsgNumber, wsrmNs);
writer.WriteValue(this.lastMsgNumber);
writer.WriteEndElement();
}
}
writer.WriteEndElement();
}
示例14: WriteTo
public void WriteTo(XmlDictionaryWriter writer)
{
writer.WriteStartElement(this.coordinationStrings.Prefix, this.coordinationXmlDictionaryStrings.Register, this.coordinationXmlDictionaryStrings.Namespace);
XmlDictionaryString str = WSAtomicTransactionStrings.ProtocolToWellKnownName(this.Protocol, this.protocolVersion);
writer.WriteStartElement(this.coordinationXmlDictionaryStrings.Protocol, this.coordinationXmlDictionaryStrings.Namespace);
writer.WriteString(str);
writer.WriteEndElement();
this.ParticipantProtocolService.WriteTo(MessagingVersionHelper.AddressingVersion(this.protocolVersion), writer, this.coordinationXmlDictionaryStrings.ParticipantProtocolService, this.coordinationXmlDictionaryStrings.Namespace);
if (this.Loopback != Guid.Empty)
{
writer.WriteStartElement("mstx", XD.DotNetAtomicTransactionExternalDictionary.Loopback, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
writer.WriteValue(this.Loopback);
writer.WriteEndElement();
}
writer.WriteEndElement();
}
示例15: OnWriteHeaderContents
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
WriteAckRanges(writer, base.ReliableMessagingVersion, this.sequenceID, this.ranges);
if ((base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && this.final)
{
writer.WriteStartElement(DXD.Wsrm11Dictionary.Final, dictionaryNamespace);
writer.WriteEndElement();
}
if (this.bufferRemaining != -1)
{
writer.WriteStartElement("netrm", dictionary.BufferRemaining, XD.WsrmFeb2005Dictionary.NETNamespace);
writer.WriteValue(this.bufferRemaining);
writer.WriteEndElement();
}
}