Imports EDMI_ClientSuite.ClassControlUtils Public Class ClassControlBuilder #Region "State" Private _DesignMode As Boolean #End Region #Region "Constants" Private DEFAULT_SIZE As Size = New Size(200, 27) Private DEFAULT_TEXT As String = "Unnamed Control" #End Region Public Sub New(DesignMode As Boolean) _DesignMode = DesignMode End Sub Private Function GetRandomControlName(Name As String) Return $"{Name}-{ClassUtils.ShortGUID()}" End Function Public Function CreateLabel() As Label Dim Metadata As New ControlMetadata() With { .Id = 4711, .Type = ControlType.Label } Dim oLabel As New Label() With { .Name = GetRandomControlName("Label"), .Text = DEFAULT_TEXT, .AutoSize = False, .Size = DEFAULT_SIZE, .Tag = Metadata } Return oLabel End Function Public Function CreateTextbox() As TextBox Dim Metadata As New ControlMetadata() With { .Id = 4711, .Type = ControlType.TextBox } Dim oTextbox As New TextBox() With { .Name = GetRandomControlName("Textbox"), .Size = DEFAULT_SIZE, .Tag = Metadata } Return oTextbox End Function End Class