private void OnPathBuilderHistoryUndoRedoHappened(object sender, UndoRedoEventArgs <SmoothPathBuilder> e) { _needToRedrawInkSurface = true; _canvas.Invalidate(); StrokesChanged?.Invoke(this, EventArgs.Empty); }
public void Track(UndoRedoEventArgs args) { if ((args.Action & UndoRedoAction.RedoClear) == UndoRedoAction.RedoClear) { var cnt = this.Items.Count - 1; while (cnt >= 0) { if (!(this.Items[cnt] is UndoRedoListBoxItem item)) { continue; } if (item.Type == UndoRedoType.Redo) { this.Items.RemoveAt(cnt); } else // UndoRedoType == Undo { break; } cnt = this.Items.Count - 1; } } if ((args.Action & UndoRedoAction.UndoPop) == UndoRedoAction.UndoPop) { if (!(this.Items[activeIndex] is UndoRedoListBoxItem item)) { return; } item.Type = UndoRedoType.Redo; this.Items[activeIndex--] = item; activeIndex = Math.Max(-1, activeIndex); } if ((args.Action & UndoRedoAction.UndoPush) == UndoRedoAction.UndoPush) { if (activeIndex == Items.Count - 1) { this.Items.Add(new UndoRedoListBoxItem(args.DisplayText, UndoRedoType.Undo)); activeIndex++; } else { if (!(this.Items[++activeIndex] is UndoRedoListBoxItem item)) { return; } item.Type = UndoRedoType.Undo; this.Items[activeIndex] = item; } } this.SelectedIndex = -1; this.Invalidate(); this.TopIndex = this.Items.Count - 1; }
private void OnPathBuilderHistoryUndoRedoHappened(object sender, UndoRedoEventArgs <SmoothPathBuilder> e) { EnableToolbarUndo(Canvas.PathBuilderHistory.CanUndo); EnableToolbarRedo(Canvas.PathBuilderHistory.CanRedo); //try //{ //} //catch { } }
/// <inheritdoc cref="UndoRedoEventArgs"/> public async Task OnEventHandler(object publisher, UndoRedoEventArgs e) { try { var(copy, to) = View.TryUndoRedo(e.Action); var action = e.Action == UndoRedoAction.Redo ? UndoRedoAction.Undo : UndoRedoAction.Redo; await Render( new PipelineBlock(copy), to, action ).ConfigureAwait(true); Aggregator.PublishFromAll(publisher, new ContainerUpdatedEventArgs(to, copy)); } catch (Exception ex) { OnError(publisher, Errors.UndoRedo); } }
/// <summary> /// Called when a command is undone/redone /// </summary> public static void OnUndoRedo(object sender, UndoRedoEventArgs e) { DebugWriteMethod(); //RhinoApp.WriteLine("> Undo/Redo"); //string event_type = "None"; //if (e.IsBeginRecording) // event_type = "Begin Recording"; //else if (e.IsEndRecording) // event_type = "End Recording"; //else if (e.IsBeginUndo) // event_type = "Begin Undo"; //else if (e.IsEndUndo) // event_type = "End Undo"; //else if (e.IsBeginRedo) // event_type = "Begin Redo"; //else if (e.IsEndRedo) // event_type = "End Redo"; //else if (e.IsPurgeRecord) // event_type = "Purge Record"; //RhinoApp.WriteLine(" EventType = {0}", event_type); }
public static void OnUndoRedo(object sender, UndoRedoEventArgs e) { DebugWriteMethod(); }
private void TextBufferUndoHistory_UndoRedoHappened(object sender, UndoRedoEventArgs e) { this.OnIsDirtyChanged(EventArgs.Empty); }
public virtual async Task OnEventHandler(object publisher, UndoRedoEventArgs e) { }
private void ActiveDocument_UndoRedoChanged(object sender, UndoRedoEventArgs e) { UpdateUndoRedoButtons(); undoRedoListView.Track(e); }
public static void OnUndoRedo(object sender, UndoRedoEventArgs e) { RhinoApp.WriteLine("** EVENT: Undo/Redo **"); }
private void OnUndoRedoHappened(object sender, UndoRedoEventArgs args) { this.DismissCompletionSession(); }