OK, we will see. First, some data types are built into the CLR. They cannot be changed or new ones added, as they are part of the standard. Here you can find a list here or here . This is C #, but the list must also exist for VB.net somewhere, and it should look equal, because the underlying CLR is the same. Also, the list is not complete because floats and char are missing, but you get the idea.
But then there are some structures that encapsulate these data types and add some additional features. For example, System.Int32 is just a standard structure, without magic. Feel free to look at it in Reflector, this is in mscorlib:
[Serializable, StructLayout(LayoutKind.Sequential), ComVisible(true)] public struct Int32 : IComparable, IFormattable, IConvertible, IComparable<int>, IEquatable<int>
So you want your own “1 to 10” Integer? Then I recommend looking at the closest suitable type, which is either Int16 or Byte . If you look at them, you will see that they all look somewhat similar, but they are based on one of the built-in data types.
Just copying / pasting and changing some of the built-in structures (i.e. System.Byte ) does not fully work because some members are internal (i.e. NumberFormatInfo.ValidateParseStyleInteger ), but Reflector can help here.
source share