Another Random.cs compile fix.
[mono.git] / mcs / class / corlib / System / Byte.cs
1 //
2 // System.Byte.cs
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //
7 // (C) Ximian, Inc.  http://www.ximian.com
8 //
9
10 using System.Globalization;
11
12 namespace System {
13         
14         public struct Byte : IComparable, IFormattable { //, IConvertible {
15                 public const byte MinValue = 0;
16                 public const byte MaxValue = 255;
17                 
18                 // VES needs to know about value.  public is workaround
19                 // so source will compile
20                 public byte value;
21
22                 public int CompareTo (object v)
23                 {
24                         if (!(v is System.Byte))
25                                 throw new ArgumentException ("Value is not a System.Byte");
26
27                         return value - ((byte) v);
28                 }
29
30                 public override bool Equals (object o)
31                 {
32                         if (!(o is System.Byte))
33                                 return false;
34
35                         return ((byte) o) == value;
36                 }
37
38                 public override int GetHashCode ()
39                 {
40                         return value;
41                 }
42
43                 public static byte Parse (string s)
44                 {
45                         return Parse (s, NumberStyles.Integer, null);
46                 }
47
48                 public static byte Parse (string s, IFormatProvider fp)
49                 {
50                         return Parse (s, NumberStyles.Integer, fp);
51                 }
52
53                 public static byte Parse (string s, NumberStyles style)
54                 {
55                         return Parse (s, style, null);
56                 }
57
58                 public static byte Parse (string s, NumberStyles style, IFormatProvider fp)
59                 {
60                         // TODO: Implement me
61                         return 0;
62                 }
63
64                 public override string ToString ()
65                 {
66                         return ToString ("G", null);
67                 }
68
69                 public string ToString (IFormatProvider fp)
70                 {
71                         return ToString ("G", fp);
72                 }
73
74                 public string ToString (string format)
75                 {
76                         return ToString (format, null);
77                 }
78
79                 public string ToString (string format, IFormatProvider fp)
80                 {
81                         // TODO: Implement me.
82                         return "";
83                 }
84
85                 // =========== IConvertible Methods =========== //
86                 
87                 public TypeCode GetTypeCode ()
88                 {
89                         return TypeCode.Byte;
90                 }
91         }
92 }