public Result OnStartup(UIControlledApplication application) { try { appCommand = this; m_app = application; AddInId appId = m_app.ActiveAddInId; addInGuid = appId.GetGUID(); addInName = appId.GetAddInName(); doorUpdater = new DoorUpdater(appId); dtmUpdater = new DTMUpdater(appId); revisionUpdater = new RevisionUpdater(appId); socketHandler = new SocketHandler(doorUpdater, dtmUpdater, revisionUpdater); extEvent = ExternalEvent.Create(socketHandler); LogUtil.InitializeLog(); LogUtil.AppendLog("Mission Control AddIn Started"); m_app.ControlledApplication.DocumentOpening += CollectConfigurationOnOpening; m_app.ControlledApplication.DocumentOpened += RegisterUpdatersOnOpen; m_app.ControlledApplication.FailuresProcessing += FailureProcessor.CheckFailure; m_app.ControlledApplication.DocumentClosing += UnregisterUpdaterOnClosing; } catch (Exception ex) { string message = ex.Message; LogUtil.AppendLog("OnStartup:" + ex.Message); } return(Result.Succeeded); }
public Result OnStartup(UIControlledApplication application) { try { Instance = this; var appId = application.ActiveAddInId; DoorUpdaterInstance = new DoorUpdater(appId); DtmUpdaterInstance = new DtmUpdater(appId); Tasks = new Queue <Action <UIApplication> >(); application.Idling += OnIdling; application.ControlledApplication.DocumentOpening += OnDocumentOpening; application.ControlledApplication.DocumentOpened += OnDocumentOpened; application.ControlledApplication.FailuresProcessing += FailureProcessor.CheckFailure; application.ControlledApplication.DocumentClosing += OnDocumentClosing; application.ControlledApplication.DocumentSynchronizingWithCentral += OnDocumentSynchronizing; application.ControlledApplication.DocumentSynchronizedWithCentral += OnDocumentSynchronized; application.ControlledApplication.DocumentCreated += OnDocumentCreated; #if RELEASE2015 || RELEASE2016 || RELEASE2017 // (Konrad) We are not going to process warnings here. #else application.ControlledApplication.FailuresProcessing += OnFailureProcessing; #endif // (Konrad) Create buttons and register dockable panel. CommunicatorUtilities.RegisterCommunicator(application); CreateButtons(application); // (Konrad) Since Communicator Task Assistant offers to open Families for editing, // it requires an External Event because new document cannot be opened from Idling Event CommunicatorHandler = new CommunicatorRequestHandler(); CommunicatorEvent = ExternalEvent.Create(CommunicatorHandler); } catch (Exception ex) { Log.AppendLog(LogMessageType.EXCEPTION, ex.Message); } return(Result.Succeeded); }
public SocketHandler(DoorUpdater doorU, DTMUpdater dtmU, RevisionUpdater revisionU) { doorUpdater = doorU; dtmUpdater = dtmU; revisionUpdater = revisionU; }