Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Brush Serialization (Read 2313 times)
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Brush Serialization
Apr 2nd, 2010 at 2:05pm
Print Post  
I want to store a ShapeNode's Brush in a database. I know that I did this in Planner.NET  by serializing it using this method:

MindFusion.Drawing.Brush.Serialize

That was years ago. Apparently that method is no longer available, at least in the FlowChart.NET Drawing assembly. Is there some other method you are using as a replacement?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Brush Serialization
Reply #1 - Apr 2nd, 2010 at 3:20pm
Print Post  
The method is still there, but it has the EditorBrowsableState.Never attribute set. So Intellisence won't show it in the auto completion drop-down, but you can still use it and the project should compile fine.

Stoyan
  
Back to top
 
IP Logged
 
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Re: Brush Serialization
Reply #2 - Apr 2nd, 2010 at 4:05pm
Print Post  
That worked. And I can see both the Serialize and Deserialize methods in Object Browser if I check the 'Show Hidden' option.

Just out of curiosity why would you hide those methods? We database app developers find them useful for saving Brush, Pen, etc. data.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Brush Serialization
Reply #3 - Apr 6th, 2010 at 5:44am
Print Post  
Now there is a TypeConverter associated with Brush that allows converting Brush-derived objects from / to string, and I suppose our developer might have decided that's enough...

Many .NET services use type converters automatically (possibly data-binding too), but you can also explicitly get a converter and apply it like this:

TypeConverter converter = TypeDescriptor.GetConverter(e.Node.Brush);
string brushString = converter.ConvertToString(e.Node.Brush);

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