60001829 New Sample added that shows how to Display extra properties for specific object types on grid window

Article 60001829
Type General
Product Engine
Version 6023
Date Added 10/25/2012
Fixed (10/26/2012)
Submitted by Dobriyan Benov


New Sample added that shows how to Display extra properties for specific object types on grid window


In 6024 we added one more sample in our .NET samples in c# and also in VB .NET.
The name of the sample is CustomPropertyTovdFigure


In this example we demonstrate a way to add to the properties list properties that are not implemented in VectorDraw figures.
For example you can add extra properties like Area , Length , Handle etc... to our figures like vdLine vdCircle etc...
We do not by default add these properties to our objects because they require calculation and it can be very heavy depending the object but if someone really needs these properties they can be added as explained to the sample
Specially when a lot of objects are selected at the same time , for example 10.000 polylines , try to imagine the calculations of the area that are going to be made.
This is because when a lot of objects are selected the properties list gets all the properties of the objects and compares them in order to find similar values. In some cases this can slow down a lot selecting of entities.

Note that this is not a way to Globalize the Properties list. It is to add some custom properties that may be required to an application.
This way can show the properties list functionality so please be carefull on how many properties you additionally add to figures.

For the implementation of this we added a new event described below
We added the VectorDraw.Serialize.PropertyDescriptorEvents.GlobalPropertyDescriptorEvents.OnAddExtraProperties event.
This event is fired only once when the object descriptor is created to the properties list. It will not pass every time you select an item.
In this event you basically state the extra properties that you are going to implement for certain types using the VectorDraw.Serialize.CustomizePropertyDescriptor.Create method.

Please check the sample in our .NET samples for more information.

NOTE: Custom vdFigure objects do not need this implemantation because developer can export his own properties and make them visible to property grid.

Send comments on this topic.