private static TypeAndMethod GetTextPropertySetterInParent(Type type) { var current = type.BaseType; while (current != null) { if (_textSetters.TryGetValue(type, out var typeAndMethod)) { return(typeAndMethod); } else { var property = current.GetProperty(TextPropertyName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { var tam = new TypeAndMethod(current, property.GetSetMethod()); _textSetters[current] = tam; return(tam); } current = current.BaseType; } } return(null); }
public bool IsTypeAndMethod(TypeAndMethod typeAndMethod) { return(typeAndMethod.Method == Method && typeAndMethod.Type == Type); }
public Result(ParseOutcome outcome, TypeAndMethod value) { Outcome = outcome; Value = value; }