/////////////////////////////////////////////////////////////////////////////////////////// public MainWindow() { myInstance = this; InitializeComponent(); myConnection = new Connection(); //create autocomplete popup menu myPromptPopupMenu = new AutocompleteMenu(myPromptBox); myPromptPopupMenu.MinFragmentLength = 1; //size of popupmenu myPromptPopupMenu.Items.MaximumSize = new System.Drawing.Size(300, 400); myPromptPopupMenu.Items.Width = 300; myAutocompletionList = new List<string>(); // Load macros myMacros = new List<Macro>(); int i = 0; foreach(string macroShortcut in Properties.Settings.Default.MacroShortcuts) { Macro m = new Macro(); m.Shortcut = macroShortcut; m.Script = Properties.Settings.Default.MacroScripts[i++]; myMacros.Add(m); } myConnection.Connect("localhost", 22500); }
/////////////////////////////////////////////////////////////////////////////////////////// private void mySaveButton_Click(object sender, EventArgs e) { Macro newMacro = new Macro(); newMacro.Script = myScriptBox.Text; newMacro.Shortcut = myShortcutBox.Text; MainWindow.Instance.Macros.Add(newMacro); myMacroList.Items.Add(newMacro); }