|
Hi guys I have a big problem with the TypeDescriptionProvider? Actully I do not know exactly for what we need this?
I have task add the implementation of the TypeDescriptionProvider to the specific class NotificationExtension and do this like this
Apply [TypeDescriptionProvider(typeof(ZControlTypeDescriptionProvider))] attribute to control’s class Implement method which returns metadata using the following template:
#region Metadata
public static PropertyDescriptor[] GetPropertyDescriptors() { return new GenericPropertyDescriptorBuilder<ControlType>() .Property("PropertyName", "DefaultValue", registerEvent, “EventName� .Result; }
#endregion
I did this as follows public static PropertyDescriptor[] GetPropertyDescriptors() { return new GenericPropertyDescriptorBuilder<NotificationExtension>() .Property<INotificationPresenter>("Presenter", null, false) .Property("Notifications", ZNotifications.Empty, false) .Property("Notifications1", ZNotifications.Empty, false) .Property("Notifications2", ZNotifications.Empty, false) .Result; }
where add to the GetPropertyDescriptors() method all the public properrties that available in that class
and of course (as I do not know what I did) I have an exception as follows
Exception Type: System.NullReferenceException Message: Objectreferencenotsettoaninstanceofanobject. Source: System.Windows.Forms Error binding Control : TextBox, BindTo = Z0_Description StackTrace: at System.Windows.Forms.Binding.CheckBinding()
Please help me! Will be glad with any ideas!
Thanks
|