private void onLoad() { this.StartPointChanged = false; this.IMSSettings = new IMSSettings(); //Set the current settings of all the controls this.initControls(); this.isDone = true; }
public WriteProblemLog(String path, String directory) { this.settings = new IMSSettings(); if (settings.General.ProblemLister.Log) { this.Path = path; this.Directory = directory; this.problems = new List<String>(); DirectoryInfo d = new DirectoryInfo(Directory); d.Create(); FileInfo file = new FileInfo(this.Path); FileInfo logfile = new FileInfo(this.Directory + "/" + file.Name + ".log"); String s = ""; if (logfile.Exists) s = System.Environment.NewLine; File.AppendAllText(this.Directory + "\\" + file.Name + ".log", s + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + System.Environment.NewLine); } }
private void onLoad() { this.errorList = new List<Error>(); this.errorListView1.SmallImageList = new ImageList(); this.errorListView1.SmallImageList.TransparentColor = Color.White; this.errorListView1.SmallImageList.Images.Add("warning", IMSEnterprise.Properties.Resources.warning); this.errorListView1.SmallImageList.Images.Add("error", IMSEnterprise.Properties.Resources.error); this.totErrorLabel.Text = "0 error(s)"; this.totWarningLabel.Text = "0 warning(s)"; this.eLvwColumnSorter = new ListViewColumnSorter(); this.lvwColumnSorter = new ListViewColumnSorter(); this.listView.ListViewItemSorter = this.lvwColumnSorter; this.errorListView1.ListViewItemSorter = this.eLvwColumnSorter; this.MinimumSize = new Size(1024, this.Size.Height); this.searchInput.GotFocus += this.searchInput_Enter; this.searchInput.LostFocus += this.searchInput_Leave; this.searchInput.Tag = 0; this.documentationExists(); this.KeyPreview = true; enterpriseList.ShowNodeToolTips = true; saveToolStripMenuItem.Enabled = false; sourceIdLabel.Height = 20; progressBar.Hide(); // get IMSEnterprise.config this.IMSSettings = new IMSSettings(); this.initSettings(); // prepare the bgw for reading files bgwIMS.DoWork += bgwIMS_DoWork; bgwIMS.RunWorkerCompleted += bgwIMS_RunWorkerCompleted; bgwIMS.WorkerSupportsCancellation = true; if(this.IMSSettings.Startup.FileToOpen.Choice != 3) { if (Uri.IsWellFormedUriString(this.IMSSettings.Startup.FileToOpen.Value, UriKind.Absolute)) // file to open is a uri { UrlInputDialog url = new UrlInputDialog(this.IMSSettings.Startup.FileToOpen.Value); url.StartPosition = FormStartPosition.CenterScreen; url.Text = "Downloading..."; if (url.ShowDialog() == DialogResult.OK) { this.downloadAndProcessTime = Convert.ToInt32(url.Timer.ElapsedMilliseconds); this.currentFilePath = url.CurrentFilePath; this.recentSaved = false; if (this.IMSSettings.Startup.FileToOpen.Choice == 0) this.IMSSettings.Startup.FileToOpen.Value = url.Uri; this.enableLoadingMode(); bgwIMS.RunWorkerAsync(); } else // download was interupted { this.fileNotFound(); } } else // file to open is a local file { if (IMSSettings.Startup.FileToOpen.Value != null) // file to open had no value { FileInfo info = new FileInfo(@IMSSettings.Startup.FileToOpen.Value); if (!info.Exists) // file didnt exist { this.fileNotFound(); } else // file did exist { this.currentFilePath = @IMSSettings.Startup.FileToOpen.Value; this.enableLoadingMode(); bgwIMS.RunWorkerAsync(); // start processing the file } } } } }
private void beforeOptionsCloses(Object sender, FormClosingEventArgs e) { this.IMSSettings = new IMSSettings(); if (this.IMSOptions.StartPointChanged || this.IMSOptions.MaxChanged) this.setupEnterpriseList(); this.initSettings(); }