Click here to Skip to main content
15,927,699 members
Home / Discussions / C#
   

C#

 
GeneralRESOLVED Pin
BlackDice13-Nov-04 4:13
BlackDice13-Nov-04 4:13 
GeneralHiding listview header Pin
BlackDice13-Nov-04 3:15
BlackDice13-Nov-04 3:15 
GeneralRe: Hiding listview header Pin
Dennis C. Dietrich13-Nov-04 3:47
Dennis C. Dietrich13-Nov-04 3:47 
GeneralRe: Hiding listview header Pin
BlackDice13-Nov-04 4:00
BlackDice13-Nov-04 4:00 
GeneralNotification of value change Pin
Christian Graus12-Nov-04 22:34
protectorChristian Graus12-Nov-04 22:34 
GeneralRe: Notification of value change Pin
Colin Angus Mackay13-Nov-04 1:55
Colin Angus Mackay13-Nov-04 1:55 
GeneralRe: Notification of value change Pin
Christian Graus13-Nov-04 14:05
protectorChristian Graus13-Nov-04 14:05 
GeneralRe: Notification of value change Pin
Colin Angus Mackay13-Nov-04 14:19
Colin Angus Mackay13-Nov-04 14:19 
Christian Graus wrote:
In this case though, it's not my intetion to make the variable public, I just don't want the property part of the code to be what notices that the value has changed.

So, you just want to add some protection from developers setting the variable without some other thing being triggered at the same time. And you can't necessarily do that with a member variable because, even if it is private or protected it is still accessible directly be code in the class (or, in the case of protected, but derived classes also).

You know, years ago I wanted to do the same thing because I didn't trust other developers to respect my code. In the end I just had to live with the idea that other developers tend to be reasonable sane people and if you comment the member variable telling people to access it trough the property (or some particular method) they will generally do that.

With XML comments it makes it easier because (when intellisense isn't broken) you can put in the <summary> tag some text that will appear in the tooltip so they know to use the property.

Christian Graus wrote:
In practice, I think it idiotic to write code like this [code omitted for brevity]

It is how the language works. Get over it.


Do you want to know more?


GeneralRe: Notification of value change Pin
Christian Graus13-Nov-04 14:21
protectorChristian Graus13-Nov-04 14:21 
GeneralRe: Notification of value change Pin
Colin Angus Mackay13-Nov-04 14:32
Colin Angus Mackay13-Nov-04 14:32 
GeneralRe: Notification of value change Pin
Skynyrd13-Nov-04 3:03
Skynyrd13-Nov-04 3:03 
GeneralRe: Notification of value change Pin
Christian Graus13-Nov-04 13:58
protectorChristian Graus13-Nov-04 13:58 
GeneralRe: Notification of value change Pin
leppie13-Nov-04 7:58
leppie13-Nov-04 7:58 
GeneralRe: Notification of value change Pin
Christian Graus13-Nov-04 13:57
protectorChristian Graus13-Nov-04 13:57 
GeneralRe: Notification of value change Pin
leppie13-Nov-04 22:00
leppie13-Nov-04 22:00 
GeneralRe: Notification of value change Pin
Nick Parker13-Nov-04 8:00
protectorNick Parker13-Nov-04 8:00 
GeneralRe: Notification of value change Pin
Christian Graus13-Nov-04 13:56
protectorChristian Graus13-Nov-04 13:56 
Generalmacromedia flash Pin
Member 143434912-Nov-04 21:26
Member 143434912-Nov-04 21:26 
GeneralRe: macromedia flash Pin
Skynyrd13-Nov-04 0:23
Skynyrd13-Nov-04 0:23 
GeneralOOP Pin
steve_rm12-Nov-04 18:47
steve_rm12-Nov-04 18:47 
GeneralRe: OOP Pin
Christian Graus12-Nov-04 22:27
protectorChristian Graus12-Nov-04 22:27 
GeneralRe: OOP Pin
Skynyrd13-Nov-04 0:18
Skynyrd13-Nov-04 0:18 
GeneralSearching an XML File with C# Pin
Member 138504912-Nov-04 17:04
Member 138504912-Nov-04 17:04 
GeneralRe: Searching an XML File with C# Pin
Alex Korchemniy12-Nov-04 18:15
Alex Korchemniy12-Nov-04 18:15 
Generalwindows forms Pin
new_eng_0712-Nov-04 14:16
new_eng_0712-Nov-04 14:16 

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.