Ejemplo n.º 1
0
        void IExtensionApplication.Initialize()
        {
            ContainerRegistrar.SetupContainer();

            this.logger = ContainerRegistrar.Container.Resolve <IWebTracker>();
            AppDomain.CurrentDomain.FirstChanceException += CurrentDomainOnFirstChanceException;

            Application.DocumentManager.MdiActiveDocument.CommandWillStart += logger.TrackCommandUsage;

            var uiGenerator = ContainerRegistrar.Container.Resolve <IUiGenerator>();

            try
            {
                uiGenerator.GenerateUi(false);
            }
            catch (Exception exception)
            {
                logger.TrackException(exception);
            }

            ContainerRegistrar.Container.Release(uiGenerator);

            IKojtoCadUpdater updater;

            try
            {
                updater = ContainerRegistrar.Container.Resolve <IKojtoCadUpdater>();
                updater.UpdateKojtoCad();
            }
            catch (Exception exception)
            {
                this.logger.TrackException(exception);
            }
        }
Ejemplo n.º 2
0
        private void CurrentDomainOnFirstChanceException(object sender,
                                                         FirstChanceExceptionEventArgs firstChanceExceptionEventArgs)
        {
            var thisasm = Assembly.GetExecutingAssembly();

            if (thisasm.GetName().Name.ToLower().Contains("kojto"))
            {
                if (this.logger != null)
                {
                    logger.TrackException(firstChanceExceptionEventArgs.Exception);
                }
            }
        }