コード例 #1
0
        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));
        }
コード例 #2
0
        private static PropertyInfo GetProperty(Type type, string propertyName)
        {
            PropertyInfo property;

            try
            {
                property = type.GetProperty(propertyName);
            }
            catch (AmbiguousMatchException)
            {
                property = CLRPropertyListener.GetShadowedProperty(type, propertyName);
            }
            return(property);
        }