protected override void detachSubject(IReactiveShape subject) { Subject.MouseDown -= Subject_MouseDown; Subject.MouseUp -= Subject_MouseUp; Subject.MouseMove -= Subject_MouseMove; Subject.DragCancel -= Subject_DragCancel; }
protected override void attachSubject(IReactiveShape subject) { Subject.MouseDown += Subject_MouseDown; Subject.MouseUp += Subject_MouseUp; Subject.MouseEnter += Subject_MouseEnter; Subject.MouseLeave += Subject_MouseLeave; }
protected override void attachSubject(IReactiveShape subject) { Subject.MouseDown += Subject_MouseDown; Subject.MouseUp += Subject_MouseUp; Subject.MouseMove += Subject_MouseMove; Subject.DragCancel += Subject_DragCancel; }
protected override void attachSubject(IReactiveShape subject) { Subject.MouseEnter += Subject_MouseEnter; Subject.MouseLeave += Subject_MouseLeave; Subject.MouseMove += Subject_MouseMove; Subject.Render.ShapeDrawed += SubjectShapeDrawed; }
protected override void detachSubject(IReactiveShape subject) { Subject.MouseDown -= Subject_MouseDown; Subject.MouseUp -= Subject_MouseUp; Subject.MouseEnter -= Subject_MouseEnter; Subject.MouseLeave -= Subject_MouseLeave; }
protected override void attachSubject(IReactiveShape subject) { Subject.ChangedForm += Subject_ChangedForm; Subject.CommandHandlers["BeginDrag"].ExecuteHnd += Shape_BeginDrag; Subject.CommandHandlers["EndDrag"].ExecuteHnd += Shape_EndDrag; Subject.Render.ShapeDrawed += Subject_ShapeDrawed; }
protected override void detachSubject(IReactiveShape subject) { Subject.MouseEnter -= Subject_MouseEnter; Subject.MouseLeave -= Subject_MouseLeave; Subject.Render.ShapeDrawed -= SubjectShapeDrawed; Subject.MouseMove -= Subject_MouseMove; }
protected override void detachSubject(IReactiveShape subject) { Subject.ChangedForm -= Subject_ChangedForm; // ReSharper disable DelegateSubtraction Subject.CommandHandlers["BeginDrag"].ExecuteHnd -= Shape_BeginDrag; Subject.CommandHandlers["EndDrag"].ExecuteHnd -= Shape_EndDrag; // ReSharper restore DelegateSubtraction Subject.Render.ShapeDrawed -= Subject_ShapeDrawed; }
public void RemoveShape(IShape shape, IReactiveShape reactive) { reactive.ChangedForm -= reactive_ChangedForm; reactive.Disposing -= reactive_Disposing; shapes.Remove(reactive); reactives.Remove(reactive); if (shape.Render.IsSee) IsChanged = true; }
private void Shape_BeginDrag(IReactiveShape shape, string mnemoCode, params object[] args) { dragged = shape; }
private void Shape_EndDrag(IReactiveShape shape, string mnemoCode, params object[] args) { dragged = null; }
protected override void detachSubject(IReactiveShape subject) { guides.Remove(subject); }
private void capturer_Disposing(object obj) { Capturer = null; }
private void removeShape(IShape shape, IReactiveShape reactive) { if (reactive != null) reactive.Disposing -= reactive_Disposing; getLayer(chiToLay[shape]).RemoveShape(shape, reactive); chiToLay.Remove(shape); if (RemovedShape != null) RemovedShape(this, shape, reactive); }
private void addShape(int layer, IShape shape, IReactiveShape reactive) { getLayer(layer).AddShape(shape, reactive); chiToLay.Add(shape, layer); if (reactive != null) reactive.Disposing += reactive_Disposing; if (AddedShape != null) AddedShape(this, shape, reactive); }
public void MouseUp(MouseEventArgs e) { LastMouseEventArgs = e; if (Capturer != null) { var sdea = new SimpleDragEventArgs(Capturer, e.X, e.Y); foreach (var item in UnderCursor .Where(s => s.AllowDrop) .Where(s => s != Capturer)) { item.OnDragDrop(sdea); if (sdea.Handled) break; } if (clickTimer.ElapsedMilliseconds <= SystemInformation.DoubleClickTime) ++countClicks; else countClicks = 1; var sizeClicks = new Size(Math.Abs(firstMouseDown.X - e.Location.X), Math.Abs(firstMouseDown.Y - e.Location.Y)); if (countClicks > 1 && (SystemInformation.DoubleClickSize.Width < sizeClicks.Width || SystemInformation.DoubleClickSize.Height < sizeClicks.Height)) countClicks = 1; Capturer.OnMouseUp(e); if (Capturer.Contains(e.Location)) if (countClicks == 2) { Capturer.OnMouseDoubleClick(e); countClicks = 0; clickTimer.Stop(); } else Capturer.OnMouseClick(e); Capturer = null; } }
public void MouseDown(MouseEventArgs e) { LastMouseEventArgs = e; if (!clickTimer.IsRunning || clickTimer.ElapsedMilliseconds > SystemInformation.DoubleClickTime) { countClicks = 0; clickTimer.Restart(); firstMouseDown = e.Location; } Capturer = Reactives.FirstOrDefault(s => s.Contains(e.Location)); if (Capturer != null) Capturer.OnMouseDown(e); }
public void KeyUp(KeyEventArgs e) { if (e.KeyCode == Keys.Escape && Capturer != null) { if (Capturer.IsDrag) Capturer.OnDragCancel(new SimpleDragEventArgs(Capturer, int.MinValue, int.MinValue)); Capturer.IsDrag = false; Capturer = null; } }
private void capturer_ChangedForm(IShape obj, ChangeFormState state = ChangeFormState.All) { if (state.HasFlag(ChangeFormState.Visibility) && !obj.Render.IsSee) Capturer = null; }
public void AddMenuToShape(IReactiveShape shape) { if (shapes.Add(shape)) { shape.MouseSenseEnter += shape_MouseSenseEnter; shape.MouseSenseLeave += shape_MouseSenseLeave; shape.ChangedForm += shape_ChangedForm; shape.Disposing += shape_Disposing; } }
protected override void attachSubject(IReactiveShape subject) { guides.Add(subject); }
private void ActionOnDragOnDistanceAddingMarker(IReactiveShape reactiveShape, PointF pnt) { int ind; Filler.Shape.GetNormalPoint(pnt, out ind); ind = (ind + 1) % Filler.Shape.Count; if (Filler.Shape.Insert(ind, pnt)) ViewLayer.Capturer = Markers[ind]; // перетаскивается вместо маркера добавленная точка addingPointMaker.IsVisible = false; }
public void AddShape(IShape shape, IReactiveShape reactive) { shapes.Add(shape); if (reactive != null) { reactives.Add(reactive); reactive.ChangedForm += reactive_ChangedForm; reactive.Disposing += reactive_Disposing; } if (shape.Render.IsSee) IsChanged = true; }