예제 #1
0
        public override string GenerateCode()
        {
            var s = Name.ToLowerInvariant();

            s = "Cmd" + GenerateCodeHelper.ConvertDashesToCamelCase(s);
            return($"public bool {s} {{ get {{ return _args[\"{Name}\"].IsTrue; }} }}");
        }
예제 #2
0
        public override string GenerateCode()
        {
            var s = Name.ToLowerInvariant();

            s = "Cmd" + GenerateCodeHelper.ConvertDashesToCamelCase(s);
            return(string.Format("public bool {0} {{ get {{ return _args[\"{1}\"].IsTrue; }} }}", s, Name));
        }
예제 #3
0
        public override string GenerateCode()
        {
            var s = Name.Replace("<", "").Replace(">", " ").ToLowerInvariant();

            s = "Arg" + GenerateCodeHelper.ConvertDashesToCamelCase(s);

            if (Value != null && Value.IsList)
            {
                return(string.Format("public ArrayList {0} {{ get {{ return _args[\"{1}\"].AsList; }} }}", s, Name));
            }
            return(string.Format("public string {0} {{ get {{ return null == _args[\"{1}\"] ? null : _args[\"{1}\"].ToString(); }} }}", s, Name));
        }
예제 #4
0
        public override string GenerateCode()
        {
            var s = Name.ToLowerInvariant();

            s = "Opt" + GenerateCodeHelper.ConvertToPascalCase(s);

            if (ArgCount == 0)
            {
                return($"public bool {s} {{ get {{ return _args[\"{Name}\"].IsTrue; }} }}");
            }
            var defaultValue = Value == null ? "null" : $"\"{Value}\"";

            return(string.Format("public string {0} {{ get {{ return null == _args[\"{1}\"] ? {2} : _args[\"{1}\"].ToString(); }} }}", s, Name, defaultValue));
        }