/// <summary> /// Implement OnStartup method to subscribe related events. /// </summary> /// <param name="application">Current loaded application.</param> /// <returns></returns> public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) { // specify the log string assemblyName = this.GetType().Assembly.Location; m_eventReactor = new EventsReactor(assemblyName.Replace(".dll", ".log")); // // subscribe events application.ControlledApplication.DocumentSaving += new EventHandler <Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(EventReactor.DocumentSaving); application.ControlledApplication.DocumentSavingAs += new EventHandler <Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(EventReactor.DocumentSavingAs); application.ControlledApplication.DocumentClosed += new EventHandler <Autodesk.Revit.DB.Events.DocumentClosedEventArgs>(EventReactor.DocumentClosed); return(Autodesk.Revit.UI.Result.Succeeded); }
/// <summary> /// Implement OnStartup method to subscribe related events. /// </summary> /// <param name="application">Current loaded application.</param> /// <returns></returns> public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) { // specify the log string assemblyName = this.GetType().Assembly.Location; m_eventReactor = new EventsReactor(assemblyName.Replace(".dll", ".log")); // // subscribe events application.ControlledApplication.DocumentSaving += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(EventReactor.DocumentSaving); application.ControlledApplication.DocumentSavingAs += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(EventReactor.DocumentSavingAs); application.ControlledApplication.DocumentClosed += new EventHandler<Autodesk.Revit.DB.Events.DocumentClosedEventArgs>(EventReactor.DocumentClosed); return Autodesk.Revit.UI.Result.Succeeded; }