Hi all,
I recently created a class which has a constructor taking 3 enumerations as arguments. These enumerations are defined in the object itself as ObjectEnum and AnotherObjectEnum in the example below.
LongObjectName pt = new LongObjectName(
LongObjectName.ObjectEnum.EnumerationOne,
LongObjectName.ObjectEnum.EnumerationTwo,
LongObjectName.AnotherObjectEnum.EnumerationThree,
0.0);
I have to initialize 8 of these objects and I'd like to condense this into a clearer format for future coders. I'd like to structure this code so that I can simplify the declaration of this object - something like a "with" from VB.NET. I would have to implement the IDisposable interface in order to use the "using" command.
ideally I'd like my code to look like this:
LongObjectName pt = new LongObjectName(
ObjectEnum.EnumerationOne,
ObjectEnum.EnumerationTwo,
AnotherObjectEnum.EnumerationThree,
0.0);
Is there any simple way to clean up code like this? Thanks in advance - this is my first question so constructive criticism is appreciated.