Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic RoundRectangle outline (Read 1746 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
RoundRectangle outline
Feb 25th, 2014 at 12:14am
Print Post  
I defined 2 shapes (actually it should be outline of a shape), like below:
MDShapes.RoundRect = new Shape(
     new ElementTemplate[]
     {
           new RoundRectangleTemplate(0, 0, 100, 100, 8)
     }, FillMode.Winding);
MDShapes.ActivityAccept = new Shape(
     new ElementTemplate[]
     {
           new LineTemplate(0, 0, 100, 0),
           new LineTemplate(100, 0, 100, 100),
           new LineTemplate(100, 100, 0, 100),
           new LineTemplate(0, 100, 8, 50),
           new LineTemplate(8, 50, 0, 0)
     }, FillMode.Winding);

The first one is round rectangle. then i defined 2 node, assign RoundRect to
one node, and assign ActivityAccept to another when. Then save diagram to
string and load the string to diagram again. round recttangle changed to rectangle
and ActivityAccept is still same.

if I assign Shapes.RoundRect to node, then it can be same shape when reload
string to diagram. That's why ? how to resolve it?

Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: RoundRectangle outline
Reply #1 - Feb 25th, 2014 at 11:44am
Print Post  
Shapes are saved only by their string identifier, you will have to specify it as last argument of the Shape constructor:

MDShapes.ActivityAccept = new Shape(..., "ActivityAccept");

You must run that shape initialization code when your application starts to make sure there are shapes associated with the identifiers before loading a diagram. Alternatively, save the custom shapes in a shape library file and load it upon start-up.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: RoundRectangle outline
Reply #2 - Feb 25th, 2014 at 4:24pm
Print Post  
Thanks, it can work well.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint