次の方法で共有


QuickLink Class

最も使用頻度の高いアプリケーションの間でコンテンツを共有するのに役立つショートカットを表します。

構文

var quickLink = new Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink();
public sealed class QuickLink
Public NotInheritable Class QuickLink
public ref class QuickLink sealed 

属性

[MarshalingBehavior(Standard)]

[Version(0x06020000)]

メンバー

QuickLinkクラス には次の種類のメンバーがあります。

  • コンストラクター
  • メソッド
  • プロパティ

コンストラクター

QuickLinkクラス にはこれらのコンストラクターがあります。

コンストラクター 説明
QuickLink Creates a new instance of a QuickLink object.

 

メソッド

The QuickLink クラス からメソッドを継承します。Object クラス (C#/VB/C++).

プロパティ

QuickLinkクラス には次のプロパティがあります。

プロパティ アクセスの種類 説明

Id

読み取り/書き込み Specifies an ID for the QuickLink. Your app receives this ID when the user selects its QuickLink. You can use this ID to further customize the sharing process for the user.

SupportedDataFormats

読み取り専用 An array of strings that specify the data formats supported by the QuickLink app. The system shows the QuickLink only when the data that a user wants to share matches a format in this array.

SupportedFileTypes

読み取り専用 An array of strings that specify the file types supported by a QuickLink app. The system shows the QuickLink only when the data that a user wants to share contains file items, and the file extensions for those file items match a file type in this array.

Thumbnail

読み取り/書き込み Specifies a thumbnail image for the QuickLink. The system displays this image when the user is presented with a list of possible apps to share content with.

Title

読み取り/書き込み Specifies the title of a QuickLink. The system displays this info when the user is presented with a list of possible apps to share content with.

 

解説

メモ  : このクラスはアジャイルではないため、そのスレッド モデルとマーシャリングの動作を考慮する必要があります。詳細については、「スレッド処理とマーシャリング (C++/CX)」および「Using Windows Runtime objects in a multithreaded environment (.NET) (マルチスレッド環境での Windows ランタイム オブジェクトの使用 (.NET))」を参照してください。

次の関数は QuickLink を作成して返します。

function reportCompleted() {
    var quickLink = new Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink();
    quickLink.id = "123456789";
    quickLink.title = id("quickLinkTitle").value;
    
    // For quicklinks, the supported FileTypes and DataFormats are set 
    // independently from the manifest.
    var dataFormats = Windows.ApplicationModel.DataTransfer.StandardDataFormats;
    quickLink.supportedFileTypes.replaceAll(["*"]);
    quickLink.supportedDataFormats.replaceAll([dataFormats.text, dataFormats.uri, 
        dataFormats.bitmap, dataFormats.storageItems, dataFormats.html, customFormatName]);

    Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("images\\user.png").then(function (iconFile) {
        quickLink.thumbnail = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(iconFile);
        shareOperation.reportCompleted(quickLink);
    });
    shareOperation.reportCompleted(quickLink);
}

要件

最小限サポートされるクライアント

Windows 8 [Windows ストア アプリのみ]

最小限サポートされるサーバー

Windows Server 2012 [Windows ストア アプリのみ]

名前空間

Windows.ApplicationModel.DataTransfer.ShareTarget Windows::ApplicationModel::DataTransfer::ShareTarget [C++]

メタデータ

Windows.winmd