void ExecuteDeselectAll(object o) { if (CurrentPolygon != null) { CurrentPolygon.DeselectAll(); } SelectedField = null; FieldView.RefreshView(); }
void ExecuteAddNewImmediately(object o) { if (CurrentPolygon != null) { CurrentPolygon.DeselectAll(); } var hSize = 20; var location = FieldView.GetCurrentMousePos(); var polygon = new FieldPolygon(); polygon.AddPoint(new Vector2(location.X - hSize, location.Y - hSize)); polygon.AddPoint(new Vector2(location.X + hSize, location.Y - hSize)); polygon.AddPoint(new Vector2(location.X + hSize, location.Y + hSize)); polygon.AddPoint(new Vector2(location.X - hSize, location.Y + hSize)); commitPoly(polygon); FieldView.RefreshView(); }
void ExecuteAddNew(object o) { if (CurrentPolygon != null) { CurrentPolygon.DeselectAll(); } _currentClickableAction = new NewFieldClickAction(); _currentClickableAction.ActionDone += (sender, args) => { var poly = args.Result as IFieldPolygon; if (poly == null) { return; } commitPoly(poly); FieldView.RefreshView(); }; }