IConnectedUsersInfoEx.Disconnect

Fore Syntax

Disonnect(Value: IConnectedUserInfoEx);

Fore.NET Syntax

Disonnect(Value: Prognoz.Platform.Interop.Metabase.IConnectedUserInfoEx);

Description

The Disconnect method disconnects an active user from the repository.

Fore Example

Executing the example requires the Button component with the Button1 identifier.

Add a link to the Metabase system assembly.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    User: IConnectedUserInfoEx;
    Users: IConnectedUsersInfoEx;
Begin
    MB := MetabaseClass.Active;
    Users := MB.GetConnectedUsersEx;
    
If Users.Count < 5 Then
            Debug.Write(
"Number connected users is less than 5");
    
Else
        User := Users.Item(
5);
        Users.Disconnect(User);
    
End If;
End Sub Button1OnClick;

After executing the example clicking the button checks the number of active repository users. If the number of active users is less than five then the console displays the message: Number of connected users is less than 5". If the number of connected users is greater than five then the user with the identifier 5 will be disconnected.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Metabase;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    User: IConnectedUserInfoEx;
    Users: IConnectedUsersInfoEx;
Begin
    MB := Self.Metabase;
    Users := MB.GetConnectedUsersEx();
    
If Users.Count > 5 Then
            System.Diagnostics.Debug.Write(
"Number of connected users is less than 5");
    
Else
        User := Users.Item[
6];
        Users.Disconnect(User);
    
End If;
End Sub;

See also:

IConnectedUsersInfoEx