Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic saving simple integer value in .tag property (Read 2108 times)
alexdoan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jun 16th, 2006
saving simple integer value in .tag property
Jul 2nd, 2006 at 10:59am
Print Post  
I am saving a simple integer value in the .tag property.
This is not being saved when I save with xml writer.

how do i use SerializeTagArgs.Representation???

the help files says u have to set this to work...

what do i set this to???

please give simple examples of serializing simple integer value in .tag property.

and then reading in back with xml.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: saving simple integer value in .tag property
Reply #1 - Jul 3rd, 2006 at 5:47am
Print Post  
Here is a complete example:

Code
Select All
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim xw As New XmlWriter(fc)
  AddHandler xw.SerializeTag, AddressOf WriteTag
  xw.Options.CustomTagSerialization = False
  xw.Write("C:\test.xml")
End Sub

Private Sub WriteTag(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.Xml.SerializeTagArgs)
  If TypeOf e.Object Is Box Then
    Dim b As Box = e.Object
    e.Representation = b.Tag.ToString()
  End If
End Sub

Private Sub fc_InitializeBox(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.BoxEventArgs) Handles fc.InitializeBox
  e.Box.Tag = fc.Boxes.Count
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  Dim xr As New XmlReader(fc)
  AddHandler xr.DeserializeTag, AddressOf ReadTag
  xr.Options.CustomTagSerialization = False
  xr.Read("C:\test.xml")
End Sub

Private Sub ReadTag(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.Xml.SerializeTagArgs)
  If TypeOf e.Object Is Box Then
    Dim b As Box = e.Object
    b.Tag = Integer.Parse(e.Representation)
  End If
End Sub
 



Stoyan
  
Back to top
 
IP Logged
 
alexdoan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jun 16th, 2006
Re: saving simple integer value in .tag property
Reply #2 - Jul 3rd, 2006 at 5:47pm
Print Post  
thanks.

your tech support is GREAT...

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: saving simple integer value in .tag property
Reply #3 - Jul 4th, 2006 at 6:11am
Print Post  
8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint