Item(Key: Integer): IMetabaseObjectDescriptor;
Item[Key: Integer]: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;
Key. Repository object key.
The Item property returns repository object description with the specified key.
The property returns Null, if object with the specified key is absent in repository.
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;
After executing the example if an object with the "100" key exists in the repository, its identifier is displayed in a development environment console.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
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;
See also: