Ejemplo n.º 1
0
        public KeyBindingData(ReadOnlyCollection<CommandKeyBinding> bindings)
        {
            // All bindings passed have the same KeyInput as their first key, so get it
            var firstKeyInput = bindings.First().KeyBinding.FirstKeyStroke;
            KeyName = KeyBinding.CreateKeyBindingStringForSingleKeyStroke(firstKeyInput);

            _bindings = bindings;
            _handledByOptions.AddRange(
                new[] {
                     _visualStudioOption = new KeyBindingHandledByOption("Visual Studio", bindings.Select(binding => binding.Name)),
                     _vsVimOption = new KeyBindingHandledByOption("VsVim", Enumerable.Empty<string>())
                });
        }
Ejemplo n.º 2
0
        public KeyBindingData(ReadOnlyCollection <CommandKeyBinding> bindings)
        {
            // All bindings passed have the same KeyInput as their first key, so get it
            var firstKeyInput = bindings.First().KeyBinding.FirstKeyStroke;

            KeyName = KeyBinding.CreateKeyBindingStringForSingleKeyStroke(firstKeyInput);

            _bindings = bindings;
            _handledByOptions.AddRange(
                new[] {
                _visualStudioOption = new KeyBindingHandledByOption("Visual Studio", bindings.Select(binding => binding.Name)),
                _vsVimOption        = new KeyBindingHandledByOption("VsVim", Enumerable.Empty <string>())
            });
        }
Ejemplo n.º 3
0
        public KeyBindingData(ReadOnlyCollection<CommandKeyBinding> bindings)
        {
            // All bindings passed have the same KeyInput as their first key, so get it
            var firstKeyInput = bindings.First().KeyBinding.FirstKeyStroke;
            KeyName = KeyBinding.CreateKeyBindingStringForSingleKeyStroke(firstKeyInput);

            // It's possible that Visual Studio will bind multiple key strokes to the same
            // command.  Often it will be things like "Ctrl-[, P" and "Ctr-[, Ctrl-P".  In
            // that case we don't want to list the command twice so filter that possibility
            // out here
            var commandNames = bindings.Select(x => x.Name).Distinct(StringComparer.OrdinalIgnoreCase);

            _bindings = bindings;
            _handledByOptions.AddRange(
                new[] {
                     _visualStudioOption = new KeyBindingHandledByOption("Visual Studio", commandNames),
                     _vsVimOption = new KeyBindingHandledByOption("VsVim", Enumerable.Empty<string>())
                });
        }
Ejemplo n.º 4
0
        public KeyBindingData(ReadOnlyCollection <CommandKeyBinding> bindings)
        {
            // All bindings passed have the same KeyInput as their first key, so get it
            var firstKeyInput = bindings.First().KeyBinding.FirstKeyStroke;

            KeyName = KeyBinding.CreateKeyBindingStringForSingleKeyStroke(firstKeyInput);

            // It's possible that Visual Studio will bind multiple key strokes to the same
            // command.  Often it will be things like "Ctrl-[, P" and "Ctr-[, Ctrl-P".  In
            // that case we don't want to list the command twice so filter that possibility
            // out here
            var commandNames = bindings.Select(x => x.Name).Distinct(StringComparer.OrdinalIgnoreCase);

            _bindings = bindings;
            _handledByOptions.AddRange(
                new[] {
                _visualStudioOption = new KeyBindingHandledByOption("Visual Studio", commandNames),
                _vsVimOption        = new KeyBindingHandledByOption("VsVim", Enumerable.Empty <string>())
            });
        }