Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SaveLocationState and RestoreLocationState (Read 1903 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
SaveLocationState and RestoreLocationState
Feb 19th, 2010 at 11:22am
Print Post  
Hi Stoyo

Why RestoreLocationState and SaveLocationState functions are not implemeted in DiagramItem class with empty implementation ?
DiagramLink and ShapeNode classes are derived from diagramItem class.

In following implementation, one need to explicitly typecast the object in correct object type to make call for these functions.


protected override void OnMouseUp(MouseButtonEventArgs e)


{



if (Diagram.Interaction != null && dragSegment != DragLinkSegment.None)



{




var link = (DiagramLink)Diagram.Interaction.CurrentItem;




var state = link.SaveLocationState();




base.OnMouseUp(e);




link.RestoreLocationState(state);




return;



}




if (bMouseButtonDown)




base.OnMouseUp(e);


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SaveLocationState and RestoreLocationState
Reply #1 - Feb 19th, 2010 at 1:56pm
Print Post  
Hi Rajesh,

They are virtual methods defined in DiagramItem. You don't actually need the type-cast operation.

Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: SaveLocationState and RestoreLocationState
Reply #2 - Feb 19th, 2010 at 2:09pm
Print Post  
Hi Stoyo

Sorry for this question. I guess I checked these functions at wrong place in ObjectBrowser.

-Rajesh
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint