0

在原型 3 中。

我有两个枚举,在业务代码中,它们都在使用中。

现在,我想要一个新的枚举,新的枚举等于两个旧枚举的总和。

enum Day {
    // how to merge WorkDay&OffDay into DayType?
    /* want:
        WorkDay = 0;
        OffDay = 1;

        --- in business code, use as:
        Day.Monday
        Day.Tuesday
        Day.Wednesday
        Day.Thursday
        Day.Friday
        Day.Saturday
        Day.Sunday
    */
}

enum WorkDay {
    Monday = 0;
    Tuesday = 1;
    Wednesday = 2;
    Thursday = 3;
    Friday = 4;
}

enum OffDay {
    Saturday = 0;
    Sunday = 1;
}

我应该怎么办?

4

0 回答 0