IWxWorkspace.Modified

Syntax

Modified: Boolean;

Modified: boolean;

Description

The Modified property returns True if there are any changes made in a workspace.

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;
    b, b1: Boolean;
Begin
    wsp := UiWorkspace1.WxWorkspace;
    Arrow := wsp.CreateArrow;
    Arrow.FirstPoint := New GxPointF.Create(12);
    Arrow.LastPoint := New GxPointF.Create(319);
    Arrow.Angle := 10;
    If wsp.Modified Then
    b := WinApplication.YesNoCancelBox("Save changed data?", b1);
        If b1 Then
        Else
            wsp.Undo(wsp.UndoNumSteps);
        End If;
    End If;
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;
Begin
    wsp := uiWorkspaceNet1.WxWorkspace;
    Arrow := wsp.CreateArrow();
    Arrow.FirstPoint.Create(12);
    Arrow.LastPoint.Create(319);
    Arrow.Angle := 10;
    If wsp.Modified Then
    b := WinAppCls.YesNoCancelBox("Save changed data?"Var b1, New IWin32WindowForeAdapter(Self));
        If b1 Then
        Else
            wsp.Undo(wsp.UndoNumSteps);
        End If;
    End If;
End Sub;

After executing the example and in case there are any changes made in a workspace, the user is prompted to save them.

See also:

IWxWorkspace