private void SaveDirtyParts(WaitOnPartsNotDirty waitOperation) { // save any dirty parts foreach (var tabViewItem in partsTabControl.Items) { var webView = tabViewItem as EditorWebViewTabItem; if ((webView != null) && (webView.PartModel.IsDirty)) { if (waitOperation != null) { waitOperation.AddPart(webView.PartModel); } webView.Browser.ExecuteScriptAsync($"postFile()"); } } }
private void SavePackageAs(string filename) { WaitOnPartsNotDirty waitOperation = new WaitOnPartsNotDirty(); SaveDirtyParts(waitOperation); if (!waitOperation.HasDirtyParts) { SavePackageAsCore(filename); } else { m_pendingSaveAsPreviousCursor = Cursor; Cursor = Cursors.Wait; m_pendingSaveAsFilename = filename; waitOperation.AllPartsNotDirty += WaitOperation_AllPartsNotDirty; } }