打印本文 打印本文 关闭窗口 关闭窗口
Delphi深度探索-CodeSite应用指南
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2962  更新时间:2009/4/23 18:39:53  文章录入:mintao  责任编辑:mintao
bsp;  end;

    这里为了在网格察看器中格式化数据,我们使用AddNameValuePair方法来实现。 

    function TCSEmployeeDetailsFormatter.TypeName: string;

    begin

      Result := ''''TCSEmployee'''';

    end;

    下面两个过程是用来封装对SendCustomData方法的调用的,这里对全局的TCodeSite对象实例CodeSite进行了调用:

    {=====================}

    {== Support Methods ==}

    {=====================}

    procedure CSSendEmployeeSummary( const Msg: string; EmpRec: TCSEmployee );

    begin

      CodeSite.SendCustomData( csmEmployeeSummary, Msg, EmpRec );

    end;

    procedure CSSendEmployeeDetails( const Msg: string; EmpRec: TCSEmployee );

    begin

      CodeSite.SendCustomData( csmEmployeeDetails, Msg, EmpRec );

    end;

    最后,不要忘了调用CSObjectManager.RegisterCustomFormatter方法把格式器注册到CodeSite对象管理器中。

    initialization

      CSObjectManager.RegisterCustomFormatter( csmEmployeeSummary,

                      TCSEmployeeSummaryFormatter );

      CSObjectManager.RegisterCustomFormatter( csmEmployeeDetails,

                       TCSEmployeeDetailsFormatter );

    end.

    除了上面谈到的特性外CodeSite还支持远程调试,也就是可以把消息路由到一台远程机器上的日志文件或Code Viewer上。由于通常时候我们很少会用到这一特性,这里就不进行详细的讨论了。

 

上一页  [1] [2] [3] [4] 

打印本文 打印本文 关闭窗口 关闭窗口