Пример #1
0
        public void RunConflictingKeyBindingStateCheck(IEnumerable <KeyInput> neededInputs, Action <ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete)
        {
            if (_snapshot != null)
            {
                onComplete(_state, _snapshot);
                return;
            }

            var util = new KeyBindingUtil(_dte);
            var set  = new HashSet <KeyInput>(neededInputs);

            _snapshot = util.CreateCommandKeyBindingSnapshot(set);
            ConflictingKeyBindingState = _snapshot.Conflicting.Any()
                ? ConflictingKeyBindingState.FoundConflicts
                : ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
        }
Пример #2
0
 public void ShowDialog(IVimBuffer buffer)
 {
     try
     {
         var util     = new KeyBindingUtil(_dte);
         var snapshot = util.CreateCommandKeyBindingSnapshot(buffer);
         new UI.ConflictingKeyBindingDialog(snapshot).ShowDialog();
     }
     catch (Exception)
     {
         // When dogfooding VsVim there is a bug in Visual Studio which causes the
         // VsVim DLL to be loaded twice (once for VsVim and once for the Settings
         // and associated designers).  This causes WPF to error when loading the dialog
         // resources and an unhandled exception occurs.
         VsShellUtilities.ShowMessageBox(
             _serviceProvider,
             "Error displaying options page",
             "Error",
             OLEMSGICON.OLEMSGICON_WARNING,
             OLEMSGBUTTON.OLEMSGBUTTON_OK,
             OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
     }
 }
Пример #3
0
 public void ShowDialog(IVimBuffer buffer)
 {
     try
     {
         var util = new KeyBindingUtil(_dte);
         var snapshot = util.CreateCommandKeyBindingSnapshot(buffer);
         new UI.ConflictingKeyBindingDialog(snapshot).ShowDialog();
     }
     catch (Exception)
     {
         // When dogfooding VsVim there is a bug in Visual Studio which causes the
         // VsVim DLL to be loaded twice (once for VsVim and once for the Settings
         // and associated designers).  This causes WPF to error when loading the dialog
         // resources and an unhandled exception occurs.
         VsShellUtilities.ShowMessageBox(
             _serviceProvider,
             "Error displaying options page",
             "Error",
             OLEMSGICON.OLEMSGICON_WARNING,
             OLEMSGBUTTON.OLEMSGBUTTON_OK,
             OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
     }
 }
Пример #4
0
        internal void RunConflictingKeyBindingStateCheck(IEnumerable<KeyInput> neededInputs, Action<ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete)
        {
            if (_snapshot != null)
            {
                onComplete(_state, _snapshot);
                return;
            }

            var util = new KeyBindingUtil(_dte, GetOrCreateImportantScopeSet());
            var set = new HashSet<KeyInput>(neededInputs);
            _snapshot = util.CreateCommandKeyBindingSnapshot(set);
            ConflictingKeyBindingState = _snapshot.Conflicting.Any()
                ? ConflictingKeyBindingState.FoundConflicts
                : ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
        }
Пример #5
0
 internal CommandKeyBindingSnapshot CreateCommandKeyBindingSnapshot(IVimBuffer vimBuffer)
 {
     var util = new KeyBindingUtil(_dte, GetOrCreateImportantScopeSet());
     return util.CreateCommandKeyBindingSnapshot(vimBuffer);
 }
Пример #6
0
        public void RunConflictingKeyBindingStateCheck(IEnumerable<KeyInput> neededInputs, Action<ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete)
        {
            if (_snapshot != null)
            {
                onComplete(_state, _snapshot);
                return;
            }

            var util = new KeyBindingUtil(_dte);
            var set = new HashSet<KeyInput>(neededInputs);
            _snapshot = util.CreateCommandKeyBindingSnapshot(set);
            if (_snapshot.Conflicting.Any())
            {
                ConflictingKeyBindingState = ConflictingKeyBindingState.FoundConflicts;
            }
            else
            {
                ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
            }
        }
Пример #7
0
 public void ShowDialog(IVimBuffer buffer)
 {
     var util = new KeyBindingUtil(_dte);
     var snapshot = util.CreateCommandKeyBindingSnapshot(buffer);
     UI.ConflictingKeyBindingDialog.DoShow(snapshot);
 }