c# - Constants in static classes -
c# - Constants in static classes -
with utilize of static classes (and constant strings) want able constant values this:
var value = constants.labels.controls.topnavigation.save;
i created construction problem:
public static class constants { public static class labels { public static class controls { public static class topnavigation { public const string save = "save"; public const string refresh = "refresh"; } } public static class general { public static class errors { public const string unexpectederror = "an unexpected error occured."; } } } }
now problem is, if define in it, grow enormously. best way split different/partial classes or folder construction keeps maintainable. maintain in mind... value, want obligate user start constants.labels....
if possible 1 class-file per lowest level...
you utilize either resource files or xml file store them key pair.
c# static constants
Comments
Post a Comment