本文整理汇总了C#中System.Xml.XmlDictionaryReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReader.Skip方法的具体用法?C# XmlDictionaryReader.Skip怎么用?C# XmlDictionaryReader.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDictionaryReader
的用法示例。
在下文中一共展示了XmlDictionaryReader.Skip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Create
public static CloseSequenceResponseInfo Create(XmlDictionaryReader reader)
{
if (reader == null)
{
Fx.Assert("Argument reader cannot be null.");
}
CloseSequenceResponseInfo closeSequenceResponseInfo = new CloseSequenceResponseInfo();
XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
reader.ReadStartElement(DXD.Wsrm11Dictionary.CloseSequenceResponse, wsrmNs);
reader.ReadStartElement(XD.WsrmFeb2005Dictionary.Identifier, wsrmNs);
closeSequenceResponseInfo.Identifier = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return closeSequenceResponseInfo;
}
示例3: InvalidAcknowledgementFault
public InvalidAcknowledgementFault(FaultCode code, FaultReason reason, XmlDictionaryReader detailReader, ReliableMessagingVersion reliableMessagingVersion) : base(code, "InvalidAcknowledgement", reason, true, false)
{
UniqueId id;
bool flag;
WsrmAcknowledgmentInfo.ReadAck(reliableMessagingVersion, detailReader, out id, out this.ranges, out flag);
base.SequenceID = id;
while (detailReader.IsStartElement())
{
detailReader.Skip();
}
detailReader.ReadEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:InvalidAcknowledgementFault.cs
示例4: OnReadBodyContents
protected override void OnReadBodyContents(XmlDictionaryReader reader)
{
base.OnReadBodyContents(reader);
reader.ReadStartElement("ResourceCreated", "http://schemas.xmlsoap.org/ws/2004/09/transfer");
reader.Skip();
reader.ReadStartElement("ReferenceParameters", "http://www.w3.org/2005/08/addressing");
XmlUtility.DeserializeObjectReference(reader, out this._objectReference);
this._instance = reader.ReadElementString("instance", "http://schemas.microsoft.com/2008/1/ActiveDirectory");
reader.ReadEndElement();
reader.ReadEndElement();
DirectoryControlSerializer.Deserialize(reader, out this._controls, false, false);
reader.ReadEndElement();
}
示例5: GetReaderAtDetailContents11
public static XmlDictionaryReader GetReaderAtDetailContents11(string detailName, string detailNamespace, XmlDictionaryReader headerReader)
{
XmlDictionaryString namespaceUri = DXD.Wsrm11Dictionary.Namespace;
headerReader.ReadFullStartElement(XD.WsrmFeb2005Dictionary.SequenceFault, namespaceUri);
headerReader.Skip();
headerReader.ReadFullStartElement(XD.Message12Dictionary.FaultDetail, namespaceUri);
if (((headerReader.NodeType == XmlNodeType.Element) && !(headerReader.NamespaceURI != detailNamespace)) && !(headerReader.LocalName != detailName))
{
return headerReader;
}
headerReader.Close();
return null;
}
示例6: Create
public static CreateSequenceResponseInfo Create(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, XmlDictionaryReader reader)
{
CreateSequenceResponseInfo info = new CreateSequenceResponseInfo();
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
reader.ReadStartElement(dictionary.CreateSequenceResponse, namespaceUri);
reader.ReadStartElement(dictionary.Identifier, namespaceUri);
info.Identifier = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
if (reader.IsStartElement(dictionary.Expires, namespaceUri))
{
reader.ReadElementContentAsTimeSpan();
}
if ((reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && reader.IsStartElement(DXD.Wsrm11Dictionary.IncompleteSequenceBehavior, namespaceUri))
{
string str2 = reader.ReadElementContentAsString();
if (((str2 != "DiscardEntireSequence") && (str2 != "DiscardFollowingFirstGap")) && (str2 != "NoDiscard"))
{
string message = System.ServiceModel.SR.GetString("CSResponseWithInvalidIncompleteSequenceBehavior");
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(message));
}
}
if (reader.IsStartElement(dictionary.Accept, namespaceUri))
{
reader.ReadStartElement();
info.AcceptAcksTo = EndpointAddress.ReadFrom(addressingVersion, reader, dictionary.AcksTo, namespaceUri);
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
}
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return info;
}
示例7: Create
public static CloseSequenceResponseInfo Create(XmlDictionaryReader reader)
{
CloseSequenceResponseInfo info = new CloseSequenceResponseInfo();
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
reader.ReadStartElement(DXD.Wsrm11Dictionary.CloseSequenceResponse, namespaceUri);
reader.ReadStartElement(XD.WsrmFeb2005Dictionary.Identifier, namespaceUri);
info.Identifier = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return info;
}
示例8: ReadXml
public virtual void ReadXml( XmlDictionaryReader reader )
{
if ( reader == null )
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "reader" );
}
reader.MoveToContent();
if ( reader.IsStartElement( XD.XmlSignatureDictionary.KeyInfo.Value, XD.XmlSignatureDictionary.Namespace.Value ) )
{
// <KeyInfo>
reader.ReadStartElement();
while ( reader.IsStartElement() )
{
// <RetrievalMethod>
if ( reader.IsStartElement( XmlSignatureConstants.Elements.RetrievalMethod, XD.XmlSignatureDictionary.Namespace.Value ) )
{
string method = reader.GetAttribute( XD.XmlSignatureDictionary.URI.Value );
if ( !string.IsNullOrEmpty( method ) )
{
_retrieval = method;
}
reader.Skip();
}
// check if internal serializer can handle clause
else if ( _keyInfoSerializer.CanReadKeyIdentifierClause( reader ) )
{
_ski.Add( _keyInfoSerializer.ReadKeyIdentifierClause( reader ) );
}
// trace we skipped over an element
else if ( reader.IsStartElement() )
{
string xml = reader.ReadOuterXml();
if ( DiagnosticUtility.ShouldTraceWarning )
{
TraceUtility.TraceString( System.Diagnostics.TraceEventType.Warning, SR.GetString( SR.ID8023, reader.Name, reader.NamespaceURI, xml ) );
}
}
reader.MoveToContent();
}
reader.MoveToContent();
reader.ReadEndElement();
}
}
示例9: ReadKeyIdentifierClauseCore
public override SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore(XmlDictionaryReader reader)
{
string encryptionMethod = null;
string carriedKeyName = null;
SecurityKeyIdentifier encryptingKeyIdentifier = null;
byte[] encryptedKey = null;
reader.ReadStartElement(XD.XmlEncryptionDictionary.EncryptedKey, NamespaceUri);
if (reader.IsStartElement(XD.XmlEncryptionDictionary.EncryptionMethod, NamespaceUri))
{
encryptionMethod = reader.GetAttribute(XD.XmlEncryptionDictionary.AlgorithmAttribute, null);
bool isEmptyElement = reader.IsEmptyElement;
reader.ReadStartElement();
if (!isEmptyElement)
{
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
}
}
if (this.securityTokenSerializer.CanReadKeyIdentifier(reader))
{
encryptingKeyIdentifier = this.securityTokenSerializer.ReadKeyIdentifier(reader);
}
reader.ReadStartElement(XD.XmlEncryptionDictionary.CipherData, NamespaceUri);
reader.ReadStartElement(XD.XmlEncryptionDictionary.CipherValue, NamespaceUri);
encryptedKey = reader.ReadContentAsBase64();
reader.ReadEndElement();
reader.ReadEndElement();
if (reader.IsStartElement(XD.XmlEncryptionDictionary.CarriedKeyName, NamespaceUri))
{
reader.ReadStartElement();
carriedKeyName = reader.ReadString();
reader.ReadEndElement();
}
reader.ReadEndElement();
return new EncryptedKeyIdentifierClause(encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName);
}
示例10: ReadFrom
private void ReadFrom(XmlDictionaryReader reader)
{
try
{
reader.ReadFullStartElement(this.coordinationXmlDictionaryStrings.RegisterResponse, this.coordinationXmlDictionaryStrings.Namespace);
this.CoordinatorProtocolService = EndpointAddress.ReadFrom(MessagingVersionHelper.AddressingVersion(this.protocolVersion), reader, this.coordinationXmlDictionaryStrings.CoordinatorProtocolService, this.coordinationXmlDictionaryStrings.Namespace);
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
}
catch (XmlException exception)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
}
}
示例11: ReadHeader
public static WsrmAckRequestedInfo ReadHeader(ReliableMessagingVersion reliableMessagingVersion, XmlDictionaryReader reader, MessageHeaderInfo header)
{
WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
reader.ReadStartElement();
reader.ReadStartElement(dictionary.Identifier, namespaceUri);
UniqueId sequenceID = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
if ((reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005) && reader.IsStartElement(dictionary.MessageNumber, namespaceUri))
{
reader.ReadStartElement();
WsrmUtilities.ReadSequenceNumber(reader, true);
reader.ReadEndElement();
}
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return new WsrmAckRequestedInfo(sequenceID, header);
}
示例12: ReadXml
public virtual void ReadXml(XmlDictionaryReader reader)
{
if (reader == null)
{
throw DiagnosticUtil.ExceptionUtil.ThrowHelperArgumentNull("reader");
}
reader.MoveToContent();
if (reader.IsStartElement("KeyInfo", "http://www.w3.org/2000/09/xmldsig#"))
{
reader.ReadStartElement();
while (reader.IsStartElement())
{
if (reader.IsStartElement("RetrievalMethod", "http://www.w3.org/2000/09/xmldsig#"))
{
string attribute = reader.GetAttribute("URI");
if (!string.IsNullOrEmpty(attribute))
{
this._retrieval = attribute;
}
reader.Skip();
}
else if (this._keyInfoSerializer.CanReadKeyIdentifierClause(reader))
{
this._ski.Add(this._keyInfoSerializer.ReadKeyIdentifierClause(reader));
}
else if (reader.IsStartElement())
{
string str2 = reader.ReadOuterXml();
//if (DiagnosticUtil.TraceUtil.ShouldTrace(TraceEventType.Warning))
//{
// DiagnosticUtil.TraceUtil.TraceString(TraceEventType.Warning, SR.GetString("ID8023", new object[] { reader.Name, reader.NamespaceURI, str2 }), new object[0]);
//}
}
reader.MoveToContent();
}
reader.MoveToContent();
reader.ReadEndElement();
}
}
示例13: Create
public static CloseSequenceInfo Create(XmlDictionaryReader reader)
{
CloseSequenceInfo info = new CloseSequenceInfo();
XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
Wsrm11Dictionary dictionary = DXD.Wsrm11Dictionary;
reader.ReadStartElement(dictionary.CloseSequence, namespaceUri);
reader.ReadStartElement(XD.WsrmFeb2005Dictionary.Identifier, namespaceUri);
info.Identifier = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
if (reader.IsStartElement(dictionary.LastMsgNumber, namespaceUri))
{
reader.ReadStartElement();
info.LastMsgNumber = WsrmUtilities.ReadSequenceNumber(reader, false);
reader.ReadEndElement();
}
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return info;
}
示例14: ReadKeyIdentifierCore
public override SecurityKeyIdentifier ReadKeyIdentifierCore( XmlDictionaryReader reader )
{
reader.ReadStartElement( LocalName, NamespaceUri );
SecurityKeyIdentifier keyIdentifier = new SecurityKeyIdentifier();
while ( reader.IsStartElement() )
{
SecurityKeyIdentifierClause clause = this.securityTokenSerializer.ReadKeyIdentifierClause( reader );
if ( clause == null )
{
reader.Skip();
}
else
{
keyIdentifier.Add( clause );
}
}
if ( keyIdentifier.Count == 0 )
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new XmlException( SR.GetString( SR.ErrorDeserializingKeyIdentifierClause ) ) );
}
reader.ReadEndElement();
return keyIdentifier;
}
示例15: Create
public static TerminateSequenceInfo Create(ReliableMessagingVersion reliableMessagingVersion,
XmlDictionaryReader reader)
{
if (reader == null)
{
Fx.Assert("Argument reader cannot be null.");
}
TerminateSequenceInfo terminateSequenceInfo = new TerminateSequenceInfo();
WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary;
XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(reliableMessagingVersion);
reader.ReadStartElement(wsrmFeb2005Dictionary.TerminateSequence, wsrmNs);
reader.ReadStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs);
terminateSequenceInfo.Identifier = reader.ReadContentAsUniqueId();
reader.ReadEndElement();
if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
{
if (reader.IsStartElement(DXD.Wsrm11Dictionary.LastMsgNumber, wsrmNs))
{
reader.ReadStartElement();
terminateSequenceInfo.LastMsgNumber = WsrmUtilities.ReadSequenceNumber(reader, false);
reader.ReadEndElement();
}
}
while (reader.IsStartElement())
{
reader.Skip();
}
reader.ReadEndElement();
return terminateSequenceInfo;
}