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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -