UndoChange() protected method

protected UndoChange ( MonoTextEditor fromEditor, MonoTextEditor toEditor, Hunk hunk ) : void
fromEditor MonoTextEditor
toEditor MonoTextEditor
hunk Hunk
return void
Exemplo n.º 1
0
 protected override bool OnButtonPressEvent(EventButton evnt)
 {
     if (evnt.Button == 1 && !selectedHunk.IsEmpty)
     {
         widget.UndoChange(fromEditor, toEditor, selectedHunk);
     }
     return(base.OnButtonPressEvent(evnt));
 }
Exemplo n.º 2
0
 protected override bool OnButtonPressEvent(EventButton evnt)
 {
     if (!evnt.TriggersContextMenu() && evnt.Button == 1 && !selectedHunk.IsEmpty)
     {
         widget.UndoChange(fromEditor, toEditor, selectedHunk);
         return(true);
     }
     return(base.OnButtonPressEvent(evnt));
 }
Exemplo n.º 3
0
 protected override bool OnButtonPressEvent(EventButton evnt)
 {
     if (!evnt.TriggersContextMenu() && evnt.Button == 1 && !selectedHunk.IsEmpty)
     {
         try {
             widget.UndoChange(fromEditor, toEditor, selectedHunk);
         } catch (Exception e) {
             LoggingService.LogInternalError("Error while undoing widget change.", e);
         }
         return(true);
     }
     return(base.OnButtonPressEvent(evnt));
 }
Exemplo n.º 4
0
            void PerformRevert(Hunk hunk)
            {
                try {
                    var selectedBounds = GetFocusedButton()?.Bounds;

                    widget.UndoChange(fromEditor, toEditor, hunk);
                    UpdateAccessiblity();

                    if (selectedBounds != null)
                    {
                        var nearestButton = GetNearestButton(selectedBounds.Value);
                        if (nearestButton != null)
                        {
                            nearestButton.Accessible.Focused = true;
                        }
                        else
                        {
                            Accessible.SetCurrentFocus();
                        }
                    }
                } catch (Exception e) {
                    LoggingService.LogInternalError("Error while undoing widget change.", e);
                }
            }