2016-10-21 11:58:28 +00:00
|
|
|
unit X2UtService.GUIContext;
|
|
|
|
|
|
|
|
interface
|
|
|
|
uses
|
|
|
|
X2UtService.Intf;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
TX2ServiceContextGUI = class(TInterfacedObject, IX2ServiceContext)
|
|
|
|
protected
|
|
|
|
procedure StartService(AService: IX2Service); virtual;
|
|
|
|
public
|
|
|
|
constructor Create(AService: IX2Service);
|
|
|
|
|
|
|
|
{ IX2ServiceContext }
|
|
|
|
function GetMode: TX2ServiceMode;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
|
|
|
X2UtService.GUIContext.Form;
|
|
|
|
|
|
|
|
|
|
|
|
{ TX2ServiceContextGUI }
|
|
|
|
constructor TX2ServiceContextGUI.Create(AService: IX2Service);
|
|
|
|
begin
|
|
|
|
inherited Create;
|
2016-10-21 12:35:35 +00:00
|
|
|
|
|
|
|
StartService(AService);
|
2016-10-21 11:58:28 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TX2ServiceContextGUI.GetMode: TX2ServiceMode;
|
|
|
|
begin
|
|
|
|
Result := smInteractive;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TX2ServiceContextGUI.StartService(AService: IX2Service);
|
|
|
|
begin
|
|
|
|
with TX2ServiceContextGUIForm.Create(nil) do
|
|
|
|
try
|
|
|
|
Caption := AService.DisplayName;
|
|
|
|
Service := AService;
|
|
|
|
|
|
|
|
ShowModal;
|
|
|
|
finally
|
|
|
|
Free;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|