Protect the diagram library browser from adding new masters

Applies to: Nevron Diagram for .NET

How to protect the diagram library browser from adding new masters?

You can protect the library from new items being inserted with the following code:

[C#]
NAbilities protection = libraryDocument.Protection;
protection.InsertElements = false;
libraryDocument.Protection = protection;

[VB.NET]
Dim protection As NAbilities = libraryDocument.Protection
protection.InsertElements = False
libraryDocument.Protection = protection

This code must be executed for each library document displayed in the library browser. You can do that like this:

[C#]
foreach (NLibraryGroup group in libraryBrowser.Bands)
{
    NLibraryDocument libraryDocument = group.Document;
  
    // insert protection code here
}

[VB.NET]
For Each group As NLibraryGroup In libraryBrowser.Bands
    Dim libraryDocument As NLibraryDocument = group.Document
      
    ' insert protection code here
Next

Article ID: 30, Created On: 10/5/2010, Modified: 11/15/2010

Comments (1)

Lutz Möller

You have to set the InsertElement Attribute to true for protection.

7/12/2013 at 7:43 AM