System.Runtime.Serialization.FormatterConverter Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.Serialization
Summary
Represents a base implementation of the IFormatterConverter interface that uses the Convert class and the IConvertible interface.
C# Syntax:
public class FormatterConverter : IFormatterConverter
See also:
System.Runtime.Serialization Namespace

System.Runtime.Serialization.FormatterConverter Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the FormatterConverter class.
Public Methods
Convert Overloaded:
Convert(object value, Type type)

Converts a value to the given Type.
Convert Overloaded:
Convert(object value, TypeCode typeCode)

Converts a value to the given TypeCode.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToBoolean Converts a value to a Boolean.
ToByte Converts a value to an 8-bit unsigned integer.
ToChar Converts a value to a Unicode character.
ToDateTime Converts a value to a DateTime.
ToDecimal Converts a value to a Decimal.
ToDouble Converts a value to a double-precision floating-point number.
ToInt16 Converts a value to a 16-bit signed integer.
ToInt32 Converts a value to a 32-bit signed integer.
ToInt64 Converts a value to a 64-bit signed integer.
ToSByte Converts a value to an SByte.
ToSingle Converts a value to a single-precision floating-point number.
ToString
(inherited from System.Object)
Overloaded:
ToString()

See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
ToString Overloaded:
ToString(object value)

Converts the specified object to a String.
ToUInt16 Converts a value to a 16-bit unsigned integer.
ToUInt32 Converts a value to a 32-bit unsigned integer.
ToUInt64 Converts a value to a 64-bit unsigned integer.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Runtime.Serialization.FormatterConverter Member Details

ctor #1
Summary
Initializes a new instance of the FormatterConverter class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public FormatterConverter();

Return to top


Overloaded Method: Convert(
   object value,
   Type type
)
Summary
Converts a value to the given Type.
C# Syntax:
public object Convert(
   object value,
   Type type
);
Parameters:

value

The object to convert.

type

The Type into which value is converted.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.Convert

Return to top


Overloaded Method: Convert(
   object value,
   TypeCode typeCode
)
Summary
Converts a value to the given TypeCode.
C# Syntax:
public object Convert(
   object value,
   TypeCode typeCode
);
Parameters:

value

The object to convert.

typeCode

The TypeCode into which value is converted.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.Convert

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~FormatterConverter();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToBoolean(
   object value
)
Summary
Converts a value to a Boolean.
C# Syntax:
public bool ToBoolean(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToBoolean
Remarks
Implementation of the method is the same as Convert.ToBoolean. For more information, see Boolean, Convert and ValueType.)

Return to top


Method: ToByte(
   object value
)
Summary
Converts a value to an 8-bit unsigned integer.
C# Syntax:
public byte ToByte(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToByte
Remarks
Implementation of the method is the same as Convert.ToByte. For more information, see Byte, Convert and ValueType.

Return to top


Method: ToChar(
   object value
)
Summary
Converts a value to a Unicode character.
C# Syntax:
public char ToChar(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToChar
Remarks
Implementation of the method is the same as Convert.ToChar. For more information, see Char, Convert and ValueType.

Return to top


Method: ToDateTime(
   object value
)
Summary
Converts a value to a DateTime.
C# Syntax:
public DateTime ToDateTime(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToDateTime
Remarks
Implementation of the method is the same as Convert.ToDateTime. For more information, see DateTime, Convert and ValueType.

Return to top


Method: ToDecimal(
   object value
)
Summary
Converts a value to a Decimal.
C# Syntax:
public decimal ToDecimal(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToDecimal
Remarks
Implementation of the method is the same as Convert.ToDecimal. For more information, see Decimal, Convert and ValueType.

Return to top


Method: ToDouble(
   object value
)
Summary
Converts a value to a double-precision floating-point number.
C# Syntax:
public double ToDouble(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToDouble
Remarks
Implementation of the method is the same as Convert.ToDouble. For more information, see Double, Convert and ValueType.

Return to top


Method: ToInt16(
   object value
)
Summary
Converts a value to a 16-bit signed integer.
C# Syntax:
public short ToInt16(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToInt16
Remarks
Implementation of the method is the same as Convert.ToInt16. For more information, see Int16, Convert and ValueType.

Return to top


Method: ToInt32(
   object value
)
Summary
Converts a value to a 32-bit signed integer.
C# Syntax:
public int ToInt32(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToInt32
Remarks
Implementation of the method is the same as Convert.ToInt32. For more information, see Int32, Convert and ValueType.

Return to top


Method: ToInt64(
   object value
)
Summary
Converts a value to a 64-bit signed integer.
C# Syntax:
public long ToInt64(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToInt64
Remarks
Implementation of the method is the same as Convert.ToInt64. For more information, see Int64, Convert and ValueType.

Return to top


Method: ToSByte(
   object value
)
Summary
Converts a value to an SByte.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public sbyte ToSByte(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToSByte
Remarks
Implementation of the method is the same as Convert.ToSByte. For more information, see SByte, Convert and ValueType.

Return to top


Method: ToSingle(
   object value
)
Summary
Converts a value to a single-precision floating-point number.
C# Syntax:
public float ToSingle(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToSingle
Remarks
Implementation of the method is the same as Convert.ToSingle. For more information, see Single, Convert and ValueType.

Return to top


Overloaded Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Overloaded Method: ToString(
   object value
)
Summary
Converts the specified object to a String.
C# Syntax:
public string ToString(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToString
Remarks
Implementation of the method is the same as Convert.ToString. For more information, see String, Convert and ValueType.

Return to top


Method: ToUInt16(
   object value
)
Summary
Converts a value to a 16-bit unsigned integer.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public ushort ToUInt16(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToUInt16
Remarks
Implementation of the method is the same as Convert.ToUInt16. For more information, see UInt16, Convert and ValueType.

Return to top


Method: ToUInt32(
   object value
)
Summary
Converts a value to a 32-bit unsigned integer.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public uint ToUInt32(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToUInt32
Remarks
Implementation of the method is the same as Convert.ToUInt32. For more information, see UInt32, Convert and ValueType.

Return to top


Method: ToUInt64(
   object value
)
Summary
Converts a value to a 64-bit unsigned integer.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public ulong ToUInt64(
   object value
);
Parameters:

value

The object to convert.

Return Value:
The converted value, or null if the type parameter is null.
Exceptions
Exception Type Condition
ArgumentNullException The value parameter is null.
Implements:
IFormatterConverter.ToUInt64
Remarks
Implementation of the method is the same as Convert.ToUInt64. For more information, see UInt64, Convert and ValueType.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.