Esempio n. 1
0
 private void BuildNodeSource(FXmlNode config, string path)
 {
     if (config.HasNode)
     {
         // Build private
         foreach (FXmlNode node in config.Nodes)
         {
             string clsName = MakeClassName(path + config["name"] + node["name"]);
             string varname = "_" + RString.FirstLower(node["name"]);
             _source.Append("      private ");
             if (node.IsName("Folder"))
             {
                 _source.Append(clsName + " " + varname + " = new ");
                 _source.AppendLine(clsName + "();");
             }
             else if (node.IsName("Property"))
             {
                 _source.AppendLine("FStringValue " + varname + " = new FStringValue();");
             }
         }
         // Build property
         foreach (FXmlNode node in config.Nodes)
         {
             string clsName = MakeClassName(path + config["name"] + node["name"]);
             string varname = "_" + RString.FirstLower(node["name"]);
             string ptyname = RString.FirstUpper(node["name"]);
             _source.Append("      public ");
             if (node.IsName("Folder"))
             {
                 string scName = path + node["name"];
                 _source.Append(clsName + " " + ptyname + " {");
                 _source.AppendLine(" get { return " + varname + "; } }");
             }
             else if (node.IsName("Property"))
             {
                 _source.Append("FStringValue " + ptyname + " {");
                 _source.AppendLine(" get { return " + varname + "; } }");
             }
         }
     }
 }