A SimulatedPageFile is used in connection with simulating a current-page file that needs to (seem to) be in the book folder so local hrefs work. We don't actually put files there (see EnhancedImageServer.MakeSimulatedPageFileInBookFolder for more), but rather store some data in the our file server object. The particular purpose of the SimulatedPageFile is to manage the lifetime for which the simulated page is kept in the server. It can be passed to the Browser which will Dispose() it when no longer needed. (In that regard, it is used in rather the same way as a TempFile object is used to make sure that a temp file gets deleted when the Browser no longer needs it.)
Inheritance: IDisposable
Example #1
0
        public void SetupServerWithCurrentPageIframeContents()
        {
            _domForCurrentPage = CurrentBook.GetEditableHtmlDomForPage(_pageSelection.CurrentSelection);
            CheckForBL2364("setup");
            SetPageZoom();
            XmlHtmlConverter.MakeXmlishTagsSafeForInterpretationAsHtml(_domForCurrentPage.RawDom);
            CheckForBL2364("made tags safe");
            if (_currentPage != null)
                _currentPage.Dispose();
            _currentPage = EnhancedImageServer.MakeSimulatedPageFileInBookFolder(_domForCurrentPage, true);
            CheckForBL2364("made simulated page");

            // Enhance JohnT: Can we somehow have a much simpler toolbox content until the user displays it?
            //if (_currentlyDisplayedBook.BookInfo.ToolboxIsOpen)
                _server.ToolboxContent = ToolboxView.MakeToolboxContent(_currentlyDisplayedBook);
            //else
            //	_server.ToolboxContent = "<html><head><meta charset=\"UTF-8\"/></head><body></body></html>";

            _server.AuthorMode = CanAddPages;
        }