示例#1
0
        private void NoteEdit_OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (Settings != null)
            {
                var ekey = KeyInterop.KeyFromVirtualKey((int)e.KeyCode);
                var emod = ModifierKeys.None;
                if (e.Control)
                {
                    emod |= ModifierKeys.Control;
                }
                if (e.Alt)
                {
                    emod |= ModifierKeys.Alt;
                }
                if (e.Shift)
                {
                    emod |= ModifierKeys.Shift;
                }

                foreach (var sc in Settings.Shortcuts)
                {
                    if (sc.Value.Scope == AlephShortcutScope.NoteEdit || sc.Value.Scope == AlephShortcutScope.Window)
                    {
                        var kk = (Key)sc.Value.Key;
                        var mm = (ModifierKeys)sc.Value.Modifiers;
                        if (kk == ekey && mm == (emod & mm))
                        {
                            ShortcutManager.Execute(this, sc.Key);
                            e.Handled = true;
                        }
                    }
                }
            }
        }
示例#2
0
        public ViewModel()
        {
            ApplicationStateModel = new ApplicationStateModel();
            _configurationManager = new ConfigurationManager();
            ConfigurationModel    = _configurationManager.Load();

            if (ConfigurationModel.PresetCollection.Count == 0)
            {
                ConfigurationModel.PresetCollection.Add(new Preset()
                {
                    Name = "New Preset"
                });
            }

            _openFileManager = new OpenFileManager();
            _soundManager    = new SoundManager(ConfigurationModel);
            _shortcutManager = new ShortcutManager(ApplicationStateModel, ConfigurationModel, _soundManager);
            _updateManager   = new UpdateManager();

            PresetConfigurationViewModel = new PresetConfigurationViewModel(ApplicationStateModel, ConfigurationModel);

            ConfigurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender);

            ConfigurationModel.SoundShortcuts.Pause.Command    = PauseCommand;
            ConfigurationModel.SoundShortcuts.Continue.Command = ContinueCommand;
            ConfigurationModel.SoundShortcuts.Stop.Command     = StopCommand;

            Task.Run(() => _updateManager.AutoUpdateCheck(Version));
        }
示例#3
0
        [SuppressMessage("ReSharper", "SuggestBaseTypeForParameter")]// needed for DI
        public MainViewModel(
            Configuration config,
            ShortcutManager shortcutManager, // manually injecting all tabs for now,
            SourcesViewModel sourcesVm,      // might want to replace this if more tabs get added
            ConfigurationViewModel configuration,
            DownloaderViewModel downloader,
            LibraryViewModel library)
        {
            DisplayName          = WindowTitleBase;
            TabClosing           = OnTabClosing;
            this.config          = config;
            this.shortcutManager = shortcutManager;
            CreateShortcuts();
            Items.AddRange(new TabViewModelBase[]
            {
                library,
                downloader,
                sourcesVm,
                configuration,
            });

            library.ConductWith(this);
            downloader.ConductWith(this);
            sourcesVm.ConductWith(this);
            configuration.ConductWith(this);

            var tabId = config.State.ActiveTab ?? string.Empty;
            var tab   = Items.FirstOrDefault(t => t.Id == tabId);

            if (tab != null)
            {
                ActivateItem(tab);
            }
        }
示例#4
0
 private void SetShortcuts(string cmdId, ShortcutManager shortcuts)
 {
     if (shortcuts != null)
     {
         this.Shortcut = shortcuts[cmdId];
     }
 }
示例#5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            appMutex = new Mutex(true, AppName, out bool newMutexCreated);
            if (!newMutexCreated)
            {
                Shutdown();
                return;
            }

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            configurationManager          = new ConfigurationManager();
            configurationManager.Changed += ConfigurationManager_Changed;
            ConfigurationManager_Changed(configurationManager.ConfigFile);

            if (configurationManager.ConfigFile.AutoUpdate)
            {
                var updateManager = new UpdateManager(AppOwner, AppName);
                updateManager.CheckForNewVersion();
            }

            windowManager = new WindowManager(configurationManager);

            shortcutManager = new ShortcutManager(configurationManager, windowManager);

            taskbarManager = new TaskbarManager(configurationManager);

            notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
        }
示例#6
0
    public void CursolOn()
    {
        switch (CursolPos)
        {
        case 0:
            ShortcutManager.SetShortcut(1, InventoryManager.ReturnSelectItem());
            MenuManager.SetMenuState("UseItem");
            break;

        case 1:
            ShortcutManager.SetShortcut(2, InventoryManager.ReturnSelectItem());
            MenuManager.SetMenuState("UseItem");
            break;

        case 2:
            ShortcutManager.SetShortcut(3, InventoryManager.ReturnSelectItem());
            MenuManager.SetMenuState("UseItem");
            break;

        case 3:
            ShortcutManager.SetShortcut(4, InventoryManager.ReturnSelectItem());
            MenuManager.SetMenuState("UseItem");
            break;

        case 4:
            MenuManager.SetMenuState("UseComand");
            break;
        }
    }
示例#7
0
        public ViewModel()
        {
            _applicationStateModel = new ApplicationStateModel();
            _configurationManager  = new ConfigurationManager();
            _configurationModel    = _configurationManager.Load();
            if (_configurationModel.PresetCollection.Count == 0)
            {
                _configurationModel.PresetCollection.Add(new Preset()
                {
                    Name = "New Preset"
                });
            }
            _openFileManager = new OpenFileManager();
            _soundManager    = new SoundManager(_configurationModel);
            _shortcutManager = new ShortcutManager(_applicationStateModel, _configurationModel, _soundManager);
            _updateManager   = new UpdateManager();

            _presetConfigurationViewModel = new PresetConfigurationViewModel(_applicationStateModel, _configurationModel);

            _configurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender);

            _configurationModel.CounterShortcuts.Next.Command      = NextCounterCommand;
            _configurationModel.CounterShortcuts.Previous.Command  = PreviousCounterCommand;
            _configurationModel.CounterShortcuts.Increment.Command = IncrementCommand;
            _configurationModel.CounterShortcuts.Decrement.Command = DecrementCommand;
            _configurationModel.CounterShortcuts.Reset.Command     = ResetCommand;
            _configurationModel.SoundShortcuts.Pause.Command       = PauseCommand;
            _configurationModel.SoundShortcuts.Continue.Command    = ContinueCommand;
            _configurationModel.SoundShortcuts.Stop.Command        = StopCommand;

            Task.Run(() => _updateManager.AutoUpdateCheck(Version));
        }
示例#8
0
        public static void EditorLinks()
        {
            Elements.BoldLabel(ToolTips.editorLinksLabel);

            Elements.BeginToolbarHorizontal();
            if (Elements.ToolbarButton(ToolTips.reportBug))
            {
                ShortcutManager.OpenReportBug();
            }
            if (Elements.ToolbarButton(ToolTips.requestFeature))
            {
                ShortcutManager.OpenRequestFeature();
            }
            if (Elements.ToolbarButton(ToolTips.roadMap))
            {
                ShortcutManager.OpenRoadMap();
            }
            Elements.EndToolbarHorizontal();

            Elements.BeginToolbarHorizontal();
            if (Elements.ToolbarButton(ToolTips.wiki))
            {
                ShortcutManager.OpenWiki();
            }
            if (Elements.ToolbarButton(ToolTips.discord))
            {
                ShortcutManager.OpenDiscord();
            }
            Elements.EndToolbarHorizontal();
        }
        private void SaveSettings()
        {
            conf.Ui_Language                     = combobox_language.SelectedValue.ToString();
            conf.General_RegisterHotkeys         = (bool?)checkbox_registerhotkeys.Checked;
            conf.Output_File_Path                = textbox_storagelocation.Text;
            conf.Output_File_FilenamePattern     = textbox_screenshotname.Text;
            conf.Output_File_Format              = combobox_primaryimageformat.Text;
            conf.Output_File_CopyPathToClipboard = (bool?)checkbox_copypathtoclipboard.Checked;
            conf.Output_File_JpegQuality         = trackBarJpegQuality.Value;
            conf.Output_File_PromptJpegQuality   = (bool?)checkbox_alwaysshowjpegqualitydialog.Checked;
            conf.Ui_Effects_Flashlight           = (bool?)checkbox_showflashlight.Checked;
            conf.Ui_Effects_CameraSound          = (bool?)checkbox_playsound.Checked;
            ScreenshotDestinations dest = 0;

            if (checkbox_clipboard.Checked)
            {
                dest |= ScreenshotDestinations.Clipboard;
            }
            if (checkbox_file.Checked)
            {
                dest |= ScreenshotDestinations.FileDefault;
            }
            if (checkbox_fileas.Checked)
            {
                dest |= ScreenshotDestinations.FileWithDialog;
            }
            if (checkbox_printer.Checked)
            {
                dest |= ScreenshotDestinations.Printer;
            }
            if (checkbox_editor.Checked)
            {
                dest |= ScreenshotDestinations.Editor;
            }
            conf.Output_Destinations        = dest;
            conf.Output_Print_Center        = (bool?)checkboxAllowCenter.Checked;
            conf.Output_Print_AllowEnlarge  = (bool?)checkboxAllowEnlarge.Checked;
            conf.Output_Print_AllowRotate   = (bool?)checkboxAllowRotate.Checked;
            conf.Output_Print_AllowShrink   = (bool?)checkboxAllowShrink.Checked;
            conf.Output_Print_PromptOptions = (bool?)checkbox_alwaysshowprintoptionsdialog.Checked;

            conf.Store();

            if (checkbox_autostartshortcut.Checked)
            {
                ShortcutManager.createShortcut(Environment.SpecialFolder.Startup);
            }
            else
            {
                ShortcutManager.removeShortcut(Environment.SpecialFolder.Startup);
            }
            if (checkbox_desktopshortcut.Checked)
            {
                ShortcutManager.createShortcut(Environment.SpecialFolder.Desktop);
            }
            else
            {
                ShortcutManager.removeShortcut(Environment.SpecialFolder.Desktop);
            }
        }
        public SettingsWindowViewmodel(MainWindow main, AppSettings data)
        {
            mainWindow = main;
            Settings   = data;

            ShortcutList = ShortcutManager.ListObservableShortcuts(data);

            AvailableThemes   = App.Themes.GetAllAvailableThemes();
            AvailableModifier = App.Themes.GetAllAvailableModifier().Select(m => new CheckableAlephTheme {
                Theme = m, Owner = this, Checked = data.ThemeModifier.Contains(m.SourceFilename)
            }).ToList();

            _selectedTheme = App.Themes.GetThemeByFilename(Settings.Theme, out _)
                             ?? App.Themes.GetDefault()
                             ?? AvailableThemes.FirstOrDefault()
                             ?? App.Themes.GetFallback();

            _oldTheme     = ThemeManager.Inst.CurrentBaseTheme;
            _oldModifiers = ThemeManager.Inst.CurrentModifers.ToList();

            SnippetList = new ObservableCollectionNoReset <EditableSnippet>(data.Snippets.Data.Select(p => new EditableSnippet {
                PreviewFunc = SnippetPrev, ID = p.Key, Name = p.Value.DisplayName, Value = p.Value.Value
            }));
            NewSnippetID = GetNextSnippetID();
        }
示例#11
0
        private void MainWindow_OnKeyDown(object sender, KeyEventArgs e)
        {
            if (Settings != null && ReferenceEquals(e.OriginalSource, NoteEditHost))
            {
                foreach (var sc in Settings.Shortcuts)
                {
                    if (sc.Value.Scope == AlephShortcutScope.NoteEdit)
                    {
                        var kk = (Key)sc.Value.Key;
                        var mm = (ModifierKeys)sc.Value.Modifiers;
                        if (kk == e.Key && mm == (e.KeyboardDevice.Modifiers & mm))
                        {
                            ShortcutManager.Execute(this, sc.Key);
                            e.Handled = true;
                            return;
                        }
                    }
                }
            }

            if (e.Key == Key.System && ReferenceEquals(e.OriginalSource, NoteEditHost) && Settings?.SciRectSelection == true)
            {
                // Prevent ALT key removing focus of control
                e.Handled = true;
                return;
            }
        }
示例#12
0
        private void SetShortcut()
        {
            List <ShortcutInfo> shortcutInfoList = new List <ShortcutInfo>();

            var shortcuts = data.Where(x => x.IsShortcut == true)
                            .OrderBy(x => x.ID).ToList();
            int count = (shortcuts.Count > 4) ? 4 : shortcuts.Count;

            for (int i = 0; i < count; i++)
            {
                Intent intent = new Intent();
                intent.SetClass(this, typeof(WakeActivity));
                intent.SetAction(Intent.ActionMain);
                intent.PutExtra("BroadcastAddress", shortcuts[i].BroadcastAddress);
                intent.PutExtra("MacAddress", shortcuts[i].MacAddress);
                intent.PutExtra("Port", shortcuts[i].Port);
                intent.PutExtra("SendingCount", shortcuts[i].SendingCount);
                ShortcutInfo info = new ShortcutInfo.Builder(this, $"intent{i}")
                                    .SetRank(i)
                                    .SetIcon(Icon.CreateWithResource(this, Resource.Drawable.device))
                                    .SetShortLabel(shortcuts[i].Name)
                                    .SetLongLabel(shortcuts[i].Name)
                                    .SetIntent(intent)
                                    .Build();
                shortcutInfoList.Add(info);
            }

            ShortcutManager shortcutManager = (ShortcutManager)GetSystemService(Context.ShortcutService);

            shortcutManager.RemoveAllDynamicShortcuts();
            shortcutManager.SetDynamicShortcuts(shortcutInfoList);
        }
示例#13
0
        public override void Begin()
        {
            Engine.MapLoaded = true;
            Logger.Log("Beginning map editor.");

            // Initialize room list window
            RoomListWindow = new WindowRoomList();
            ToolListWindow = new WindowToolList(BGAutotiler, FGAutotiler);

            List <string> roomNames = new List <string>();

            foreach (Room room in State.LoadedLevel.Rooms)
            {
                roomNames.Add(room.Name);
            }
            RoomListWindow.RoomNames = roomNames.ToArray();

            Engine.CreateWindow(RoomListWindow);
            Engine.CreateWindow(ToolListWindow);

            Engine.Instance.GraphicsDevice.SetRenderTarget(null);
            Engine.OnViewportUpdate += UpdateViewport;
            RoomListWindow.UpdateListHeight();
            ToolListWindow.UpdateListHeight();

            // Initialize shortcuts
            Shortcuts = new ShortcutManager();

            Shortcuts.RegisterShortcut(new Shortcut(Menubar.Open, Keys.LeftControl, Keys.O));
            Shortcuts.RegisterShortcut(new Shortcut(new Action(() => { Menubar.Save(); }), Keys.LeftControl, Keys.S));
            Shortcuts.RegisterShortcut(new Shortcut(Menubar.SaveAs, Keys.LeftControl, Keys.LeftShift, Keys.S));
            Shortcuts.RegisterShortcut(new Shortcut(State.Redo, Keys.LeftControl, Keys.LeftShift, Keys.Z));
            Shortcuts.RegisterShortcut(new Shortcut(State.Undo, Keys.LeftControl, Keys.Z));
        }
示例#14
0
        /// <summary>
        /// Create a dynamic shortcut that will open the app and display the relevant info
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="flightNumber"></param>
        public void CreateFlightShortcut(object sender, string flightNumber)
        {
            // Create a shortcut builder
            var shortcutBuilder = new ShortcutInfo.Builder(this, flightNumber);

            // Set the shortcut info
            shortcutBuilder.SetIcon(Android.Graphics.Drawables.Icon.CreateWithResource(this, Resource.Drawable.flight));
            shortcutBuilder.SetShortLabel($"Flight {flightNumber}");
            shortcutBuilder.SetLongLabel($"Flight {flightNumber}");
            Intent openFlightInfoIntent = new Intent(
                Intent.ActionView,                                                      // Action
                Android.Net.Uri.Parse($"content:////actions//flight-{flightNumber}"),   // Intent data
                this,                                                                   // Context
                typeof(MainActivity));                                                  // Activity class

            shortcutBuilder.SetIntent(openFlightInfoIntent);

            // Build the shortcut
            ShortcutInfo myFlightShortcut = shortcutBuilder.Build();

            // Get the shortcut manager
            ShortcutManager shortcutManager = (ShortcutManager)this.GetSystemService(Java.Lang.Class.FromType(typeof(ShortcutManager)));

            // Set the list of shortcuts as the App's shortcut
            shortcutManager.SetDynamicShortcuts(new System.Collections.Generic.List <ShortcutInfo>()
            {
                myFlightShortcut
            });
        }
示例#15
0
    public void CursolOn()
    {
        switch (CursolPos)
        {
        case 0:
            ShortcutManager.SetShortcut(1, MenuManager.SelectItemID);
            MenuManager.SetMenuState("UseItem");
            break;

        case 1:
            ShortcutManager.SetShortcut(2, MenuManager.SelectItemID);
            MenuManager.SetMenuState("UseItem");
            break;

        case 2:
            ShortcutManager.SetShortcut(3, MenuManager.SelectItemID);
            MenuManager.SetMenuState("UseItem");
            break;

        case 3:
            ShortcutManager.SetShortcut(4, MenuManager.SelectItemID);
            MenuManager.SetMenuState("UseItem");
            break;

        case 4:
            MenuManager.SetMenuState("UseComand");
            break;
        }
    }
        private void DisplaySettings()
        {
            combobox_language.SelectedValue      = conf.Ui_Language;
            checkbox_registerhotkeys.Checked     = (bool)conf.General_RegisterHotkeys;
            textbox_storagelocation.Text         = conf.Output_File_Path;
            textbox_screenshotname.Text          = conf.Output_File_FilenamePattern;
            combobox_primaryimageformat.Text     = conf.Output_File_Format.ToString();
            checkbox_copypathtoclipboard.Checked = (bool)conf.Output_File_CopyPathToClipboard;
            trackBarJpegQuality.Value            = conf.Output_File_JpegQuality;
            textBoxJpegQuality.Text = conf.Output_File_JpegQuality + "%";
            checkbox_alwaysshowjpegqualitydialog.Checked = (bool)conf.Output_File_PromptJpegQuality;
            checkbox_showflashlight.Checked = (bool)conf.Ui_Effects_Flashlight;
            checkbox_playsound.Checked      = (bool)conf.Ui_Effects_CameraSound;

            checkbox_clipboard.Checked = (conf.Output_Destinations & ScreenshotDestinations.Clipboard) == ScreenshotDestinations.Clipboard;
            checkbox_file.Checked      = (conf.Output_Destinations & ScreenshotDestinations.FileDefault) == ScreenshotDestinations.FileDefault;
            checkbox_fileas.Checked    = (conf.Output_Destinations & ScreenshotDestinations.FileWithDialog) == ScreenshotDestinations.FileWithDialog;
            checkbox_printer.Checked   = (conf.Output_Destinations & ScreenshotDestinations.Printer) == ScreenshotDestinations.Printer;
            checkbox_editor.Checked    = (conf.Output_Destinations & ScreenshotDestinations.Editor) == ScreenshotDestinations.Editor;

            checkboxAllowCenter.Checked  = (bool)conf.Output_Print_Center;
            checkboxAllowEnlarge.Checked = (bool)conf.Output_Print_AllowEnlarge;
            checkboxAllowRotate.Checked  = (bool)conf.Output_Print_AllowRotate;
            checkboxAllowShrink.Checked  = (bool)conf.Output_Print_AllowShrink;
            checkbox_alwaysshowprintoptionsdialog.Checked = (bool)conf.Output_Print_PromptOptions;

            checkbox_autostartshortcut.Checked = ShortcutManager.shortcutExists(Environment.SpecialFolder.Startup);
            checkbox_desktopshortcut.Checked   = ShortcutManager.shortcutExists(Environment.SpecialFolder.Desktop);
        }
示例#17
0
    // Use this for initialization
    void Start()
    {
        slotBtn      = GetComponent <Button>();
        invenManager = inven.GetComponent <InventoryManager>();

        shortcutManager = shortcut.GetComponent <ShortcutManager>();
    }
示例#18
0
        public void SetLangAngShortcut(ShortcutManager shortcutManager)
        {
            label1.Text    = Utility.Language["SFAutherName"];
            label2.Text    = Utility.Language["SFMovieLatency"];
            groupBox1.Text = Utility.Language["SFGroupBox1"];
            groupBox2.Text = Utility.Language["SFGroupBox2"];
            checkBox1.Text = Utility.Language["SFCheckBox1"];
            checkBox2.Text = Utility.Language["SFCheckBox2"];
            listBox1.Items.Clear();
            listBox1.Items.Add(Utility.Language["General"]);
            listBox1.Items.Add(Utility.Language["ShortcutKey"]);
            listBox1.Items.Add(Utility.Language["EnvironmentVariable"]);
            dataGridView1.Columns[0].HeaderText = Utility.Language["Command"];
            dataGridView1.Columns[1].HeaderText = Utility.Language["Key"];
            groupBox3.Text  = Utility.Language["ToggleOption"];
            moveLabel1.Text = Utility.Language["Move1"];
            moveLabel2.Text = Utility.Language["Move2"];
            moveLabel3.Text = Utility.Language["Move3"];
            moveLabel4.Text = Utility.Language["Move4"];
            moveLabel5.Text = Utility.Language["Move5"];
            moveLabel6.Text = Utility.Language["Move6"];
            moveLabel7.Text = Utility.Language["Move7"];
            moveLabel8.Text = Utility.Language["Move8"];
            label13.Text    = Utility.Language["None"];
            button3.Text    = Utility.Language["DeleteShortcut"];
            label6.Text     = Utility.Language["DragAngleRestriction"];
            checkBox3.Text  = Utility.Language["SFCheckBox3"];
            button4.Text    = Utility.Language["AddCommand"];
            button5.Text    = Utility.Language["RemoveCommand"];


            this.shortcutManager = shortcutManager;
            ShortcutInfo[] shortcuts = shortcutManager.Shortcuts;
            dataGridView1.Rows.Clear();

            regularShortcutCount = 0;
            foreach (ShortcutType type in Enum.GetValues(typeof(ShortcutType)))
            {
                if (type == ShortcutType.None)
                {
                    continue;
                }
                else if (type == ShortcutType.Custom)
                {
                    foreach (var shortcut in shortcuts.Where(s => s.ShortcutType == ShortcutType.Custom))
                    {
                        dataGridView1.Rows.Add(GetCustomShortcutText(shortcut), GetReadableShortcut(shortcut));
                    }
                }
                else
                {
                    var info = shortcuts.FirstOrDefault(i => i.ShortcutType == type);
                    dataGridView1.Rows.Add(Utility.Language[type.ToString()], info == null ? "" : GetReadableShortcut(info));
                    regularShortcutCount++;
                }
            }

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }
示例#19
0
 public void RegisterKeyboardShortcuts(ShortcutManager shortcutManager)
 {
     shortcutManager.Add(new ShortcutItem(Keys.D, () => this.ShowFilterPopup(dateColumn), "Show filter popup for Date column"));
     shortcutManager.Add(new ShortcutItem(Keys.H, () => this.ShowFilterPopup(threadColumn), "Show filter popup for tHread column"));
     shortcutManager.Add(new ShortcutItem(Keys.T, () => this.ShowFilterPopup(typeColumn), "Show filter popup for Type column"));
     shortcutManager.Add(new ShortcutItem(Keys.C, () => this.ShowFilterPopup(classColumn), "Show filter popup for Class column"));
     shortcutManager.Add(new ShortcutItem(Keys.M, () => this.ShowFilterPopup(messageColumn), "Show filter popup for Message column"));
 }
示例#20
0
 public void Update()
 {
     PlayerManager.PlayerDeathCheck();
     CameraManager.PlayerPosCheck();
     ControlManager.TownKey();
     UI_Manager.UiStatusUpdate();
     ShortcutManager.AllPiecesReset();
 }
示例#21
0
        private void ClearDynamicShortcuts(string sender)
        {
            // Get the shortcut manager
            ShortcutManager shortcutManager = (ShortcutManager)this.GetSystemService(Java.Lang.Class.FromType(typeof(ShortcutManager)));

            // Remove all dynamic shortcuts
            shortcutManager.RemoveAllDynamicShortcuts();
        }
 public ListOfShortcutsDlg(ShortcutManager shortcutManager)
 {
     InitializeComponent();
     foreach (ShortcutItem item in shortcutManager.Shortcuts)
     {
         shortcutsListView.Items.Add(new ListViewItem(new string[] { item.ShortcutKeysDesc, item.Description }));
     }
 }
示例#23
0
 private void SetShortcuts(string cmdId, ShortcutManager shortcuts)
 {
     if (shortcuts != null)
     {
         this.Shortcut     = shortcuts[cmdId];
         this.ShowShortcut = shortcuts.IsDisplayed(cmdId);
     }
 }
示例#24
0
 /// <summary>
 /// When the form is closed, applies shortcuts.
 /// </summary>
 private void DialogClosed(object sender, FormClosedEventArgs e)
 {
     for (int i = 0; i < this.shortcutListItems.Length; i++)
     {
         this.shortcutListItems[i].ApplyChanges();
     }
     Globals.MainForm.ApplyAllSettings();
     ShortcutManager.SaveCustomShortcuts();
 }
示例#25
0
        private void OnMenuClick(object sender, RoutedEventArgs e)
        {
            var p = GetParent(ParentAnchor) ?? GetParent(this) ?? MainWindow.Instance;

            if (p != null)
            {
                ShortcutManager.Execute(p, AlephAction);
            }
        }
示例#26
0
        private void SettingsChanged()
        {
            if (Settings == null)
            {
                return;
            }

            ShortcutManager.UpdateSnippetCommands(Settings.Snippets.Data);
        }
示例#27
0
        public MainWindow()
        {
            InitializeComponent();
            _photoCollageWindows = new Dictionary <string, PhotoCollageWindow>();
            _dialogExtender      = new FileDialogExtender(FileDialogExtender.DialogViewTypes.Thumbnails, true);
            _shortcutManager     = new ShortcutManager(this);

            RegisterShortcutKeys();
        }
    private void Start()
    {
        instance = this;

        levelGenerator   = LevelGenerator.instance;
        propertiesWindow = PropertiesWindow.instance;

        gameObject.SetActive(false);
    }
示例#29
0
 public void Update()
 {
     PlayerManager.PlayerDeathCheck();
     EnemyManager.EnemyUpdate();
     CameraManager.PlayerPosCheck();
     ControlManager.KeyCheck();
     UI_Manager.UiStatusUpdate();
     ShortcutManager.AllPiecesReset();
     EnemyManager.MakeEnemy();
 }
示例#30
0
 public static void Move(int delay)
 {
     ShortcutManager.CtrlWith(Keys.N, delay);
     Thread.Sleep(delay);
     SendKeys.SendWait(4.ToString());
     Thread.Sleep(delay);
     Clicker.LeftClick(Cursor.Position.X, Cursor.Position.Y, delay);
     Thread.Sleep(delay);
     Clicker.RightClick(delay);
 }
示例#31
0
        // On charge dans les deux manageurs les données du document XML
        public static void Load(ShortcutManager<Keys> keyManager, ShortcutManager<NoteID> midiNoteManager)
        {
            string XMLKeysBind = ConfigurationManager.AppSettings["XMLKeysBind"];
            // Si le document XML existe
            if (File.Exists(XMLKeysBind))
            {
                // On charge le XDocument contenu dans le document XML
                XDocument xdoc = XDocument.Load(XMLKeysBind);
                // On récupère la racine du document
                XElement root = xdoc.Root;

                // On récupère la liste des balises fillse de <Key></Key>
                IEnumerable<XElement> keysList = root.Descendants(KEY);
                // Pour chacune de ces balises
                foreach (XElement item in keysList)
                {
                    // On ajoute le raccourci trouvé au manageur
                    string soundId = item.Element(SOUND_ID).Value;
                    string keyId = item.Element(KEYCODE).Value;
                    keyManager.SetShortcut(Model.Model.GetInstance().SoundLibrary.GetSoundByID(soundId), (Keys)Enum.Parse(typeof(Keys), keyId));
                }

                // On récupère la liste des balises filles de <Note></Note>
                IEnumerable<XElement> pitchsList = root.Descendants(NOTE);
                // Pour chacune de ces balises
                foreach (XElement item in pitchsList)
                {
                    // On ajoute le raccourci trouvé au manageur
                    string soundId = item.Element(SOUND_ID).Value;
                    string note = item.Element(NOTE_ID).Value;
                    midiNoteManager.SetShortcut(Model.Model.GetInstance().SoundLibrary.GetSoundByID(soundId), new NoteID(int.Parse(note)));
                }
            }
            XMLShortcutManager.GetInstance()._keyManager = keyManager;
            XMLShortcutManager.GetInstance()._midiNoteManager = midiNoteManager;
        }