C# Класс Bloom.Edit.EditingModel

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Visible bool

Открытые методы

Метод Описание
BrowserFocusChanged ( ) : void
CanChangeImages ( ) : bool
ChangeBookLicenseMetaData ( Palaso.UI.WindowsForms.ClearShare.Metadata metadata ) : void
ChangePicture ( GeckoHtmlElement img, Palaso.UI.WindowsForms.ImageToolbox.PalasoImage imageInfo, IProgress progress ) : void
ContentLanguagesSelectionChanged ( ) : void

user has selected or de-selected a content language

CopyImageMetadataToWholeBook ( Palaso.UI.WindowsForms.ClearShare.Metadata metadata ) : void
DeterminePageWhichWouldPrecedeNextInsertion ( ) : IPage
EditingModel ( BookSelection bookSelection, PageSelection pageSelection, Bloom.Edit.TemplateInsertionCommand templateInsertionCommand, PageListChangedEvent pageListChangedEvent, RelocatePageEvent relocatePageEvent, BookRefreshEvent bookRefreshEvent, PageRefreshEvent pageRefreshEvent, DuplicatePageCommand duplicatePageCommand, DeletePageCommand deletePageCommand, SelectedTabChangedEvent selectedTabChangedEvent, SelectedTabAboutToChangeEvent selectedTabAboutToChangeEvent, LibraryClosing libraryClosingEvent, LocalizationChangedEvent localizationChangedEvent, CollectionSettings collectionSettings, EnhancedImageServer server, BloomWebSocketServer webSocketServer ) : System
GetBookHasChanged ( ) : bool
GetCurrentLayout ( ) : Layout
GetFontAvailabilityMessage ( ) : string
GetLayoutChoices ( ) : IEnumerable
GetXmlDocumentForCurrentPage ( ) : HtmlDom

Return the DOM that represents the content of the current page. Note that this is typically not the top-level thing displayed by the browser; rather, it is embedded in an iframe.

GetXmlDocumentForEditScreenWebPage ( ) : HtmlDom

Return the top-level document that should be displayed in the browser for the current page.

OnIdleAfterDocumentSupposedlyCompleted ( object sender, EventArgs e ) : void

For some reason, we need to call this code OnIdle. We couldn't figure out the timing any other way.

OnPageSelectionChanged ( object sender, EventArgs e ) : void
RefreshDisplayOfCurrentPage ( ) : void
SaveNow ( ) : void
SavePageFrameState ( ) : void

Save anything we want to persist from page to page but which is not part of the book from the page's current state. Currently this is just the zoom level.

SetLayout ( Layout layout ) : void
SetView ( EditingView view ) : void
SetupServerWithCurrentPageIframeContents ( ) : void
ShowAddPageDialog ( ) : void

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

ViewVisibleNowDoSlowStuff ( ) : void

Приватные методы

Метод Описание
AddMessageEventListener ( string name, Action listener ) : void
AddStandardEventListeners ( ) : void

listen for these events raised by javascript.

CannotSavePage ( ) : bool
ChangePageLayout ( IPage page ) : void
CheckForBL2364 ( string when ) : void
DeletePage ( IPage page ) : void
DocumentCompleted ( ) : void

View calls this once the main document has completed loading. But this is not really reliable. Also see comments in EditingView.UpdateSingleDisplayedPage. TODO really need a more reliable way of determining when the document really is complete

DuplicatePage ( IPage page ) : void
FinishSavingPage ( string ignored = null ) : void

Called from a JavaScript event after it has done everything appropriate in JS land towards saving a page, in the process of wrapping up this page before moving to another. The main point is that any changes on this page get saved back to the main document. In case it is an origami page, there is some special stuff to do as commented below. (Argument is required for JS callback, not used).

OnBookSelectionChanged ( object sender, EventArgs e ) : void
OnDeletePage ( ) : void
OnDuplicatePage ( ) : void
OnInsertTemplatePage ( object sender, EventArgs e ) : void
OnPageSelectionChanging ( object sender, EventArgs eventArgs ) : void
OnRelocatePage ( RelocatePageInfo info ) : void
OnTabAboutToChange ( TabChangedDetails details ) : void

we need to guarantee that we save *before* any other tabs try to update, hence this "about to change" event

OnTabChanged ( TabChangedDetails details ) : void
PageSelectionFinished ( ) : void

Flag that the current (former) page selection has finished, so it's safe to select another page.

PageSelectionStarted ( ) : void

Flag that a page selection is currently under way.

ReactivateFormOnIdle ( object sender, EventArgs eventArgs ) : void
RemoveStandardEventListeners ( ) : void

stop listening for these events raised by javascript.

RethinkPageAndReloadIt ( string obj ) : void
SaveToolboxSettings ( string data ) : void
SetPageZoom ( ) : void

Set a style on the body of the main content page that will zoom it to the extent the user currently prefers.

SetTopic ( string englishTopicAsKey ) : void

When the user types ctrl+n, we do this: 1) If the user is on a page that is xmatter, or a singleton, then we just add the first page in the template 2) Else, make a new page of the same type as the current one

Описание методов

BrowserFocusChanged() публичный Метод

public BrowserFocusChanged ( ) : void
Результат void

CanChangeImages() публичный Метод

public CanChangeImages ( ) : bool
Результат bool

ChangeBookLicenseMetaData() публичный Метод

public ChangeBookLicenseMetaData ( Palaso.UI.WindowsForms.ClearShare.Metadata metadata ) : void
metadata Palaso.UI.WindowsForms.ClearShare.Metadata
Результат void

ChangePicture() публичный Метод

public ChangePicture ( GeckoHtmlElement img, Palaso.UI.WindowsForms.ImageToolbox.PalasoImage imageInfo, IProgress progress ) : void
img GeckoHtmlElement
imageInfo Palaso.UI.WindowsForms.ImageToolbox.PalasoImage
progress IProgress
Результат void

ContentLanguagesSelectionChanged() публичный Метод

user has selected or de-selected a content language
public ContentLanguagesSelectionChanged ( ) : void
Результат void

CopyImageMetadataToWholeBook() публичный Метод

public CopyImageMetadataToWholeBook ( Palaso.UI.WindowsForms.ClearShare.Metadata metadata ) : void
metadata Palaso.UI.WindowsForms.ClearShare.Metadata
Результат void

DeterminePageWhichWouldPrecedeNextInsertion() публичный Метод

public DeterminePageWhichWouldPrecedeNextInsertion ( ) : IPage
Результат IPage

EditingModel() публичный Метод

public EditingModel ( BookSelection bookSelection, PageSelection pageSelection, Bloom.Edit.TemplateInsertionCommand templateInsertionCommand, PageListChangedEvent pageListChangedEvent, RelocatePageEvent relocatePageEvent, BookRefreshEvent bookRefreshEvent, PageRefreshEvent pageRefreshEvent, DuplicatePageCommand duplicatePageCommand, DeletePageCommand deletePageCommand, SelectedTabChangedEvent selectedTabChangedEvent, SelectedTabAboutToChangeEvent selectedTabAboutToChangeEvent, LibraryClosing libraryClosingEvent, LocalizationChangedEvent localizationChangedEvent, CollectionSettings collectionSettings, EnhancedImageServer server, BloomWebSocketServer webSocketServer ) : System
bookSelection Bloom.Book.BookSelection
pageSelection PageSelection
templateInsertionCommand Bloom.Edit.TemplateInsertionCommand
pageListChangedEvent PageListChangedEvent
relocatePageEvent RelocatePageEvent
bookRefreshEvent BookRefreshEvent
pageRefreshEvent PageRefreshEvent
duplicatePageCommand DuplicatePageCommand
deletePageCommand DeletePageCommand
selectedTabChangedEvent SelectedTabChangedEvent
selectedTabAboutToChangeEvent SelectedTabAboutToChangeEvent
libraryClosingEvent LibraryClosing
localizationChangedEvent LocalizationChangedEvent
collectionSettings Bloom.Collection.CollectionSettings
server EnhancedImageServer
webSocketServer BloomWebSocketServer
Результат System

GetBookHasChanged() публичный Метод

public GetBookHasChanged ( ) : bool
Результат bool

GetCurrentLayout() публичный Метод

public GetCurrentLayout ( ) : Layout
Результат Bloom.Book.Layout

GetFontAvailabilityMessage() публичный Метод

public GetFontAvailabilityMessage ( ) : string
Результат string

GetLayoutChoices() публичный Метод

public GetLayoutChoices ( ) : IEnumerable
Результат IEnumerable

GetXmlDocumentForCurrentPage() публичный Метод

Return the DOM that represents the content of the current page. Note that this is typically not the top-level thing displayed by the browser; rather, it is embedded in an iframe.
public GetXmlDocumentForCurrentPage ( ) : HtmlDom
Результат Bloom.Book.HtmlDom

GetXmlDocumentForEditScreenWebPage() публичный Метод

Return the top-level document that should be displayed in the browser for the current page.
public GetXmlDocumentForEditScreenWebPage ( ) : HtmlDom
Результат Bloom.Book.HtmlDom

OnIdleAfterDocumentSupposedlyCompleted() публичный Метод

For some reason, we need to call this code OnIdle. We couldn't figure out the timing any other way.
public OnIdleAfterDocumentSupposedlyCompleted ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

OnPageSelectionChanged() публичный Метод

public OnPageSelectionChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

RefreshDisplayOfCurrentPage() публичный Метод

public RefreshDisplayOfCurrentPage ( ) : void
Результат void

SaveNow() публичный Метод

public SaveNow ( ) : void
Результат void

SavePageFrameState() публичный Метод

Save anything we want to persist from page to page but which is not part of the book from the page's current state. Currently this is just the zoom level.
public SavePageFrameState ( ) : void
Результат void

SetLayout() публичный Метод

public SetLayout ( Layout layout ) : void
layout Bloom.Book.Layout
Результат void

SetView() публичный Метод

public SetView ( EditingView view ) : void
view EditingView
Результат void

SetupServerWithCurrentPageIframeContents() публичный Метод

public SetupServerWithCurrentPageIframeContents ( ) : void
Результат void

ShowAddPageDialog() публичный Метод

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
Результат void

ViewVisibleNowDoSlowStuff() публичный Метод

public ViewVisibleNowDoSlowStuff ( ) : void
Результат void

Описание свойств

Visible публичное свойство

public bool Visible
Результат bool