Stetic.CommandDescriptor.FindBoolProperty C# (CSharp) Method

FindBoolProperty() private method

private FindBoolProperty ( object obj, object &target ) : PropertyInfo
obj object
target object
return System.Reflection.PropertyInfo
        PropertyInfo FindBoolProperty(object obj, out object target)
        {
            PropertyInfo prop = obj.GetType().GetProperty (name, flags);
            if (prop != null && prop.PropertyType == typeof(bool)) {
                target = obj;
                return prop;
            }

            ObjectWrapper wrap = ObjectWrapper.Lookup (obj);
            if (wrap != null) {
                prop = wrap.GetType().GetProperty (name, flags);
                if (prop != null && prop.PropertyType == typeof(bool)) {
                    target = wrap;
                    return prop;
                }
            }
            target = null;
            return null;
        }