CleanHtmlAndCopyToPageDom() public method

this started as an experiment, where our textareas were not being read when we saved because of the need to change the picture
public CleanHtmlAndCopyToPageDom ( ) : void
return void
 public void SaveNow()
 {
     if (_domForCurrentPage != null)
     {
         try
         {
             // CleanHtml already requires that we are on UI thread. But it's worth asserting here too in case that changes.
             // If we weren't sure of that we would need locking for access to _tasksToDoAfterSaving and _inProcessOfSaving,
             // and would need to be careful about whether any delayed tasks needed to be on the UI thread.
             Debug.Assert(!_view.InvokeRequired);
             _inProcessOfSaving = true;
             _tasksToDoAfterSaving.Clear();
             _view.CleanHtmlAndCopyToPageDom();
             _bookSelection.CurrentSelection.SavePage(_domForCurrentPage);
         }
         finally
         {
             _inProcessOfSaving = false;
         }
         while (_tasksToDoAfterSaving.Count > 0)
         {
             var task = _tasksToDoAfterSaving[0];
             _tasksToDoAfterSaving.RemoveAt(0);
             task();
         }
     }
 }
Esempio n. 2
0
 public void SaveNow()
 {
     if (_domForCurrentPage != null)
     {
         _view.CleanHtmlAndCopyToPageDom();
         _bookSelection.CurrentSelection.SavePage(_domForCurrentPage);
     }
 }