/// <summary> /// Implement this method to implement the external application which should be called when /// Revit is about to exit,Any documents must have been closed before this method is called. /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> /// <returns>Return the status of the external application. /// A result of Succeeded means that the external application successfully shutdown. /// Cancelled can be used to signify that the user cancelled the external operation at /// some point. /// If false is returned then the Revit user should be warned of the failure of the external /// application to shut down correctly.</returns> public Result OnShutdown(UIControlledApplication application) { m_CtrlApp.DocumentChanged -= CtrlApp_DocumentChanged; m_InfoForm = null; m_ChangesInfoTable = null; return(Result.Succeeded); }
/// <summary> /// Implement this method to implement the external application which should be called when /// Revit starts before a file or default template is actually loaded. /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> /// <returns>Return the status of the external application. /// A result of Succeeded means that the external application successfully started. /// Cancelled can be used to signify that the user cancelled the external operation at /// some point. /// If false is returned then Revit should inform the user that the external application /// failed to load and the release the internal reference.</returns> public Result OnStartup(UIControlledApplication application) { // initialize member variables. m_CtrlApp = application.ControlledApplication; m_ChangesInfoTable = CreateChangeInfoTable(); m_InfoForm = new ChangesInformationForm(ChangesInfoTable); // register the DocumentChanged event m_CtrlApp.DocumentChanged += new EventHandler <Autodesk.Revit.DB.Events.DocumentChangedEventArgs>(CtrlApp_DocumentChanged); // show dialog m_InfoForm.Show(); return(Result.Succeeded); }
/// <summary> /// Implement this method to implement the external application which should be called when /// Revit starts before a file or default template is actually loaded. /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> /// <returns>Return the status of the external application. /// A result of Succeeded means that the external application successfully started. /// Cancelled can be used to signify that the user cancelled the external operation at /// some point. /// If false is returned then Revit should inform the user that the external application /// failed to load and the release the internal reference.</returns> public Result OnStartup(UIControlledApplication application) { // initialize member variables. m_CtrlApp = application.ControlledApplication; m_ChangesInfoTable = CreateChangeInfoTable(); m_InfoForm = new ChangesInformationForm(ChangesInfoTable); // register the DocumentChanged event m_CtrlApp.DocumentChanged += new EventHandler<Autodesk.Revit.DB.Events.DocumentChangedEventArgs>(CtrlApp_DocumentChanged); // show dialog m_InfoForm.Show(); return Result.Succeeded; }
/// <summary> /// Implement this method to implement the external application which should be called when /// Revit is about to exit,Any documents must have been closed before this method is called. /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> /// <returns>Return the status of the external application. /// A result of Succeeded means that the external application successfully shutdown. /// Cancelled can be used to signify that the user cancelled the external operation at /// some point. /// If false is returned then the Revit user should be warned of the failure of the external /// application to shut down correctly.</returns> public Result OnShutdown(UIControlledApplication application) { m_CtrlApp.DocumentChanged -= CtrlApp_DocumentChanged; m_InfoForm = null; m_ChangesInfoTable = null; return Result.Succeeded; }