示例#1
0
        private void EditMacro()
        {
            if (listViewMacro.SelectedItems.Count != 1)
            {
                return;
            }

            try
            {
                string command  = listViewMacro.SelectedItems[0].Text;
                string fileName = TV3BlasterPlugin.PathCombine(command);

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

                    throw new FileNotFoundException("Macro file missing", fileName);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
                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();
        }