Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Where am I send a request about C# new language feature Pin
Higty27-Mar-14 16:00
Higty27-Mar-14 16:00 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon27-Mar-14 21:20
mvePete O'Hanlon27-Mar-14 21:20 
GeneralRe: Where am I send a request about C# new language feature Pin
Higty30-Mar-14 13:47
Higty30-Mar-14 13:47 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon30-Mar-14 20:22
mvePete O'Hanlon30-Mar-14 20:22 
GeneralRe: Where am I send a request about C# new language feature Pin
Higty30-Mar-14 21:31
Higty30-Mar-14 21:31 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon30-Mar-14 22:38
mvePete O'Hanlon30-Mar-14 22:38 
GeneralRe: Where am I send a request about C# new language feature Pin
Higty30-Mar-14 23:46
Higty30-Mar-14 23:46 
GeneralRe: Where am I send a request about C# new language feature Pin
BobJanova27-Mar-14 6:36
BobJanova27-Mar-14 6:36 
Code snippets and other IDE magic are working around language deficiencies, and are generally 'write helpers' rather than things that help a reader or modifier of the code (i.e. 90% of interactions with the code).

I do feel that there's a missing language feature in this area but I'm not sure it's quite been nailed here. What would solve the INPC and validation scenarios would be

class SomeClass : INotifyPropertyChanged {
 public int Value { get; set; beforeset ValidateValue; afterset Notify; }
 public string Description { get; set; afterset Notify; }

 private int ValidateValue(string property, int value) { ... }
 private void Notify<T>(string property, T value) {
  // usual stuff here
 }
}


'beforeset' and 'afterset' would take a method reference or a lambda matching Func<string, T, T> and Action<string, T> respectively where T is the property type, so beforeset methods can update the value if needed, and both methods get given the property name if they want to use it for data binding, INPC notifications or error messages.

The compiler could insert the relevant calls into the auto-generated property method very easily.
GeneralRe: Where am I send a request about C# new language feature Pin
Matt T Heffron27-Mar-14 7:21
professionalMatt T Heffron27-Mar-14 7:21 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon27-Mar-14 11:26
mvePete O'Hanlon27-Mar-14 11:26 
GeneralRe: Where am I send a request about C# new language feature Pin
BobJanova28-Mar-14 0:31
BobJanova28-Mar-14 0:31 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon28-Mar-14 1:27
mvePete O'Hanlon28-Mar-14 1:27 
GeneralRe: Where am I send a request about C# new language feature Pin
BobJanova28-Mar-14 4:33
BobJanova28-Mar-14 4:33 
GeneralRe: Where am I send a request about C# new language feature Pin
Pete O'Hanlon28-Mar-14 4:38
mvePete O'Hanlon28-Mar-14 4:38 
GeneralRe: Where am I send a request about C# new language feature Pin
Higty30-Mar-14 14:07
Higty30-Mar-14 14:07 
Questionis it secure to send windows password via netNamedPipeBinding to WCF service running on windows service? Pin
sudhakarponnusamy@gmail.com25-Mar-14 21:27
sudhakarponnusamy@gmail.com25-Mar-14 21:27 
AnswerRe: is it secure to send windows password via netNamedPipeBinding to WCF service running on windows service? Pin
BobJanova27-Mar-14 6:40
BobJanova27-Mar-14 6:40 
QuestionC#: Setup Project in VS2010 with Custom actions Pin
AshwiniSH25-Mar-14 21:07
professionalAshwiniSH25-Mar-14 21:07 
QuestionRe: C#: Setup Project in VS2010 with Custom actions Pin
Richard MacCutchan25-Mar-14 22:37
mveRichard MacCutchan25-Mar-14 22:37 
AnswerRe: C#: Setup Project in VS2010 with Custom actions Pin
AshwiniSH25-Mar-14 23:38
professionalAshwiniSH25-Mar-14 23:38 
GeneralRe: C#: Setup Project in VS2010 with Custom actions Pin
Richard MacCutchan25-Mar-14 23:41
mveRichard MacCutchan25-Mar-14 23:41 
GeneralRe: C#: Setup Project in VS2010 with Custom actions Pin
AshwiniSH27-Mar-14 0:20
professionalAshwiniSH27-Mar-14 0:20 
GeneralRe: C#: Setup Project in VS2010 with Custom actions Pin
Richard MacCutchan27-Mar-14 0:22
mveRichard MacCutchan27-Mar-14 0:22 
GeneralRe: C#: Setup Project in VS2010 with Custom actions Pin
AshwiniSH27-Mar-14 0:48
professionalAshwiniSH27-Mar-14 0:48 
GeneralRe: C#: Setup Project in VS2010 with Custom actions Pin
AshwiniSH4-Apr-14 0:03
professionalAshwiniSH4-Apr-14 0:03 

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.