Click here to Skip to main content
11,486,466 members (73,587 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: Apropos of nothing in particular Pin
d@nish 15-Mar-13 1:40
member d@nish 15-Mar-13 1:40 
GeneralRe: Apropos of nothing in particular Pin
Mark_Wallace15-Mar-13 1:49
memberMark_Wallace15-Mar-13 1:49 
JokeIf you ever wondered... Pin
RogelioP / EX DE,HL14-Mar-13 16:35
memberRogelioP / EX DE,HL14-Mar-13 16:35 
GeneralDefine: Emperor Palpatine Pin
AspDotNetDev14-Mar-13 10:03
protectorAspDotNetDev14-Mar-13 10:03 
GeneralRe: Define: Emperor Palpatine Pin
CDP180214-Mar-13 10:12
memberCDP180214-Mar-13 10:12 
GeneralRe: Define: Emperor Palpatine Pin
AspDotNetDev14-Mar-13 10:14
protectorAspDotNetDev14-Mar-13 10:14 
GeneralRe: Define: Emperor Palpatine Pin
CDP180214-Mar-13 10:18
memberCDP180214-Mar-13 10:18 
GeneralRe: Define: Emperor Palpatine Pin
Mark_Wallace14-Mar-13 21:27
memberMark_Wallace14-Mar-13 21:27 
GeneralRe: Define: Emperor Palpatine Pin
AspDotNetDev14-Mar-13 21:32
protectorAspDotNetDev14-Mar-13 21:32 
GeneralRe: Define: Emperor Palpatine Pin
wizardzz14-Mar-13 10:22
memberwizardzz14-Mar-13 10:22 
GeneralRe: Define: Emperor Palpatine Pin
AspDotNetDev14-Mar-13 10:26
protectorAspDotNetDev14-Mar-13 10:26 
GeneralRe: Define: Emperor Palpatine Pin
BillWoodruff14-Mar-13 19:23
memberBillWoodruff14-Mar-13 19:23 
GeneralRe: Define: Emperor Palpatine Pin
Mark_Wallace14-Mar-13 21:26
memberMark_Wallace14-Mar-13 21:26 
GeneralIt's interesting how much lambda, extension and anonymous methods I'm using nowadays [modified] Pin
Marc Clifton14-Mar-13 9:48
protectorMarc Clifton14-Mar-13 9:48 
For example, here's a setter that updates the underlying field of a data row and fires a change event based on whether the field actually changed (UpdateField, an extension method, returns true) and whether the event has been wired (not null):

set {row.UpdateField<string>(model, "TableOfContents", value).Then(() => TableOfContentsChanged.IfNotNull(e => e(this))); }

[edit]
For example, the above would otherwise be written as:

bool changed = row.UpdateField<string>(model, "TableOfContents", value);
if (changed)
{
  if (TableOfContentsChanged != null)
  {
    TableOfContentsChanged(this);
  }
}

[/edit]

Or, here's something that scans the nodes in a tree (Hierarchy being an extension method) and if it finds a match (not null) updates the title in the tree's caption:

TreeView.Hierarchy().FirstOrDefault(n => n.Tag == rec).IfNotNull(t=>t[0] = rec.GetTitle());

I'm also noticing how my programming is becoming much more "functional" - I often pass in Func or Action anonymous methods, etc. What about you? Is you C# imperative programming starting to look more and more like function programming?

Marc


modified 14-Mar-13 15:27pm.

GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
CDP180214-Mar-13 9:52
memberCDP180214-Mar-13 9:52 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
mark merrens14-Mar-13 9:54
membermark merrens14-Mar-13 9:54 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Deyan Georgiev14-Mar-13 9:57
memberDeyan Georgiev14-Mar-13 9:57 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Pete O'Hanlon14-Mar-13 10:00
protectorPete O'Hanlon14-Mar-13 10:00 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
dusty_dex14-Mar-13 10:21
memberdusty_dex14-Mar-13 10:21 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Dan Neely14-Mar-13 10:32
memberDan Neely14-Mar-13 10:32 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Maximilien14-Mar-13 11:21
memberMaximilien14-Mar-13 11:21 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Gjelt14-Mar-13 12:20
memberGjelt14-Mar-13 12:20 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
_Josh_14-Mar-13 13:03
member_Josh_14-Mar-13 13:03 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Nicholas Butler14-Mar-13 11:27
mentorNicholas Butler14-Mar-13 11:27 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Marco Bertschi14-Mar-13 11:41
memberMarco Bertschi14-Mar-13 11:41 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
lewax0014-Mar-13 11:44
memberlewax0014-Mar-13 11:44 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Gjelt14-Mar-13 12:22
memberGjelt14-Mar-13 12:22 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Forogar14-Mar-13 13:15
memberForogar14-Mar-13 13:15 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
_Maxxx_14-Mar-13 15:48
member_Maxxx_14-Mar-13 15:48 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Joe Woodbury14-Mar-13 16:27
memberJoe Woodbury14-Mar-13 16:27 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
dusty_dex14-Mar-13 18:54
memberdusty_dex14-Mar-13 18:54 
JokeRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Peter_in_278015-Mar-13 0:13
memberPeter_in_278015-Mar-13 0:13 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
dusty_dex15-Mar-13 0:57
memberdusty_dex15-Mar-13 0:57 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Marc Clifton15-Mar-13 2:44
protectorMarc Clifton15-Mar-13 2:44 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Brady Kelly14-Mar-13 19:34
memberBrady Kelly14-Mar-13 19:34 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
BillWoodruff14-Mar-13 19:38
memberBillWoodruff14-Mar-13 19:38 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
Marc Clifton15-Mar-13 2:35
protectorMarc Clifton15-Mar-13 2:35 
GeneralRe: It's interesting how much lambda, extension and anonymous methods I'm using nowadays Pin
c242315-Mar-13 1:56
memberc242315-Mar-13 1:56 
GeneralRandom Project [modified] Pin
Brisingr Aerowing14-Mar-13 9:21
memberBrisingr Aerowing14-Mar-13 9:21 
GeneralRe: Random Project Pin
Marco Bertschi14-Mar-13 9:24
memberMarco Bertschi14-Mar-13 9:24 
GeneralRe: Random Project Pin
Vasudevan Deepak Kumar14-Mar-13 9:39
memberVasudevan Deepak Kumar14-Mar-13 9:39 
GeneralRe: Random Project Pin
Marc Clifton14-Mar-13 9:42
protectorMarc Clifton14-Mar-13 9:42 
GeneralRe: Random Project Pin
Brisingr Aerowing14-Mar-13 13:57
memberBrisingr Aerowing14-Mar-13 13:57 
GeneralRe: Random Project Pin
wizardzz14-Mar-13 9:45
memberwizardzz14-Mar-13 9:45 
GeneralRe: Random Project Pin
Matthew Faithfull14-Mar-13 9:50
memberMatthew Faithfull14-Mar-13 9:50 
GeneralRe: Random Project Pin
Jörgen Andersson14-Mar-13 9:54
memberJörgen Andersson14-Mar-13 9:54 
GeneralRe: Random Project Pin
Ravi Bhavnani14-Mar-13 9:59
memberRavi Bhavnani14-Mar-13 9:59 
GeneralRe: Random Project Pin
gavindon14-Mar-13 10:17
membergavindon14-Mar-13 10:17 
QuestionCompletely new to this site, and not sure how to ask question directly to others. Can you help me? Pin
Paga Cession14-Mar-13 9:16
memberPaga Cession14-Mar-13 9:16 
AnswerRe: Completely new to this site, and not sure how to ask question directly to others. Can you help me? Pin
Pete O'Hanlon14-Mar-13 9:19
protectorPete O'Hanlon14-Mar-13 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 26 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid