Share via


DataPackageView.GetTextAsync メソッド

定義

オーバーロード

GetTextAsync(String)

DataPackageView オブジェクトのテキストを取得します。

GetTextAsync()

DataPackageView オブジェクトのテキストを取得します。

GetTextAsync(String)

DataPackageView オブジェクトのテキストを取得します。

public:
 virtual IAsyncOperation<Platform::String ^> ^ GetTextAsync(Platform::String ^ formatId) = GetTextAsync;
/// [Windows.Foundation.Metadata.Overload("GetCustomTextAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<winrt::hstring> GetTextAsync(winrt::hstring const& formatId);
[Windows.Foundation.Metadata.Overload("GetCustomTextAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<string> GetTextAsync(string formatId);
function getTextAsync(formatId)
Public Function GetTextAsync (formatId As String) As IAsyncOperation(Of String)

パラメーター

formatId
String

Platform::String

winrt::hstring

データ形式を表す文字列。 通常 、StandardDataFormats.Text

戻り値

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

要求された形式のテキスト。

属性

こちらもご覧ください

適用対象

GetTextAsync()

DataPackageView オブジェクトのテキストを取得します。

public:
 virtual IAsyncOperation<Platform::String ^> ^ GetTextAsync() = GetTextAsync;
/// [Windows.Foundation.Metadata.Overload("GetTextAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<winrt::hstring> GetTextAsync();
[Windows.Foundation.Metadata.Overload("GetTextAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<string> GetTextAsync();
function getTextAsync()
Public Function GetTextAsync () As IAsyncOperation(Of String)

戻り値

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

テキスト。

属性

ShareOperation shareOperation = args.ShareOperation;
if (shareOperation.Data.Contains(StandardDataFormats.Text))
{
    string text = await shareOperation.Data.GetTextAsync();

    // To output the text from this example, you need a TextBlock control
    // with a name of "sharedContent".
    sharedContent.Text = "Text: " + text;
}
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);
        }
    });
}

こちらもご覧ください

適用対象