private void OpenFile(string fileName) { openFileName = fileName; Stream stream; try { // get the file name and open a stream stream = new FileStream(fileName, FileMode.Open); } catch { String errorMsg = "Cannot open " + fileName; System.Windows.Forms.MessageBox.Show(errorMsg, "Error!"); openFileName = null; return; } if (stream != null) { m_Data = new ProfileEventData(stream); // set the time start to the extent TimeExtent extent = m_Data.TimeExtent; m_TimeStart = (Time)extent.Min; m_TimeEnd = (Time)extent.Max; this.Text = "Profile Event Viewer - " + fileName; Invalidate(); stream.Close(); } m_Summary.PostShow(this); m_Bookmarks.PostShow(this); }
public void Merge(TimeExtent other) { Min = Math.Min(other.Min, Min); Max = Math.Max(other.Max, Max); }