protected override void OnClick() { AppSingleton.Instance().CreateWorkspacePath(); ToolForm form = new ToolForm(); form.ShowDialog(); }
/// <summary>Show a dialog to select the desired time frames</summary> public void ShowTimeFrameSelection(Transmitter trans) { // Get the list of currently selected time frames var existing = trans.TimeFrames; // Show a dialog for selecting time frames var dlg = new ToolForm { Text = "Select Time Frames", FormBorderStyle = FormBorderStyle.SizableToolWindow, StartPosition = FormStartPosition.CenterParent, ShowInTaskbar = false, Size = new Size(250, 360), }; var chklist = dlg.Controls.Add2(new CheckedListBox { Dock = DockStyle.Fill }); foreach (var tf in Enum <ETimeFrame> .Values) { chklist.Items.Add(tf, existing.Contains(tf)); } dlg.ShowDialog(); // Update the list of time frames var new_list = chklist.CheckedItems.OfType <ETimeFrame>().ToArray(); trans.TimeFrames = new_list; // Make this list the new default set Settings.DefaultTimeFrames = new_list; }