Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) I could facilitate an example (Read 7856 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I could facilitate an example
Reply #15 - Oct 5th, 2008 at 8:30am
Print Post  
Do you mean that the Tag value is lost? Are you handling the SerializeTag and DeserializeTag events?
  
Back to top
 
IP Logged
 
calin36
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 10th, 2008
Re: I could facilitate an example
Reply #16 - Oct 5th, 2008 at 6:02pm
Print Post  
What is lost is the description of the node.
because I can not do the following:

node.Bounds.X = CType(dt.Rows .Item("BoundsX"), Single)

happened and I get error:
Expression is a value and therefore cannot be the  target of an assignment.

Without this property I can not assign which to situate ??

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I could facilitate an example
Reply #17 - Oct 6th, 2008 at 8:05am
Print Post  
By that the compiler means that node.Bounds returns a value on the stack, because RectangleF is a value type, and setting its X property would not actually change the rectangle instance stored for 'node'. What you can do is to assign a RectangleF object to Bounds:

float x = CType(dt.Rows .Item("BoundsX"), Single)
...
node.Bounds = new RectangleF(x, y, w, h)

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 10th, 2008
Re: I could facilitate an example
Reply #18 - Oct 9th, 2008 at 3:32pm
Print Post  
Dear Stoyan,
You still can not get results with what I sent.
Questions:
1.-How can I tell if an eclipse or a rectangle.
if the For Each runs as I can know what kind of object is, because when it does what it does is to remove all control and take all the checks.
I like the following code:

For Each node In diagram.Nodes

           Dim xxx As Integer = node.Bounds.X

           Dim yyy As Integer = node.Bounds.Y

           Dim nom As String = node.Tag

           Dim www As Integer = node.Bounds.Width

           Dim hhh As Integer = node.Bounds.Height

           ' Dim fff = node.Bounds.Top



           If TypeOf node Is ShapeNode Then

               'Me.Response.Write("nom, xxx, yyy, www, hhh, fff")

               Dim Resul1 As Integer

               Resul1 = SqlHelper.ExecuteNonQuery(strConnection, _

                                              "INS_MAPANODO_LOCALIZACION", _

                                              New SqlParameter("@cod_mapa", CType(Request("cod_mapa"), Integer)), _

                                              New SqlParameter("@Tag", CType(nom, String)), _

                                              New SqlParameter("@BoundsX", CType(xxx, String)), _

                                              New SqlParameter("@BoundsY", CType(yyy, String)), _

                                              New SqlParameter("@Width", CType(www, String)), _

                                              New SqlParameter("@Width", CType(www, String)))



              

           End If

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I could facilitate an example
Reply #19 - Oct 10th, 2008 at 6:43am
Print Post  
Use CType to cast node to ShapeNode, and then check the ShapeNode.Shape.Id property.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Sep 10th, 2008
Re: I could facilitate an example
Reply #20 - Oct 13th, 2008 at 3:56pm
Print Post  
Stoyan,
I can record in the database coordinates (x, y, w, h), but I want to read this information, looking like objects (ellipse, rectangle, document etc.) so that when you open the diagram read the data on my new table, EJM:

1 .- the first time I open the diagram shows the default coordenads which I defined.
2.-Now if I move the objects and I record it on the table Guerda Map Nodes

3.-then if I want to see the diagrma with new definitions as achievement?

While this code covers all control and brings out the locations of all objects as I can go all the control and assign a function only of ellipses, rectangles, so you find:

For Each node In diagram.Nodes

           Dim xxx As Integer = node.Bounds.X

           Dim yyy As Integer = node.Bounds.Y

           Dim nom As String = node.Tag

           Dim www As Integer = node.Bounds.Width

           Dim hhh As Integer = node.Bounds.Height

           Dim fff = node.Bounds.Top



           If TypeOf node Is ShapeNode Then

               MsgBox(nom & " " & xxx & " " & yyy & " " & www & " " & hhh & " ")

           End If



       Next node

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I could facilitate an example
Reply #21 - Oct 14th, 2008 at 9:21am
Print Post  
If you are asking how to save and restore the ShapeNode.Shape, it should look like this:

dim id as string
dim snode as ShapeNode
snode = CType(node, ShapeNode)
id = snode.Shape.Id
datatable["id"] = id
'adapter.Update(...)

and later

'adapter.Fill(...)
id = datatable["id"];
snode.Shape = Shape.FromId(id)

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint