File: Enums.cs

package info (click to toggle)
ironpython 1.1.1-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,976 kB
  • ctags: 19,824
  • sloc: cs: 89,583; python: 34,457; makefile: 62; xml: 38; sh: 22
file content (268 lines) | stat: -rw-r--r-- 7,687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public
 * License. A  copy of the license can be found in the License.html file at the
 * root of this distribution. If  you cannot locate the  Microsoft Public
 * License, please send an email to  dlr@microsoft.com. By using this source
 * code in any fashion, you are agreeing to be bound by the terms of the 
 * Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * ***************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;

namespace IronPythonTest {
    [Flags]
    public enum DaysInt : int {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }
    [Flags]
    public enum DaysShort : short {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }
    [Flags]
    public enum DaysLong : long {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }
    [Flags]
    public enum DaysSByte : sbyte {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }
    [Flags]
    public enum DaysByte : byte {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }
    [Flags]
    public enum DaysUShort : ushort {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }

    [Flags]
    public enum DaysUInt : uint {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }

    [Flags]
    public enum DaysULong : ulong {
        Mon = 0x01,
        Tue = 0x02,
        Wed = 0x04,
        Thu = 0x08,
        Fri = 0x10,
        Sat = 0x20,
        Sun = 0x40,
        None = 0,
        Weekdays = Mon | Tue | Wed | Thu | Fri,
        Weekend = Sat | Sun,
        All = Weekdays | Weekend
    }

    public class EnumTest {
        public virtual DaysInt TestDaysInt() {
            return DaysInt.Weekend;
        }
        public virtual DaysShort TestDaysShort() {
            return DaysShort.Weekend;
        }
        public virtual DaysLong TestDaysLong() {
            return DaysLong.Weekend;
        }
        public virtual DaysSByte TestDaysSByte() {
            return DaysSByte.Weekend;
        }
        public virtual DaysByte TestDaysByte() {
            return DaysByte.Weekend;
        }
        public virtual DaysUShort TestDaysUShort() {
            return DaysUShort.Weekend;
        }
        public virtual DaysUInt TestDaysUInt() {
            return DaysUInt.Weekend;
        }
        public virtual DaysULong TestDaysULong() {
            return DaysULong.Weekend;
        }

        public static void TestEnumInt(int arg) {
        }
        public static void TestEnumShort(short arg) {
        }
        public static void TestEnumLong(long arg) {
        }
        public static void TestEnumSByte(sbyte arg) {
        }
        public static void TestEnumUInt(uint arg) {
        }
        public static void TestEnumUShort(ushort arg) {
        }
        public static void TestEnumULong(ulong arg) {
        }
        public static void TestEnumByte(byte arg) {
        }
        public static void TestEnumBoolean(bool arg) {
        }
    }

    public enum EnumSByte : sbyte {
        Zero = 0,
        MinSByte = SByte.MinValue,
        MaxSByte = SByte.MaxValue,
    }
    public enum EnumByte : byte {
        Zero = 0,
        MaxSByte = (byte)SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
    }
    public enum EnumShort : short {
        Zero = 0,
        MinSByte = SByte.MinValue,
        MaxSByte = SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MinShort = Int16.MinValue,
        MaxShort = Int16.MaxValue,
    }
    public enum EnumUShort : ushort {
        Zero = 0,
        MaxSByte = (ushort)SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MaxShort = (ushort)Int16.MaxValue,
        MinUShort = UInt16.MinValue,
        MaxUShort = UInt16.MaxValue,
    }
    public enum EnumInt : int {
        Zero = 0,
        MinSByte = SByte.MinValue,
        MaxSByte = SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MinShort = Int16.MinValue,
        MaxShort = Int16.MaxValue,
        MinUShort = UInt16.MinValue,
        MaxUShort = UInt16.MaxValue,
        MinInt = Int32.MinValue,
        MaxInt = Int32.MaxValue,
    }
    public enum EnumUInt : uint {
        Zero = 0,
        MaxSByte = (uint)SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MaxShort = (uint)Int16.MaxValue,
        MinUShort = UInt16.MinValue,
        MaxUShort = UInt16.MaxValue,
        MaxInt = Int32.MaxValue,
        MinUInt = UInt32.MinValue,
        MaxUInt = UInt32.MaxValue,
    }
    public enum EnumLong : long {
        Zero = 0,
        MinSByte = SByte.MinValue,
        MaxSByte = SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MinShort = Int16.MinValue,
        MaxShort = Int16.MaxValue,
        MinUShort = UInt16.MinValue,
        MaxUShort = UInt16.MaxValue,
        MinInt = Int32.MinValue,
        MaxInt = Int32.MaxValue,
        MinUInt = UInt32.MinValue,
        MaxUInt = UInt32.MaxValue,
        MinLong = Int64.MinValue,
        MaxLong = Int64.MaxValue,
    }
    public enum EnumULong : ulong {
        Zero = 0,
        MaxSByte = (ulong)SByte.MaxValue,
        MinByte = Byte.MinValue,
        MaxByte = Byte.MaxValue,
        MaxShort = (ulong)Int16.MaxValue,
        MinUShort = UInt16.MinValue,
        MaxUShort = UInt16.MaxValue,
        MaxInt = Int32.MaxValue,
        MinUInt = UInt32.MinValue,
        MaxUInt = UInt32.MaxValue,
        MaxLong = Int64.MaxValue,
        MinULong = UInt64.MinValue,
        MaxULong = UInt64.MaxValue,
    }
}