Ejemplo n.º 1
0
        public void Execute()
        {
            _logger = LogManager.GetLogger("log");

            try
            {
                InitializeLoggingConfiguration();

                Application.AddMessageFilter(KeyboardTracking.Instance);
                SdlTradosStudio.Application.Closing += Application_Closing;

                _service                  = new KeyboardTrackingService(_logger);
                _editorController         = SdlTradosStudio.Application.GetController <EditorController>();
                _editorController.Opened += _editorController_Opened;
                _editorController.ActiveDocumentChanged += _editorController_ActiveDocumentChanged;
                _editorController.Closing += _editorController_Closing;

                var twitterPersistenceService = new TwitterPersistenceService(_logger);
                if (twitterPersistenceService.HasAccountConfigured)
                {
                    return;
                }
                using (var tForm = new TwitterAccountSetup(twitterPersistenceService))
                {
                    tForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                _logger.Debug(ex, "Unexpected exception when intializing the app");
                throw;
            }
        }
Ejemplo n.º 2
0
        public void Execute()
        {
            _logger = LogManager.GetLogger("log");
            #if DEBUG
            {
                _emailService = new EmailService(true);
            }
            #else
            {
                _emailService = new EmailService(false);
            }
            #endif

            try
            {
                RavenContext.Current.Initialize();
                InitializeLoggingConfiguration();

                Application.AddMessageFilter(KeyboardTracking.Instance);
                SdlTradosStudio.Application.Closing += Application_Closing;

                _service = new KeyboardTrackingService(_logger,
                                                       _emailService);
                _editorController         = SdlTradosStudio.Application.GetController <EditorController>();
                _editorController.Opened += _editorController_Opened;
                _editorController.ActiveDocumentChanged += _editorController_ActiveDocumentChanged;
                _editorController.Closing += _editorController_Closing;

                var twitterPersistenceService = new TwitterPersistenceService(_logger);
                if (twitterPersistenceService.HasAccountConfigured)
                {
                    return;
                }
                using (var tForm = new TwitterAccountSetup(twitterPersistenceService))
                {
                    tForm.ShowDialog();
                }
                _logger.Info(string.Format("Started productivity plugin version {0}", VersioningService.GetPluginVersion()));
            }
            catch (Exception ex)
            {
                _logger.Debug(ex, "Unexpected exception when intializing the app");
                _emailService.SendLogFile();
            }
        }
Ejemplo n.º 3
0
        public static bool IsTwitterAccountConfigured(TwitterPersistenceService twitterPersistenceService, Logger logger)
        {
            var isTwitterAccountConfigured = true;

            if (twitterPersistenceService.HasAccountConfigured)
            {
                return(true);
            }
            using (var tForm = new TwitterAccountSetup(twitterPersistenceService))
            {
                var result = tForm.ShowDialog();
                if (result != DialogResult.OK)
                {
                    isTwitterAccountConfigured = false;
                }
            }
            return(isTwitterAccountConfigured);
        }