System.Tether.AppProfile.TTetheringAppProfile.Notify

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

procedure Notify(const ANotification, Data: string); override;

C++

virtual void __fastcall Notify(const System::UnicodeString ANotification, const System::UnicodeString Data);

Propriétés

Type Visibilité  Source Unité  Parent
procedure
function
public
System.Tether.AppProfile.pas
System.Tether.AppProfile.hpp
System.Tether.AppProfile TTetheringAppProfile


Description

Gère une notification du gestionnaire envoyée à l'origine par un profil distant.

Remarque : Vous n'avez pas besoin d'appeler Notify lorsque vous utilisez TTetheringAppProfile. Cependant, vous pouvez, si vous le souhaitez, réimplémenter Notify si vous sous-classez TTetheringAppProfile ou TTetheringProfile.

Notify reçoit les paramètres suivants :

  • La chaîne ANotification.
  • La chaîne Data contient plusieurs paramètres séparés par un token, #*#.

Valeur possibles de ANotification

Valeur Description

"NOT_SNDRES"

Annonce qu'une ressource distante temporelle contenant une chaîne a été envoyée par un profil d'application distant et attend que vous la récupérez.

Data fournit les paramètres suivants :

  1. L'ID du profil distant qui envoie la chaîne.
  2. Le nom de la ressource distante.
  3. Le conseil de la ressource distante.
  4. Le type de ressource de la ressource distante.
  5. La chaîne.

"NOT_UPDPRO"

Annonce qu'un profil d'application distant a changé.

Data fournit un seul paramètre : l'ID du profil distant qui a changé.

"NOT_UPDRES"

Annonce qu'un élément distant publié par un profil d'application distant a changé.

Data fournit les paramètres suivants :

  1. L'ID du profil distant qui publie l'élément distant.
  2. Le nom de l'élément distant.
  3. Une représentation JSON des nouvelles données de l'élément distant.

Conversion de Data en tableau

Dans Delphi :

Parameters := Data.Split(['#*#'], TStringSplitOptions.None);

Dans C++ :

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/iter_find.hpp>

std::list<std::wstring> Parameters;
std::wstring DataAsWideString = Data.w_str();
boost::iter_split(Parameters, DataAsWideString, boost::first_finder(L"#*#"));

Voir aussi