Why do I get a type mismatch error when trying to access the
Shapes or Lines collection?
The shapes and lines collection use the Elements collection which in turn
inherits from DictionaryBase. Dictionaries in the .NET framework (such as
hashtables) store information using a separate Keys and Values ICollection. This
makes lookups of even large collections of objects very quick.
To loop through an Elements collection, or any other dictionary, enumerate
the Values property of the collection e.g.
[C#]
foreach (Element element in
model1.Shapes.Values)
{
}
[Visual Basic]
Dim element As Element Dim shape As Shape
For Each element In Diagram1.Shapes.Values
Next
How do I display text for a Line?
The line class is used as base class for other lines and doesn't have a Label
property. To display a line with a Label, use the Link class instead. The Link
class adds support for a single label and creates an arrow marker at the end
origin automatically.
How can I display more than one Image or Label per Shape?
In previous versions of ERM Diagram, is was possible to display multiple
Images and Labels per Shape using the built in collections. In ERM Diagram 4, a
shape has only one Label and Image defined. To display an element with multiple
images or shapes consider the following options.
- Use the Table class. The Table class has support for multiple groups and
rows, each with their own image and text.
- Add child elements to a ComplexShape. The ComplexShape class supports
unlimited number of child elements, through the Children property. Add a new
SolidElement object for each additional Label or Image you wish to display.
- Create your own custom class. Override the Shape.Render method and draw your
own labels and images using Label.Render and Image.Render.
How do I redistribute the ERM Diagram component for users of my
application?
Files to distribute with your application
- Crainiate.ERM4.dll
- Crainiate.ERM4.Layouts.dll
- msvcp71.dll (Microsoft Visual C++ Runtime library)
- msvcr71.dll (Microsoft Visual C Runtime library)
It is only necessary to distribute the Crainiate.ERM4.Layouts.dll and
Microsoft C/C++ runtimes libraries files if you use the Crainiate.ERM4.Layouts
namespace in your application.
Both .dll files are signed and can be added to the Global Assembly Cache
(GAC). The C/C++ runtime files should be placed in the same folder as the
program, and not in the system folder.
Licensing information to include with your application
When you register your copy of ERM Diagram 4 as a developer, a signed xml
license file is created in the component installation folder (e.g. c:\Program
Files\Crainiate\ERM Diagram 4) or the folder you chose when activating the
component. This file contains information about the registered license holder
for development using the component.
When the component is initialized, it will check the following locations for
a valid license file named ERM4.License.xml
- Any resources contained within your application.
- The application folder e.g. the folder containing your application.
- The installation folder defined by the value of install in the
following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Crainiate\ERM4
When distributing your application, add the ERM4.License.xml file to your
application and select Embedded Resource as the build action from the
File properties window.