Consider the following case
public class SomethingWithAReallyReallyAnnoyinglyLongName{
public struct Names
{
public const string SomeConstant = "Hello";
public const string SomeOtherConstant = "World";
}
}
Is there a way of referencing SomethingWithAReallyReallyAnnoyinglyLongName.Names.SomeConstant
without having to reference SomethingWithAReallyReallyAnnoyinglyLongName
, when outside of the SomethingWithAReallyReallyAnnoyinglyLongName
context?
// Won't work "Struct Name is not valid at this point."
var names = SomethingWithAReallyReallyAnnoyinglyLongName.Names;
SomeFunction(names.SomeConstant, names.SomeOtherConstant);
// Won't work "Cannot access static constant..."
var names = new SomethingWithAReallyReallyAnnoyinglyLongName.Names();
SomeFunction(names.SomeConstant, names.SomeOtherConstant);
The long class name is auto-generated, so I can't change that, but I could probably change anything about the Names struct (make it a class, change the consts to not be const, etc.).
Any ideas?