static void Main(string[] argsarray) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); List <string> args = new List <string>(argsarray); Excel.Init(); // if (Args.Count > 0 && Args[0] == "/t") { Test.Run(); return; } if (args.Count > 0 && args[0] == "/u") { Updater.DelayDays = 0; args.RemoveAt(0); } MainForm form = new MainForm(); form.Show(); Updater.Start(); Gradients.Reset(); if (args.Count > 0) // Load file if passed as argument { try { form.Model.Load(args[0]); } catch { MessageBox.Show(Resources.FileOpenFail.Replace("#file", args[0])); } } Application.Run(form); // FPlot runs normally }
private void ImportClick(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { string src = openFileDialog.FileName; string dest = Path.Combine(Resources.GradientPath, Path.GetFileName(src)); System.IO.File.Copy(src, dest); try { Gradients.Reset(); } catch (Exception ex) { string file = ""; if (ex.Data.Contains("filename")) { file = ex.Data["filename"] as string; } MessageBox.Show(Properties.Resources.GIMPError.Replace("$f", file)); } gradientChooser.Reset(); gradientChooser.Refresh(); } }