Class InfoReader
- Namespace
- CADability
- Assembly
- CADability.dll
Encapsulates the SerializationInfo.GetInfo function
public class InfoReader
- Inheritance
-
InfoReader
- Inherited Members
Constructors
InfoReader()
public InfoReader()
Methods
Read(SerializationInfo, string, Type)
Reads the requested object. Returns null if the object cannot be read. Calls info.GetValue(key,type).
public static object Read(SerializationInfo info, string key, Type type)
Parameters
infoSerializationInfothe SerializationInfo object
keystringthe name of the object
typeTypethe type of the requested object
Returns
- object
the object or null
ReadBool(object)
public static bool ReadBool(object val)
Parameters
valobject
Returns
ReadOrCreate(SerializationInfo, string, Type, params object[])
Reads or creates the requested object. Calls info.GetValue(key,type). If the object cannot be read, this method tries to invoke a constructor for the object with the given parameters. If the constructor invokation fails null will be returned.
public static object ReadOrCreate(SerializationInfo info, string key, Type type, params object[] args)
Parameters
infoSerializationInfothe SerializationInfo object
keystringthe name of the object
typeTypethe type of the requested object
argsobject[]parameters for the constructor
Returns
- object
the read or created object