bookcollection.vb

来自「OOP With Microsoft VB.NET And Csharp Ste」· VB 代码 · 共 24 行

VB
24
字号
Public Class BookCollection
    Inherits System.Collections.DictionaryBase

    Public Sub Add(ByVal aBook As Book)
        Me.Dictionary.Add(aBook.Title, aBook)
    End Sub

    Public Sub Remove(ByVal title As String)
        Me.Dictionary.Remove(title)
    End Sub

    Default Public ReadOnly Property Item(ByVal title As String) As Book
        Get
            If Me.Dictionary.Contains(title) Then
                Return CType(Me.Dictionary(title), Book)
            Else
                Return Nothing
            End If
        End Get
    End Property


End Class

⌨️ 快捷键说明

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