private void DocumentSaving(object sender, DocumentEventArgs e) { this.FormatDocument(e.Document); }
int RaiseEvent(uint docCookie, EventHandler<DocumentEventArgs> eventToRaise) { if (eventToRaise == null) { return HResult.S_OK; } Document doc = GetDocumentFromCookie(docCookie); if (doc == null) { return HResult.S_OK; } try { var args = new DocumentEventArgs(doc); eventToRaise(this, args); } catch (Exception ex) { Log.SendException("Error in raising event.", ex); } return HResult.S_OK; }