s2.form.ts2dialogfactory.pas

来自「轉載的程序應用框架」· PAS 代码 · 共 50 行

PAS
50
字号
unit S2.Form.TS2DialogFactory;

interface

uses
  S2.View.TS2View, S2.Form.TS2Dialog, S2.Form.TS2ViewDialog;

type
  TS2DialogFactory = class
  public
    class function GetDialog(View: TS2View): TS2ViewDialog; virtual;
    class function GetMessageDialog(const Messgae: string): TS2Dialog; virtual;
    class function GetSavePromptDialog: TS2Dialog; virtual;
    class procedure ShowMessage(const Message: string);
  end;

implementation

uses
  S2.View.TS2DataItemView, S2.View.TS2DataItemsView, S2.Form.TS2DataItemViewDialog, S2.Form.TS2DataItemsViewDialog,
  S2.View.TS2AdapterDataItemsView, S2.Model.TS2SystemObject;

{ TS2DialogFactory }

class function TS2DialogFactory.GetDialog(View: TS2View): TS2ViewDialog;
begin
  if View is TS2AdapterDataItemsView then
  if View is TS2DataItemView then
    Result := TS2DataItemViewDialog.Create(GetGlobalSystemObject, GetGlobalSystemObject)
  else if View is TS2DataItemsView then
    Result := TS2DataItemsViewDialog.Create(GetGlobalSystemObject, GetGlobalSystemObject);                                   
end;

class function TS2DialogFactory.GetMessageDialog(const Messgae: string): TS2Dialog;
begin

end;

class function TS2DialogFactory.GetSavePromptDialog: TS2Dialog;
begin

end;

class procedure TS2DialogFactory.ShowMessage(const Message: string);
begin

end;

end.

⌨️ 快捷键说明

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