public static void Setup()
 {
     Bootstrapper.Run();
     _settingsService = Container.Windsor.Resolve<SettingsService>();
     _twitterClient = Container.Windsor.Resolve<TwitterClient>();
     _twitterClient.CurrentlyLoggedInUserSettings = _settingsService.GetSettings();
 }
 public ProStudioTweetPackageController(IRepository<Settings> settingsRepo, IRepository<User> userRepo, IRepository<DirectMessage> directMessageRepo, IRepository<Tweet> tweetRepo, SettingsService settingsService, TwitterClient twitterClient)
 {
     _settingsRepo = settingsRepo;
     _userRepo = userRepo;
     _directMessageRepo = directMessageRepo;
     _tweetRepo = tweetRepo;
     _settingsService = settingsService;
     _twitterClient = twitterClient;
 }
 public DebugViewModel(TwitterClient twitterClient, SettingsService settingsService)
 {
     _twitterClient = twitterClient;
     _settingsService = settingsService;
     Settings = new List<Settings>();
     CurrentlyLoggedInUser = new List<User>();
     CurrentlyLoggedInUserSettings = new List<Settings>();
     this.Settings.Add(_settingsService.GetSettings());
     this.CurrentlyLoggedInUser.Add(_twitterClient.CurrentlyLoggedInUser);
     this.CurrentlyLoggedInUserSettings.Add(_twitterClient.CurrentlyLoggedInUserSettings);
 }
        public MainWindowViewModel(TwitterClient twitterClient)
        {
            _twitterClient = twitterClient;
            RefreshTimeline(null);

            Messenger.Default.Register<RefreshTimelineMessage>(this, RefreshTimeline);
            Messenger.Default.Register<SendTweetMessage>(this, SendTweet);
            Messenger.Default.Register<TimelineTypeChangedMessage>(this, TimelineTypeChanged);

            var friendsTimelineTimer = new Timer {Interval = 90000};
            friendsTimelineTimer.Elapsed += FriendsTimelineTimerOnElapsed;
            friendsTimelineTimer.Start();

            var directMessageTimer = new Timer {Interval = 90000};
            directMessageTimer.Elapsed += DirectMessageTimerOnElapsed;
            directMessageTimer.Start();
        }
 private void TryLogin(TwitterClient twitterClient)
 {
     try {
         // Schedule the update function in the UI thread.
         LayoutRoot.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,new PostLoginDelegate(UpdatePostLoginInterface),(object)twitterClient.Authenticate(pinEdit.Text));
         Close();
     } catch (WebException ex) {
         MessageBox.Show("There was a problem logging in to Twitter. " + ex.Message);
     } catch (RateLimitException ex) {
         MessageBox.Show(ex.Message);
     } catch (ProxyAuthenticationRequiredException ex) {
         MessageBox.Show("Proxy server is configured incorrectly.  Please correct the settings on the Options menu.");
     }
 }