示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="subSet"></param>
        /// <param name="Strings"></param>
        /// <param name="sElem"></param>
        /// <param name="iIndent"></param>
        private void writeParamSet(TParameterSet subSet,
                                   List<string> Strings,
                                   string sElem,
                                   int iIndent)
        {
            string sLine;
            int Idx;

            if (!subSet.bRootNode())
                Strings.Add("");

            sLine = new string(' ', iIndent) + "<" + sElem + " name=\"" + subSet.sEnglishName + "\"";
            if (subSet.bRootNode())
                sLine += " version=\"" + subSet.sVersion + "\">";
            else
            {
                if (subSet.iLocaleCount() > 0)
                {
                    sLine += " locales=\"" + subSet.getLocale(0);
                    for (Idx = 1; Idx <= subSet.iLocaleCount() - 1; Idx++)
                        sLine += ";" + subSet.getLocale(Idx);
                    sLine += "\"";
                }
                sLine += ">";
            }
            Strings.Add(sLine);

            if (subSet.iTranslationCount() > 0)
                for (Idx = 0; Idx <= subSet.iTranslationCount() - 1; Idx++)
                {
                    sLine = new string(' ', iIndent + 2) + "<translate lang=\"" +
                             subSet.getTranslation(Idx).sLang + "\">" +
                             TTypedValue.escapeText(subSet.getTranslation(Idx).sText) + "</translate>";
                    Strings.Add(sLine);
                }

            for (Idx = 0; Idx <= subSet.iDefinitionCount() - 1; Idx++)
                writeParameters(subSet, subSet.getDefinition(Idx), Strings, iIndent + 2);
            for (Idx = 0; Idx <= subSet.iChildCount() - 1; Idx++)
                writeParamSet(subSet.getChild(Idx), Strings, "set", iIndent + 2);

            sLine = new string(' ', iIndent) + "</" + sElem + ">";
            if (!subSet.bRootNode() && (subSet.iChildCount() > 0))
                sLine += "<!-- " + subSet.sEnglishName + " -->";

            Strings.Add(sLine);
        }