Show / Hide Table of Contents

Class TypeResolver

Used only by WCF (SScada). TODO: the sub folder ExpressionSerializer can be removed (?)

Inheritance
object
TypeResolver
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Serialization
Assembly: Sartorius.SAF.dll
Syntax
public sealed class TypeResolver

Constructors

View Source

TypeResolver(IEnumerable<Assembly>, IEnumerable<Type>)

Relying on the constructor only, to load all possible (including IEnumerable, IQueryable, Nullable, Array) Types into memory, may not scale well.

Declaration
public TypeResolver(IEnumerable<Assembly> assemblies = null, IEnumerable<Type> knownTypes = null)
Parameters
Type Name Description
IEnumerable<Assembly> assemblies
IEnumerable<Type> knownTypes

Properties

View Source

KnownTypes

KnownTypes for DataContractSerializer. Only needs to hold the element type, not the collection or array type.

Declaration
public ReadOnlyCollection<Type> KnownTypes { get; }
Property Value
Type Description
ReadOnlyCollection<Type>

Methods

View Source

GetBaseTypes(Type)

Declaration
public static IEnumerable<Type> GetBaseTypes(Type expectedType)
Parameters
Type Name Description
Type expectedType
Returns
Type Description
IEnumerable<Type>
View Source

GetDerivedTypes(Type)

For determining KnownType(s) to declare on a DataContract

Declaration
public static List<Type> GetDerivedTypes(Type baseType)
Parameters
Type Name Description
Type baseType
Returns
Type Description
List<Type>
View Source

GetElementType(Type)

Declaration
public static Type GetElementType(Type collectionType)
Parameters
Type Name Description
Type collectionType
Returns
Type Description
Type
View Source

GetMethod(Type, string, Type[], Type[])

Declaration
public static MethodInfo GetMethod(Type declaringType, string name, Type[] parameterTypes, Type[] genArgTypes)
Parameters
Type Name Description
Type declaringType
string name
Type[] parameterTypes
Type[] genArgTypes
Returns
Type Description
MethodInfo
View Source

GetOrCreateAnonymousTypeFor(string, NameTypePair[], NameTypePair[])

Declaration
public Type GetOrCreateAnonymousTypeFor(string name, NameTypePair[] properties, NameTypePair[] ctrParams)
Parameters
Type Name Description
string name
NameTypePair[] properties
NameTypePair[] ctrParams
Returns
Type Description
Type
View Source

GetType(string)

Declaration
public Type GetType(string typeName)
Parameters
Type Name Description
string typeName
Returns
Type Description
Type
View Source

GetType(string, IEnumerable<Type>)

Declaration
public Type GetType(string typeName, IEnumerable<Type> genericArgumentTypes)
Parameters
Type Name Description
string typeName
IEnumerable<Type> genericArgumentTypes
Returns
Type Description
Type
View Source

HasBaseType(Type, Type)

Declaration
public static bool HasBaseType(Type thisType, Type baseType)
Parameters
Type Name Description
Type thisType
Type baseType
Returns
Type Description
bool
View Source

HasInheritedProperty(Type, PropertyInfo)

Declaration
public static bool HasInheritedProperty(Type declaringType, PropertyInfo pInfo)
Parameters
Type Name Description
Type declaringType
PropertyInfo pInfo
Returns
Type Description
bool
View Source

HasMappedKnownType(Type)

Declaration
public bool HasMappedKnownType(Type input)
Parameters
Type Name Description
Type input
Returns
Type Description
bool
View Source

HasMappedKnownType(Type, out Type)

Checks if the input Type is "mapped" or otherwise somehow related (e.g. Array) to a KnownType found in this.KnownTypes.

Declaration
public bool HasMappedKnownType(Type input, out Type knownType)
Parameters
Type Name Description
Type input
Type knownType
Returns
Type Description
bool
View Source

IsIEnumerableOf(Type, Type)

Declaration
public static bool IsIEnumerableOf(Type enumerableType, Type elementType)
Parameters
Type Name Description
Type enumerableType

the candidate enumerable Type in question

Type elementType

is the candidate type a IEnumerable of elementType

Returns
Type Description
bool
View Source

IsNullableType(Type)

Declaration
public static bool IsNullableType(Type t)
Parameters
Type Name Description
Type t
Returns
Type Description
bool
View Source

ToGenericTypeFullNameString(Type)

Declaration
public static string ToGenericTypeFullNameString(Type t)
Parameters
Type Name Description
Type t
Returns
Type Description
string
View Source

ToGenericTypeNameString(Type)

Declaration
public static string ToGenericTypeNameString(Type t)
Parameters
Type Name Description
Type t
Returns
Type Description
string

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX