Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Inheriting Box and Arrow (Read 3890 times)
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Inheriting Box and Arrow
Oct 27th, 2006 at 11:55am
Print Post  
Hello Stoyan,

i am trying to inherit Box and Arrow Classes, and make my own classes for them.

I am not able to inherit box as the VS.NET compiler gives an error - Quote:
"No overload for method 'Box' takes '0' arguments"


Same error for Arrow - Quote:
"No overload for method 'Arrow'"


What could be the problem?

There is no sample which has custom boxes and arrows.

Requirement for custom boxes and arrows is for a runtime customisation while drawing.

Also i would like to ask whether i can store an object of another class in the Box.Tag?? Are there any known problems in this?

Cheers

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Inheriting Box and Arrow
Reply #1 - Oct 27th, 2006 at 4:47pm
Print Post  
Hello Phil,

You must call the base Box/Arrow class constructors, which take a FlowChart argument, so that should look like:

MyBox(FlowChart fc) : base(fc) {...}

You can handle the DrawBox/DrawArrow events to customize the drawing code without inheriting the box or arrow classes.

You can store objects as Tag values. If the objects are from a serializable class, they will be saved/loaded together with the rest of the items' data when serializing the flowchart.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Inheriting Box and Arrow
Reply #2 - Oct 30th, 2006 at 7:25am
Print Post  
Hello Stoyan,

Thanks for your reply.
Quote:
You can store objects as Tag values. If the objects are from a serializable class, they will be saved/loaded together with the rest of the items' data when serializing the flowchart.


Does this mean i can store more than one object in a single box tag?

Same question on an arrow tag.

Cheers

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Inheriting Box and Arrow
Reply #3 - Oct 30th, 2006 at 7:36am
Print Post  
Hello Phil,

I guess you could create a serializable collection class and store several objects per Tag through an instance of that collection, or create a compound class if the objects will be from different types.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Inheriting Box and Arrow
Reply #4 - Oct 30th, 2006 at 2:17pm
Print Post  
Stoyan,

Well that would be obvious thing to do, my question was more relating to custom properties to the box and arrow class. Sorry .... my mistake in not wording it right. But i meant it differently Smiley

I need to store 2 different objects in one arrow/box class object or have some custom parameters which takes object type. So either it would be compound class on my end or properties from your end. It seems that the former is the most obvious thing.

If custom properties is there, i would not have been required to inherit the classes and make my own classes for diagramming.

Thanks a ton anyways. Great support!!! Grin Cheesy 8)

Cheers

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Inheriting Box and Arrow
Reply #5 - Oct 30th, 2006 at 4:38pm
Print Post  
Hello Phil,

At this time it is not very easy to use custom Box and Arrow classes; there will be better support for that in version 5 of the control. So that leaves us with the compound class option  Smiley Take a look at the SiteMap sample project - it defines file additional properties for boxes through the PageProps class.

Cheers,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint