Created
August 22, 2012 20:39
-
-
Save wonderful-panda/3429122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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