示例#1
0
        public static CloseSequenceInfo Create(XmlDictionaryReader reader)
        {
            if (reader == null)
            {
                Fx.Assert("Argument reader cannot be null.");
            }

            CloseSequenceInfo closeSequenceInfo = new CloseSequenceInfo();

            XmlDictionaryString wsrmNs           = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
            Wsrm11Dictionary    wsrm11Dictionary = DXD.Wsrm11Dictionary;

            reader.ReadStartElement(wsrm11Dictionary.CloseSequence, wsrmNs);
            reader.ReadStartElement(XD.WsrmFeb2005Dictionary.Identifier, wsrmNs);
            closeSequenceInfo.Identifier = reader.ReadContentAsUniqueId();
            reader.ReadEndElement();

            if (reader.IsStartElement(wsrm11Dictionary.LastMsgNumber, wsrmNs))
            {
                reader.ReadStartElement();
                closeSequenceInfo.LastMsgNumber = WsrmUtilities.ReadSequenceNumber(reader, false);
                reader.ReadEndElement();
            }

            while (reader.IsStartElement())
            {
                reader.Skip();
            }

            reader.ReadEndElement();

            return(closeSequenceInfo);
        }
        public static CloseSequenceInfo Create(XmlDictionaryReader reader)
        {
            if (reader == null)
            {
                Fx.Assert("Argument reader cannot be null.");
            }

            CloseSequenceInfo closeSequenceInfo = new CloseSequenceInfo();

            XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
            Wsrm11Dictionary wsrm11Dictionary = DXD.Wsrm11Dictionary;

            reader.ReadStartElement(wsrm11Dictionary.CloseSequence, wsrmNs);
            reader.ReadStartElement(XD.WsrmFeb2005Dictionary.Identifier, wsrmNs);
            closeSequenceInfo.Identifier = reader.ReadContentAsUniqueId();
            reader.ReadEndElement();

            if (reader.IsStartElement(wsrm11Dictionary.LastMsgNumber, wsrmNs))
            {
                reader.ReadStartElement();
                closeSequenceInfo.LastMsgNumber = WsrmUtilities.ReadSequenceNumber(reader, false);
                reader.ReadEndElement();
            }

            while (reader.IsStartElement())
            {
                reader.Skip();
            }

            reader.ReadEndElement();

            return closeSequenceInfo;
        }
 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;
 }
        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);
        }