Count: Integer;
The Count property returns number of workspace styles.
Executing the example requires that the repository contains a workspace with the IWSTYLE identifier that contains several styles.
Add links to the Andy, Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Wsp: IWxWorkspace;
Sts: IWxStyles;
style: IWxStyle;
Begin
// Get workspace for editing
Mb := MetabaseClass.Active;
Wsp := Mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
Sts := Wsp.Styles;
style := Sts.Item(Sts.Count - 1);
style.Delete;
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the last style is deleted from the list.
See also: