Example #1
0
        protected override void Execute()
        {
            Application.EnableVisualStyles();
            var logger = LogManager.GetLogger("log");

            try
            {
                var twitterPersistenceService = new TwitterPersistenceService(logger);

                if (!ProductivityUiHelper.IsTwitterAccountConfigured(twitterPersistenceService, logger))
                {
                    MessageBox.Show(
                        PluginResources
                        .ProductivityViewPartAction_Execute_You_need_to_configure_the_twitter_account_to_see_your_score);
                    return;
                }
                using (var pForm = new ProductivityForm())
                {
                    pForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                logger.Debug(ex, "Unexpected exception when opening the productivity score");
                throw;
            }
        }
Example #2
0
        public static void CreateProductivityForm(Logger logger)
        {
            try
            {

                var productivityService = new ProductivityService(logger);
                var twitterPersistanceService = new TwitterPersistenceService(logger);
                var leaderboardApi = new LeaderboardApi(twitterPersistanceService);
                var versioningService = new VersioningService(leaderboardApi);
                var tweetMessageService = new TweetMessageService(versioningService);
                var twitterShareService = new TwitterShareService(twitterPersistanceService, tweetMessageService);
                using (var pForm = new ProductivityForm(productivityService, twitterShareService))
                {
                    pForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                logger.Debug(ex, "Unexpected exception when opening the productivity score");
                throw;
            }
        }
        protected override void Execute()
        {
            Application.EnableVisualStyles();
            var logger = LogManager.GetLogger("log");
            try
            {
                var twitterPersistenceService = new TwitterPersistenceService(logger);

                if (!ProductivityUiHelper.IsTwitterAccountConfigured(twitterPersistenceService, logger))
                {
                    MessageBox.Show(
                        PluginResources
                            .ProductivityViewPartAction_Execute_You_need_to_configure_the_twitter_account_to_see_your_score);
                    return;
                }
                using (var pForm = new ProductivityForm())
                {
                    pForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                logger.Debug(ex, "Unexpected exception when opening the productivity score");
                throw;
            }
        }