Exemple #1
0
        /// <summary>
        /// Generates an XmlElement describint this element
        /// </summary>
        /// <param name="doc">The document in which to create the element</param>
        /// <returns></returns>
        public virtual XmlElement CreateXML(XmlDocument doc)
        {
            XmlElement eltMissing = doc.CreateElement(Type);

            eltMissing.SetAttribute("name", Name);
            //Status.status.SetAttributes (eltMissing);
            Status.SetAttributes(eltMissing);

            XmlElement eltAttributes = MissingBase.CreateMemberCollectionElement("attributes", rgAttributes, nsAttributes, doc);

            if (eltAttributes != null)
            {
                eltMissing.AppendChild(eltAttributes);
            }

            return(eltMissing);
        }
Exemple #2
0
        public void SetAttributes(XmlElement elt)
        {
            status.SetAttributes(elt);
            statusCountsChildren.SetAttributes(elt, "");
            statusCountsTotal.SetAttributes(elt, "_total");

            // add any warning messages
            if (lstWarnings != null)
            {
                XmlElement eltWarnings = elt.OwnerDocument.CreateElement("warnings");
                elt.AppendChild(eltWarnings);
                foreach (NodeMessage msg in lstWarnings)
                {
                    XmlElement eltWarning = elt.OwnerDocument.CreateElement("warning");
                    eltWarnings.AppendChild(eltWarning);
                    eltWarning.SetAttribute("text", msg.Message);
                }
            }

            //int percentComplete = (cTotal == 0) ? 100 : (100 - 100 * (cMissing + cExtra) / cTotal);
            //elt.SetAttribute ("complete", percentComplete.ToString ());
        }