Nevron .NET Vision Documentation
Library Documents

Library documents (or simply libraries) are represented by the NLibraryDocument class (derived from NDocument). This type of document is in fact a collection of masters. Masters are reusable drawing clippings, which can be instanced in every drawing. Library documents are components, which appear in the Visual Studio toolbox.  They are represented by the following item:

In the context of WinForms drawing documents are displayed and edited with the help of a NLibraryView instance(s).

Masters

Masters are collections of diagram elements, which can be reused in multiple drawings. Masters are stored in libraries. Masters store all the needed information, which is required for the proper duplication of the elements they contain. Currently this includes:

In order for masters to be displayed in library views, each master must provide three images:

If one of these images is not specified (which is the most common case) it will be automatically generated for the master, from an instance of the NMasterImageGenerator class, which is an attribute of every library.

You can easily create a master from any set of diagram elements. The following example creates a master, which contains a rectangle shape, measured in millimeters:

C#
Copy Code
NRectangleShape rect = new NRectangleShape(0, 0, 30, 30);
NMaster master = new NMaster(rect, NGraphicsUnit.Millimeter, "My first master", "Drag me on the drawing");
library.AddChild(master);
Visual Basic
Copy Code
Dim rect As New NRectangleShape(0, 0, 30, 30)
Dim master As New NMaster(rect, NGraphicsUnit.Millimeter, "My first master", "Drag me on the drawing")
library.AddChild(master)
Data exchange

By default libraries add an instance of the NLibraryDataObjectAdaptor class to their DataObjectAdaptors collection. This type of adaptor can adapt data objects of the following formats:

Related Examples
Windows Forms: Visual Interface Components - Library Browser
See Also

 

 


©2017. Nevron Software LLC.

Send Feedback