Esempio n. 1
0
        public static string ToTextCode(this IToTextCodeAble target, IdToNameMap nameMap, int indent = 0)
        {
            var builder = new StringBuilder();

            target.ToTextCode(nameMap, builder, indent);
            return(builder.ToString());
        }
Esempio n. 2
0
        public override void ToTextCode(IdToNameMap nameMap, StringBuilder result, int indent = 0)
        {
            string strForUBound;

            if (UBound.Length == 0)
            {
                strForUBound = "";
            }
            else if (UBound.Length == 1 && UBound[0] == 0)
            {
                strForUBound = "\"0\"";
            }
            else
            {
                strForUBound = "\"" + string.Join(",", UBound.Select(x => x == 0 ? "" : x.ToString())) + "\"";
            }
            TextCodeUtils.WriteDefinedCode(result, indent, "程序集变量", nameMap.GetUserDefinedName(Id), nameMap.GetDataTypeName(DataType), "", strForUBound, Comment);
        }
Esempio n. 3
0
 public void ToTextCode(IdToNameMap nameMap, StringBuilder result, int indent, bool writeMethod, bool writeCode = true)
 {
     if (GlobalVariables != null && GlobalVariables.Length != 0)
     {
         TextCodeUtils.WriteJoinCode(GlobalVariables, Environment.NewLine, nameMap, result, indent);
         result.AppendLine();
     }
     TextCodeUtils.WriteJoinCode(Classes, Environment.NewLine, writeMethod ? this : null, nameMap, result, indent, writeCode);
     if (DllDeclares != null && DllDeclares.Length != 0)
     {
         result.AppendLine();
         TextCodeUtils.WriteJoinCode(DllDeclares, Environment.NewLine, nameMap, result, indent);
     }
     if (Structs != null && Structs.Length != 0)
     {
         result.AppendLine();
         TextCodeUtils.WriteJoinCode(Structs, Environment.NewLine, nameMap, result, indent);
     }
 }
Esempio n. 4
0
 public void ToTextCode(IdToNameMap nameMap, StringBuilder result, int indent = 0)
 {
     ToTextCode(nameMap, result, indent, true);
 }
 public abstract void ToTextCode(IdToNameMap nameMap, StringBuilder result, int indent = 0);
Esempio n. 6
0
 public static void WriteJoinCode(IEnumerable <MethodInfo> items, string separator, IdToNameMap nameMap, StringBuilder builder, int indent, bool writeCode)
 {
     WriteJoinCode(items, separator, builder, x => x.ToTextCode(nameMap, builder, indent, writeCode));
 }
Esempio n. 7
0
 public static void WriteJoinCode(IEnumerable <ClassInfo> items, string separator, CodeSectionInfo codeSection, IdToNameMap nameMap, StringBuilder builder, int indent, bool writeCode = true)
 {
     WriteJoinCode(items, separator, builder, x => x.ToTextCode(nameMap, builder, indent, codeSection, writeCode));
 }
Esempio n. 8
0
 public static void WriteJoinCode(IEnumerable <IToTextCodeAble> items, string separator, IdToNameMap nameMap, StringBuilder builder, int indent)
 {
     WriteJoinCode(items, separator, builder, x => x.ToTextCode(nameMap, builder, indent));
 }
Esempio n. 9
0
 public void ToTextCode(IdToNameMap nameMap, StringBuilder result, int indent = 0)
 {
     TextCodeUtils.WriteJoinCode(Constants, Environment.NewLine, nameMap, result, indent);
 }