IMetabaseDeviceDescriptors.Count

Syntax

Count: Integer;

Count: System.Int32;

Description

The Count property returns the number of devices in the list of printers available for printing.

Example

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

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MP: IMetabasePolicy;
    DP: IMetabaseDevicePolicy;
    DevDess: IMetabaseDeviceDescriptors;
    DevDes: IMetabaseDeviceDescriptor;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    MS := MB.Security;
    MP := Ms.Policy;
    DP := MP.PrintersPolicy;
    DevDess := DP.Enumerate;
    
For i:=0 To DevDess.Count-1 Do
        DevDes:= DevDess.Item(
0);
        Debug.WriteLine(DevDes.DeviceName);
        Debug.WriteLine(DevDes.Key);
        Debug.WriteLine(
"----------------");
    
End For;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params : StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MP: IMetabasePolicy;
    DP: IMetabaseDevicePolicy;
    DevDess: IMetabaseDeviceDescriptors;
    DevDes: IMetabaseDeviceDescriptor;
    i: Integer;
Begin
    MB := Params.Metabase;
    MS := MB.Security;
    MP := Ms.Policy;
    DP := MP.PrintersPolicy;
    DevDess := DP.Enumerate();
    
For i:=0 To DevDess.Count-1 Do
        DevDes:= DevDess.Item[
0];
        System.Diagnostics.Debug.WriteLine(DevDes.DeviceName);
        System.Diagnostics.Debug.WriteLine(DevDes.Key);
        System.Diagnostics.Debug.WriteLine(
"----------------");
    
End For;
End Sub;

After executing the example device name and key are displayed in the console.

See also:

IMetabaseDeviceDescriptors