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 */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.Tether.AppProfile.pas System.Tether.AppProfile.hpp |
System.Tether.AppProfile | TTetheringAppProfile |
説明
指定されたリモート アクションの実行を要求し、実行が成功した場合には True
を、エラーが発生した場合には False
を返します。
リモート アクションは、以下のいずれかのパラメータで指定できます。
- TRemoteAction のインスタンス(
AnAction
)を渡す。 - リモート アクションを含むリモート プロファイル(
AProfile
)と、リモート アクションの名前(AnActionName
)を渡す。
RunRemoteAction は、以下のいずれかのエラーが発生すると False
を返します。
- 要求したアクションの名前を持つアクションが、リモート プロファイルによって公開されていない。
- RunRemoteAction がリモート プロファイルに送信したコマンドが無効である。
- メモ: RunRemoteAction は、実行要求をリモート プロファイルに送信する前に、クライアント側で確認を行います。そのため、これらの状況が発生することはおそらくありません。
RunRemoteAction は、同期関数です。 この関数は、リモート プロファイルへのリクエストを実行し、その関数の実行は、リモート プロファイルからレスポンスがあったときにのみ終了します。 RunRemoteActionAsync メソッドを使用したい場合もあるでしょう。
例外
RunRemoteAction への呼び出しは、次の例外のいずれかを発生させます:
Exception | Exception.Message | シナリオ |
---|---|---|
アクション <アクション名> のプロファイルが見つかりません。 |
| |
<プロファイル識別子> への接続がありません。 |
| |
プロファイル <プロファイル識別子> へ接続できません。 |
|
関連項目
- 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 サンプル