0

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?

Norbert Forgacs
  • 605
  • 1
  • 8
  • 27
  • I don't understand what you're trying to accomplish. Could you add an example of what you would like your code to behave like? – CKII Oct 04 '17 at 09:07
  • I would recommend you to use static instances instead. So P1 and P2 can be static properties containing instances of the same (or not) class. Then you can pass those instances and have access to all properties. – Pavel Agarkov Oct 04 '17 at 09:10

0 Answers0