Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Subclassing BOX (Read 2455 times)
Aaron
Guest


Subclassing BOX
Apr 21st, 2006 at 8:59pm
Print Post  
How do you subclass the BOX class while still using the CreateBox function?
  
Back to top
 
IP Logged
 
Aaron
Guest


Re: Subclassing BOX
Reply #1 - Apr 24th, 2006 at 12:57am
Print Post  
There are several properties that I need to add to the BOX and  TABLE classes. Would it be safer to buy the code and add the few properties that I need or would it be doable to subclass each calss and add the properties. I fear that I wil run into issues of functions delivered with each class not working properly using the subclassing approach....
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Subclassing BOX
Reply #2 - Apr 24th, 2006 at 9:59am
Print Post  
You can subclass a box and use the

flowchart.Add(new NodeClass())

to create objects of the new class.

However it is easier to attach the additional properties to the Box.Tag and Table.Tag, otherwise you will also have to subclass the FlowChart class in order to implement serialization.

Stoyan
  
Back to top
 
IP Logged
 
Aaron
Guest


Re: Subclassing BOX
Reply #3 - Apr 24th, 2006 at 11:04am
Print Post  
OK! So if you store in the tag a class rather than a single identification value, then you can not use your find node function, correct?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Subclassing BOX
Reply #4 - Apr 24th, 2006 at 12:31pm
Print Post  
You can still keep id values in the tag objects. Override the Equals method of the tag class if you need to use the flowchart's FindBox, or create your own FindBox version that checks the box.Tag.Id.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint