Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / March 2005

Tip: Looking for answers? Try searching our database.

DefaultValue with Dynamic value ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
azerty - 06 Mar 2005 13:00 GMT
Hello

With

[DefaultValue("My string")]

I can say to IDE :
this defaultValue property is"My string", So it is not necessary to save the
value in InitializeComponent method if this property equal "My string"

Perfect, But I want to specify a dynamic value

Example : If Prop1 equal the value of Prop1 another component property,
don't save it

In Delphi, we was able to use Is stored function to return True or false >>
IDE Save or not the value in DFM ....

Do you know a way to do this ??

Thanks a lot for your help
joeycalisay - 07 Mar 2005 04:42 GMT
You should use the ShouldSerialize<propertyname> method:

private bool ShouldSerializeMyProperty()
{
   if (test) return true; //serialize it...
   else return false; // don't serialize it...
}

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Hello
>
[quoted text clipped - 18 lines]
>
> Thanks a lot for your help
azerty - 07 Mar 2005 09:44 GMT
perfect !!

thanks a lot !

> You should use the ShouldSerialize<propertyname> method:
>
[quoted text clipped - 27 lines]
> >
> > Thanks a lot for your help
azerty - 07 Mar 2005 12:50 GMT
Just a question :

My Property is ExtenderProperty

Do you think I must write this on extender ...

private bool ShouldSerializeMyProperty(Control ctrl)
{
....
}

> You should use the ShouldSerialize<propertyname> method:
>
[quoted text clipped - 27 lines]
> >
> > Thanks a lot for your help
joeycalisay - 08 Mar 2005 00:32 GMT
Yes.
Try to look for the "Getting to know IExtenderProvider" article in
codeproject, good resource.

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Just a question :
>
[quoted text clipped - 38 lines]
> > >
> > > Thanks a lot for your help

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.