コード例 #1
0
 public override bool Compare(ZMethodArg arg)
 {
     if (arg is ZMethodGenericArg)
     {
         return(false);
     }
     else if (arg is ZMethodNormalArg)
     {
         ZMethodNormalArg znarg = (arg as ZMethodNormalArg);
         if (znarg.ArgZType.SharpType == ZLambda.ActionType)
         {
             return(true);
         }
         else if (znarg.ArgZType.SharpType == ZLambda.CondtionType)
         {
             return(ValueZType == ZTypeManager.ZBOOL);
         }
         else
         {
             return(ReflectionUtil.IsExtends(ValueZType.SharpType, znarg.ArgZType.SharpType));
         }
     }
     else
     {
         throw new ZyyRTException();
     }
 }
コード例 #2
0
ファイル: ProcDescHelper.cs プロジェクト: pyzh/ZCompileCore2
        public static ZConstructorDesc CreateZConstructorDesc(ConstructorInfo ci)
        {
            List <ZMethodNormalArg> args = new List <ZMethodNormalArg>();

            foreach (ParameterInfo param in ci.GetParameters())
            {
                ZMethodNormalArg arg = new ZMethodNormalArg(param.Name, ZTypeManager.GetBySharpType(param.ParameterType) as ZType);
                args.Add(arg);
            }
            ZConstructorDesc desc = new ZConstructorDesc(args);

            desc.Constructor = ci;
            return(desc);
        }
コード例 #3
0
ファイル: ZMethodDesc.cs プロジェクト: pyzh/ZCompileCore2
        public string ToMethodName()
        {
            List <string> list = new List <string>();

            for (int i = 0; i < this.Parts.Count; i++)
            {
                object item = this.Parts[i];
                if (item is string)
                {
                    list.Add(item as string);
                }
                else if (item is ZMethodNormalArg)
                {
                    ZMethodNormalArg arg = item as ZMethodNormalArg;
                    list.Add(arg.ArgZType.ZName + arg.ArgName ?? "");
                }
                else
                {
                    throw new ZyyRTException();
                }
            }
            return(string.Join("", list));
        }