private void OnClick_Add(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { var dcw = new DisplayChangerWrapper(); string newConfigName = Interaction.InputBox("Enter a name"); if (!string.IsNullOrWhiteSpace(newConfigName)) { Console.WriteLine(newConfigName); dcw.CreateNewConfig(newConfigName); configHandler.AddConfigElement(newConfigName); SetContextMenuStrip(); } } }
private void OnClick_ConfigItem(object sender, MouseEventArgs e) { var dcw = new DisplayChangerWrapper(); notifyIcon.ContextMenuStrip.Close(); var clickedToolStripItem = (ToolStripItem)sender; var configName = clickedToolStripItem.Text; // Sets the config if (e.Button == MouseButtons.Left) { dcw.SetConfig(configName); } // deletes the config else if (e.Button == MouseButtons.Right) { dcw.DeleteConfig(configName); configHandler.DeleteConfig(configName); SetContextMenuStrip(); } }