Get internal sub class properties parent class name

50 views Asked by At

Having the following Helper static class

internal static class Helper
{
    internal static class Properties
    {
        internal static class P1
        {
            public const string set1 = "abcd"
            public const string set2 = "abdc"
        }
        internal static class P2
        {
            public const string set3 = "rbcd"
            public const string set4 = "vbdc"
        }
    }
}

Having the following method

GetSettings(string value)
{
    ...
}

Which can be called like this:

GetSettings(Helper.Properties.P2.set3);

I would also like to access inside the GetSettings method the name of the parent classes of set3. So I won't only know that set3's value is "rbcd" I will also know the name "P2", then "Properties" and also "Helper". But I have no idea how to do this. Any ideas or sugestion?

0

There are 0 answers