Datasnap.DBClient.TRemoteEvent

From RAD Studio API Documentation
Jump to: navigation, search

C++

typedef void __fastcall (__closure *TRemoteEvent)(System::TObject* Sender, System::OleVariant &OwnerData);

Properties

Type Visibility Source Unit Parent
typedef public Datasnap.DBClient.hpp Datasnap.DBClient Datasnap.DBClient

Description

TRemoteEvent is the type for event handlers that pass custom information to or from a provider.

TRemoteEvent is the type for event handlers that allow client applications and providers to customize the communication that occurs over an IAppServer interface. Before every IAppServer call that is directed toward a provider, the client dataset receives an event of type TRemoteEvent where it can return custom information as an OleVariant. When the IAppServer interface passes the command to the target provider, the provider receives an event of type TRemoteEvent where it can respond to or change the incoming information before the command is executed. After executing the command, the provider receives another event of the same type, where it can once again review the custom information and return custom information to the client dataset. Finally, the client dataset receives the returned information in a TRemoteEvent event handler or as a parameter to the method.

Sender is the client dataset or provider that receives the event:

OwnerData is the custom information defined by the application developer.

  • In client dataset “BeforeXXX” events, this parameter is for output only so that it can be sent to the provider.
  • In provider “BeforeXXX” events, this parameter enters as information sent by the client dataset “BeforeXXX” event and returns the information passed to the provider “AfterXXX” event.
  • In the provider “AfterXXX” event, this parameter enters as information from the provider (or client dataset) “BeforeXXX” event and returns the information that is passed to the client dataset “AfterXXX” event.
  • In client dataset “AfterXXX” events, this parameter is for input only, and contains the information returned by the provider.

Note: OwnerData is an OleVariant. As such, it can contain a single data value, an interface, or a Variant array. See the example link for one way to package multiple values into the OwnerData parameter.