IMetabase.Item

Syntax

Item(Key: Integer): IMetabaseObjectDescriptor;

Item[Key: Integer]: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;

Parameters

Key. Repository object key.

Description

The Item property returns repository object description with the specified key.

Comments

The property returns Null, if object with the specified key is absent in repository.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    MDesc := MB.Item(
100);
    
If MDesc <> Null Then
    Debug.WriteLine(MDesc.Id);
    
Else
    Debug.WriteLine(
"Object with the 100 key is absent in repository.");
End If;
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := Params.Metabase;
    MDesc := MB.Item[100];
    If MDesc <> Null Then
        System.Diagnostics.Debug.WriteLine(MDesc.Id);
    Else
        System.Diagnostics.Debug.WriteLine("Object with the 100 key is absent in repository.");
    End If;
End Sub;

After executing the example if an object with the 100 key exists in the repository, its identifier is displayed in a development environment console.

See also:

IMetabase