Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property in a form
Message
 
To
26/10/2004 11:01:54
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
00954513
Message ID:
00954559
Views:
11
Bonnie,

Okay, I am going to repeat what you said Bonnie to make sure I got it right.

Basically I would use a property if I want to use the property sheet or have more code fire utilizing the get and set commands.

I would use a protected var or public var or private var just to hold a value and have no need for property sheet or extra code at the get and set commands.

I guess I have one question if the above is right.

If I was to put code on a property using the get and set, I guess why would I just create a method that does what the get and set would have done.

Is it to reduce coding because I would have two methods, where the property is contained in a common area, actually I think I would need two methods if I was using a get and set because, each operation could do something different.


Does this make sense....

--> Shawn

>Shawn,
>
>It only needs to be public if you need it outside of your class (in this case, outside of your form). If not, then either private or protected is fine.
>
>And, if it *does* need to be public, it doesn't necessarily need to be a property (with a get/set), although that's probably better (in case you want to be able to set it via the property sheet, or in case you need to have extra code in the get/set).
>
>~~Bonnie
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform