IWxStyles.FindById

Syntax

FindById(Id: String): IWxStyle;

FindById(Id: String): Prognoz.Platform.Interop.Andy.IWxStyle;

Parameters

Id. Identifier.

Description

The FindById method searches for a style by the defined identifier.

Example

Executing the example requires that repository contains a workspace with the IWSTYLE identifier containing a style with the New_Style identifier.

Add links to the Andy, Drawing, 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.FindById(
"New_Style");
    style.BackgroundBrushForeColor := GxColor.FromName(
"Red");
    (ws 
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;
    ws: IWxWorkspace;
    Sts: IWxStyles;
    style: IWxStyle;
    Color: GxColorClassClass = 
New GxColorClassClass();
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    Sts := 
ws.Styles;
    style := Sts.FindById(
"New_Style");
    style.BackgroundBrushForeColor := Color.FromName(
"Red");
    (ws 
As IMetabaseObject).Save();
End Sub;

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

See also:

IWxStyles