API:Datasnap.Win.SConnect.TWebConnection.SetConnected
Delphi
procedure SetConnected(Value: Boolean); override;
C++
virtual void __fastcall SetConnected(bool Value);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | Datasnap.Win.SConnect.pas Datasnap.Win.SConnect.hpp |
Datasnap.Win.SConnect | TWebConnection |
Description
Sets the Connected property.
Datasnap.Win.SConnect.TWebConnection.SetConnected inherits from Datasnap.Win.MConnect.TDispatchConnection.SetConnected. All content below this line refers to Datasnap.Win.MConnect.TDispatchConnection.SetConnected.
Sets the Connected property.
SetConnected is the protected implementation of the Connected property. It establishes a connection to the Application server if Value is true, and disconnects from the application server if Value is false.
If Value is false, SetConnected generates a BeforeDisconnect event, closes the connection, and generates an AfterDisconnect event.
If Value is true, SetConnected performs the following actions:
1. If LoginPrompt is true, and the connection is not already open, SetConnected generates an OnGetUsername event, and uses that to initialize a login dialog. It displays the login dialog, and aborts the connection if the user cancels.
2. It generates a BeforeConnect event.
3. It opens the connection.
4. It generates an AfterConnect event.
5. If LoginPrompt is true, and the connection opened successfully, SetConnected generates an OnLogin event.