示例#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 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;
			                             };
		}
示例#3
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());
		}
示例#4
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());
 }
示例#5
0
 public static Core.ILog Fatal(string format, params object[] args)
 {
     Core.ILog logger = Fatal();
     logger.WriteFormat(format, args);
     return(logger);
 }
示例#6
0
 public static Core.ILog Fatal(string logInfo)
 {
     Core.ILog logger = Fatal();
     logger.Write(logInfo);
     return(logger);
 }
示例#7
0
 public static Core.ILog Error(string logInfo)
 {
     Core.ILog logger = Error();
     logger.Write(logInfo);
     return(logger);
 }
示例#8
0
 public static Core.ILog Debug(string logInfo)
 {
     Core.ILog logger = Debug();
     logger.Write(logInfo);
     return(logger);
 }