Пример #1
0
		public ShellViewModel(IWindowManager windowManager, ISpotifyController spotifyController, ICoverService coverService, IEventAggregator eventAggregator, AppSettings settings, Core.ILog logger, IUpdateService updateService, IUsageTrackerService usageTrackerService, IBroadcastService broadcastService) {
			_WindowManager = windowManager;
			_SpotifyController = spotifyController;
			_CoverService = coverService;
			_EventAggregator = eventAggregator;
			_Settings = settings;
			_Logger = logger;
			_UpdateService = updateService;
			_UsageTrackerService = usageTrackerService;
			_BroadcastService = broadcastService;
			_ApplicationSize = _Settings.ApplicationSize;

			CoverImage = NoCoverUri;
			UpdateView();

			_SpotifyController.TrackChanged += (o, e) => UpdateView();
			_SpotifyController.SpotifyOpened += (o, e) => SpotifyOpened();
			_SpotifyController.SpotifyExited += (o, e) => SpotifyExited();
			_UpdateService.UpdateReady += UpdateReady;
			_UpdateService.StartBackgroundCheck();
			_UsageTrackerService.Track();

			_BroadcastService.BroadcastMessageReceived += BroadcastMessageReceived;
			_BroadcastService.StartListening();

			_Settings.PropertyChanged += (o, e) => {
				                             if (e.PropertyName == ApplicationSize.GetType().Name)
					                             ApplicationSize = _Settings.ApplicationSize;
			                             };
		}
Пример #2
0
		public SettingsViewModel(AppSettings settings, AppContracts contracts, ICoverService coverService, Core.ILog logger) {
			_Settings = settings;
			_Contracts = contracts;
			_CoverService = coverService;
			_Logger = logger;
			DisplayName = string.Format("Settings - {0}", _Contracts.ApplicationName);
			CacheSize = Helper.MakeNiceSize(_CoverService.CacheSize());
		}
Пример #3
0
 public NewBroadcastMessageViewModel(AppSettings settings, BroadcastMessage message) {
     _Settings = settings;
     _Message = message;
     ActionName = message.ActionName;
     Title = message.Title;
     Body = message.Body;
     ActionToolTip = string.Format("Opens \"{0}\"", _Message.ActionUrl);
 }
Пример #4
0
        public AutorunService(ILog logger, AppSettings settings, AppContracts contracts) {
            _Logger = logger;
            _Settings = settings;
            _Contracts = contracts;
            _AutorunHive = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);

            ValidateAutorun();

            _Settings.PropertyChanged += (o, e) => {
                                             if (e.PropertyName == AutorunSettingsName)
                                                 ValidateAutorun();
                                         };
        }
Пример #5
0
        public AboutViewModel(AppSettings settings, AppContracts contracts) {
            _Settings = settings;
            _Contracts = contracts;

            DisplayName = string.Format("About - {0}", _Contracts.ApplicationName);
            UsedComponents = new List<ComponentData>(new [] {
                                                                new ComponentData("http://caliburnmicro.codeplex.com/","MIT License","Caliburn.Micro"),
                                                                new ComponentData("http://nlog-project.org/","MIT License", "NLog"), 
                                                                new ComponentData("https://github.com/grumpydev/TinyIoC", "Ms-Pl","TinyIoC"), 
                                                                new ComponentData("https://github.com/dbuksbaum/Caliburn.Micro.TinyIOC","MIT License", "Caliburn.Micro.TinyIOC"), 
                                                                new ComponentData("http://json.codeplex.com/","MIT License", "Newtonsoft Json.Net"), 
                                                                new ComponentData("http://jariz.nl", "Apache 2.0 License","Spotify local API")
                                                            });
        }
Пример #6
0
 public UsageTrackerService(AppSettings settings, ILog logger, AppContracts contracts) {
     _Settings = settings;
     _Contracts = contracts;
     _Logger = logger;
 }
Пример #7
0
 public AppWindowManager(AppSettings settings) {
     _Settings = settings;
 }
Пример #8
0
 public LocalUsageTrackerService(AppSettings settings, ILog logger, AppContracts contracts) : base(settings, logger, contracts) {
 }