Example #1
0
        /// <summary>
        /// Format array into XML element
        /// </summary>
        /// <returns></returns>
        public override string toXmlString()
        {
            string s       = "<" + getTypeName();
            string VarName = getVarName();

            if (VarName != null && VarName.Length > 0)
            {
                s += " varName=\"" + VarName + "\"";
            }
            if (hasByteOrder())
            {
                s += " byteOrder=\"" + getByteOrder() + "\"";
            }
            if (hasBlockSize())
            {
                s += " blockSize=\"" + Convert.ToString(getBlockSize()) + "\"";
            }
            s += ">";
            if (sizeRef_ != null && isArrayVariable())
            {
                s += "<sizeRef>" + sizeRef_.toXmlString() + "</sizeRef>";
            }
            s += element_.toXmlString();
            s += dim_.toXmlString();
            s += "</" + getTypeName() + ">";
            return(s);
        }
Example #2
0
        /// <summary>
        /// Format a stack of dim elements in a hierarchy
        /// </summary>
        /// <returns></returns>
        public override string toXmlString()
        {
            string s = "<dim";

            if (name_ != null && name_.Length > 0)
            {
                s += " name=\"" + name_ + "\"";
            }
            if (count_ > 0)
            {
                s += " indexTo=\"" + Convert.ToString(count_ - 1) + "\"";
            }
            s += ">";
            if (child_ != null)
            {
                Console.WriteLine("DimNode.toXmlString {0}", s);
                s += child_.toXmlString();
            }
            s += "</dim>";
            return(s);
        }