⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 personlist.vb

📁 對c#初學者參考..為課題asp.net 2.0教材代碼
💻 VB
字号:
Imports Microsoft.VisualBasic

Imports System.Collections
Public Class PersonList
    Implements System.Collections.IEnumerable

    Private innerList As ArrayList = New ArrayList()

    Public Sub Add(ByVal aPerson As Person)
        innerList.Add(aPerson)
    End Sub

    Public Sub Remove(ByVal aPerson As Person)
        innerList.Remove(aPerson)
    End Sub

    Public ReadOnly Property Count() As Integer
        Get
            Return innerList.Count
        End Get
    End Property

    'Get/set element at given index
    Default Public Property Item(ByVal index As Integer) As Person
        Get
            Return CType(innerList(index), Person)
        End Get
        Set(ByVal Value As Person)
            innerList(index) = Value
        End Set
    End Property

    Public Function GetEnumerator() As IEnumerator _
            Implements IEnumerable.GetEnumerator
        Return innerList.GetEnumerator()
    End Function
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -