public void loadFiles(string[] fileNames) { foreach (string fileName in fileNames) { try { RunLog log = Common.loadBinaryObjectFromFile(fileName) as RunLog; RunLogExplorerForm explorer = new RunLogExplorerForm(log, fileName); explorer.MdiParent = this.MdiParent; explorer.FormClosed += new FormClosedEventHandler(explorer_FormClosed); explorer.Show(); openLogs.Add(log, explorer); } catch (Exception ex) { MessageBox.Show("Unable to open or read file " + fileName + " due to exception: " + ex.Message + ex.StackTrace); } } updateOpenLogList(); }
public void loadFiles(string[] fileNames) { foreach (string fileName in fileNames) { try { FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None); BinaryFormatter bf = new BinaryFormatter(); RunLog log = (RunLog)bf.Deserialize(fs); RunLogExplorerForm explorer = new RunLogExplorerForm(log, fileName); explorer.MdiParent = this.MdiParent; explorer.FormClosed += new FormClosedEventHandler(explorer_FormClosed); explorer.Show(); openLogs.Add(log, explorer); } catch (Exception ex) { MessageBox.Show("Unable to open or read file " + fileName + " due to exception: " + ex.Message + ex.StackTrace); } } updateOpenLogList(); }