IWxStyles.Count

Syntax

Count: Integer;

Count: integer;

Description

The Count property returns number of workspace styles.

Example

Executing the example requires that repository contains a workspace with the IWSTYLE identifier containing several styles.

Add links to the Andy, Metabase system assemblies.


Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Sts: IWxStyles;
    style: IWxStyle;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
    Sts := Ws.Styles;
    style := Sts.Item(Sts.Count - 1);
    style.Delete;
    (ws As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Sts: IWxStyles;
    style: IWxStyle;
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    Sts := Ws.Styles;
    style := Sts.Item[Sts.Count - 
1];
    style.Delete();
    (ws 
As IMetabaseObject).Save();
End Sub;

After executing the example the last style is deleted from the list.

See also:

IWxStyles