Top: Integer;
Top: System.Int32;
The Top property determines the number of observed records of the access protocol.
The property enables limiting the number of observed records of the access protocol, which speeds up working with it.
By default the property has 0 value.
If the values are 0 and -1, the list of access protocol records is unlimited, that is all records are observed.
To execute the example, create a form, add a button with Button1 name, the IntegerEdit component with IntegerEdit1 name and the Memo component with Memo1 name, in IntegerEdit1 specify the required number of the access protocol records which must be displayed.
Class OBJ2097Form: Form
Button1:Button;
Memo1: Memo;
IntegerEdit1: IntegerEdit;
Sub ShowLog(log: IAuditLog);
Var
opers: IAuditOperations;
Begin
Memo1.Lines.Clear;
opers := log.OpenOperations(-1);
While Not opers.Eof Do
Memo1.Lines.Add(opers.Name+" "+opers.Stamp.ToString);
opers.Next;
End While;
End Sub ShowLog;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
log: IAuditLog;
Begin
log := MetabaseClass.Active.Security.OpenAuditLog;
log.Filter.Top := IntegerEdit1.Value;
ShowLog(log);
End Sub Button1OnClick;
End Class OBJ2097Form;
On click the Button1 in the Memo1 field the list from the specified number of the last records of the access protocol appears.
To execute the example create a .NET assembly, in the assembly create a .NET form, add a button with Button1 name, the numericUpDown component with numericUpDown1 name and the TextBox component with TextBox1 name, specify in the numericUpDown1 component the specified number of the access protocol records, which must be displayed.
Imports System;
Imports System.Collections.Generic;
Imports System.ComponentModel;
Imports System.Data;
Imports System.Drawing;
Imports System.Text;
Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.NET;
Imports Prognoz.Platform.Interop.Metabase;
Public Partial Class OBJ2100Form: Prognoz.Platform.Forms.NET.ForeNetForm
Public Constructor OBJ2100Form();
Begin
InitializeComponent();
End Constructor;
Sub ShowLog(log: IAuditLog);
Var
ALogon: IAuditLogons;
opers: IAuditOperations;
Begin
Alogon := log.OpenLogons(False);
opers := log.OpenOperations(-1 As uinteger);
While Not opers.Eof() Do
textbox1.Text := textbox1.Text + opers.Name + char.ConvertFromUtf32(13) + char.ConvertFromUtf32(10);
opers.Next();
End While;
End Sub ShowLog;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
log: IAuditLog;
Begin
textbox1.Clear();
log := Self.Metabase.Security.OpenAuditLog();
log.Filter.Top := numericUpDown1.Value As Integer;
ShowLog(log);
End Sub;
End Class;
On clicking the Button1 in the TextBox1 field the list from the specified number of the last records of the access protocol appears.
See also: