Click here to Skip to main content
15,915,336 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 4:16
mvaMarc Clifton13-Oct-17 4:16 
AnswerRe: PSOTWIFLI Pin
Sascha Lefèvre13-Oct-17 4:02
professionalSascha Lefèvre13-Oct-17 4:02 
AnswerRe: PSOTWIFLI Pin
GuyThiebaut13-Oct-17 4:04
professionalGuyThiebaut13-Oct-17 4:04 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 4:09
mvaMarc Clifton13-Oct-17 4:09 
GeneralRe: PSOTWIFLI Pin
Jim_Snyder13-Oct-17 4:14
professionalJim_Snyder13-Oct-17 4:14 
AnswerRe: PSOTWIFLI Pin
Richard Deeming13-Oct-17 4:12
mveRichard Deeming13-Oct-17 4:12 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 4:15
mvaMarc Clifton13-Oct-17 4:15 
GeneralRe: PSOTWIFLI Pin
Richard Deeming13-Oct-17 4:22
mveRichard Deeming13-Oct-17 4:22 
Or better yet, like this:
C#
public class ProcessEventArgs : EventArgs
{
  public IMembrane FromMembrane { get; }
  public IReceptor FromReceptor { get; }
  public IMembrane ToMembrane { get; }
  public IReceptor ToReceptor { get; }
  public ISemanticType SemanticType { get; }
 
  public ProcessEventArgs(IMembrane fromMembrane, IReceptor fromReceptor, IMembrane toMembrane, IReceptor toReceptor, ISemanticType semanticType)
  {
    FromMembrane = fromMembrane;
    FromReceptor = fromReceptor;
    ToMembrane = toMembrane;
    ToReceptor = toReceptor;
    SemanticType = semanticType;
  }
}

(Assuming you're using the C# 6 compiler or later. Otherwise, private set; would have a similar effect.)

Also, named parameters can make the constructor look more like the object initializer:
C#
Processing.Fire(this, new ProcessEventArgs(
  fromMembrane: fromMembrane,
  fromReceptor: fromReceptor,
  toMembrane: membrane,
  toReceptor: target,
  semanticType: obj
));




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer



modified 13-Oct-17 10:32am.

GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 4:51
mvaMarc Clifton13-Oct-17 4:51 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 13:19
mvaMarc Clifton13-Oct-17 13:19 
AnswerRe: PSOTWIFLI Pin
Pete O'Hanlon13-Oct-17 4:19
mvePete O'Hanlon13-Oct-17 4:19 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 4:53
mvaMarc Clifton13-Oct-17 4:53 
AnswerRe: PSOTWIFLI Pin
Johnny J.13-Oct-17 4:22
professionalJohnny J.13-Oct-17 4:22 
JokeRe: PSOTWIFLI Pin
Jeremy Falcon13-Oct-17 6:25
professionalJeremy Falcon13-Oct-17 6:25 
GeneralRe: PSOTWIFLI Pin
Johnny J.15-Oct-17 20:11
professionalJohnny J.15-Oct-17 20:11 
PraiseRe: PSOTWIFLI Pin
Jeremy Falcon16-Oct-17 8:09
professionalJeremy Falcon16-Oct-17 8:09 
AnswerRe: PSOTWIFLI Pin
Tim Carmichael13-Oct-17 4:38
Tim Carmichael13-Oct-17 4:38 
GeneralRe: PSOTWIFLI Pin
Marc Clifton13-Oct-17 5:13
mvaMarc Clifton13-Oct-17 5:13 
GeneralRe: PSOTWIFLI Pin
Tim Carmichael13-Oct-17 6:07
Tim Carmichael13-Oct-17 6:07 
AnswerRe: PSOTWIFLI Pin
Mladen Janković13-Oct-17 6:04
Mladen Janković13-Oct-17 6:04 
AnswerRe: PSOTWIFLI Pin
Jeremy Falcon13-Oct-17 6:24
professionalJeremy Falcon13-Oct-17 6:24 
GeneralRe: PSOTWIFLI Pin
dandy7213-Oct-17 8:17
dandy7213-Oct-17 8:17 
AnswerRe: PSOTWIFLI Pin
dandy7213-Oct-17 8:11
dandy7213-Oct-17 8:11 
AnswerRe: PSOTWIFLI Pin
Eddy Vluggen13-Oct-17 9:51
professionalEddy Vluggen13-Oct-17 9:51 
AnswerRe: PSOTWIFLI Pin
H.Brydon13-Oct-17 11:11
professionalH.Brydon13-Oct-17 11:11 

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.