public PTProperty(PTAccessLimit accessLimit, PTCompileType compileType, PTTypeDefine type, string name, string getReturnCode, string comment = null)
 {
     AccessLimit   = accessLimit;
     Type          = PTTypeUtil.GetCodeType(type);
     CompileType   = compileType;
     Name          = name;
     GetReturnCode = getReturnCode;
     Comment       = comment;
 }
 public PTVariable(PTAccessLimit accessLimit, PTCompileType compileType, PTTypeDefine type, string name, string value, string comment = null)
 {
     AccessLimit = accessLimit;
     CompileType = compileType;
     Name        = name;
     Value       = value;
     Type        = PTTypeUtil.GetCodeType(type);
     CompileType = compileType;
     Comment     = comment;
 }
        public static CodeTypeReference GetCodeType(PTTypeDefine type)
        {
            CodeTypeReference retType = null;

            switch (type)
            {
            case PTTypeDefine.Char:
                retType = new CodeTypeReference(typeof(System.Char));
                break;

            case PTTypeDefine.Double:
                retType = new CodeTypeReference(typeof(System.Double));
                break;

            case PTTypeDefine.Float:
                retType = new CodeTypeReference(typeof(System.Decimal));
                break;

            case PTTypeDefine.Int:
                retType = new CodeTypeReference(typeof(System.Int32));
                break;

            case PTTypeDefine.UInt:
                retType = new CodeTypeReference(typeof(System.UInt32));
                break;

            case PTTypeDefine.Short:
                retType = new CodeTypeReference(typeof(System.Int16));
                break;

            case PTTypeDefine.UShort:
                retType = new CodeTypeReference(typeof(System.UInt16));
                break;

            case PTTypeDefine.String:
                retType = new CodeTypeReference(typeof(System.String));
                break;
            }
            return(retType);
        }