unit XData.Design.DatasetEditor;

interface

uses
  DBReg, DSDesign, DB,
  Aurelius.Design.DatasetEditor,
  Aurelius.Bind.Dataset;

type
  TXDataDataSetEditor = class(TAureliusDataSetEditor)
  public
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

implementation

uses
  SysUtils, IOUtils,
  XData.Design.DatasetDesigner;

{ TXDataDataSetEditor }

procedure TXDataDataSetEditor.ExecuteVerb(Index: Integer);
begin
  case Index - inherited GetVerbCount of
    0: TfmXDataFieldLoader.Execute(GetComponent as TDataset);
  else
    inherited ExecuteVerb(Index);
  end;
end;

function TXDataDataSetEditor.GetVerb(Index: Integer): string;
begin
  case Index - inherited GetVerbCount of
    0: Result := 'Load from XData server...';
  else
    Result := inherited GetVerb(Index);
  end;
end;

function TXDataDataSetEditor.GetVerbCount: Integer;
begin
  Result := 1 + inherited GetVerbCount;
end;

end.
