internal static CLRPropertyListener CreateListener(IRaisePropertyPathStepChanged pathStep, string name, object source, bool listenToChanges) { PropertyInfo property = CLRPropertyListener.GetProperty(source.GetType(), name); if (property == null) { return(null); } return(new CLRPropertyListener(pathStep, source.GetType(), property, listenToChanges)); }
private static PropertyInfo GetProperty(Type type, string propertyName) { PropertyInfo property; try { property = type.GetProperty(propertyName); } catch (AmbiguousMatchException) { property = CLRPropertyListener.GetShadowedProperty(type, propertyName); } return(property); }