Ejemplo n.º 1
0
    public static string GetConfig(PROGRAM program, string key, ConfigFile file)
    {
        Config config = GetConfig(file);

        return(config.Get(program == PROGRAM.NONE ? "" : program.ToString(), key));
    }
Ejemplo n.º 2
0
 public bool IsCreate(PROGRAM program)
 {
     return(Info[program].Create);
 }
Ejemplo n.º 3
0
 public LaunchSessionEventArgs(Session session, PROGRAM program)
 {
     this.session = session;
     this.program = program;
 }
 public LaunchSessionEventArgs(Session session, PROGRAM program )
 {
     this.session = session;
     this.program = program;
 }
Ejemplo n.º 5
0
 public IGenerate(PROGRAM code)
 {
     m_Code = code;
 }
Ejemplo n.º 6
0
    public string GetCode(PROGRAM program)
    {
        int index = (int)program;

        return(Codes.Count > index ? Codes[index] : "");
    }
Ejemplo n.º 7
0
 public Primitive GetValue() => PROGRAM.GetVariable(variableName).GetValue();
Ejemplo n.º 8
0
 public Primitive GetValue()
 {
     return(PROGRAM.PerformOperation(operand, a.GetValue()));
 }
Ejemplo n.º 9
0
 public Primitive Not()
 {
     return(PROGRAM.PerformOperation(UniOperand.NOT, this));
 }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Logger.SetLogger(new LibLogger());
            try {
                int    length = args.Length;
                string key    = "";
                for (var i = 0; i < length; ++i)
                {
                    var arg = args[i];
                    if (string.IsNullOrEmpty(key))
                    {
                        if (!arg.StartsWith("-"))
                        {
                            throw new Exception("参数值只能是单个参数");
                        }
                        key = arg;
                    }
                    else
                    {
                        Args[key] = arg;
                        key       = "";
                    }
                }
                if (!Args.ContainsKey("-t") || !Args.ContainsKey("-file") || !Args.ContainsKey("-package"))
                {
                    throw new Exception("[-t -file -package] 三个参数是必填项");
                }
                int    t       = int.Parse(Args["-t"]);
                string fileArg = Args["-file"];
                if (t == 0 || t == 1)
                {
                    var files = t == 1 ? string.Join(";", Directory.GetFiles(fileArg, "*.xls", SearchOption.AllDirectories)) : fileArg;
                    new TableBuilder().Transform(files, Get("-config"), Args["-package"], Get("-spawn"), Util.ToBoolean(Get("-manager"), false), false, GetProgramConfig());
                }
                Console.WriteLine("执行成功");
                Console.ReadKey();
                return;
            } catch (System.Exception ex) {
                Console.WriteLine("Exec is error : " + ex.ToString());
            }
            string hint = @"
-t              (必填)类型 0转换单个表 1转换文件夹
-file           (必填)根据类型填不同数据
-config         table表配置 自定义结构
-package        (必填)生成的包名
-spawn          关键字列表 多关键字用;隔开
-manager        是否生成tablemanager 默认为false
";

            for (int i = (int)PROGRAM.NONE + 1; i < (int)PROGRAM.COUNT; ++i)
            {
                PROGRAM program = (PROGRAM)i;
                string  str     = @"-__programcode       __program 代码生成路径
-__programdata      __program Data生成路径
-__programcom       __program Data是否压缩
";
                hint += str.Replace("__program", program.ToString().ToLower());
            }
            hint += @"
    注:code和Data路径如果是多路径,请使用【;】隔开";
            Console.WriteLine(hint);
            Console.ReadKey();
        }
Ejemplo n.º 11
0
 public int Compare(Primitive p)
 {
     return(Convert.ToInt32(CastNumber(PROGRAM.PerformOperation(BiOperand.COMPARE, this, p)).GetTypedValue()));
 }
Ejemplo n.º 12
0
 public Primitive Divide(Primitive p)
 {
     return(PROGRAM.PerformOperation(BiOperand.DIVIDE, this, p));
 }
Ejemplo n.º 13
0
 public Primitive Multiply(Primitive p)
 {
     return(PROGRAM.PerformOperation(BiOperand.MULTIPLY, this, p));
 }
Ejemplo n.º 14
0
 public Primitive Minus(Primitive p)
 {
     return(PROGRAM.PerformOperation(BiOperand.SUBTACT, this, p));
 }
Ejemplo n.º 15
0
 public Primitive Plus(Primitive p)
 {
     return(PROGRAM.PerformOperation(BiOperand.ADD, this, p));
 }