Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
GeneralDatagrid, handling events Pin
benqazou2-Apr-04 5:09
benqazou2-Apr-04 5:09 
GeneralRe: Datagrid, handling events Pin
Heath Stewart2-Apr-04 9:39
protectorHeath Stewart2-Apr-04 9:39 
GeneralPassing data to a form. Pin
Demian Panello2-Apr-04 4:58
Demian Panello2-Apr-04 4:58 
GeneralRe: Passing data to a form. Pin
CWIZO2-Apr-04 8:01
CWIZO2-Apr-04 8:01 
GeneralRe: Passing data to a form. Pin
Heath Stewart2-Apr-04 9:42
protectorHeath Stewart2-Apr-04 9:42 
GeneralRe: Passing data to a form. Pin
Demian Panello2-Apr-04 13:26
Demian Panello2-Apr-04 13:26 
GeneralPersistant DefaultValueAttributes Pin
ajenny2-Apr-04 4:04
ajenny2-Apr-04 4:04 
GeneralRe: Persistant DefaultValueAttributes Pin
Heath Stewart2-Apr-04 9:45
protectorHeath Stewart2-Apr-04 9:45 
Implement the ICustomTypeDescriptor in your class. In the implementation for GetProperties you can attach all the attributes to your <cdoe>PropertyDescriptors that you want. I use this for an object with "properties" that are allocated from a database, and I add a DefaultValueAttribute to those PropertyDescriptors from the database as well.

If you simply want to serialize these, then you use the TypeDescriptor.GetProperties method to get the PropertyDescriptorCollection and enumerate those properties, getting the value from the DefaultValueAttribute which may be found in PropertyDescriptor.Attributes (inheritted from MemberDescriptor).

 

Microsoft MVP, Visual C#
My Articles
GeneralUpdating Controls included in other controls Pin
veroBT2-Apr-04 4:02
veroBT2-Apr-04 4:02 
GeneralRe: Updating Controls included in other controls Pin
Heath Stewart2-Apr-04 9:47
protectorHeath Stewart2-Apr-04 9:47 
QuestionSsh in c#?? Pin
polkiujhy2-Apr-04 3:44
polkiujhy2-Apr-04 3:44 
AnswerRe: Ssh in c#?? Pin
Dave Kreskowiak2-Apr-04 4:08
mveDave Kreskowiak2-Apr-04 4:08 
GeneralRe: Ssh in c#?? Pin
polkiujhy2-Apr-04 5:43
polkiujhy2-Apr-04 5:43 
GeneralRe: Ssh in c#?? Pin
Dave Kreskowiak2-Apr-04 5:48
mveDave Kreskowiak2-Apr-04 5:48 
GeneralRe: Ssh in c#?? Pin
Heath Stewart2-Apr-04 9:50
protectorHeath Stewart2-Apr-04 9:50 
GeneralPlease Help Pin
Nicholas Naddaf2-Apr-04 3:30
Nicholas Naddaf2-Apr-04 3:30 
QuestionC# syntax question? Pin
Anonymous2-Apr-04 3:12
Anonymous2-Apr-04 3:12 
AnswerRe: C# syntax question? Pin
Grimolfr2-Apr-04 3:41
Grimolfr2-Apr-04 3:41 
AnswerRe: C# syntax question? Pin
Dave Kreskowiak2-Apr-04 4:04
mveDave Kreskowiak2-Apr-04 4:04 
GeneralSerializing a Winform Pin
anand9112-Apr-04 0:48
anand9112-Apr-04 0:48 
GeneralRe: Serializing a Winform Pin
Dave Kreskowiak2-Apr-04 4:36
mveDave Kreskowiak2-Apr-04 4:36 
GeneralRe: Serializing a Winform Pin
Stefan Troschuetz2-Apr-04 5:57
Stefan Troschuetz2-Apr-04 5:57 
GeneralRe: Serializing a Winform Pin
Heath Stewart2-Apr-04 9:53
protectorHeath Stewart2-Apr-04 9:53 
QuestionStatic Arraylist? Pin
SherKar1-Apr-04 21:48
SherKar1-Apr-04 21:48 
AnswerRe: Static Arraylist? Pin
The Catalyst21-Apr-04 21:56
sussThe Catalyst21-Apr-04 21:56 

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.