Пример #1
0
        private void EditMacro()
        {
            if (listViewMacro.SelectedItems.Count != 1)
            {
                return;
            }

            try
            {
                string command  = listViewMacro.SelectedItems[0].Text;
                string fileName = MPBlastZonePlugin.FolderMacros + command + IrssUtils.Common.FileExtensionMacro;

                if (File.Exists(fileName))
                {
                    MacroEditor macroEditor = new MacroEditor(command);
                    macroEditor.ShowDialog(this);
                }
                else
                {
                    RefreshMacroList();
                    RefreshCommandsCombo();

                    throw new FileNotFoundException("Macro file missing", fileName);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                MessageBox.Show(this, ex.Message, "Failed to edit macro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void buttonNewMacro_Click(object sender, EventArgs e)
        {
            MacroEditor macroEditor = new MacroEditor();

            macroEditor.ShowDialog(this);

            RefreshMacroList();
            RefreshCommandsCombo();
        }