示例#1
0
 void ExecuteDeselectAll(object o)
 {
     if (CurrentPolygon != null)
     {
         CurrentPolygon.DeselectAll();
     }
     SelectedField = null;
     FieldView.RefreshView();
 }
示例#2
0
        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();
        }
示例#3
0
        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();
            };
        }