DesignerFactory class

The interface an addin implements to make its designers. The addin passes an object of its own class to Designers.Register, and the IDE calls CreateDesigner on it each time it opens a file in that designer.

Private Class HexFactory
    Implements DesignerFactory
    Private Owner As Object

    Public Sub New(ByVal Owner As Object)
        Set Me.Owner = Owner
    End Sub

    Private Function DesignerFactory_CreateDesigner() As Designer
        Return New HexDesigner(Owner)
    End Function
End Class

A factory usually holds the addin’s own object, as here, and hands it to each designer it makes, so that the designer can reach the Host and the addin’s settings. Write Set Me.Owner = Owner when the parameter has the field’s name: without Me., the parameter is set to itself and the field stays Nothing.

Methods

CreateDesigner

Returns a new designer for one tab. The IDE calls it as it opens a file in the designer, and again for each designer tab that is open when the compiler restarts.

Syntax: factory.CreateDesigner() As Designer

Return a new object each time: each tab has a designer of its own.

See Also