列挙型(enum) → 文字列(string)
var enmVal = Season.Spring; var strVal = Enum.GetName(typeof(Season), enmVal);
列挙型(enum) → 数値(int)
var enmVal = Season.Autumn | Season.Winter; var intVal = (int)enmVal;
文字列(string) → 列挙型(enum)
var strVal = "spring, summer"; var enmVal = (Season)Enum.Parse(typeof(Season), strVal, true);
数値(int) → 列挙型(enum)
var intVal = 2; var enmVal = (Season)Enum.ToObject(typeof(Season), intVal);