Click here to Skip to main content
15,891,513 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# using get set. Why is this failing? Pin
Pete O'Hanlon29-May-19 0:43
mvePete O'Hanlon29-May-19 0:43 
GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion29-May-19 14:41
Brian_TheLion29-May-19 14:41 
GeneralRe: C# using get set. Why is this failing? Pin
Pete O'Hanlon29-May-19 18:57
mvePete O'Hanlon29-May-19 18:57 
GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion29-May-19 19:55
Brian_TheLion29-May-19 19:55 
GeneralRe: C# using get set. Why is this failing? Pin
OriginalGriff29-May-19 1:11
mveOriginalGriff29-May-19 1:11 
GeneralRe: C# using get set. Why is this failing? Pin
BillWoodruff29-May-19 3:30
professionalBillWoodruff29-May-19 3:30 
GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion29-May-19 20:14
Brian_TheLion29-May-19 20:14 
GeneralRe: C# using get set. Why is this failing? Pin
BillWoodruff29-May-19 22:48
professionalBillWoodruff29-May-19 22:48 
Do keep in mind that MS Guidelines suggest using Properties only as gateways to internal fields [^]
Quote:
In general, methods represent actions and properties represent data. Properties are meant to be used like fields, meaning that properties should not be computationally complex or produce side effects. When it does not violate the following guidelines, consider using a property, rather than a method, because less experienced developers find properties easier to use.
not to produce 'side-effects" by way of internal computation in the setter and/or getter ... and advocates using methods to replace any internal computation.

While I feel "relaxed" about some computation in a Property setter/getter, there are folks who have strong opinions this is bad practice. Another argument against computation in Properties is that end-users of your code may not be aware of the "cost" of access.

Of course, you can implement INotifyPropertyChanged as a "trigger" for some external action.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot


modified 30-May-19 5:10am.

GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion30-May-19 1:20
Brian_TheLion30-May-19 1:20 
GeneralRe: C# using get set. Why is this failing? Pin
BillWoodruff30-May-19 4:33
professionalBillWoodruff30-May-19 4:33 
GeneralRe: C# using get set. Why is this failing? Pin
BillWoodruff31-May-19 20:12
professionalBillWoodruff31-May-19 20:12 
AnswerRe: C# using get set. Why is this failing? Pin
Gerry Schmitz29-May-19 3:52
mveGerry Schmitz29-May-19 3:52 
GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion29-May-19 14:52
Brian_TheLion29-May-19 14:52 
QuestionWinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Ken Guru28-May-19 4:46
Ken Guru28-May-19 4:46 
AnswerRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Eddy Vluggen28-May-19 5:42
professionalEddy Vluggen28-May-19 5:42 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Ken Guru28-May-19 22:00
Ken Guru28-May-19 22:00 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Eddy Vluggen28-May-19 23:30
professionalEddy Vluggen28-May-19 23:30 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Ken Guru29-May-19 4:24
Ken Guru29-May-19 4:24 
AnswerRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
BillWoodruff28-May-19 15:52
professionalBillWoodruff28-May-19 15:52 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Ken Guru28-May-19 21:54
Ken Guru28-May-19 21:54 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
BillWoodruff29-May-19 3:17
professionalBillWoodruff29-May-19 3:17 
AnswerRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Gerry Schmitz29-May-19 3:47
mveGerry Schmitz29-May-19 3:47 
GeneralRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
Ken Guru29-May-19 4:28
Ken Guru29-May-19 4:28 
AnswerRe: WinForms, Window with FormBorderStyle.None and Taskbar moved doesn't adjust to new size Pin
BillWoodruff29-May-19 7:12
professionalBillWoodruff29-May-19 7:12 
QuestionC# using class library how to get download pdf link in mail Pin
Member 1447263827-May-19 20:28
Member 1447263827-May-19 20:28 

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.