5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
10 using System.Globalization;
14 public struct Byte : IComparable, IFormattable { //, IConvertible {
15 public const byte MinValue = 0;
16 public const byte MaxValue = 255;
18 // VES needs to know about value. public is workaround
19 // so source will compile
22 public int CompareTo (object v)
24 if (!(v is System.Byte))
25 throw new ArgumentException ("Value is not a System.Byte");
27 return value - ((byte) v);
30 public override bool Equals (object o)
32 if (!(o is System.Byte))
35 return ((byte) o) == value;
38 public override int GetHashCode ()
43 public static byte Parse (string s)
45 return Parse (s, NumberStyles.Integer, null);
48 public static byte Parse (string s, IFormatProvider fp)
50 return Parse (s, NumberStyles.Integer, fp);
53 public static byte Parse (string s, NumberStyles style)
55 return Parse (s, style, null);
58 public static byte Parse (string s, NumberStyles style, IFormatProvider fp)
64 public override string ToString ()
66 return ToString ("G", null);
69 public string ToString (IFormatProvider fp)
71 return ToString ("G", fp);
74 public string ToString (string format)
76 return ToString (format, null);
79 public string ToString (string format, IFormatProvider fp)
81 // TODO: Implement me.
85 // =========== IConvertible Methods =========== //
87 public TypeCode GetTypeCode ()