Skip to content

Instantly share code, notes, and snippets.

@wonderful-panda
Created August 22, 2012 20:39
Show Gist options
  • Save wonderful-panda/3429122 to your computer and use it in GitHub Desktop.
Save wonderful-panda/3429122 to your computer and use it in GitHub Desktop.
public class WeekDay
{
public readonly int Value;
public readonly string Name;
public readonly string ShortName;
public WeekDay(int value, string name, string shortName)
{
this.Value = value;
this.Name = name;
this.ShortName = shortName;
}
public static readonly WeekDay Sunday = new WeekDay(0, "Sunday", "Sun");
public static readonly WeekDay Monday = new WeekDay(1, "Monday", "Mon");
public static readonly WeekDay Tuesday = new WeekDay(2, "Tuesday", "Tue");
// 以下略
// 必要に応じてToStringのoverrideやintへの暗黙の変換も実装
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment