public Reader(bool mono) { bMono = mono; GetStartupState(); BuildMenus(); InitializeComponent(); Application.AddMessageFilter(this); this.Closing += new System.ComponentModel.CancelEventHandler(this.RdlReader_Closing); _GetPassword = new Engine.NeedPassword(this.GetPassword); // open up the current files if any if (_CurrentFiles != null) { foreach (string file in _CurrentFiles) { MDIChild mc = new MDIChild(this.ClientRectangle.Width * 3 / 4, this.ClientRectangle.Height * 3 / 4); mc.MdiParent = this; mc.Viewer.GetDataSourceReferencePassword = _GetPassword; mc.SourceFile = file; mc.Text = file; mc.Show(); } _CurrentFiles = null; // don't need this any longer } }
// Create an MDI child. Only creates it if not already open private void CreateMDIChild(string file, bool bMenuUpdate) { MDIChild mcOpen = null; if (file != null) { file = file.Trim(); foreach (MDIChild mc in this.MdiChildren) { if (file == mc.SourceFile.Trim()) { // we found it mcOpen = mc; break; } } } if (mcOpen == null) { MDIChild mc = new MDIChild(this.ClientRectangle.Width * 3 / 4, this.ClientRectangle.Height * 3 / 4); mc.MdiParent = this; mc.Viewer.GetDataSourceReferencePassword = _GetPassword; mc.SourceFile = file; mc.Text = file; NoteRecentFiles(file, bMenuUpdate); mc.Show(); } else { mcOpen.Activate(); } }
public Reader(bool mono) { bMono = mono; GetStartupState(); BuildMenus(); InitializeComponent(); Application.AddMessageFilter(this); this.Closing += new System.ComponentModel.CancelEventHandler(this.RdlReader_Closing); _GetPassword = new Engine.NeedPassword(this.GetPassword); // open up the current files if any if (_CurrentFiles != null) { foreach (string file in _CurrentFiles) { MDIChild mc = new MDIChild(this.ClientRectangle.Width*3/4, this.ClientRectangle.Height*3/4); mc.MdiParent = this; mc.Viewer.GetDataSourceReferencePassword = _GetPassword; mc.SourceFile = file; mc.Text = file; mc.Show(); } _CurrentFiles = null; // don't need this any longer } }
// Create an MDI child. Only creates it if not already open private void CreateMDIChild(string file, bool bMenuUpdate) { MDIChild mcOpen=null; if (file != null) { file = file.Trim(); foreach (MDIChild mc in this.MdiChildren) { if (file == mc.SourceFile.Trim()) { // we found it mcOpen = mc; break; } } } if (mcOpen == null) { MDIChild mc = new MDIChild(this.ClientRectangle.Width*3/4, this.ClientRectangle.Height*3/4); mc.MdiParent = this; mc.Viewer.GetDataSourceReferencePassword = _GetPassword; mc.SourceFile = file; mc.Text = file; NoteRecentFiles(file, bMenuUpdate); mc.Show(); } else mcOpen.Activate(); }