System.ComponentModel.CustomTypeDescriptor.GetPropertyOwner C# (CSharp) Method

GetPropertyOwner() public method

public GetPropertyOwner ( PropertyDescriptor pd ) : object
pd PropertyDescriptor
return object
        public virtual object GetPropertyOwner(PropertyDescriptor pd)
        {
            if (_parent != null)
            {
                return _parent.GetPropertyOwner(pd);
            }

            return null;
        }
    }

Usage Example

 public void GetPropertyOwnerShouldReturnExpectedValue()
 {
     var parent = TypeDescriptor.GetProvider( typeof( string ) ).GetTypeDescriptor( typeof( string ) );
     var target = new CustomTypeDescriptor<string>( parent );
     var property = target.GetProperties().Cast<PropertyDescriptor>().First();
     var owner = target.GetPropertyOwner( property );
     Assert.Equal( target, owner );
 }
All Usage Examples Of System.ComponentModel.CustomTypeDescriptor::GetPropertyOwner