IWxStyle.Assign

Syntax

Assign(StyleFrom: IWxStyle);

Assign(StyleFrom: Prognoz.Platform.Interop.Andy.IWxStyle);

Parameters

StyleFrom. Style to be inherited.

Description

The Assign method is used to inherit all properties of another style.

Example

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

Add links to the Andy, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shape, Shape1: IWxShape;
    FormStyle: IWxStyle;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
    wsp.BeginUpdate;
    Shape := wsp.Shapes.Item(0);
    Shape1 := wsp.Shapes.Item(1);
    FormStyle := Shape.Style;
    Shape1.Style.Assign(FormStyle);
    wsp.EndUpdate;
    (wsp As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shape, Shape1: IWxShape;
    FormStyle: IWxStyle;
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    wsp := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    wsp.BeginUpdate();
    Shape := wsp.Shapes.Item[
0];
    Shape1 := wsp.Shapes.Item[
1];
    FormStyle := Shape.Style;
    Shape1.Style.Assign(FormStyle);
    wsp.EndUpdate();
    (wsp 
As IMetabaseObject).Save();
End Sub;

After executing the example, the first object inherits the formatting of the second object.

See also:

IWxStyle