Show / Hide Table of Contents

Class TypeRegistry

Provides a registry of types, types that do not need to be described in a serialization stream

Inheritance
System.Object
TypeRegistry
Implements
System.Collections.Generic.IEnumerable<System.Type>
System.Collections.IEnumerable
System.Runtime.Serialization.ISerializable
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: NFX.Serialization.Slim
Assembly: NFX.dll
Syntax
[Serializable]
public sealed class TypeRegistry : IEnumerable<Type>, IEnumerable, ISerializable

Constructors

TypeRegistry(IEnumerable<Type>[])

Initializes TypeRegistry with types from other sources

Declaration
public TypeRegistry(params IEnumerable<Type>[] others)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Type>[] others

Fields

NULL_HANDLE

Denotes a special type which is object==null

Declaration
public static readonly VarIntStr NULL_HANDLE
Field Value
Type Description
VarIntStr

Properties

BoxedCommonNullableTypes

Returns common nullable types - use when much boxing is expected

Declaration
public static IEnumerable<Type> BoxedCommonNullableTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

BoxedCommonTypes

Returns common primitive types - use when much boxing is expected

Declaration
public static IEnumerable<Type> BoxedCommonTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

CommonCollectionTypes

Returns frequently-used generic collections

Declaration
public static IEnumerable<Type> CommonCollectionTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

Count

How many items in the registry

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

CSum

Returns quick checksum of type registry contents. It is updated when new types get added into the registry

Declaration
public ulong CSum { get; }
Property Value
Type Description
System.UInt64

DataAccessCRUDTypes

Returns common types for DataAccess.CRUD

Declaration
public static IEnumerable<Type> DataAccessCRUDTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

GlueProtocolTypes

Returns Glue protocol specific types

Declaration
public static IEnumerable<Type> GlueProtocolTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

Item[VarIntStr]

Returns type by handle i.e. VarIntStr(1) or VarIntStr("full name"). Throws in case of error

Declaration
public Type this[VarIntStr handle] { get; }
Parameters
Type Name Description
VarIntStr handle
Property Value
Type Description
System.Type

Item[String]

Returns type by handle i.e. '$11' or full name. Throws in case of error

Declaration
public Type this[string handle] { get; }
Parameters
Type Name Description
System.String handle
Property Value
Type Description
System.Type

PODTypes

Returns PortableObjectDocument types

Declaration
public static IEnumerable<Type> PODTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

Methods

Add(Type)

Adds the type if it not already in registry and returns true

Declaration
public bool Add(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Boolean

GetEnumerator()

Declaration
public IEnumerator<Type> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Type>

GetTypeHandle(Type)

Returns a VarIntStr with the type index formatted as handle if type exists in registry, or fully qualified type name otherwise

Declaration
public VarIntStr GetTypeHandle(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
VarIntStr

GetTypeHandleAsString(Type)

Returns a string with the type index formatted as handle if type exists in registry, or fully qualified type name otherwise

Declaration
public string GetTypeHandleAsString(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.String

IsNullHandle(VarIntStr)

Declaration
public static bool IsNullHandle(VarIntStr handle)
Parameters
Type Name Description
VarIntStr handle
Returns
Type Description
System.Boolean

IsNullHandle(String)

Declaration
public static bool IsNullHandle(string handle)
Parameters
Type Name Description
System.String handle
Returns
Type Description
System.Boolean

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info
System.Runtime.Serialization.StreamingContext context

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.Runtime.Serialization.ISerializable

Extension Methods

CollectionUtils.ForEach<T>(IEnumerable<T>, Action<T>)
CollectionUtils.ForEach<T>(IEnumerable<T>, Action<T, Int32>)
CollectionUtils.SkipLast<T>(IEnumerable<T>)
CollectionUtils.SkipLast<T>(IEnumerable<T>, Int32)
CollectionUtils.FirstMin<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>)
CollectionUtils.FirstMin<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>, out TComparand)
CollectionUtils.FirstMax<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>)
CollectionUtils.FirstMax<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>, out TComparand)
CollectionUtils.FirstOrAnyOrDefault<TResult>(IEnumerable<TResult>, Func<TResult, Boolean>)
CollectionUtils.Distinct<TResult, TKey>(IEnumerable<TResult>, Func<TResult, TKey>)
MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
LookAheadExtensions.AsLookAheadEnumerable<T>(IEnumerable<T>)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX