System.Tether.AppProfile.TTetheringAppProfile.RunRemoteAction
Delphi
function RunRemoteAction(const AnAction: TRemoteAction): Boolean; overload;
function RunRemoteAction(const AProfile: TTetheringProfileInfo; const AnActionName: string): Boolean; overload;
C++
bool __fastcall RunRemoteAction(TRemoteAction* const AnAction)/* overload */;
bool __fastcall RunRemoteAction(const System::Tether::Manager::TTetheringProfileInfo &AProfile, const System::UnicodeString AnActionName)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Tether.AppProfile.pas System.Tether.AppProfile.hpp |
System.Tether.AppProfile | TTetheringAppProfile |
Description
Requests the execution of the specified remote action and returns True
if the execution is successful or False
if there is an error.
You can specify a remote action with either of the following parameters:
- Provide an instance of TRemoteAction (
AnAction
). - Provide the remote profile that contains the remote action (
AProfile
) and the name of the remote action (AnActionName
).
RunRemoteAction returns False
if any of the following errors occur:
- The remote profile has not published an action with the name of the requested action.
- The command that RunRemoteAction sent to the remote profile was invalid.
- Note: RunRemoteAction performs client-side checks before it sends any execution request to a remote profile, so none of these scenarios is likely.
RunRemoteAction is a synchronous function. This function performs a request to the remote profile, and the function execution only finishes after there is a response from the remote profile. You might want to use the RunRemoteActionAsync method.
Exceptions
A call to RunRemoteAction may raise any of the following exceptions:
Exception | Exception.Message | Scenarios |
---|---|---|
Can't find profile for action <action name> |
| |
No available connections to <profile identifier> |
| |
Can't connect to profile <profile identifier> |
|
See Also
- System.Tether.AppProfile.TRemoteAction
- System.Tether.AppProfile.TCustomRemoteItem.Name
- System.Tether.Manager.TTetheringProfileInfo
- System.Tether.AppProfile.TTetheringAppProfile.RunRemoteActionAsync
- System.Tether.Manager.TTetheringProfile.SendCommand
- System.Tether.AppProfile.TTetheringAppProfile.Connect
- MediaPlayer sample