By default, C # enums are stored as integers. I would like to make it shorter. Is there any way to do this?
Of course, this can be done, but it must be an integral type (byte, short, int, etc.), except for char ...
enum myEnum : short { FirstValue = 0, };
here are the MSDN docs
Like this:
enum MyEnum : short { ... }
String , , http://weblogs.asp.net/stefansedich/archive/2008/03/12/enum-with-string-values-in-c.aspx
,
enum Range : short {Max = 6, Min = 1, Mid = 3};
Source: https://habr.com/ru/post/1763012/More articles:Is there a call in vb.net that I can make to determine daylight saving time? - datetimeКак можно стирать пробелы и новые строки с помощью шаблонов Мако? Мой 12362-строчный HTML файл убивает IE - model-view-controllerHow to determine when an embedded Flash object is loaded? - javascriptiPhone Отправить в Apple - проверить приложение ничего не делает - iphoneИзображение маски с помощью другого изображения - iphoneSoftware Suggestions to Facilitate Build Server Configuration - hudsonSleep mode for single display - javaJQuery delegate conflicts with another delegate in IE - internet-explorer-8jQuery: cancel events when history: back? - jqueryУнифицированные векторы объединения inplace - c++All Articles