public FMB() { InitializeComponent(); //Create the default form stuff Resize += ResizeWindow; //To allow for window resizing SetupLayout(); //Setup the layout of the form UpdateProjects(false, true); //Receive the projects from the projects.json file UpdateOptions(false, true); //Receive the options from the options.json file FormClosed += FMBClosed; //Handle when the form closes Load += (sender, e) => { UpdateChecker.CheckForUpdates(UpdateChecker.UpdateURL); //When it loads the form, check for updates }; }
public FMB() { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; InitializeComponent(); //Create the default form stuff Resize += ResizeWindow; //To allow for window resizing SetupLayout(); //Setup the layout of the form UpdateProjects(false, true); //Receive the projects from the projects.json file UpdateOptions(false, true); //Receive the options from the options.json file FormClosed += FMBClosed; //Handle when the form closes optionsToolStripMenuItem.DropDown.Closing += (sender, e) => { if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) { e.Cancel = true; } else { Dictionary <string, bool> checkVersions = new Dictionary <string, bool>(); foreach (ToolStripMenuItem dropDownItem in SelectVersionsToCheckMenuItem.DropDownItems) { checkVersions.Add(dropDownItem.Text, dropDownItem.Checked); } if (Options.ContainsKey("sync_versions")) { Options["sync_versions"] = checkVersions; } else { Options.Add("sync_versions", checkVersions); } UpdateOptions(true, false); } }; SelectVersionsToCheckMenuItem.DropDown.Closing += (sender, e) => { if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) { e.Cancel = true; } }; Load += (sender, e) => { UpdateChecker.CheckForUpdates(UpdateChecker.UpdateURL); //When it loads the form, check for updates AddBuildFileText("No project loaded"); BuildFile.ReadOnly = true; NewProjectMenu.SetupVersions(); }; }
private void CheckForUpdatesMenuItem_Click(object sender, EventArgs e) { UpdateChecker.CheckForUpdates(UpdateChecker.UpdateURL); }