Adds a binding of a type with the specified original assembly and type name.
Use this method to add support for backwards compatibility with respect to removed types.
When an object with the specified specified original assembly and type, marked with a PersistenceVersion
attribute less than the specified majorUpperVersion and minorUpperVersion, is encountered in the
serialized format, an object of the specified boundType will be deserialized in place of the
original type.
Namespace: Spotfire.Dxp.Application.ExtensionAssembly: Spotfire.Dxp.Application (in Spotfire.Dxp.Application.dll) Version: 14.10.7525.5058 (14.10.7525.5058)
Syntax
Parameters
- originalAssemblyName
- Type: System String
Name of the original assembly.
- originalTypeName
- Type: System String
Name of the original type.
- majorUpperVersion
- Type: System Int32
Used with minorVersion to specify when this binding shall apply.
- minorUpperVersion
- Type: System Int32
The smallest minor version (within the specified majorVersion) of the specified original type for which this binding shall not apply.
- boundType
- Type: System Type
The type that is to be bound to the specified original type.
Examples
persistenceManager.AddTypeBinding( "The.Assembly.Name.Of.Type.A, Version=1.0.0.0, PublicKeyToken=094358714857...", "Some.Namespace.A", 1, 8, typeof(B));
It is also possible to add bindings for generic types. Assume that the type Foo<T> is no longer available and has been replaced by type Bar<T>. Also assume that the last PersistenceVersion of Foo<T> was 1.0. To deserialize a document containing objects of type Foo<int>, Foo<string>, etc., as objects of type Bar<int> and Bar<string>, a call to PersistenceManager.AddTypeBinding() must be made as follows:
persistenceManager.AddTypeBinding( "The.Assembly.Name.Of.Type.Foo, Version=1.0.0.0, PublicKeyToken=094358714857...", "Some.Namespace.Foo`1", // The "`1" syntax means "Generic type with one type argument". 1, 1, typeof(Bar<>));
Version Information
See Also