This class contains properties that qualify some of the signed data objects. The signature generated by the signer does not cover the content of this element. This information is added for the shake of completeness and to cope with potential future needs for inclusion of such kind of properties.
Exemplo 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;
            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();
                }
            }
        }
		/// <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();
				}
			}
		}
		/// <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;
		}
        /// <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);
        }