unit uROExtraEditors; {----------------------------------------------------------------------------} { RemObjects SDK Library - Delphi IDE Integration } { } { compiler: Delphi 5 and up } { platform: Win32 } { } { (c)opyright RemObjects Software. all rights reserved. } { } { Using this code requires a valid license of the RemObjects SDK } { which can be obtained at http://www.remobjects.com. } {----------------------------------------------------------------------------} {$IFNDEF MSWINDOWS} {$I ../RemObjects.inc} {$ELSE} {$I ..\RemObjects.inc} {$ENDIF} interface uses Classes, uRODL, {$IFDEF FPC} PropEdits,ComponentEditors, {$ELSE} {$IFDEF DELPHI5}DsgnIntf, DMDesigner,{$ELSE}DesignIntf, DesignEditors,{$ENDIF} {$ENDIF} uRODynamicRequest; type { TRODynRequestServiceNameProperty } TRODynRequestServiceNameProperty = class(TStringProperty) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(Proc: TGetStrProc); override; end; { TRODynRequestOperationNameProperty } TRODynRequestOperationNameProperty = class(TStringProperty) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(Proc: TGetStrProc); override; end; { TRODynamicRequestEditor } TRODynamicRequestEditor = class(TComponentEditor) public function GetVerbCount: Integer; override; procedure ExecuteVerb(Index: Integer); override; function GetVerb(Index: Integer): string; override; end; implementation uses SysUtils, Dialogs, uROClientIntf; { TRODynRequestServiceNameProperty } function TRODynRequestServiceNameProperty.GetAttributes: TPropertyAttributes; begin result := [paValueList] end; procedure TRODynRequestServiceNameProperty.GetValues(Proc: TGetStrProc); var dynreq : TRODynamicRequest; i: Integer; begin dynreq := TRODynamicRequest(GetComponent(0)); for i := 0 to (dynreq.RODLLibrary.ServiceCount-1) do Proc(dynreq.RODLLibrary.Services[i].Info.Name); end; { TRODynRequestOperationNameProperty } function TRODynRequestOperationNameProperty.GetAttributes: TPropertyAttributes; begin result := [paValueList] end; procedure TRODynRequestOperationNameProperty.GetValues(Proc: TGetStrProc); var dynreq : TRODynamicRequest; i: Integer; svc : TRODLService; begin dynreq := TRODynamicRequest(GetComponent(0)); svc := TRODLService(dynreq.RODLLibrary.ItemByName(dynreq.RemoteService.ServiceName)); if (svc=NIL) then Exit; for i := 0 to (svc.Default.Count-1) do Proc(svc.Default.Items[i].Info.Name); end; { TRODynamicRequestEditor } procedure TRODynamicRequestEditor.ExecuteVerb(Index: Integer); begin with TRODynamicRequest(GetComponent).Params do begin Refresh; MessageDlg(Format('%d parameters have been created. ', [Count]), mtInformation, [mbOK], 0); end; end; function TRODynamicRequestEditor.GetVerb(Index: Integer): string; begin result := 'Retrieve parameter list'; end; function TRODynamicRequestEditor.GetVerbCount: Integer; begin result := 1 end; end.