AppServiceConnection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
App Service のエンドポイントへの接続を表します。 App Services を使用すると、ユニバーサル Windows アプリから他のユニバーサル Windows アプリにサービスを提供できるようにすることで、アプリ間の通信が可能になります。 AppService プロバイダーは、バックグラウンド タスクの一部として接続要求を受け取ります。詳細については、「 AppServiceTriggerDetails クラス 」を参照してください。
public ref class AppServiceConnection sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppServiceConnection final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class AppServiceConnection final : IClosable
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppServiceConnection : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class AppServiceConnection : System.IDisposable
function AppServiceConnection()
Public NotInheritable Class AppServiceConnection
Implements IDisposable
- 継承
- 属性
- 実装
Windows の要件
| デバイス ファミリ |
Windows 10 (10.0.10240.0 で導入)
|
| API contract |
Windows.Foundation.UniversalApiContract (v1.0 で導入)
|
注釈
バージョン履歴
| Windows のバージョン | SDK バージョン | 追加された値 |
|---|---|---|
| 1607 | 14393 | OpenRemoteAsync |
| 1607 | 14393 | ユーザー |
| 1903 | 18362 | SendStatelessMessageAsync |
コンストラクター
| AppServiceConnection() |
AppServiceConnection クラスの新しいインスタンスを作成して初期化します。 |
プロパティ
| AppServiceName |
接続するアプリ サービスの名前を取得または設定します。 |
| PackageFamilyName |
アプリ サービスのエンドポイントを含むパッケージのパッケージ ファミリ名を取得または設定します。 |
| User |
ユーザー コンテキストを取得または設定します。 呼び出し元がユーザーを指定しなかった場合、このプロパティは null を 返します。 |
メソッド
| Close() |
アプリ サービスへの接続を閉じます。 |
| Dispose() |
アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。 |
| OpenAsync() |
App Service のエンドポイントへの接続を開きます。 |
| OpenRemoteAsync(RemoteSystemConnectionRequest) |
App Service の別のデバイス上のエンドポイントへの接続を開きます。 |
| SendMessageAsync(ValueSet) |
App Service 接続の他のエンドポイントにメッセージを送信します。 |
| SendStatelessMessageAsync(AppServiceConnection, RemoteSystemConnectionRequest, ValueSet) |
App Service 接続を開き、1 つのメッセージを送信し、1 つの応答を待機してから、接続を閉じます。 |
イベント
| RequestReceived |
App Service 接続の他のエンドポイントからメッセージが到着したときに発生します。 |
| ServiceClosed |
他のエンドポイントがアプリ サービスへの接続を閉じると発生します。 |