Microsoft.Xades.OtherValue.LoadXml C# (CSharp) Method

LoadXml() public method

Load state from an XML element
public LoadXml ( System xmlElement ) : void
xmlElement System XML element containing new state
return void
		public void LoadXml(System.Xml.XmlElement xmlElement)
		{
			this.anyXmlElement = xmlElement;
		}

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Load state from an XML element
        /// </summary>
        /// <param name="xmlElement">XML element containing new state</param>
        public void LoadXml(System.Xml.XmlElement xmlElement)
        {
            XmlNamespaceManager xmlNamespaceManager;
            XmlNodeList         xmlNodeList;
            OtherValue          newOtherValue;
            IEnumerator         enumerator;
            XmlElement          iterationXmlElement;

            if (xmlElement == null)
            {
                throw new ArgumentNullException("xmlElement");
            }

            xmlNamespaceManager = new XmlNamespaceManager(xmlElement.OwnerDocument.NameTable);
            xmlNamespaceManager.AddNamespace("xsd", XadesSignedXml.XadesNamespaceUri);

            this.otherValueCollection.Clear();
            xmlNodeList = xmlElement.SelectNodes("xsd:OtherValue", xmlNamespaceManager);
            enumerator  = xmlNodeList.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    iterationXmlElement = enumerator.Current as XmlElement;
                    if (iterationXmlElement != null)
                    {
                        newOtherValue = new OtherValue();
                        newOtherValue.LoadXml(iterationXmlElement);
                        this.otherValueCollection.Add(newOtherValue);
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
All Usage Examples Of Microsoft.Xades.OtherValue::LoadXml