private void Doc_DocumentSaving(object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e) { if (e.Cancellable) { e.Cancel(); ShowMessage("取消事件"); } }
// Show a message to decide whether to save the document. void a_DocumentSaving( object obj, DocumentSavingEventArgs args) { // Ask whether to prevent from saving: bool cancel = args.Cancellable && LabUtils.QuestionMsg( "Saving event handler was triggered.\r\n" + "Using the pre-event mechanism, we can cancel the save.\r\n" + "Continue saving the document?"); //args.Cancel = cancel; // 2011 if (cancel) { args.Cancel(); } // 2012 }
void m_app_DocumentSaving(object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e) { DisplayEvent("Document saving"); }
/// <summary> /// Subscribe to the DocumentSaving event to be notified when Revit is just about to save the document. /// </summary> /// <param name="sender">sender</param> /// <param name="e">The event argument used by DocumentSaving event. </param> private void application_DocumentSaving(Object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e) { validateParameters(e.Document); }
public void Application_DocumentSaving(object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e) { ExecuteEventHooks(EventType.Application_DocumentSaving, sender, e); }