Version 3.3.1.2

DeserializationContext class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public sealed class DeserializationContext : ICacheNotificationReceiver
The context of a given deserialization session. This class maintains all internal and external references during deserialization.
Inheritance
  • System.Object
  • DeserializationContext
See Also
  • Sirenix.Serialization.Utilities.ICacheNotificationReceiver

Constructors

DeserializationContext()
Initializes a new instance of the DeserializationContext class.
public DeserializationContext()
DeserializationContext(FormatterConverter)
Initializes a new instance of the DeserializationContext class.
public DeserializationContext(FormatterConverter formatterConverter)
Parameters
System.Runtime.Serialization.FormatterConverter formatterConverter

The formatter converter to use.

DeserializationContext(StreamingContext)
Initializes a new instance of the DeserializationContext class.
public DeserializationContext(StreamingContext context)
Parameters
System.Runtime.Serialization.StreamingContext context

The streaming context to use.

DeserializationContext(StreamingContext, FormatterConverter)
Initializes a new instance of the DeserializationContext class.
public DeserializationContext(StreamingContext context, FormatterConverter formatterConverter)
Parameters
System.Runtime.Serialization.StreamingContext context

The streaming context to use.

System.Runtime.Serialization.FormatterConverter formatterConverter

The formatter converter to use.

Exceptions
System.ArgumentNullException

The formatterConverter parameter is null.

Properties

Binder
Gets or sets the context's type binder.
public TwoWaySerializationBinder Binder { get; set; }
Config
Gets or sets the serialization configuration.
public SerializationConfig Config { get; set; }
FormatterConverter
Gets the formatter converter.
public IFormatterConverter FormatterConverter { get; }
GuidReferenceResolver
Gets or sets the Guid reference resolver.
public IExternalGuidReferenceResolver GuidReferenceResolver { get; set; }
IndexReferenceResolver
Gets or sets the index reference resolver.
public IExternalIndexReferenceResolver IndexReferenceResolver { get; set; }
StreamingContext
Gets the streaming context.
public StreamingContext StreamingContext { get; }
StringReferenceResolver
Gets or sets the string reference resolver.
public IExternalStringReferenceResolver StringReferenceResolver { get; set; }

Methods

GetExternalObject(Guid)
Gets an external object reference by guid, or null if the guid could not be resolved.
public object GetExternalObject(Guid guid)
Parameters
System.Guid guid

The guid to resolve.

Returns
System.Object

An external object reference by the given guid, or null if the guid could not be resolved.

GetExternalObject(Int32)
Gets an external object reference by index, or null if the index could not be resolved.
public object GetExternalObject(int index)
Parameters
System.Int32 index

The index to resolve.

Returns
System.Object

An external object reference by the given index, or null if the index could not be resolved.

GetExternalObject(String)
Gets an external object reference by an id string, or null if the id string could not be resolved.
public object GetExternalObject(string id)
Parameters
System.String id

The id string to resolve.

Returns
System.Object

An external object reference by an id string, or null if the id string could not be resolved.

GetInternalReference(Int32)
Gets an internal reference from a given id, or null if the id has not been registered.
public object GetInternalReference(int id)
Parameters
System.Int32 id

The id of the reference to get.

Returns
System.Object

An internal reference from a given id, or null if the id has not been registered.

RegisterInternalReference(Int32, Object)
Registers an internal reference to a given id.
public void RegisterInternalReference(int id, object reference)
Parameters
System.Int32 id

The id to register the reference with.

System.Object reference

The reference to register.

Reset()
Resets the deserialization context completely to baseline status, as if its constructor has just been called. This allows complete reuse of a deserialization context, with all of its internal reference buffers.
public void Reset()