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

📄 sourcefile.vb

📁 OOP With Microsoft VB.NET And Csharp Step By Step
💻 VB
字号:
Public Class SourceFile
    Private m_fullPath As String
    Private m_linesOfCode As Integer
    Private m_classNames() As String
    Private m_classCount As Integer

    Public ReadOnly Property FullPath() As String
        Get
            Return m_fullPath
        End Get
    End Property

    Public ReadOnly Property FileName() As String
        Get
            Dim lastSlash As Integer
            lastSlash = m_fullPath.LastIndexOf("\")
            Return m_fullPath.Substring(lastSlash + 1)
        End Get
    End Property

    Public ReadOnly Property ClassCount() As Integer
        Get
            Return m_classCount
        End Get
    End Property

    Public ReadOnly Property LinesOfCode() As Integer
        Get
            Return m_linesOfCode
        End Get
    End Property

    Public Property Classes(ByVal index As Integer) As String
        Get
            If index < m_classCount Then
                Return m_classNames(index)
            Else
                Throw New System.IndexOutOfRangeException( _
                "There are only " & m_classCount & " classes defined..")
            End If
        End Get

        Set(ByVal Value As String)
            If index < m_classCount Then
                m_classNames(index) = Value
            Else
                Throw New System.IndexOutOfRangeException( _
                "There are only " & m_classCount & " classes defined..")
            End If
        End Set
    End Property





    Public Sub New(ByVal fullPath As String)
        m_classCount = 0
        m_linesOfCode = 0
        m_fullPath = fullPath
        m_classNames = New String(10) {}
        Try
            Dim reader As New System.IO.StreamReader(m_fullPath)
            Dim nameStart As Integer
            Dim oneline As String
            oneline = reader.ReadLine()
            While (Not (oneline Is Nothing))
                oneline = oneline.Trim()
                ' Don 抰 count blank lines and comment lines.
                If ((oneline <> "") And (Not oneline.StartsWith("

⌨️ 快捷键说明

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