Show page source of 開発者へ #53341

[[PageNavi(NavigationList)]]

== 開発者へ ==

|| このページは作成中です。後でチェックしてください(訳注:…と原文には書かれています。)||

=== 概要 === #Overview

1.0.34以降のVBDOXでは、レポートマネージャーやパーサを作成する際に、VBDOXのソースは必要としません。1.0以降のVBDOXではコンポーネント構造を持ち、以下のクラスを実装した外部ActiveXモジュールを使用しています。

 * IReportManager - レポートマネージャ用 
 * IDocParser - ドキュメント用コメントパーサ用 

=== レポートマネージャの作成 === #CustomReportManager

新しいレポートマネージャの作成はとても簡単です。

 1. ActiveX DLLを作成するVisual Basic プロジェクトを作成します 
 2. VBDOXCOR.DLLへの参照をプロジェクトに設定します 
 3. publicクラス(Instancingが 5 - !MultiUse。)を追加します 
 4. 「IReportManager」インタフェースを実装します。このインタフェースは「saveReport」メソッドのみが定義されています。このメソッドの引数は以下の通りです。 
    a. fname - レポートファイル(*.html)の名前。 このファイル名はVBDOX.EXE (VBDOXUI)からレポートマネージャに渡されます。この名前は変更可能です。例えば、XMLファイルを作成するような場合、拡張子を変更できます。 
    b. group - Visual Basic (VBScript or ASP) のソースを解析したオブジェクトモデルです。 Visual Basicのオブジェクトブラウザ(F2キーで開きます)を使用して、プロパティやメソッドを調べることが可能です。私は、詳細なドキュメントを作成するために設計しています。 
    c. docParser - 使用されたドキュメント用コメントパーサへの参照 
 5. 作成したレポートマネージャを登録レポートマネージャ一覧へ追加します - 「vbdox.config」ファイルの「report.manager.list」変数にそのProgID (projectname.classname)を追加します。この変数はレポートマネージャのカンマ区切りのリストです。 


'''例:'''

{{{
report.manager.list=VBDOXEXT.clsReportManager,VBDOXEXT.clsReportManagerEx,
VBDOXEXT.clsReportManagerXML,VBDOXSAMPLE.clsSampleReportManager
}}}

今すぐに、VBDOXを起動して、あなたのレポートマネージャを選んで、何が起こるかを見ることができます。

以下はサンプルのレポートマネージャのソースコードです。

{{{
'*
'*      Copyright (c) 2000, 2001 Mihayl Stamenov <michael.stamenov@web.de>
'*
'* This program is free software; you can redistribute it and/or modify
'* it under the terms of the GNU General Public License as published by
'* the Free Software Foundation; either version 2, or (at your option)
'* any later version.
'*
'* This program is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU General Public License for more details.
'*
'* You should have received a copy of the GNU General Public License
'* along with this program; see the file COPYING.  If not, write to
'* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
'*

''
' Sample Report Manager for VBDOX (VBDOXSAMPLE.clsSampleReportManager)
'
' @version VBDOX Version: 1.0.34 or later
' @author michael.stamenov
' @date 200011015

Option Explicit

Implements VBDOXCOR.IReportManager

Private dp  As VBDOXCOR.IDocParser

Private Sub IReportManager_saveReport(fname As String, group As VBDOXCOR.clsGroup, _
    docParser As VBDOXCOR.IDocParser)
Dim prj     As VBDOXCOR.clsProject
Dim mdl     As VBDOXCOR.clsModule
Dim entry   As VBDOXCOR.clsEntry
Dim file    As Integer

    Set dp = docParser
    
    file = FreeFile
    Open fname For Output Access Write As file
    
    ' Print group name (may not exist)
    Print #file, "<H1>"; group.getName; "</H1>"
    For Each prj In group.projects
        ' Print project name
        Print #file, "<H2>"; prj.getName; "</H2>"
        For Each mdl In prj.modules
            Print #file, "<H3>"; mdl.getName; "</H3>"
            Print #file, "<P>"; dp.getModuleDescription(mdl); "</P>"
            For Each entry In mdl.entries
                Print #file, "<BR/>"; entry.getName; " - "; dp.getDescription(entry)
            Next
        Next
    Next
    
    Close #file

End Sub

' end of file
}}}

=== ドキュメント用コメントパーサの作成 === #CustomDocumentationParser

このドキュメントは[http://vbdox.sourceforge.net/developer.html VODOX]のサイトを元に作成しました 

[[PageNavi(NavigationList)]]