private string GetSearchWatermark()
        {
            var focusOnSearchKeyGesture = (KeyGesture)InputBindings.OfType <KeyBinding>().First(
                x => x.Command == Commands.FocusOnSearchBox).Gesture;

            return($"Search ({focusOnSearchKeyGesture.GetDisplayStringForCulture(CultureInfo.CurrentCulture)})");
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     // Let's ensure everything is cleaned up.
     foreach (var keyBindings in InputBindings.OfType <KeyBinding>())
     {
         HotkeyManager.SetRegisterGlobalHotkey(keyBindings, false);
     }
 }
Ejemplo n.º 3
0
        // Returns the text to be displayed in the search box.
        private string GetSearchText()
        {
            var focusOnSearchKeyGesture = (KeyGesture)InputBindings.OfType <KeyBinding>().First(
                x => x.Command == Commands.FocusOnSearchBox).Gesture;

            return(string.Format(CultureInfo.CurrentCulture,
                                 Resx.Resources.Text_SearchBoxText,
                                 focusOnSearchKeyGesture.GetDisplayStringForCulture(CultureInfo.CurrentCulture)));
        }
Ejemplo n.º 4
0
        private void BindMacro(InputGesture gesture, Action <PadEditor> action)
        {
            var oldBinding = InputBindings.OfType <InputBinding>().FirstOrDefault(i =>
                                                                                  i.Gesture.Equals(gesture));

            if (oldBinding != null)
            {
                InputBindings.Remove(oldBinding);
            }
            InputBindings.Add(
                new InputBinding(EditingCommands.HandleKey, gesture)
            {
                CommandParameter = action
            });
        }