public SwitchMatchFields(Delegate[] funcs, TypeOfFIelds typeOfFields) { this.typeOfFields = typeOfFields; this.matches = funcs.Select(f => Tuple.Create(f.Method.GetParameters().Select(p => p.ParameterType).ToArray(), f)).ToArray(); }
internal static FieldOrPropertyOrGetMethod[] GetFieldsOrPropertiesOrGetMethods(this Type t, TypeOfFIelds typeOfFIelds) { return(fieldOrPropertyOrMethods.WeakMemoize(t, type => new FieldOrPropertyOrGetMethod[0] .Concat(typeOfFIelds.HasFlag(TypeOfFIelds.Fields) ? GetPublicFields(type).Select(p => new FieldOrPropertyOrGetMethod(p)) : new FieldOrPropertyOrGetMethod[0]) .Concat(typeOfFIelds.HasFlag(TypeOfFIelds.Properties) ? GetPublicProperties(type).Select(p => new FieldOrPropertyOrGetMethod(p)) : new FieldOrPropertyOrGetMethod[0]) .Concat(typeOfFIelds.HasFlag(TypeOfFIelds.Methods) ? GetPublicGetMethods(type).Select(p => new FieldOrPropertyOrGetMethod(p)) : new FieldOrPropertyOrGetMethod[0]) .ToArray() )); }
public Fields(Type type, TypeOfFIelds typeOfFIelds) { fields = type.GetFieldsOrPropertiesOrGetMethods(typeOfFIelds).ToArray(); }
public Fields(Type type, TypeOfFIelds typeOfFIelds) { fields = type.GetFieldsOrPropertiesOrGetMethods(typeOfFIelds).ToArray(); }