/// <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;
            UnsignedDataObjectProperty newUnsignedDataObjectProperty;
            IEnumerator                enumerator;
            XmlElement iterationXmlElement;

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

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

            this.unsignedDataObjectPropertyCollection.Clear();
            xmlNodeList = xmlElement.SelectNodes("xsd:UnsignedDataObjectProperty", xmlNamespaceManager);
            enumerator  = xmlNodeList.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    iterationXmlElement = enumerator.Current as XmlElement;
                    if (iterationXmlElement != null)
                    {
                        newUnsignedDataObjectProperty = new UnsignedDataObjectProperty();
                        newUnsignedDataObjectProperty.LoadXml(iterationXmlElement);
                        this.unsignedDataObjectPropertyCollection.Add(newUnsignedDataObjectProperty);
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Add typed object to the collection
        /// </summary>
        /// <param name="objectToAdd">Typed object to be added to collection</param>
        /// <returns>The object that has been added to collection</returns>
        public UnsignedDataObjectProperty Add(UnsignedDataObjectProperty objectToAdd)
        {
            base.Add(objectToAdd);

            return(objectToAdd);
        }