IWxObject.Protection

Syntax

Protection(ObjectProperty: WxObjectProperty): Boolean;

Protection[ObjectProperty: Prognoz.Platform.Interop.Andy.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 default property value is False.

Example

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

Add links to the Andy, 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;
Imports Prognoz.Platform.Interop.Andy;
 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shape: IWxShape;
Begin
    
// Get repository
    mb := Params.Metabase;
    wsp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    Shape := wsp.Shapes.Item[
0];
    Shape.Protection[WxObjectProperty.wopEntityFree] := 
False;
    (wsp 
As IMetabaseObject).Save();
End Sub;

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

See also:

IWxObject