Exemple #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var shortcuts = ShortCut.LoadShortcuts();
            var textboxes = new System.Windows.Controls.TextBox[] { TargetShowKeyText, TargetHideKeyText, WindowShowKeyText, WindowHideKeyText };

            for (int i = 0; i < textboxes.Length; i++)
            {
                var textbox = textboxes[i];
                if (i >= shortcuts.Count)
                {
                    break;
                }
                textbox.Text = GetKeyString(shortcuts[i]);
            }
        }
Exemple #2
0
        private void initializeHotKey()
        {
            this.KeyBinder.Clear();

            var sc = ShortCut.LoadShortcuts();
            var i  = 0;

            this.KeyBinder.AddBindHandler(sc[i].key, sc[i ++].modifierKey, delegate(object sender, KeyPressedEventArgs e) {
                this.showFetishes();
            });
            this.KeyBinder.AddBindHandler(sc[i].key, sc[i ++].modifierKey, delegate(object sender, KeyPressedEventArgs e) {
                this.hideFetishes();
            });
            this.KeyBinder.AddBindHandler(sc[i].key, sc[i ++].modifierKey, delegate(object sender, KeyPressedEventArgs e) {
                this.Show();
            });
            this.KeyBinder.AddBindHandler(sc[i].key, sc[i ++].modifierKey, delegate(object sender, KeyPressedEventArgs e) {
                this.Hide();
            });
        }