Here's my problem: I have an object that's referencing a DLL. I would like other objects to reference my object, without having to also include a reference to the DLL itself.
This is fine for the most part except there is an enum in the DLL that I would like to replicate. I could write out the enum line by line, but I'm wondering if there's a better way to do this.
ie.
Let's say the DLL's got the following enum:
public enum dllEnum
{
value1,
value2,
value3
}
I could do the following:
public enum myEnum
{
value1,
value2,
value3
}
or better yet:
public enum myEnum
{
value1 = dllEnum.value1,
value2 = dllEnum.value2,
value3 = dllEnum.value3
}
But each of these cases has me writing out the entire enum out myself. I would rather just be able to wrap the entire enum as my own, preserving the indexes of the original enum.
Something along the lines of:
public enum myEnum
{
Enum.GetValues(dllEnum)
}
What you are asking has been discussed here:
Enum "Inheritance"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With