当前位置: 首页>>代码示例>>C#>>正文


C# XmlDictionaryReader.ReadStartElement方法代码示例

本文整理汇总了C#中System.Xml.XmlDictionaryReader.ReadStartElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReader.ReadStartElement方法的具体用法?C# XmlDictionaryReader.ReadStartElement怎么用?C# XmlDictionaryReader.ReadStartElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlDictionaryReader的用法示例。


在下文中一共展示了XmlDictionaryReader.ReadStartElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadFrom

 public void ReadFrom(XmlDictionaryReader reader, long maxBufferSize)
 {
     this.ValidateReadState();
     reader.MoveToStartElement(this.OpeningElementName, NamespaceUri);
     this.encoding = reader.GetAttribute(EncodingAttribute, null);
     this.id = reader.GetAttribute(System.ServiceModel.XD.XmlEncryptionDictionary.Id, null) ?? System.ServiceModel.Security.SecurityUniqueId.Create().Value;
     this.wsuId = reader.GetAttribute(System.ServiceModel.XD.XmlEncryptionDictionary.Id, System.ServiceModel.XD.UtilityDictionary.Namespace) ?? System.ServiceModel.Security.SecurityUniqueId.Create().Value;
     this.mimeType = reader.GetAttribute(MimeTypeAttribute, null);
     this.type = reader.GetAttribute(TypeAttribute, null);
     this.ReadAdditionalAttributes(reader);
     reader.Read();
     if (reader.IsStartElement(EncryptionMethodElement.ElementName, NamespaceUri))
     {
         this.encryptionMethod.ReadFrom(reader);
     }
     if (this.tokenSerializer.CanReadKeyIdentifier(reader))
     {
         this.KeyIdentifier = this.tokenSerializer.ReadKeyIdentifier(reader);
     }
     reader.ReadStartElement(CipherDataElementName, NamespaceUri);
     reader.ReadStartElement(CipherValueElementName, NamespaceUri);
     if (maxBufferSize == 0L)
     {
         this.ReadCipherData(reader);
     }
     else
     {
         this.ReadCipherData(reader, maxBufferSize);
     }
     reader.ReadEndElement();
     reader.ReadEndElement();
     this.ReadAdditionalElements(reader);
     reader.ReadEndElement();
     this.State = EncryptionState.Read;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:35,代码来源:EncryptedType.cs

示例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;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:CloseSequenceResponse.cs

示例3: ReadXml

        public void ReadXml( XmlDictionaryReader reader )
        {
            if ( reader == null )
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "reader" );
            }

            reader.MoveToContent();
            if ( !reader.IsStartElement( XmlEncryptionConstants.Elements.CipherData, XmlEncryptionConstants.Namespace ) )
            {
                throw DiagnosticUtility.ThrowHelperXml( reader, SR.GetString( SR.ID4188 ) );
            }

            reader.ReadStartElement( XmlEncryptionConstants.Elements.CipherData, XmlEncryptionConstants.Namespace );
            reader.ReadStartElement( XmlEncryptionConstants.Elements.CipherValue, XmlEncryptionConstants.Namespace );

            _cipherText = reader.ReadContentAsBase64();
            _iv         = null;

            // <CipherValue>
            reader.MoveToContent();           
            reader.ReadEndElement();

            
            // <CipherData>
            reader.MoveToContent();
            reader.ReadEndElement(); 
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:28,代码来源:CipherDataElement.cs

示例4: DeserializeStruct

        private static object DeserializeStruct(XmlDictionaryReader reader, Type targetType)
        {
            if (targetType.IsDefined(typeof(DataContractAttribute), false))
            {
                Dictionary<string, MemberInfo> dataMembers = GetDataMembers(targetType);
                object targetObject = Activator.CreateInstance(targetType);

                reader.ReadStartElement(XmlRpcProtocol.Struct);
                
                while( reader.NodeType != XmlNodeType.EndElement )
                {
                    string memberName;

                    reader.ReadStartElement(XmlRpcProtocol.Member);
                    reader.ReadStartElement(XmlRpcProtocol.Name);
                    memberName = reader.ReadContentAsString();
                    reader.ReadEndElement();
                    
                    reader.ReadStartElement(XmlRpcProtocol.Value);
                    reader.MoveToContent();
                    if (dataMembers.ContainsKey(memberName))
                    {
                        MemberInfo member = dataMembers[memberName];
                        if (member is PropertyInfo)
                        {
                            ((PropertyInfo)member).SetValue(
                                targetObject, 
                                Deserialize(reader, ((PropertyInfo)member).PropertyType), 
                                BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.Public | BindingFlags.NonPublic, 
                                null, null,
                                CultureInfo.CurrentCulture);
                        }
                        else if (member is FieldInfo)
                        {
                            ((FieldInfo)member).SetValue(
                                targetObject,
                                Deserialize(reader, ((FieldInfo)member).FieldType),
                                BindingFlags.Instance|BindingFlags.SetField|BindingFlags.Public|BindingFlags.NonPublic,
                                null,
                                CultureInfo.CurrentCulture);
                        }
                    }
                    reader.ReadEndElement(); // value
                    reader.ReadEndElement(); // member
                }
                reader.ReadEndElement(); // struct
                reader.MoveToContent();
                return targetObject;                
            }
            else
            {
                throw new InvalidOperationException();
            }
            
        }
开发者ID:ehabqadah,项目名称:Distributed-Nodes-Network-Management,代码行数:55,代码来源:XmlRpcDataContractSerializer.cs

示例5: 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();
		}
开发者ID:nickchal,项目名称:pash,代码行数:13,代码来源:ADCreateResponseMsg.cs

示例6: 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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:CloseSequenceResponse.cs

示例7: OnReadBodyContents

		protected override void OnReadBodyContents(XmlDictionaryReader reader)
		{
			reader.ReadStartElement("BaseObjectSearchResponse", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess");
			ResultSerializer.Deserialize(reader, ResultSerializer.ResultDialect.XPath1, out this._entry);
			DirectoryControlSerializer.Deserialize(reader, out this._controls, false, false);
			reader.ReadEndElement();
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ADGetResponseMsg.cs

示例8: X509CertificateEndpointIdentity

        internal X509CertificateEndpointIdentity(XmlDictionaryReader reader)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");

            reader.MoveToContent();
            if (reader.IsEmptyElement)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.Format(SR.UnexpectedEmptyElementExpectingClaim, XD.AddressingDictionary.X509v3Certificate.Value, XD.AddressingDictionary.IdentityExtensionNamespace.Value)));

            reader.ReadStartElement(XD.XmlSignatureDictionary.X509Data, XD.XmlSignatureDictionary.Namespace);
            while (reader.IsStartElement(XD.XmlSignatureDictionary.X509Certificate, XD.XmlSignatureDictionary.Namespace))
            {
                reader.MoveToContent();
                X509Certificate2 certificate = new X509Certificate2(Convert.FromBase64String(reader.ReadContentAsString()));
                if (certificateCollection.Count == 0)
                {
                    // This is the first certificate. We assume this as the primary 
                    // certificate and initialize the base class.
                    Initialize(new Claim(ClaimTypes.Thumbprint, certificate.GetCertHash(), Rights.PossessProperty));
                }

                certificateCollection.Add(certificate);
            }

            reader.ReadEndElement();

            if (certificateCollection.Count == 0)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.Format(SR.UnexpectedEmptyElementExpectingClaim, XD.AddressingDictionary.X509v3Certificate.Value, XD.AddressingDictionary.IdentityExtensionNamespace.Value)));
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:29,代码来源:X509CertificateEndpointIdentity.cs

示例9: ReadObject

 public override object ReadObject(XmlDictionaryReader reader, bool verifyObjectName)
 {
     reader.ReadStartElement("Data");
     var data = reader.ReadContentAsBase64();
     reader.ReadEndElement();
     return DecodeObject(data);
 }
开发者ID:cg123,项目名称:xenko,代码行数:7,代码来源:XenkoXmlObjectSerializer.cs

示例10: BinaryBodyReader

 public BinaryBodyReader(XmlDictionaryReader reader)
 {
     reader.ReadStartElement(BinaryElementName);
     _data = reader.ReadContentAsBase64();
     if (reader.NodeType == XmlNodeType.Text) reader.Read();
     reader.ReadEndElement();
 }
开发者ID:huoxudong125,项目名称:WcfRestContrib,代码行数:7,代码来源:BinaryBodyReader.cs

示例11: ReadFrom

 public static IdentifierHeader ReadFrom(XmlDictionaryReader reader)
 {
    reader.ReadStartElement(ElementName, EventingActions.Namespace);
    string result = reader.Value;
    reader.Read();
    reader.ReadEndElement();
    return new IdentifierHeader(result);
 }
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:IdentifierHeader.cs

示例12: 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);
            }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:46,代码来源:XmlEncApr2001.cs

示例13: ReadFrom

 public static TotalItemsCountEstimate ReadFrom(XmlDictionaryReader reader)
 {
    reader.ReadStartElement(ElementName, ManagementNamespaces.Namespace);
    int value = XmlConvert.ToInt32(reader.ReadString());
    TotalItemsCountEstimate result = new TotalItemsCountEstimate(value);
    reader.ReadEndElement();
    return result;
 }
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:TotalItemsCountEstimate.cs

示例14: ReadFrom

      public static ResourceUriHeader ReadFrom(XmlDictionaryReader reader)
      {
		 reader.ReadStartElement(ElementName, ManagementNamespaces.Namespace);
         string result = reader.Value;
         reader.Read();
         reader.ReadEndElement();
         return new ResourceUriHeader(result);
      }
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:ResourceUriHeader.cs

示例15: ReadHeaderValue

 static PollingDuplexSession ReadHeaderValue(XmlDictionaryReader reader)
 {
     string str = null;
     string str2 = null;
     if (reader.IsStartElement("Duplex", "http://schemas.microsoft.com/2008/04/netduplex"))
     {
         reader.ReadStartElement();
         reader.MoveToContent();
         while (reader.IsStartElement())
         {
             if (reader.IsStartElement("SessionId", "http://schemas.microsoft.com/2008/04/netduplex"))
             {
                 if (!string.IsNullOrEmpty(str2))
                 {
                     throw new InvalidOperationException("Multiple sessionId elements in a duplex header.");
                 }
                 str2 = reader.ReadElementContentAsString();
                 if (string.IsNullOrEmpty(str2))
                 {
                     throw new InvalidOperationException("Invalid sessionId element content in a duplex header.");
                 }
             }
             else
             {
                 if (reader.IsStartElement("Address", "http://schemas.microsoft.com/2008/04/netduplex"))
                 {
                     if (!string.IsNullOrEmpty(str))
                     {
                         throw new InvalidOperationException("Multiple address elements in a duplex header.");
                     }
                     str = reader.ReadElementContentAsString();
                     if (string.IsNullOrEmpty(str))
                     {
                         throw new InvalidOperationException("Invalid address element in a duplex header.");
                     }
                     continue;
                 }
                 if (reader.IsStartElement("CloseSession", "http://schemas.microsoft.com/2008/04/netduplex"))
                 {
                     reader.Skip();
                     continue;
                 }
                 reader.Skip();
             }
         }
         reader.ReadEndElement();
     }
     if (str == null)
     {
         throw new InvalidOperationException("Missing address in a duplex header.");
     }
     if (str2 == null)
     {
         throw new InvalidOperationException("Missing sessionId in a duplex header.");
     }
     return new PollingDuplexSession(str, str2);
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:57,代码来源:DuplexHeader.cs


注:本文中的System.Xml.XmlDictionaryReader.ReadStartElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。