How to setup constants like this - Constants.Page.Title.MyCase - in C#?
-
22-07-2019 - |
Question
I am trying how figure how to setup like for instance
Color.RGG.Black which equal to "#000000"
I am trying to make it similar like that and implement into my Constants Class. How do I do this?
Constants.Page.Title.MyCase
equal to "My Case"
;
Thanks
Solution
You can set that up by using nested static classes:
public static class Constants
{
public static class Page
{
public static class Title
{
public const string MyCase = "MyCase";
}
}
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow