获取内部子类属性父类名

时间:2017-10-04 09:04:13

标签: c# static internal-class

拥有以下Helper静态类

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"
        }
    }
}

有以下方法

GetSettings(string value)
{
    ...
}

可以这样调用:

GetSettings(Helper.Properties.P2.set3);

我还想在GetSettings方法内部访问set3的父类的名称。所以我不会只知道set3的价值是" rbcd"我也会知道名字" P2",然后"属性"还有" Helper"。但我不知道该怎么做。任何想法或消化?

0 个答案:

没有答案