IWxWorkspace.Styles

Syntax

Styles: IWxStyles;

Styles: Prognoz.Platform.Interop.Andy.IWxStyles;

Description

The Styles property returns a workspace styles collection.

Example

Executing the example requires that repository contains a workspace with the WSP identifier.

Add links to the Andy, Drawing, Metabase system assemblies.

Sub userproc;
Var
    mb: IMetabase;
    wp: IWxWorkspace;
    Sts: IWxStyles;
    style: IWxStyle;
Begin
    // Get workspace
    mb := MetabaseClass.Active;
    wp := mb.ItemById("WSP").Edit As IWxWorkspace;
    Sts := wp.Styles;
    style := wp.CreateStyle;
    style.Id := "MyStyle";
    Sts := wp.Styles;
    style := Sts.FindById("My_Style");
    style := Sts.Item(0);
    style.BackgroundBrushForeColor := GxColor.FromName("Red");
    //Save changes
    (wp As IMetabaseObject).Save;
End Sub userproc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wp: IWxWorkspace;
    Sts: IWxStyles;
    style: IWxStyle;
    GxColor: GxColorClassClass = New GxColorClassClass();
    Color: GxColorClass_2 = New GxColorClass_2();
Begin
    
// Get workspace
    mb := Params.Metabase;
    wp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    Sts := wp.Styles;
    style := wp.CreateStyle();
    style.Id := 
"MyStyle";
    Sts := wp.Styles;
    style := Sts.FindById(
"My_Style");
    style := Sts.Item[
0];
    style.BackgroundBrushForeColor := GxColor.FromName(
"Red");
    
//Save changes
    (wp As IMetabaseObject).Save();
End Sub;

After executing the example the color of background fill is changed for the found style.

See also:

IWxWorkspace