Locking Down a LibraryView


Author
Message
Jason Irby
Jason Irby
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 59, Visits: 77

 

Hello,

 

I have created my own shape library and am loading it into a LibraryView control so the user can drag my predefined shapes on to a diagram.  However, I do not wish them to be able to:

1. Delete any of the shape masters currently on the libraryview

2. Drag and diagram shapes back onto the libraryview causing duplicates of the masters

 

I was looking for some kind of protection property to set but I could find none. 

Is there any way to lock dow nthe libraryview to prevent the user from modifying it but still be able to pull off it?

 

Thanks in advance,

Jason


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Jason,

To protect the library from masters deletion -> raise its RemoveElements protection. In fact for a completely locked down library you can protect it from RemoveElements, InsertElements and ReorderElements like this:

NAbilities protection = libraryDocument.Protection;
protection.RemoveElements = true;
protection.ReorderElements = true;
protection.InsertElements = true;
libraryDocument.Protection = protection;

Another way to prevent inserting elements with drag and drop is to set the AllowDrop property of the library view to false:

libraryView.AllowDrop = false;

When a certain action cannot be performed because of protection, the view will display a message. You can disable view messages like this:

libraryView.ShowMessages = false;

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search