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(); } }
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); }
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)); }