Ejemplo n.º 1
0
        //==============================================================================
        /// <summary>
        /// Convert an init script into the relevant properties.
        /// </summary>
        /// <param name="sScriptName">Name of the script.</param>
        /// <param name="sScriptText">XML text of the init script
        /// &lt;initsection&gt;
        ///      &lt;init..... /&gt;
        ///   &lt;/initsection&gt;
        ///</param>
        // N.Herrmann Feb 2007
        //==============================================================================
        public void textToInitScript(string sScriptName, string sScriptText)
        {
            uint       initCount;
            string     buf;
            uint       i;
            TDDMLValue ddmlVal;
            TSDMLValue sdmlVal;

            Byte []     data;
            TInitParser initSection;

            int index = getScriptIndex(sScriptName);

            if (index < 0)
            {
                createInitScript(sScriptName);
            }

            scriptList[index].scriptText = sScriptText;          //set the text string for the script
            scriptList[index].propertyList.Clear();              //remove all the properties
            //now get all the sdml properties from the initsection
            initSection = new TInitParser(sScriptText);          //parse the <initsection>
            ddmlVal     = new TDDMLValue("<empty/>", "defined"); //used for getting the ddml type
            initCount   = initSection.initCount();
            for (i = 1; i <= initCount; i++)
            {                                                       //for each init value
                buf     = initSection.initText(i);                  //the sdml xml
                sdmlVal = new TSDMLValue(buf, "");                  //new sdml type
                data    = new Byte[sdmlVal.sizeBytes()];
                sdmlVal.getData(ref data);                          //get the datablock
                //add this property to the script. (a little inneficient here)
                valueToInitScript(sScriptName, sdmlVal.Name, ddmlVal.getText(sdmlVal, 0, 2), data);
            }
        }
Ejemplo n.º 2
0
 //=======================================================================
 /// <summary>
 /// Reads the init section and parses the XML. Uses the &lt;initsection&gt; block
 /// retrieved in the initData() function.
 /// </summary>
 //=======================================================================
 private void readInitSection()
 {
     if (initsParser == null)
     {
         string initSDML = initData();
         if (initSDML.Length > 0)
         {
             initsParser = new TInitParser(initSDML);
         }
     }
 }
Ejemplo n.º 3
0
 //=======================================================================
 /// <summary>
 /// Create a component parser from a DOM node in an existing DOM document.
 /// </summary>
 /// <param name="domNode">DOM node to use.</param>
 //=======================================================================
 public TCompParser(XmlNode domNode)
     : base(domNode)
 {
     initsParser = null;
     getDescription();
 }
Ejemplo n.º 4
0
 //=======================================================================
 /// <summary>
 /// Create a component parser from an XML string.
 /// </summary>
 /// <param name="sXml">Component as described in an SDML document.</param>
 //=======================================================================
 public TCompParser(String sXml)
     : base(sXml)
 {
     initsParser = null;
     getDescription();
 }
Ejemplo n.º 5
0
 //=======================================================================
 /// <summary>
 /// Create a component parser from a DOM node in an existing DOM document.
 /// </summary>
 /// <param name="domNode">DOM node to use.</param>
 //=======================================================================
 public TCompParser(XmlNode domNode)
     : base(domNode)
 {
     initsParser = null;
     getDescription();
 }
Ejemplo n.º 6
0
 //=======================================================================
 /// <summary>
 /// Create a component parser from an XML string.
 /// </summary>
 /// <param name="sXml">Component as described in an SDML document.</param>
 //=======================================================================
 public TCompParser(String sXml)
     : base(sXml)
 {
     initsParser = null;
     getDescription();
 }
Ejemplo n.º 7
0
 //=======================================================================
 /// <summary>
 /// Reads the init section and parses the XML. Uses the &lt;initsection&gt; block 
 /// retrieved in the initData() function.
 /// </summary>
 //=======================================================================
 private void readInitSection()
 {
     if (initsParser == null)
     {
         string initSDML = initData();
         if (initSDML.Length > 0)
         {
             initsParser = new TInitParser(initSDML);
         }
     }
 }