private void Button_RightClick(object sender, ExecutedRoutedEventArgs e) { Object o = e.Source; Button btn = (Button)sender; HotkeyEditor editor = new HotkeyEditor(); Int32 num = Int32.Parse(btn.Name.Substring(3)); editor.SetValues(programSettings.HotkeyCommands[num].Keyword, programSettings.HotkeyCommands[num].Expansion); if ((bool)editor.ShowDialog()) { String label; String command; editor.GetValues(out label, out command); btn.Content = label; Alias alias = programSettings.HotkeyCommands[num]; alias.Keyword = label; alias.Expansion = command; programSettings.HotkeyCommands[num] = alias; } }
private void Button_RightClick(object sender, ExecutedRoutedEventArgs e) { Object o = e.Source; Button btn = (Button)sender; HotkeyEditor editor = new HotkeyEditor(); Int32 num = Int32.Parse(btn.Name.Substring(3)); editor.SetValues(programSettings.HotkeyCommands[num].Keyword, programSettings.HotkeyCommands[num].Expansion); if( (bool)editor.ShowDialog() ) { String label; String command; editor.GetValues(out label, out command); btn.Content = label; Alias alias = programSettings.HotkeyCommands[num]; alias.Keyword = label; alias.Expansion = command; programSettings.HotkeyCommands[num] = alias; } }