mscorlib(4.0.0.0) API with additions
FormatterConverter.cs
3 
5 {
7  [ComVisible(true)]
9  {
15  public object Convert(object value, Type type)
16  {
17  if (value == null)
18  {
19  throw new ArgumentNullException("value");
20  }
22  }
23 
29  public object Convert(object value, TypeCode typeCode)
30  {
31  if (value == null)
32  {
33  throw new ArgumentNullException("value");
34  }
35  return System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture);
36  }
37 
42  public bool ToBoolean(object value)
43  {
44  if (value == null)
45  {
46  throw new ArgumentNullException("value");
47  }
49  }
50 
55  public char ToChar(object value)
56  {
57  if (value == null)
58  {
59  throw new ArgumentNullException("value");
60  }
62  }
63 
68  [CLSCompliant(false)]
69  public sbyte ToSByte(object value)
70  {
71  if (value == null)
72  {
73  throw new ArgumentNullException("value");
74  }
76  }
77 
82  public byte ToByte(object value)
83  {
84  if (value == null)
85  {
86  throw new ArgumentNullException("value");
87  }
89  }
90 
95  public short ToInt16(object value)
96  {
97  if (value == null)
98  {
99  throw new ArgumentNullException("value");
100  }
102  }
103 
108  [CLSCompliant(false)]
109  public ushort ToUInt16(object value)
110  {
111  if (value == null)
112  {
113  throw new ArgumentNullException("value");
114  }
116  }
117 
122  public int ToInt32(object value)
123  {
124  if (value == null)
125  {
126  throw new ArgumentNullException("value");
127  }
129  }
130 
135  [CLSCompliant(false)]
136  public uint ToUInt32(object value)
137  {
138  if (value == null)
139  {
140  throw new ArgumentNullException("value");
141  }
143  }
144 
149  public long ToInt64(object value)
150  {
151  if (value == null)
152  {
153  throw new ArgumentNullException("value");
154  }
156  }
157 
162  [CLSCompliant(false)]
163  public ulong ToUInt64(object value)
164  {
165  if (value == null)
166  {
167  throw new ArgumentNullException("value");
168  }
170  }
171 
176  public float ToSingle(object value)
177  {
178  if (value == null)
179  {
180  throw new ArgumentNullException("value");
181  }
183  }
184 
189  public double ToDouble(object value)
190  {
191  if (value == null)
192  {
193  throw new ArgumentNullException("value");
194  }
196  }
197 
202  public decimal ToDecimal(object value)
203  {
204  if (value == null)
205  {
206  throw new ArgumentNullException("value");
207  }
209  }
210 
215  public DateTime ToDateTime(object value)
216  {
217  if (value == null)
218  {
219  throw new ArgumentNullException("value");
220  }
222  }
223 
228  public string ToString(object value)
229  {
230  if (value == null)
231  {
232  throw new ArgumentNullException("value");
233  }
235  }
236  }
237 }
Converts a base data type to another base data type.
Definition: Convert.cs:10
byte ToByte(object value)
Converts a value to an 8-bit unsigned integer.
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
static long ToInt64(object value)
Converts the value of the specified object to a 64-bit signed integer.
Definition: Convert.cs:2506
string ToString(object value)
Converts the specified object to a T:System.String.
static double ToDouble(object value)
Converts the value of the specified object to a double-precision floating-point number.
Definition: Convert.cs:3189
uint ToUInt32(object value)
Converts a value to a 32-bit unsigned integer.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Provides the connection between an instance of T:System.Runtime.Serialization.SerializationInfo and t...
decimal ToDecimal(object value)
Converts a value to a T:System.Decimal.
DateTime ToDateTime(object value)
Converts a value to a T:System.DateTime.
bool ToBoolean(object value)
Converts a value to a T:System.Boolean.
TypeCode
Specifies the type of an object.
Definition: TypeCode.cs:9
static float ToSingle(object value)
Converts the value of the specified object to a single-precision floating-point number.
Definition: Convert.cs:2982
Definition: __Canon.cs:3
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
Definition: DateTime.cs:13
char ToChar(object value)
Converts a value to a Unicode character.
int ToInt32(object value)
Converts a value to a 32-bit signed integer.
static char ToChar(object value)
Converts the value of the specified object to a Unicode character.
Definition: Convert.cs:670
sbyte ToSByte(object value)
Converts a value to a T:System.SByte.
static bool ToBoolean(object value)
Converts the value of a specified object to an equivalent Boolean value.
Definition: Convert.cs:457
object Convert(object value, Type type)
Converts a value to the given T:System.Type.
object Convert(object value, TypeCode typeCode)
Converts a value to the given T:System.TypeCode.
static ushort ToUInt16(object value)
Converts the value of the specified object to a 16-bit unsigned integer.
Definition: Convert.cs:1707
static DateTime ToDateTime(DateTime value)
Returns the specified T:System.DateTime object; no actual conversion is performed.
Definition: Convert.cs:3597
static sbyte ToSByte(object value)
Converts the value of the specified object to an 8-bit signed integer.
Definition: Convert.cs:909
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
static object ChangeType(object value, TypeCode typeCode)
Returns an object of the specified type whose value is equivalent to the specified object.
Definition: Convert.cs:155
ulong ToUInt64(object value)
Converts a value to a 64-bit unsigned integer.
static uint ToUInt32(object value)
Converts the value of the specified object to a 32-bit unsigned integer.
Definition: Convert.cs:2235
static decimal ToDecimal(object value)
Converts the value of the specified object to an equivalent decimal number.
Definition: Convert.cs:3394
Represents a base implementation of the T:System.Runtime.Serialization.IFormatterConverter interface ...
float ToSingle(object value)
Converts a value to a single-precision floating-point number.
static byte ToByte(object value)
Converts the value of the specified object to an 8-bit unsigned integer.
Definition: Convert.cs:1186
static short ToInt16(object value)
Converts the value of the specified object to a 16-bit signed integer.
Definition: Convert.cs:1452
static string ToString(object value)
Converts the value of the specified object to its equivalent string representation.
Definition: Convert.cs:3793
ushort ToUInt16(object value)
Converts a value to a 16-bit unsigned integer.
long ToInt64(object value)
Converts a value to a 64-bit signed integer.
double ToDouble(object value)
Converts a value to a double-precision floating-point number.
static ulong ToUInt64(object value)
Converts the value of the specified object to a 64-bit unsigned integer.
Definition: Convert.cs:2727
static int ToInt32(object value)
Converts the value of the specified object to a 32-bit signed integer.
Definition: Convert.cs:1974
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
short ToInt16(object value)
Converts a value to a 16-bit signed integer.