IWxStyle.Id

Syntax

Id: String;

Id: string;

Description

The Id property determines formatting style identifier.

By default, styles will be assigned with the Style N identifiers, where N is a style number.

Example

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

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

Sub UserProc;
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    style: IWxStyle;
Begin
    // Get workspace for edit
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
    style := wsp.CreateStyle;
    style.Id := "New_Style";
    style.IsPrivate := False;
    style.BackgroundBrushForeColor := GxColor.FromName("Red");
    style.ShadowBrushForeColor := GxColor.FromName("Yellow");
    style.TextAlignmentHorizontal := GxAlignment.Far;
    (wsp 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;
    wsp: IWxWorkspace;
    style: IWxStyle;
    SColor: GxColorClassClass = 
New GxColorClassClass();
Begin
    
// Get workspace for edit
    mb := Params.Metabase;
    wsp := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    style := wsp.CreateStyle();
    style.Id := 
"New_Style";
    style.IsPrivate := 
False;
    style.BackgroundBrushForeColor := SColor.FromName(
"Red");
    style.ShadowBrushForeColor := SColor.FromName(
"Yellow");
    style.TextAlignmentHorizontal := GxAlignment.walFar;
    (wsp 
As IMetabaseObject).Save();
End Sub;

After executing the example the added style is displayed in the styles collection.

See also:

IWxStyle