Click here to Skip to main content
16,008,469 members
Home / Discussions / C#
   

C#

 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 5:44
protectorHeath Stewart27-Jul-04 5:44 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 6:06
BillyBlue27-Jul-04 6:06 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 6:17
protectorHeath Stewart27-Jul-04 6:17 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 6:25
BillyBlue27-Jul-04 6:25 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 9:08
protectorHeath Stewart27-Jul-04 9:08 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 9:43
BillyBlue27-Jul-04 9:43 
QuestionHow to use NotifyParentPropertyAttribute Pin
jjansen25-Jul-04 21:19
jjansen25-Jul-04 21:19 
AnswerRe: How to use NotifyParentPropertyAttribute Pin
Heath Stewart26-Jul-04 10:13
protectorHeath Stewart26-Jul-04 10:13 
There's a couple more robust ways of doing this: implement ICustomTypeConverter on the "design-time unfriendly" object, or implement a designer. Both allow you to return a PropertyDescriptorCollection that contains PropertyDescriptors. A designer can also allow you to pre- and post-filter properties on an object. Through custom PropertyDescriptor implementations, you can configure the categories, descriptions, read-only'ness, etc. for a property, as well as call it anything you want (and implement GetValue and SetValue however you want).

I use this for a preference manager with a temporary PropertyGrid to edit the singleton data (through the internal static instance field that returns the singleton). I implement ICustomTypeDescriptor and - for the most part - just use the TypeDescriptor methods related to whatever method I'm implementing for the ICustomTypeDescriptor. For GetProperties, I use a custom PropertyDescriptor class that actually encapsulates rows in a database (via a DataSet that is filled/updated based on conditions) and displays them as properties on an object (with full support via the Type for TypeConverters, UITypeEditors, etc.).

This way, the user is actually changing the object without you having to shadow properties like you are now.

The NotifyParentPropertyAttribute simple causes the designer to use the information it has (such as what's returned for TypeConverter.GetCreateInstanceSupported) to re-create an object based on the new values in the property attributed with the NotifyParentPropertyAttribute. Very little else is documented about it, and since the implementation is primarily in the designer (i.e., the VS.NET IDE or #develop IDE, etc.) using the IL disassembler (or any disassembler/decompiler) won't be very helpful.

I recommend using ICustomTypeDescriptor or a designer.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: How to use NotifyParentPropertyAttribute Pin
jjansen27-Jul-04 21:02
jjansen27-Jul-04 21:02 
GeneralProblems with GC and HttpWebResponse Pin
Amir Zicherman25-Jul-04 8:38
Amir Zicherman25-Jul-04 8:38 
GeneralRe: Problems with GC and HttpWebResponse Pin
Heath Stewart26-Jul-04 10:02
protectorHeath Stewart26-Jul-04 10:02 
GeneralRe: Problems with GC and HttpWebResponse Pin
Amir Zicherman27-Jul-04 7:59
Amir Zicherman27-Jul-04 7:59 
GeneralRe: Problems with GC and HttpWebResponse Pin
Heath Stewart27-Jul-04 10:43
protectorHeath Stewart27-Jul-04 10:43 
Questionif(DateTime.Now>=OldDateTime)..???? Pin
Adel83k25-Jul-04 6:02
Adel83k25-Jul-04 6:02 
AnswerRe: if(DateTime.Now>=OldDateTime)..???? Pin
ChrisAdams25-Jul-04 12:43
ChrisAdams25-Jul-04 12:43 
AnswerRe: if(DateTime.Now>=OldDateTime)..???? Pin
DougW4825-Jul-04 19:17
DougW4825-Jul-04 19:17 
GeneralDotNet DataGrid RowHeight Pin
Aerobatty25-Jul-04 5:08
Aerobatty25-Jul-04 5:08 
GeneralRe: DotNet DataGrid RowHeight Pin
DougW4825-Jul-04 19:45
DougW4825-Jul-04 19:45 
GeneralNeed C# Tutorial Writers - Will pay Pin
checker_src24-Jul-04 16:49
checker_src24-Jul-04 16:49 
GeneralRe: Need C# Tutorial Writers - Will pay Pin
Small Rat24-Jul-04 17:57
Small Rat24-Jul-04 17:57 
GeneralRe: Need C# Tutorial Writers - Will pay Pin
checker_src24-Jul-04 19:15
checker_src24-Jul-04 19:15 
GeneralRe: Need C# Tutorial Writers - Will pay Pin
Grimolfr25-Jul-04 2:57
Grimolfr25-Jul-04 2:57 
GeneralRe: Need C# Tutorial Writers - Will pay Pin
checker_src25-Jul-04 3:39
checker_src25-Jul-04 3:39 
GeneralConsole Applications Pin
Vickie Madigan24-Jul-04 15:33
Vickie Madigan24-Jul-04 15:33 
GeneralRe: Console Applications Pin
Small Rat24-Jul-04 17:53
Small Rat24-Jul-04 17:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.