public static Type MembType_Exact(Type T, string arg, MembK kind_filter) { var MembSugg = GetMembSG(T); var res = MembSugg.FindSingle(arg, exact_query: true); if (res.type != SuggestionTree <MemberInfo> .FRType.unique_fit) { throw new TypingException(); } MemberInfo mi = res.suggs[0].val.payload; MembK kind = new MembK(mi); if (!kind_filter.match_filter(kind)) { throw new TypingException(); } if (mi is FieldInfo) { return((mi as FieldInfo).FieldType); } if (mi is PropertyInfo) { return((mi as PropertyInfo).PropertyType); } throw new ArgumentException(); }
public static MemberInfo[] MembAC(Type T, string arg, MembK filter) { var SG = GetMembSG(T); var res = SG.FindSingle(arg, exact_query: false); MemberInfo[] R = res.suggs.Select(sugg => sugg.val.payload).Where((MemberInfo mi) => filter.match_filter(new MembK(mi))).ToArray(); return(R); }
public bool match_filter(MembK filter) => (E & filter.E) != 0;
public static Type MembType_Exact(Type T, string arg) { return(MembType_Exact(T, arg, MembK.Any())); }
public static MemberInfo[] MembAC(Type T, string arg) { return(MembAC(T, arg, MembK.Any())); }