DataPackageView.GetTextAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
GetTextAsync(String) |
Obtient le texte dans l’objet DataPackageView . |
GetTextAsync() |
Obtient le texte dans l’objet DataPackageView . |
GetTextAsync(String)
Obtient le texte dans l’objet 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)
Paramètres
- formatId
-
String
Platform::String
winrt::hstring
Chaîne qui représente le format de données. Généralement StandardDataFormats.Text.
Retours
Texte au format demandé.
- Attributs
Voir aussi
S’applique à
GetTextAsync()
Obtient le texte dans l’objet 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)
Retours
Texte.
- Attributs
Exemples
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);
}
});
}
Voir aussi
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour