Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic serialized tag (Read 4252 times)
Arturo Peņa
Guest


serialized tag
Dec 21st, 2005 at 5:18pm
Print Post  
I'm using flowcart .net PRO

I was trying to save the tag objects of each component in the diagram
using the XML Writer, but reading the documentation it says something
about serialization.

I Tried to make a serialized class but I had no success.
I tried the samples in the documentation but are written in c#
I tried to convert them to VB NET, but some properties
does not appear as shown in the sample code.

I would like to see in the XML file the tag objects are saved as well.

If you dont mind,  would you give me a simple lines of code in order to
saved
the tag objects. I just need a little help.


Reading a previous post it says that an event is raised for this purpose, I can't find tha event browsing the all the events avalilable.

what i found it was

Dim d As New MindFusion.FlowChartX.Xml.SerializeTagEvent(AddressOf myfunction)

But I dont now how to make the association with the control flowchart1, so that the events is correctly raised.


i also read tthat having a variable type, xmlwriter
it has a property to assing the event
but the propertry is not shown as the sample code says.


private void Write(string fileName)
{

                 MindFusion.FlowChartX.Xml.XmlWriter writer =

                       new MindFusion.FlowChartX.Xml.XmlWriter(_flowChart);



                 writer.SerializeTag += new MindFusion.FlowChartX.Xml.SerializeTagEvent(

                       this.SerializeTag);




as i said the property .SerializeTag
is not shown for the variable "writer" when writing the code.















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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: serialized tag
Reply #1 - Dec 21st, 2005 at 6:08pm
Print Post  
In VB.NET it is easiest to handle events using the WithEvents variable declaration and the Handles keyword, e.g. declare the XmlWriter object as class variable and add a handler for SerializeTag:

Code
Select All
Dim WithEvents xwriter As MindFusion.FlowChartX.Xml.XmlWriter

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    xwriter = New MindFusion.FlowChartX.Xml.XmlWriter(fc)
    xwriter.Write("C:\test.xml")
End Sub

Private Sub xwriter_SerializeTag(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.Xml.SerializeTagArgs) Handles xwriter.SerializeTag
    e.Representation = e.Object.Tag.ToString()
End Sub

 

  
Back to top
 
IP Logged
 
Arturo Peņa
Guest


Re: serialized tag
Reply #2 - Dec 21st, 2005 at 8:02pm
Print Post  
perfect just what i need

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