diff options
author | Matt Ward <matt.ward@microsoft.com> | 2020-01-04 19:56:00 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2020-01-08 19:10:16 +0300 |
commit | b92b1707465c831edc83f1330e0b015dc1e38be9 (patch) | |
tree | 13a08009e0687a2c6c14fda12fd91dee445ca960 | |
parent | d92256794869bc9f14743eae9017977f883cf559 (diff) |
[DesignerSupport] Support CustomTypeDescriptors in new property editor
An object that derives from CustomTypeDescriptor would not show the
custom properties in the new native property editor but would with
the old property editor.
The problem was that the type was being passed to the TypeDescriptor's
GetProperties method instead of the object providing the properties.
Fixes VSTS #1047889 - New Property Editor does not support
CustomTypeDescriptors
-rw-r--r-- | main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs index 5a95a0b4bb..06b595bd09 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs @@ -96,11 +96,8 @@ namespace MonoDevelop.DesignerSupport var collection = new List<DescriptorPropertyInfo> (); foreach (object propertyProvider in providers) { - //get the current properties for this provider - var currentType = propertyProvider.GetType (); - - //we want all property descriptors for this propertyProvider type - var propertyDescriptors = System.ComponentModel.TypeDescriptor.GetProperties (currentType); + //we want all property descriptors for this propertyProvider + var propertyDescriptors = System.ComponentModel.TypeDescriptor.GetProperties (propertyProvider); foreach (System.ComponentModel.PropertyDescriptor propertyDescriptor in propertyDescriptors) { if (propertyDescriptor.IsBrowsable) { |