Ejemplo n.º 1
0
 public SettingsViewModel(ISettingsController settingsController, IGlobalVariables globalVariables, ITweetObserver observer)
 {
     GlobalVariables    = globalVariables;
     _observer          = observer;
     Settings           = settingsController.Settings;
     SettingsController = settingsController;
     LogoutCommand      = new ActionCommand(async() => await Logout());
 }
        public ControllerFactory(ISettingsController settingsController, ITweetObserver tweetObserver,
                                 IRaidsController raidsController, IRaidlistController raidlistController,
                                 IBlacklistController blacklistController)
        {
            GetSettingsController  = settingsController;
            GetTweetObserver       = tweetObserver;
            GetRaidsController     = raidsController;
            GetRaidlistController  = raidlistController;
            GetBlacklistController = blacklistController;

            GetSettingsController.Load();
            GetRaidsController.Load();
            GetBlacklistController.Load();
            GetRaidlistController.Load();
        }
Ejemplo n.º 3
0
        public MainViewModel(IControllerFactory controllerFactory,
                             ITwitterAuthenticator twitterAuthenticator, IGlobalVariables globalVariables, SettingsViewModel settingsViewModel)
        {
            GlobalVariables  = globalVariables;
            _raidsController = controllerFactory.GetRaidsController;
            _tweetObserver   = controllerFactory.GetTweetObserver;
            var settingsController = controllerFactory.GetSettingsController;

            _blacklistController  = controllerFactory.GetBlacklistController;
            _controllerFactory    = controllerFactory;
            _twitterAuthenticator = twitterAuthenticator;
            Follows             = _raidsController.Follows;
            SettingsDataContext = settingsViewModel;
            RaidListCtx         = new RaidListViewModel(controllerFactory);
            RaidBosses          =
                new ReadOnlyObservableCollection <RaidListItem>(
                    controllerFactory.GetRaidlistController.RaidBossListItems);
            Settings          = settingsController.Settings;
            RemoveCommand     = new ActionCommand(r => Remove((string)r));
            StartLoginCommand = new ActionCommand(async() => await Startup());
            AddNewRaidCommand =
                new ActionCommand(async() => await DialogHost.Show(new AddRaidDialog(controllerFactory
                                                                                     .GetRaidlistController.RaidBossListItems)));
            ChangeViewCommand = new ActionCommand(i => ChangeView((string)i));

            _tweetObserver.SetAddAction(AddTweet);
            CheckUpdate();
            Id = UniqueId.Create();
            if (settingsController.Settings.Autologin &&
                !string.IsNullOrWhiteSpace(settingsController.Settings.AccessToken) &&
                !string.IsNullOrWhiteSpace(settingsController.Settings.AccessTokenSecret))
            {
                Startup().ConfigureAwait(false);
            }
            //Console.WriteLine(new List<string>()[4]);
        }
Ejemplo n.º 4
0
 public TweetStreamer(ILog log, ITweetObserver observer, Tokens token)
 {
     _log      = log;
     _token    = token;
     _observer = observer;
 }