ShareOperation Class
共有操作で一括処理を行います。これは、ユーザーが共有するデータを含み、QuickLink を設定または削除して、操作の状態についてのシステムに知らせます。
構文
var shareOperation = promise.operation;
public sealed class ShareOperation
Public NotInheritable Class ShareOperation
public ref class ShareOperation sealed
属性
[MarshalingBehavior(Standard)]
[Version(0x06020000)]
メンバー
ShareOperationクラス には次の種類のメンバーがあります。
- メソッド
- プロパティ
メソッド
The ShareOperation クラス には次のメソッドがあります。 With C#、Visual Basic、および C++ では、以下からもメソッドが継承されます。Object クラス.
メソッド | 説明 |
---|---|
DismissUI | Closes the share pane. |
RemoveThisQuickLink | Removes the QuickLink from the list of QuickLinks that are available to the user. |
ReportCompleted() | Specifies that the sharing operation is complete. |
ReportCompleted(QuickLink) | Specifies that the sharing operation is complete. A QuickLink that the system can save as a shortcut for future sharing operations is included. |
ReportDataRetrieved | Specifies that the app has acquired the content that the user wants to share. |
ReportError | Specifies that an error occurred during the sharing operation. |
ReportStarted | Specifies that the app has started to acquire the content that the user wants to share. |
ReportSubmittedBackgroundTask | Specifies that the app has requested that the system allow the sharing operation to run as a background task. |
プロパティ
ShareOperationクラス には次のプロパティがあります。
プロパティ | アクセスの種類 | 説明 |
---|---|---|
読み取り専用 | Contains a DataPackage object with the data that the user wants to share. | |
読み取り専用 | A string that contains the ID of a QuickLink. |
解説
ユーザーが共有操作のターゲットとしてアプリケーションを選択すると、activated イベントが発生します。このイベントがアプリケーションに送信するオブジェクトは、ShareOperation クラスのインスタンスを格納しています。
メモ : このクラスはアジャイルではないため、そのスレッド モデルとマーシャリングの動作を考慮する必要があります。詳細については、「スレッド処理とマーシャリング (C++/CX)」および「Using Windows Runtime objects in a multithreaded environment (.NET) (マルチスレッド環境での Windows ランタイム オブジェクトの使用 (.NET))」を参照してください。
例
ShareOperation オブジェクトを操作する方法を次の例に示します。
var shareOperation = eventObject.detail.shareOperation;
if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.text)) {
shareOperation.data.getTextAsync().done(function (text) {
// To output the text using this example,
// you need a div tag with an id of "output" in your HTML file.
document.getElementById("output").innerText = text;
}, function (e) {
displayError("Error retrieving Text format: " + e);
}
});
}
要件
最小限サポートされるクライアント |
Windows 8 [Windows ストア アプリのみ] |
最小限サポートされるサーバー |
Windows Server 2012 [Windows ストア アプリのみ] |
名前空間 |
Windows.ApplicationModel.DataTransfer.ShareTarget Windows::ApplicationModel::DataTransfer::ShareTarget [C++] |
メタデータ |
Windows.winmd |
参照
クイック スタート: コンテンツの共有 (JavaScript と HTML を使った Windows Store アプリ)
クイック スタート: コンテンツの共有 (C#/VB/C++ と XAML を使った Windows Store アプリ)
クイック スタート: 共有コンテンツの受信 (JavaScript と HTML を使った Windows Store アプリ)
クイック スタート: 共有コンテンツの受信 (C#/VB/C++ と XAML を使った Windows Store アプリ)