// set the focus to a window of the document public IWindow Activate() { IWindow documentWindow = null; foreach (IWindow window in MdiApplication.GetObject().Windows) { if (window.Document == this) { documentWindow = window; break; } } Debug.Assert(documentWindow != null); documentWindow.Activate(); return(documentWindow); }
// Deletes the window and releases the document, if any, hosted in the window. public void Close(bool saveChanges) { // is this the last window open to a document that needs to be saved? if ((_document != null) && (_document.Saved == false)) { int count = 0; foreach (IWindow window in MdiApplication.GetObject().Windows) { if (window.Document == _document) { count++; } } if (count == 1) { _document.Close(saveChanges); } } }
// creates a new window public IWindow NewWindow() { return(MdiApplication.GetObject().Windows.CreateWindow(this)); }
// create a new document list internal Documents(MdiApplication mdiApplication) { _mdiApplication = mdiApplication; }
// create a new windows list internal Windows(MdiApplication mdiApplication) { _mdiApplication = mdiApplication; _parent = mdiApplication; }