I was wondering if anyone could shed some light on which of the following two code segments is preferable and explain why - or are they equal?
public class ContainerEventArgs : EventArgs
{
....
public int ID {get;}
....
}
public event EventHandler<IEnumerable<ContainerEventArgs>> MyContainerEvent;
or
public class ContainerEventArgs : EventArgs, IEnumerable<int>
{
....
public IEnumerable<int> IDs {get;}
....
}
public event EventHandlerContainerEventArgs> MyContainerEvent;
Question
ProChefChad
I was wondering if anyone could shed some light on which of the following two code segments is preferable and explain why - or are they equal?
public class ContainerEventArgs : EventArgs { .... public int ID {get;} .... } public event EventHandler<IEnumerable<ContainerEventArgs>> MyContainerEvent;or
public class ContainerEventArgs : EventArgs, IEnumerable<int> { .... public IEnumerable<int> IDs {get;} .... } public event EventHandlerContainerEventArgs> MyContainerEvent;Thanks.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts