SerializationInfo.GetValue Method (String, Type)
.NET Framework (current version)
Retrieves a value from the SerializationInfo store.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- name
-
Type:
System.String
The name associated with the value to retrieve.
- type
-
Type:
System.Type
The Type of the value to retrieve. If the stored value cannot be converted to this type, the system will throw a InvalidCastException.
| Exception | Condition |
|---|---|
| ArgumentNullException | name or type is null. |
| InvalidCastException | The value associated with name cannot be converted to type. |
| SerializationException | An element with the specified name is not found in the current instance. |
If the data stored in the SerializationInfo is of the type requested (or one of its derived classes), that value is returned directly. Otherwise, IFormatterConverter.Convert is called to convert it to the appropriate type.
The value returned by the GetValue method can always be safely cast to the type specified in the type parameter.
.NET Framework
Available since 1.1
Available since 1.1
Show: