Esempio n. 1
0
        //=======================================================================
        /// <summary>
        /// Construct a component event object using XML description.
        /// </summary>
        /// <param name="sXML">XML description that contains the DDML of the type.</param>
        //=======================================================================
        public TCompEvent(String sXML)
        {
            TXMLParser parser;
            XmlNode    anode;
            String     typeText;

            parser     = new TXMLParser(sXML);
            sDescr     = "";
            sFullDescr = "";

            //build a DDML type from the values in the event description
            typeText = "<type>";
            anode    = parser.firstElementChild(parser.rootNode(), "field");
            bIsEmpty = (anode == null);
            while (anode != null)
            {
                typeText = typeText + parser.docToString(anode);
                anode    = parser.nextElementSibling(anode, "field");
            }
            typeText = typeText + "</type>";

            initType = new TDDMLValue(typeText, "");                   //create as a DDML type
            Name     = parser.getAttrValue(parser.rootNode(), "name"); //set this object's attributes
            sKind    = parser.getAttrValue(parser.rootNode(), "kind");
            sDescr   = parser.getAttrValue(parser.rootNode(), "descr");

            if (sKind.Length < 1)
            {
                sKind = "published";      // Default when not specified
            }
            order = 0;                    //init to an invalid value
            anode = parser.firstElementChild(parser.rootNode(), "description");
            if (anode != null)
            {
                sFullDescr = parser.getText(anode);
            }
        }