AnnotationSerializationBinder Class
Allows user to control the annotation loading process and select the annotation to load.
Here is an example that shows how to create custom serialization binder for custom annotation:
Public Class CustomAnnotationSerializationBinder
Inherits Vintasoft.Imaging.Annotation.Formatters.AnnotationSerializationBinder
Public Sub New()
MyBase.New()
End Sub
Public Overrides Function BindToType(assemblyName As String, typeName As String) As System.Type
If typeName = "AnnotationDemo.TriangleAnnotation" Then
typeName = "AnnotationDemo.TriangleAnnotationData"
End If
Return MyBase.BindToType(assemblyName, typeName)
End Function
End Class
public class CustomAnnotationSerializationBinder :
Vintasoft.Imaging.Annotation.Formatters.AnnotationSerializationBinder
{
public CustomAnnotationSerializationBinder()
: base()
{
}
public override System.Type BindToType(string assemblyName, string typeName)
{
if (typeName == "AnnotationDemo.TriangleAnnotation")
typeName = "AnnotationDemo.TriangleAnnotationData";
return base.BindToType(assemblyName, typeName);
}
}
System.Object
 System.Runtime.Serialization.SerializationBinder
   Vintasoft.Imaging.Annotation.Formatters.AnnotationSerializationBinder
Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5