internal virtual void OnDocumentSaved(Controls.DocControl cont, DocumentSavedEventArgs doc) { if (DocumentSaved != null) { DocumentSaved.DynamicInvoke(new object[] { cont, doc }); } }
/// <summary> /// Save document safely. "Safe" in the sense that all exceptions are caught (and reported via OnSaveException). /// The implementer of IDocumentClient is responsible for ensuring that existing data is not lost /// if the save fails.</summary> /// <param name="document">Document to save</param> /// <param name="kind">Kind of document event associated with save</param> /// <returns>True iff document is saved safely</returns> protected bool SafeSave(IDocument document, DocumentEventType kind) { IsSaving = true; bool success = false; try { if (OnDocumentSaving(document)) { DocumentSaving.Raise(this, new DocumentEventArgs(document, kind)); IDocumentClient client = GetClient(document); client.Save(document, document.Uri); success = OnDocumentSaved(document); if (success) { document.Dirty = false; m_newDocumentPaths.Remove(document.Uri.LocalPath); DocumentSaved.Raise(this, new DocumentEventArgs(document, kind)); } } } catch (Exception ex) { OnSaveException(ex); } IsSaving = false; return(success); }
public int OnAfterSave(uint docCookie) { var info = _runningDocumentTable.GetDocumentInfo(docCookie); var path = info.Moniker; DocumentSaved?.Invoke(this, path); return(VSConstants.S_OK); }
private async void HandleDocumentSaved(object sender, EventArgs e) { var analysedDocument = await GetAnalysisDocument(); if (analysedDocument != null) { DocumentSaved?.Invoke(this, new DocumentSavedEventArgs { Document = analysedDocument }); } }
private void DocumentEvents_DocumentSaved(Document document) { var analysedDocument = GetAnalysisDocument(document); if (analysedDocument != null) { DocumentSaved?.Invoke(this, new DocumentSavedEventArgs { Document = analysedDocument }); } }
private void SaveDocument() { ChangeStatus(ServiceActivity.Saving); try { var sequence = Interlocked.Exchange(ref _sequenceFileNames, new ConcurrentBag <string>()); var destinationPath = _pdfService.SaveDocument(sequence.Reverse(), GenerateUniqueFileName()); if (destinationPath != null) { DocumentSaved?.Invoke(this, new DocumentEventArgs(destinationPath)); } } catch (Exception ex) { _logger.Error(ex.Message); throw; } ChangeStatus(ServiceActivity.Waiting); }
/// <summary> /// Invokes handlers of the <see cref="DocumentSaved"/> event. /// </summary> /// <param name="document">The saved document.</param> protected void NotifyDocumentSaved(IDocument document) { DocumentSaved?.Invoke(this, new DocumentWindowEventArgs(document)); }
public static void RaiseDocumentSaved(Document document) { DocumentSaved?.Invoke(document); }
private void OnCurrentDocumentSaved(object sender, EventArgs e) { DocumentSaved?.Invoke(sender, e); }
protected virtual void OnDocumentSaved(DevEnviromentDocument e) { DocumentSaved?.Invoke(this, e); }
public int OnAfterSave(uint docCookie) { DocumentSaved?.Invoke(docCookie); return(VSConstants.S_OK); }
public void FakeNotification() { DocumentSaved.Invoke(new Document()); }