Photon Fusion 2.0.9

Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
SerializableType< BaseType > Struct Template Reference

A System.Type wrapper that can be serialized. More...

Inherits IEquatable< SerializableType >, and IEquatable< SerializableType< BaseType >>.

Public Member Functions

readonly SerializableType AsShort ()
 Converts AssemblyQualifiedName and returns a short form, without version, culture etc. More...
 
readonly SerializableType< BaseType > AsShort ()
 
readonly override bool Equals (object obj)
 Returns true if obj is SerializableType and the AssemblyQualifiedName is the same. More...
 
readonly override bool Equals (object obj)
 
readonly bool Equals (SerializableType other)
 Returns true if the AssemblyQualifiedName is the same. More...
 
readonly bool Equals (SerializableType< BaseType > other)
 
readonly override int GetHashCode ()
 Returns the hash code of the AssemblyQualifiedName. More...
 
readonly override int GetHashCode ()
 
 SerializableType (string type)
 Create a new instance and stores type as AssemblyQualifiedName. More...
 
 SerializableType (Type type)
 Create a new instance and stores full Type.AssemblyQualifiedName. To use shorter form, use AsShort. More...
 
 SerializableType (Type type)
 

Static Public Member Functions

static string GetShortAssemblyQualifiedName (Type type)
 Converts the Type.AssemblyQualifiedName to a shorter form, without version, culture etc. More...
 
static implicit operator SerializableType (Type type)
 Implicitly convert a Type to a SerializableType. More...
 
static implicit operator SerializableType< BaseType > (Type type)
 
static implicit operator Type (SerializableType serializableType)
 Implicitly convert a SerializableType to a Type. More...
 
static implicit operator Type (SerializableType< BaseType > serializableType)
 

Public Attributes

string AssemblyQualifiedName
 Type's assembly qualified name. More...
 

Properties

readonly bool IsValid [get]
 Is the type valid. More...
 
readonly Type Value [get]
 Retrieve the type. The value is obtained using Type.GetType(string) and cached in a static More...
 

Detailed Description

A System.Type wrapper that can be serialized.

A generic version of SerializableType that can be used to store types that inherit from a specific base type.

Template Parameters
BaseTypeThe base type of the type stored

Constructor & Destructor Documentation

◆ SerializableType() [1/2]

SerializableType ( Type  type)

Create a new instance and stores full Type.AssemblyQualifiedName. To use shorter form, use AsShort.

Parameters
typeType to store. Can be null.

◆ SerializableType() [2/2]

SerializableType ( string  type)

Create a new instance and stores type as AssemblyQualifiedName.

Parameters
typeType name.

Member Function Documentation

◆ AsShort()

readonly SerializableType AsShort ( )

Converts AssemblyQualifiedName and returns a short form, without version, culture etc.

◆ Equals() [1/2]

readonly override bool Equals ( object  obj)

Returns true if obj is SerializableType and the AssemblyQualifiedName is the same.

◆ Equals() [2/2]

readonly bool Equals ( SerializableType< BaseType >  other)

Returns true if the AssemblyQualifiedName is the same.

◆ GetHashCode()

readonly override int GetHashCode ( )

Returns the hash code of the AssemblyQualifiedName.

◆ GetShortAssemblyQualifiedName()

static string GetShortAssemblyQualifiedName ( Type  type)
static

Converts the Type.AssemblyQualifiedName to a shorter form, without version, culture etc.

◆ operator SerializableType()

static implicit operator SerializableType ( Type  type)
static

Implicitly convert a Type to a SerializableType.

◆ operator Type()

static implicit operator Type ( SerializableType< BaseType >  serializableType)
static

Implicitly convert a SerializableType to a Type.

Member Data Documentation

◆ AssemblyQualifiedName

string AssemblyQualifiedName

Type's assembly qualified name.

Property Documentation

◆ IsValid

readonly bool IsValid
get

Is the type valid.

◆ Value

readonly Type Value
get

Retrieve the type. The value is obtained using Type.GetType(string) and cached in a static