다음을 통해 공유


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);
        }
    });
}

추가 정보

적용 대상