The Labs \ Source Viewer \ SSCLI \ System \ TypeCode

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. // The TypeCode enum represents the type code of an object. To obtain the
  16. // TypeCode for a given object, use the Value.GetTypeCode() method. The
  17. // TypeCode.Empty value represents a null object reference. The TypeCode.Object
  18. // value represents an object that doesn't implement the IValue interface. The
  19. // TypeCode.DBNull value represents the database null, which is distinct and
  20. // different from a null reference. The other type codes represent values that
  21. // use the given simple type encoding.
  22. //
  23. // Note that when an object has a given TypeCode, there is no guarantee that
  24. // the object is an instance of the corresponding System.XXX value class. For
  25. // example, an object with the type code TypeCode.Int32 might actually be an
  26. // instance of a nullable 32-bit integer type (with a value that isn't the
  27. // database null).
  28. //
  29. // There are no type codes for "Missing", "Error", "IDispatch", and "IUnknown".
  30. // These types of values are instead represented as classes. When the type code
  31. // of an object is TypeCode.Object, a further instance-of check can be used to
  32. // determine if the object is one of these values.
  33. namespace System
  34. {
  35.     [Serializable()]
  36.     [System.Runtime.InteropServices.ComVisible(true)]
  37.     public enum TypeCode
  38.     {
  39.         Empty = 0,
  40.         // Null reference
  41.         Object = 1,
  42.         // Instance that isn't a value
  43.         DBNull = 2,
  44.         // Database null value
  45.         Boolean = 3,
  46.         // Boolean
  47.         Char = 4,
  48.         // Unicode character
  49.         SByte = 5,
  50.         // Signed 8-bit integer
  51.         Byte = 6,
  52.         // Unsigned 8-bit integer
  53.         Int16 = 7,
  54.         // Signed 16-bit integer
  55.         UInt16 = 8,
  56.         // Unsigned 16-bit integer
  57.         Int32 = 9,
  58.         // Signed 32-bit integer
  59.         UInt32 = 10,
  60.         // Unsigned 32-bit integer
  61.         Int64 = 11,
  62.         // Signed 64-bit integer
  63.         UInt64 = 12,
  64.         // Unsigned 64-bit integer
  65.         Single = 13,
  66.         // IEEE 32-bit float
  67.         Double = 14,
  68.         // IEEE 64-bit double
  69.         Decimal = 15,
  70.         // Decimal
  71.         DateTime = 16,
  72.         // DateTime
  73.         String = 18
  74.         // Unicode character string
  75.     }
  76. }

Developer Fusion