Example #1
0
        // 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);
        }
Example #2
0
 // 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);
         }
     }
 }
Example #3
0
 // creates a new window
 public IWindow         NewWindow()
 {
     return(MdiApplication.GetObject().Windows.CreateWindow(this));
 }
Example #4
0
 // create a new document list
 internal Documents(MdiApplication mdiApplication)
 {
     _mdiApplication = mdiApplication;
 }
Example #5
0
 // create a new windows list
 internal Windows(MdiApplication mdiApplication)
 {
     _mdiApplication = mdiApplication;
     _parent         = mdiApplication;
 }