Visual Basic
Конструктор
Class Employee Public 
Sub New(ByVal fullName As String, _ ByVal empID As Integer, ByVal currPay As Double) 
 Me.fullName = fullName Me.empID = empID 
 Me.currPay = currPay 
End Sub
If the user calls this ctor, forward to the 3-arg version using arbitrary values. . .
Public Sub New(ByVal fullName As String) 
 Me.New(fullName, IDGenerator.GetNewEmpID(), 3333) 
End Sub 
. . . 
End Class
Межпотоковый доступ к контролам
Public Class frmMain

    Public Sub AddListItemMethod(ByVal li As ListViewItem)
        Me.lsvObjects.Items.Add(li)
    End Sub 'AddListItemMethod
    
    Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
            oSearchEngine.delAddListItem = New clsSearchEngine.AddListItem(AddressOf Me.AddListItemMethod)
            pbResult = oSearchEngine.SearchByText(Me.txtSearch.Text, Me)
    End Sub    

End Class
Public Class clsSearchEngine

    Public Delegate Sub AddListItem(ByVal li As ListViewItem)
    Public delAddListItem As AddListItem
    
    Private mCaller As System.Windows.Forms.Form
    Private mTimerThread As Threading.Thread
    

    Public Function SearchByText(ByVal aSearchText As String, ByVal CallerForm As System.Windows.Forms.Form) As Boolean
        mCaller = CallerForm
        
        mTimerThread = New Threading.Thread(AddressOf StartProcess)
        mTimerThread.Priority = Threading.ThreadPriority.AboveNormal
        mTimerThread.IsBackground() = True
        mTimerThread.Start()
        
    End Function
    
    Private Sub StartProcess()
        Dim i As Integer = 0

        while( i < 10 )
            System.Threading.Thread.CurrentThread.Sleep(500)
            Dim poLI As ListViewItem = new ListViewItem("Try " & i)
            Caller.Invoke(delAddListItem, New Object() {poLI})    
            i= i+1    
        wend
    End Sub    

End Class
Enum
Public Enum Action As Byte
    Create = Asc("C")
    CheckIn = Asc("I")
    CheckOut = Asc("O")
    UndoCheckOut = Asc("U")
    Save = Asc("S")
    Delete = Asc("D")
    Restore = Asc("R")
End Enum
<FlagsAttribute()> _
Public Enum Access As Integer
    Forbidden = &H0
    Enable = &H1
    Modify = &H2
    Remove = &H4
    Create = &H8
    Version = &H10
    Owner = &H20
    Append = &H40
End Enum
Public Enum eDRBState
    Hollow = 1
    NewItem = 2
    Unchanged = 4
    Dirty = 8
    Deleted = 16
End Enum
-
-
Hosted by uCoz