Mono Class Library: System.Type Overview | Members

System.Type.DefaultBinder Property

Gets the default binder used by the system.

public static System.Reflection.Binder DefaultBinder { get; }

Value

The default System.Reflection.Binder used by the system.

Remarks

This property is read-only.

Reflection models the accessibility rules of the common type system. For example, if the caller is in the same assembly, the caller does not need special permissions for internal members. Otherwise, the caller needs System.Security.Permissions.ReflectionPermission . This is consistent with lookup of members that are protected, private, and so on.

Note: The general principle is that System.Reflection.Binder.ChangeType(object, Type, System.Globalization.CultureInfo) typically performs only widening coercions, which never lose data. An example of a widening coercion is coercing a value that is a 32-bit signed integer to a value that is a 64-bit signed integer. This is distinguished from a narrowing coercion, which can lose data. An example of a narrowing coercion is coercing a 64-bit signed integer to a 32-bit signed integer.

The following table lists the coercions performed by the default binder's implementation of ChangeType.

Source TypeTarget Type
Any typeIts base type.
Any typeThe interface it implements.
CharUnt16, UInt32, Int32, UInt64, Int64, Single, Double
ByteChar, Unt16, Int16, UInt32, Int32, UInt64, Int64, Single, Double
SByteInt16, Int32, Int64, Single, Double
UInt16UInt32, Int32, UInt64, Int64, Single, Double
Int16Int32, Int64, Single, Double
UInt32UInt64, Int64, Single, Double
Int32Int64, Single, Double
UInt64Single, Double
Int64Single, Double
SingleDouble
Non-referenceBy-reference.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0