Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to fill the Arrow Tag (Read 2149 times)
Dunkelelb
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Apr 24th, 2007
how to fill the Arrow Tag
May 30th, 2007 at 5:13am
Print Post  
Hello,

Potentail I'd like to search for Arrows.
therefor I got to fill the Arrow Tag. How?

at first I want to know if that tables exist
Code
Select All
if ((flowChart6.FindTable(_hilfsstring3) != null) && (flowChart6.FindTable(_hilfsstring4)) != null) 


--> now I'd like to fill the TableTags (_hilfsstring3 and _hilfsstring4) in the tag of the new Arrow
HOW?

--> creating the Arrow
Code
Select All
flowChart6.CreateArrow(flowChart6.FindTable(_hilfsstring3), flowChart6.FindTable(_hilfsstring4)); 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to fill the Arrow Tag
Reply #1 - May 30th, 2007 at 6:02am
Print Post  
Hi,

You can create a new class, e.g. ArrowTag, with two string members and use its instances as arrow tags. When creating an arrow, assign an ArrowTag object to the arrow.Tag and set its two members. If you want to use FindArrow(), implement the ArrowTag.Equals method, and you will be able to search for tags like this:

fc.FindArrow(new ArrowTag(string1, string2));

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Dunkelelb
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Apr 24th, 2007
Re: how to fill the Arrow Tag
Reply #2 - May 30th, 2007 at 8:37am
Print Post  
hello,

thanks for your suggestion.
But I don't understand that complete.
(exist  there any sample for that?)


meanwhile I solved it another way.
Code
Select All
flowChart6.CreateArrow(flowChart6.FindTable(_hilfsstring3), flowChart6.FindTable(_hilfsstring4)).Tag = _hilfsstring3 +";"+ _hilfsstring4 



or better
Code
Select All
_hilfstable = new Table[2];
				    _hilfstable[0] = flowChart6.FindTable(_hilfsstring3);
				    _hilfstable[1] = flowChart6.FindTable(_hilfsstring4);
arrow6[i] = flowChart6.CreateArrow(_hilfstable[0], _hilfstable[1]);
//arrow is defined private Arrow[]  arrow6 = new Arrow[..];
arrow6[i].Tag = _hilfsstring3 +";"+ _hilfsstring4;

 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to fill the Arrow Tag
Reply #3 - May 30th, 2007 at 9:09am
Print Post  
Hello,

FindArrow works by calling the Object.Equals method, comparing the items tags with the value passed as argument to FindArrow. So if you use objects from a custom class as tags, you must override Equals() and implement the equality logic by comparing the class fields.

Using concatenated strings is not a bad solution either, so use whatever method you prefer  Smiley

Stoyan
  
Back to top
 
IP Logged
 
Dunkelelb
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Apr 24th, 2007
Re: how to fill the Arrow Tag
Reply #4 - May 30th, 2007 at 12:41pm
Print Post  
Thanks Roll Eyes

but now I think your way could  be the better one.

Now I want to search for the connections of a table
--> so I got to search the Arrow (there I only know the half of the Tag)

for that concatenated strings don t seem to be the best choice
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to fill the Arrow Tag
Reply #5 - May 30th, 2007 at 12:50pm
Print Post  
If you need to find all arrows connected to a table, better iterate over the IncomingArrows or OutgoingArrows collections of the table or its rows.  That should be faster than using FindArrow.

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