IWxObject.Protection

Syntax

Protection(ObjectProperty: WxObjectProperty): Boolean;

Parameters

ObjectProperty. It determines the protected property.

Description

The Protection property prevents object properties from being changed. If this property is set to True, the property specified as a parameter is protected from changes.

The property is set to False by default.

Example

Executing the example requires that the repository contains workspace with the WSP identifier containing object.

Add links to the Andy and Metabase system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Wsp: IWxWorkspace;
    Shape: IWxShape;
Begin
    // Get repository
    Mb := MetabaseClass.Active;
    Wsp := Mb.ItemById("WSP").Edit As IWxWorkspace;
    Shape := Wsp.Shapes.Item(0);
    Shape.Protection(WxObjectProperty.EntityFree) := False;
    (Wsp As IMetabaseObject).Save;
End Sub UserProc;

After executing the example deletion of an object located in a workspace is disabled.

See also:

IWxObject