private void ExtensionManager_Click(object sender, EventArgs e) { var form = new ExtensionManagerForm(); form.App = App; form.Show(); }
/// <inheritdoc/> protected override void OnGlpyhClick(GeoMouseArgs e) { using (var form = new ExtensionManagerForm()) { form.App = Manager; form.ShowDialog(); } }
//Cycle through feeds from settings and call autoupdate function. If any updates occur, show message box. public static void autoUpdateController(AppManager app, ExtensionManagerForm form) { List <String> updatesOccurred = new List <String>(); Packages packages = new Packages(); System.Collections.Specialized.StringCollection feeds = FeedManager.getAutoUpdateFeeds(); Update update = new Update(packages, null, app); if (update.IsOnline() == true) { foreach (String feed in feeds) { packages.SetNewSource(feed); update = new Update(packages, null, app); updatesOccurred.AddRange(update.autoUpdate()); } } if (updatesOccurred.Count > 0) { String begin; if (updatesOccurred.Count == 1) { begin = "The following extension has been updated:"; } else { begin = "The following extensions have been updated:"; } StringBuilder sb = new StringBuilder(); sb.AppendLine(begin); sb.AppendLine(); for (int i = 0; i < updatesOccurred.Count && i < 25; i++) { sb.AppendLine("-" + updatesOccurred.ElementAt(i)); } if (updatesOccurred.Count > 25) { sb.AppendLine("..."); } sb.AppendLine(); sb.Append("Updates will finish when HydroDesktop is restarted."); sb.AppendLine("\n\n Do you want to restart HydroDesktop now?"); DialogResult dialogResult = MessageBox.Show(sb.ToString(), "Update Complete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { System.Diagnostics.Process.Start(Application.ExecutablePath); Environment.Exit(-1); } form.AutoUpdateRestartNeccesary(); } }
//Cycle through feeds from settings and call autoupdate function. If any updates occur, show message box. public static void autoUpdateController(AppManager app, ExtensionManagerForm form) { List<String> updatesOccurred = new List<String>(); Packages packages = new Packages(); System.Collections.Specialized.StringCollection feeds = FeedManager.getAutoUpdateFeeds(); Update update = new Update(packages, null, app); if (update.IsOnline() == true) { foreach (String feed in feeds) { packages.SetNewSource(feed); update = new Update(packages, null, app); updatesOccurred.AddRange(update.autoUpdate()); } } if (updatesOccurred.Count > 0) { String begin; if (updatesOccurred.Count == 1){ begin = "The following extension has been updated:"; } else{ begin = "The following extensions have been updated:"; } StringBuilder sb = new StringBuilder(); sb.AppendLine(begin); sb.AppendLine(); for (int i = 0; i < updatesOccurred.Count && i<25; i++) { sb.AppendLine("-" + updatesOccurred.ElementAt(i)); } if (updatesOccurred.Count > 25) { sb.AppendLine("..."); } sb.AppendLine(); sb.Append("Updates will finish when HydroDesktop is restarted."); sb.AppendLine("\n\n Do you want to restart HydroDesktop now?"); DialogResult dialogResult = MessageBox.Show(sb.ToString(), "Update Complete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { System.Diagnostics.Process.Start(Application.ExecutablePath); Environment.Exit(-1); } form.AutoUpdateRestartNeccesary(); } }
private void OpenSampleProjects_Click(object sender, EventArgs e) { var form = new ExtensionManagerForm(); SampleProjectsForm sampleProjForm = new SampleProjectsForm(App); sampleProjForm.Show(); }
//Cycle through feeds from settings and call autoupdate function. If any updates occur, show message box. public static void autoUpdateController(AppManager app, ExtensionManagerForm form) { List<String> updatesOccurred = new List<String>(); Packages packages = new Packages(); System.Collections.Specialized.StringCollection feeds = FeedManager.getAutoUpdateFeeds(); foreach (String feed in feeds) { packages.SetNewSource(feed); Update update = new Update(packages, null, app); updatesOccurred.AddRange(update.autoUpdate()); } if (updatesOccurred.Count > 0) { String begin; if (updatesOccurred.Count == 1){ begin = "The following extension has been updated:"; } else{ begin = "The following extensions have been updated:"; } StringBuilder sb = new StringBuilder(); sb.AppendLine(begin); sb.AppendLine(); for (int i = 0; i < updatesOccurred.Count && i<25; i++) { sb.AppendLine(updatesOccurred.ElementAt(i)); } if (updatesOccurred.Count > 25) { sb.AppendLine("..."); } sb.AppendLine(); sb.Append("Updates will finish when HydroDesktop is restarted."); MessageBox.Show(sb.ToString()); form.AutoUpdateRestartNeccesary(); } }