ShowAddPageDialog() public method

Although browsers are happy to let you manipulate the DOM, in most cases gecko/xulrunner does not expect that we, the host process, are going to need access to those changes. For example, if we have a control that adds a class to some element based on a user choice, the user will see the choice take effect, but then when they come back to the page later, their choice will be lost. This is because that new class just isn't in the html that gets returned to us, if we do, for example, _browser.Document.GetElementsByTagName("body").outerHtml. (Other things changes *are* returned, like the new contents of an editable div). /// Anyhow this method, triggered by javascript that knows it did something that will be lost, is here in order to work around this. The Javascript does something like: var origin = window.location.protocol + '//' + window.location.host; event.initMessageEvent ('PreserveClassAttributeOfElement', true, true, theHTML, origin, 1234, window, null); document.dispatchEvent (event); /// The hard part here is knowing which element gets this html
public ShowAddPageDialog ( ) : void
return void
Example #1
0
        private void AddPageButton_Click()
        {
            // Turn double-click into a single-click
            if (_lastButtonClickedTime > DateTime.Now.AddSeconds(-1))
            {
                return;
            }
            _lastButtonClickedTime = DateTime.Now;

            if (_editingModel.CanAddPages)
            {
                _editingModel.ShowAddPageDialog();
            }
            else
            {
                // TODO: localize buttons
                MessageBox.Show(EditingView.GetInstructionsForUnlockingBook(), "Bloom", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }