Show / Hide Table of Contents

Class InfoReader

Encapsulates the SerializationInfo.GetInfo function

Inheritance
System.Object
InfoReader
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability
Assembly: CADability.dll
Syntax
public class InfoReader

Methods

| Improve this Doc View Source

Read(SerializationInfo, String, Type)

Reads the requested object. Returns null if the object cannot be read. Calls info.GetValue(key,type).

Declaration
public static object Read(SerializationInfo info, string key, Type type)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

the SerializationInfo object

System.String key

the name of the object

System.Type type

the type of the requested object

Returns
Type Description
System.Object

the object or null

| Improve this Doc View Source

ReadBool(Object)

Declaration
public static bool ReadBool(object val)
Parameters
Type Name Description
System.Object val
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ReadOrCreate(SerializationInfo, String, Type, 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.

Declaration
public static object ReadOrCreate(SerializationInfo info, string key, Type type, params object[] args)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

the SerializationInfo object

System.String key

the name of the object

System.Type type

the type of the requested object

System.Object[] args

parameters for the constructor

Returns
Type Description
System.Object

the read or created object

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX