Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic a program about ShapeLibrary  and save&lo (Read 1639 times)
grayhound
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Nov 8th, 2006
a program about ShapeLibrary  and save&lo
May 15th, 2007 at 3:59am
Print Post  
1. I get the box sharp from my customer ShapeLibrary
Code
Select All
	  protected ShapeTemplate GetSharpFromId(string sharpId)
	  {
		ShapeLibrary shapes = ShapeLibrary.LoadFrom(Application.StartupPath +
		@"\GraphicElements\SharpLibrary.shl");
		ShapeTemplate[] st = shapes.Shapes;   //if i don't put this sentence, the next sentence will return null
		return ShapeTemplate.FromId(sharpId);
	  }
 



2. Draw the Box


3. flowChart.SaveToString(true);

4. flowChart.LoadFromString(flString)


what's the program?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: a program about ShapeLibrary  and save&lo
Reply #1 - May 15th, 2007 at 4:58am
Print Post  
Is the shape library loaded when you call flowChart.LoadFromString(flString)? The shape definitions are not stored in the files/string saved using the FlowChart.Save* methods, so you will get a generic shape if the library is not loaded the next time you load the diagram.

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


I love YaBB 1G - SP1!

Posts: 19
Joined: Nov 8th, 2006
Re: a program about ShapeLibrary  and save&am
Reply #2 - May 15th, 2007 at 11:41pm
Print Post  
Thank you, the program has been solved.
anthoer question is :
Code
Select All
protected ShapeTemplate GetSharpFromId(string sharpId)
{
ShapeLibrary shapes = ShapeLibrary.LoadFrom(Application.StartupPath +
@"\GraphicElements\SharpLibrary.shl");
ShapeTemplate[] st = shapes.Shapes;   //if i don't put this sentence, the next sentence will return null
return ShapeTemplate.FromId(sharpId);
}
 



if i don't use 'ShapeTemplate[] st = shapes.Shapes;' this sentence ,ShapeTemplate will not caontain the Sharp i designed.
and when i use that sentence, ShapeTemplate will contain my sharps.

but i did't use st anywhere
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: a program about ShapeLibrary  and save&lo
Reply #3 - May 16th, 2007 at 5:40am
Print Post  
I could not reproduce that problem. Could you email the SharpLibrary.shl file to support@mindfusion.eu so we can test with it?

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