VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.Annotation.Formatters Namespace / AnnotationSerializationBinder Class
Members Example



In This Topic
    AnnotationSerializationBinder Class
    In This Topic
    Allows user to control the annotation loading process and select the annotation to load.
    Object Model
    AnnotationSerializationBinder ClassAnnotationSerializationBinder ClassAnnotationSerializationBinder Class
    Syntax
    'Declaration
     
    Public Class AnnotationSerializationBinder 
       Inherits System.Runtime.Serialization.SerializationBinder
    public class AnnotationSerializationBinder : System.Runtime.Serialization.SerializationBinder 
    public __gc class AnnotationSerializationBinder : public System.Runtime.Serialization.SerializationBinder 
    public ref class AnnotationSerializationBinder : public System.Runtime.Serialization.SerializationBinder 
    Example
    This example 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);
        }
                
    }
    Inheritance Hierarchy

    System.Object
       System.Runtime.Serialization.SerializationBinder
          Vintasoft.Imaging.Annotation.Formatters.AnnotationSerializationBinder

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also