本文整理汇总了C#中System.Xml.XmlDictionaryReader.ReadElementContentAsUniqueId方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReader.ReadElementContentAsUniqueId方法的具体用法?C# XmlDictionaryReader.ReadElementContentAsUniqueId怎么用?C# XmlDictionaryReader.ReadElementContentAsUniqueId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDictionaryReader
的用法示例。
在下文中一共展示了XmlDictionaryReader.ReadElementContentAsUniqueId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static MakeConnectionMessageInfo Create(XmlDictionaryReader reader)
{
MakeConnectionMessageInfo makeConnectionInfo = new MakeConnectionMessageInfo();
if (reader.IsStartElement(MakeConnectionConstants.MakeConnectionMessage.Name, MakeConnectionConstants.Namespace))
{
reader.ReadStartElement();
reader.MoveToContent();
while (reader.IsStartElement())
{
if (reader.IsStartElement(MakeConnectionConstants.MakeConnectionMessage.AddressElement, MakeConnectionConstants.Namespace))
{
if (!string.IsNullOrEmpty(makeConnectionInfo.Address))
{
makeConnectionInfo.MultipleAddressHeaders = true;
reader.Skip();
}
else
{
makeConnectionInfo.Address = reader.ReadElementContentAsString();
}
}
else if (reader.IsStartElement(MakeConnectionConstants.MakeConnectionMessage.IdentifierElement, MakeConnectionConstants.Namespace))
{
if (makeConnectionInfo.Identifier != null)
{
makeConnectionInfo.MultipleIdentifierHeaders = true;
reader.Skip();
}
else
{
makeConnectionInfo.Identifier = reader.ReadElementContentAsUniqueId();
}
}
else
{
if (string.IsNullOrEmpty(makeConnectionInfo.UnknownSelection))
{
makeConnectionInfo.UnknownSelection = reader.LocalName;
}
reader.Skip();
}
}
reader.ReadEndElement();
}
return makeConnectionInfo;
}
示例2: ReadGeneration
protected override UniqueId ReadGeneration(XmlDictionaryReader reader)
{
return reader.ReadElementContentAsUniqueId();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:WSSecureConversationDec2005.cs
示例3: ReadHeaderValue
public static void ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, out Uri relationshipType, out UniqueId messageId)
{
AddressingDictionary addressingDictionary = XD.AddressingDictionary;
// The RelationshipType attribute has no namespace.
relationshipType = ReplyRelationshipType;
/*
string relation = reader.GetAttribute(addressingDictionary.RelationshipType, addressingDictionary.Empty);
if (relation == null)
{
relationshipType = ReplyRelationshipType;
}
else
{
relationshipType = new Uri(relation);
}
*/
Fx.Assert(reader.IsStartElement(addressingDictionary.RelatesTo, version.DictionaryNamespace), "");
messageId = reader.ReadElementContentAsUniqueId();
}
示例4: ReadHeaderValue
public static void ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, out Uri relationshipType, out System.Xml.UniqueId messageId)
{
AddressingDictionary addressingDictionary = XD.AddressingDictionary;
relationshipType = ReplyRelationshipType;
messageId = reader.ReadElementContentAsUniqueId();
}
示例5: ReadTokenCore
public override SecurityToken ReadTokenCore(XmlDictionaryReader reader, SecurityTokenResolver tokenResolver)
{
UniqueId contextId = null;
byte[] encodedCookie = null;
UniqueId generation = null;
bool isCookieMode = false;
Fx.Assert(reader.NodeType == XmlNodeType.Element, "");
// check if there is an id
string id = reader.GetAttribute(XD.UtilityDictionary.IdAttribute, XD.UtilityDictionary.Namespace);
SecurityContextSecurityToken sct = null;
// There needs to be at least a contextId in here.
reader.ReadFullStartElement();
reader.MoveToStartElement(parent.SerializerDictionary.Identifier, parent.SerializerDictionary.Namespace);
contextId = reader.ReadElementContentAsUniqueId();
if (CanReadGeneration(reader))
{
generation = ReadGeneration(reader);
}
if (reader.IsStartElement(parent.SerializerDictionary.Cookie, XD.DotNetSecurityDictionary.Namespace))
{
isCookieMode = true;
ISecurityContextSecurityTokenCache sctCache;
sct = TryResolveSecurityContextToken(contextId, generation, id, tokenResolver, out sctCache);
if (sct == null)
{
encodedCookie = reader.ReadElementContentAsBase64();
if (encodedCookie != null)
{
sct = cookieSerializer.CreateSecurityContextFromCookie(encodedCookie, contextId, generation, id, reader.Quotas);
if (sctCache != null)
{
sctCache.AddContext(sct);
}
}
}
else
{
reader.Skip();
}
}
reader.ReadEndElement();
if (contextId == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SR.GetString(SR.NoSecurityContextIdentifier)));
}
if (sct == null && !isCookieMode)
{
ISecurityContextSecurityTokenCache sctCache;
sct = TryResolveSecurityContextToken(contextId, generation, id, tokenResolver, out sctCache);
}
if (sct == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new SecurityContextTokenValidationException(SR.GetString(SR.SecurityContextNotRegistered, contextId, generation)));
}
return sct;
}
示例6: ReadHeaderValue
public static UniqueId ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version)
{
return reader.ReadElementContentAsUniqueId();
}