IWxWorkspace.Views

Syntax

Views: IWxViews;

Views: Prognoz.Platform.Interop.Andy.IWxViews;

Description

The Views property returns a workspace views collection.

Example

Executing the example requires a form with the Button1 button, the WorkspaceBox component and the UiWorkspace component named UiWorkspace1, which is a data source for WorkspaceBox.

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

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    wsp: IWxWorkspace;
    Arrow: IWxArrow;
    view: IWxView;
    Shapes: IWxShapes;
    SelectS: IWxSelectedShapes;
    Rec: IWxRectangle;
Begin
    wsp := UiWorkspace1.WxWorkspace;
    Arrow := wsp.CreateArrow;
    Arrow.FirstPoint := New GxPointF.Create(12);
    Arrow.LastPoint := New GxPointF.Create(319);
    Arrow.Angle := 10;
    Shapes := wsp.Shapes;
    Rec := wsp.CreateRectangle;
    Rec.Id := "Rectangle1";
    Rec.PinPosition := New GxPointF.Create(12.3,-10);
    view := wsp.Views.Item(0);
    SelectS := view.SelectedShapes;
    SelectS.Add(Shapes.Item(0));
    SelectS.Add(shapes.Item(1));
    SelectS.Align(WxShapesAlignment.VerticalCenter);
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Ui;

 
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    wsp: IWxWorkspace;
    Arrow: IWxArrow;
    WinAppCls: WinApplicationClass = 
New WinApplicationClassClass();
    b, b1: Boolean;
    view: IWxView;
    Shapes: IWxShapes;
    SelectS: IWxSelectedShapes;
    Rec: IWxRectangle;
    
Begin
    wsp := uiWorkspaceNet1.WxWorkspace;
    Arrow := wsp.CreateArrow();
    Arrow.FirstPoint.Create(
12);
    Arrow.LastPoint.Create(
319);
    Arrow.Angle := 
10;
    Shapes := wsp.Shapes;
    Rec := wsp.CreateRectangle();
    Rec.Id := 
"Rectangle1";
    Rec.PinPosition.Create(
12.3,-10);
    view := wsp.Views.Item[
0];
    SelectS := view.SelectedShapes;
    SelectS.Add(Shapes.Item[
0]);
    SelectS.Add(shapes.Item[
1]);
    SelectS.Align(WxShapesAlignment.wsaVerticalCenter);
 
End Sub;

After executing the example the selected shapes are aligned to the vertical center.

See also:

IWxWorkspace