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

📄 pcsproject.cls

📁 非常有用得编辑器软件源码
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "PCSProject"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Member0" ,"Comment"
Attribute VB_Ext_KEY = "Member1" ,"CommentList"
Attribute VB_Ext_KEY = "Member2" ,"Report"
Attribute VB_Ext_KEY = "Member3" ,"ReportList"
Attribute VB_Ext_KEY = "Member4" ,"Task"
Attribute VB_Ext_KEY = "Member5" ,"TaskList"
Attribute VB_Ext_KEY = "Member6" ,"WebPage"
Attribute VB_Ext_KEY = "Member7" ,"WebPageList"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Base 1

Private mvarProjectName As String
Private mvarCommentList As CommentList
Private mvarWebPageList As WebPageList
Private mvarReportList As ReportList
Private mvarTaskList As TaskList


Public Sub Clear()
  Set mvarTaskList = Nothing
  Set mvarReportList = Nothing
  Set mvarWebPageList = Nothing
  Set mvarCommentList = Nothing
  Set mvarWebPage = New WebPage
  Set mvarComment = New Comment
  Set mvarTask = New Task
  Set mvarReport = New Report
End Sub

Private Function VerifyFile(ByVal Code As String) As Boolean
On Error GoTo 1
If Left(Code, 59) = "12332112345672344324567891030624700306597705342021794369564" _
    And _
    CLng(Mid(Code, 60)) Mod 97 = 0 _
Then
    VerifyFile = True
Else
    VerifyFile = False
End If
Exit Function
1
    VerifyFile = False
End Function

Public Function Export(ByVal FileName As String) As Boolean
Dim t As Integer
t = FreeFile
On Error GoTo 1
    Open FileName For Output As #t
        'The special number of my file type
        'to ensure that the file is generated by Page Creator
        
        'Generate a random number that is divisible by 97
        Randomize
        Print #t, DE("123321123456723443245678910" & _
                       "30624700306597705342021794369564" & _
                       Trim(str((Int(Rnd * 123321) + 1) * 97)))
              
        Print #t, DE("PJN" & Me.ProjectName)
        
        For i = 1 To Me.CommentList.Count
            Print #t, DE(Me.CommentList(i).GenerateCode)
        Next
        
        For i = 1 To Me.ReportList.Count
            Print #t, DE(Me.ReportList(i).GenerateCode)
        Next
        
        For i = 1 To Me.TaskList.Count
            Print #t, DE(Me.TaskList(i).GenerateCode)
        Next
        
        For i = 1 To Me.WebPageList.Count
            Print #t, DE(Me.WebPageList(i).GenerateCode)
        Next
        
        Print #t, DE("!@#$%^&*()")
        
    Close #t
    
    Export = True
    
    Exit Function
    
1
    Export = False
    
End Function

Public Function Import(ByVal FileName As String) As Boolean

On Error Resume Next

Dim CommentCount As Integer
Dim ReportCount As Integer
Dim TaskCount As Integer
Dim WebPageCount As Integer

Dim t As Integer
t = FreeFile

Dim LineIn As String

Open FileName For Input As #t

    Dim Unique As String

    Line Input #t, Unique
    
    If VerifyFile(DD(Unique)) = False Then
        MsgBox "File Type is not correct.", vbInformation, "Import"
        Import = False
        Exit Function
    End If
    
    Dim CodeBody As String
    
    Do Until EOF(t)
                
        Line Input #t, LineIn
        CodeBody = DD(LineIn)
   
            Select Case Left(CodeBody, 3)
   
                Case "PJN"
                    Me.ProjectName = Mid(CodeBody, 4)
                Case "CMT"
                CommentCount = CommentCount + 1
                    Me.CommentList.Add , , Trim(str(CommentCount))
                    Me.CommentList(Trim(str(CommentCount))).ReadCode CodeBody
                Case "RPT"
                ReportCount = ReportCount + 1
                    Me.ReportList.Add , , , , Trim(str(ReportCount))
                    Me.ReportList(Trim(str(ReportCount))).ReadCode CodeBody
                Case "TSK"
                TaskCount = TaskCount + 1
                    Me.TaskList.Add , , , , , , , Trim(str(TaskCount))
                    Me.TaskList(Trim(str(TaskCount))).ReadCode CodeBody
                Case "WPG"
                WebPageCount = WebPageCount + 1
                    Me.WebPageList.Add , , Trim(str(WebPageCount))
                    Me.WebPageList(Trim(str(WebPageCount))).ReadCode CodeBody
            End Select
        
    Loop

Close #t

Import = True

End Function



Public Property Get TaskList() As TaskList
    If mvarTaskList Is Nothing Then
        Set mvarTaskList = New TaskList
    End If


    Set TaskList = mvarTaskList
End Property


Public Property Set TaskList(vData As TaskList)
    Set mvarTaskList = vData
End Property



Public Property Get ReportList() As ReportList
    If mvarReportList Is Nothing Then
        Set mvarReportList = New ReportList
    End If


    Set ReportList = mvarReportList
End Property


Public Property Set ReportList(vData As ReportList)
    Set mvarReportList = vData
End Property



Public Property Get WebPageList() As WebPageList
    If mvarWebPageList Is Nothing Then
        Set mvarWebPageList = New WebPageList
    End If


    Set WebPageList = mvarWebPageList
End Property


Public Property Set WebPageList(vData As WebPageList)
    Set mvarWebPageList = vData
End Property



Public Property Get CommentList() As CommentList
    If mvarCommentList Is Nothing Then
        Set mvarCommentList = New CommentList
    End If


    Set CommentList = mvarCommentList
End Property


Public Property Set CommentList(vData As CommentList)
    Set mvarCommentList = vData
End Property

Public Property Let ProjectName(ByVal vData As String)
    mvarProjectName = vData
End Property


Public Property Get ProjectName() As String
Attribute ProjectName.VB_UserMemId = 0
    ProjectName = mvarProjectName
End Property

Private Sub Class_Initialize()
'  Set mvarWebPage = New WebPage
'  Set mvarComment = New Comment
'  Set mvarTask = New Task
'  Set mvarReport = New Report
End Sub

Private Sub Class_Terminate()
  Set mvarTaskList = Nothing
  Set mvarReportList = Nothing
  Set mvarWebPageList = Nothing
  Set mvarCommentList = Nothing
End Sub



⌨️ 快捷键说明

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