Created
December 18, 2015 18:47
-
-
Save alanmcgovern/2f8efc914e256f4e18b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task DragConnectionLineAsync (DesignerItem item, Point location) | |
{ | |
if (!Renderer.CaptureMouse ()) | |
return; | |
IPhoneDesignerItem source; | |
var scene = item as SceneDesignerItem; | |
if (scene != null) | |
source = scene.ViewController; | |
else | |
source = (IPhoneDesignerItem) item; | |
var createConnection = new SceneConnectionCreateLine (source, location); | |
surfaceDragOperation = new AsyncDragOperation (); | |
try { | |
AddVisualItem (createConnection); | |
GetVisualItemCapture (createConnection); | |
await surfaceDragOperation.MouseReleased (); | |
} finally { | |
ReleaseVisualItemCapture (); | |
RemoveVisualItem (createConnection); | |
surfaceDragOperation = null; | |
} | |
ShowCreateConnectionMenu (createConnection.PossibleConnections); | |
// the menu seems to eat the key up event | |
currentModifier = ModifierKeys.None; | |
} | |
async Task DragSelectionRectAsync (DesignerItem item, Point location) | |
{ | |
if (!Renderer.CaptureMouse ()) | |
return; | |
var selectionRect = new MultipleSelectionRectangle (item, location); | |
surfaceDragOperation = new AsyncDragOperation (); | |
try { | |
AddVisualItem (selectionRect); | |
await surfaceDragOperation.MouseReleased (); | |
} finally { | |
RemoveVisualItem (selectionRect); | |
surfaceDragOperation = null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment