本文整理汇总了C#中System.Xml.XmlDictionaryWriter.WriteEndElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryWriter.WriteEndElement方法的具体用法?C# XmlDictionaryWriter.WriteEndElement怎么用?C# XmlDictionaryWriter.WriteEndElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDictionaryWriter
的用法示例。
在下文中一共展示了XmlDictionaryWriter.WriteEndElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: 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();
}
示例3: WriteHeader
private void WriteHeader(XmlDictionaryWriter writer)
{
var nonce = new byte[64];
RandomNumberGenerator.Create().GetBytes(nonce);
string created = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.mszzzz");
writer.WriteStartElement("wsse", "UsernameToken", null);
writer.WriteAttributeString("wsu:Id", "UsernameToken-1");
writer.WriteStartElement("wsse", "Username", null);
writer.WriteString(SystemUser);
writer.WriteEndElement();//End Username
writer.WriteStartElement("wsse", "Password", null);
writer.WriteAttributeString("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest");
writer.WriteString(ComputePasswordDigest(SystemPassword, nonce, created));
writer.WriteEndElement();//End Password
writer.WriteStartElement("wsse", "Nonce", null);
writer.WriteAttributeString("EncodingType", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary");
writer.WriteBase64(nonce, 0, nonce.Length);
writer.WriteEndElement();//End Nonce
writer.WriteStartElement("wsu", "Created", null);
writer.WriteString(created);
writer.WriteEndElement();//End Created
writer.WriteEndElement();//End UsernameToken
writer.Flush();
}
示例4: 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);
}
示例5: 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();
}
}
示例6: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
writer.WriteStartElement(DXD.Wsrm11Dictionary.CloseSequenceResponse, namespaceUri);
writer.WriteStartElement(XD.WsrmFeb2005Dictionary.Identifier, namespaceUri);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
writer.WriteEndElement();
}
示例7: OnWriteHeaderContents
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
writer.WriteStartElement("ID");
//writer.WriteString("{id}");
writer.WriteString("1408");
writer.WriteEndElement();
writer.WriteStartElement("MDP");
//writer.WriteString("{mdp}");
writer.WriteString("fophjkl32");
writer.WriteEndElement();
}
示例8: OnWriteHeaderContents
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
if (this.address != null)
{
writer.WriteStartElement("netdx", "Address", "http://schemas.microsoft.com/2008/04/netduplex");
writer.WriteString(this.address);
writer.WriteEndElement();
}
writer.WriteStartElement("netdx", "SessionId", "http://schemas.microsoft.com/2008/04/netduplex");
writer.WriteString(this.sessionId);
writer.WriteEndElement();
}
示例9: WriteHeader
private void WriteHeader(XmlDictionaryWriter writer)
{
writer.WriteStartElement("wsse", "UsernameToken", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
writer.WriteXmlnsAttribute("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
writer.WriteStartElement("wsse", "Username", null);
writer.WriteString(SystemUser);
writer.WriteEndElement();//End Username
writer.WriteStartElement("wsse", "Password", null);
writer.WriteAttributeString("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
writer.WriteString(SystemPassword);
writer.WriteEndElement();//End Password
writer.WriteEndElement();//End UsernameToken
writer.Flush();
}
示例10: WriteContentsTo
internal override void WriteContentsTo(XmlDictionaryWriter writer)
{
if (writer == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
writer.WriteStartElement(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.KeyInfo, XD.XmlSignatureDictionary.Namespace);
writer.WriteStartElement(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.RsaKeyValue, XD.XmlSignatureDictionary.Namespace);
RSA rsa = (RSA)this.IdentityClaim.Resource;
RSAParameters parameters = rsa.ExportParameters(false);
writer.WriteElementString(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.Modulus, XD.XmlSignatureDictionary.Namespace, Convert.ToBase64String(parameters.Modulus));
writer.WriteElementString(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.Exponent, XD.XmlSignatureDictionary.Namespace, Convert.ToBase64String(parameters.Exponent));
writer.WriteEndElement();
writer.WriteEndElement();
}
示例11: WriteContentsTo
internal override void WriteContentsTo(XmlDictionaryWriter writer)
{
if (writer == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
}
writer.WriteStartElement(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.KeyInfo, XD.XmlSignatureDictionary.Namespace);
writer.WriteStartElement(XD.XmlSignatureDictionary.Prefix.Value, XD.XmlSignatureDictionary.X509Data, XD.XmlSignatureDictionary.Namespace);
for (int i = 0; i < this.certificateCollection.Count; i++)
{
writer.WriteElementString(XD.XmlSignatureDictionary.X509Certificate, XD.XmlSignatureDictionary.Namespace, Convert.ToBase64String(this.certificateCollection[i].RawData));
}
writer.WriteEndElement();
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:X509CertificateEndpointIdentity.cs
示例12: WriteObject
public override void WriteObject(XmlDictionaryWriter writer, object graph)
{
var data = EncodeObject(graph);
writer.WriteStartElement("Data");
writer.WriteBase64(data, 0, data.Length);
writer.WriteEndElement();
}
示例13: 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();
}
示例14: WriteEndObject
public override void WriteEndObject(XmlDictionaryWriter writer)
{
if (!skipName)
{
writer.WriteEndElement();
}
}
示例15: OnWriteBodyContents
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(this.reliableMessagingVersion);
writer.WriteStartElement(dictionary.TerminateSequence, namespaceUri);
writer.WriteStartElement(dictionary.Identifier, namespaceUri);
writer.WriteValue(this.identifier);
writer.WriteEndElement();
if ((this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && (this.lastMsgNumber > 0L))
{
writer.WriteStartElement(DXD.Wsrm11Dictionary.LastMsgNumber, namespaceUri);
writer.WriteValue(this.lastMsgNumber);
writer.WriteEndElement();
}
writer.WriteEndElement();
}