UInt32.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // System.UInt32.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. using System.Globalization;
  10. namespace System {
  11. public struct UInt32 : IComparable, IFormattable { //, IConvertible {
  12. public const uint MaxValue = 0xffffffff;
  13. public const uint MinValue = 0;
  14. public uint value;
  15. public int CompareTo (object v)
  16. {
  17. if (!(v is System.UInt32))
  18. throw new ArgumentException ("Value is not a System.UInt32");
  19. if (value == (uint) v)
  20. return 0;
  21. if (value < (uint) v)
  22. return -1;
  23. return 1;
  24. }
  25. public override bool Equals (object o)
  26. {
  27. if (!(o is System.UInt32))
  28. return false;
  29. return ((uint) o) == value;
  30. }
  31. public override int GetHashCode ()
  32. {
  33. return (int) value;
  34. }
  35. public static uint Parse (string s)
  36. {
  37. return Parse (s, NumberStyles.Integer, null);
  38. }
  39. public static uint Parse (string s, IFormatProvider fp)
  40. {
  41. return Parse (s, NumberStyles.Integer, fp);
  42. }
  43. public static uint Parse (string s, NumberStyles style)
  44. {
  45. return Parse (s, style, null);
  46. }
  47. public static uint Parse (string s, NumberStyles style, IFormatProvider fp)
  48. {
  49. // TODO: Implement me
  50. return 0;
  51. }
  52. public override string ToString ()
  53. {
  54. return ToString ("G", null);
  55. }
  56. public string ToString (IFormatProvider fp)
  57. {
  58. return ToString ("G", fp);
  59. }
  60. public string ToString (string format)
  61. {
  62. return ToString (format, null);
  63. }
  64. public string ToString (string format, IFormatProvider fp)
  65. {
  66. // TODO: Implement me.
  67. return "";
  68. }
  69. // =========== IConvertible Methods =========== //
  70. public TypeCode GetTypeCode ()
  71. {
  72. return TypeCode.UInt32;
  73. }
  74. }
  75. }