public SyncClientService(ILibraryService libraryService, IAudioFileCacheService audioFileCacheService, ISyncDeviceSpecifications deviceSpecifications) { _libraryService = libraryService; _audioFileCacheService = audioFileCacheService; _deviceSpecifications = deviceSpecifications; Initialize(); }
public CloudLibraryService(ICloudService cloudService, ILibraryService libraryService, IAudioFileCacheService audioFileCacheService, ISyncDeviceSpecifications deviceSpecifications) { _cloudService = cloudService; _libraryService = libraryService; _audioFileCacheService = audioFileCacheService; _deviceSpecifications = deviceSpecifications; _deviceInfos = new List<CloudDeviceInfo>(); _deviceInfosLeftToDownload = new List<string>(); Initialize(); }
public SyncDeviceManagerService(ISyncDeviceSpecifications deviceSpecifications, ISyncDiscoveryService discoveryService) { Console.WriteLine("SyncDeviceManagerService - Starting..."); OnStatusUpdated += (status) => {}; OnDeviceUpdated += (device) => {}; OnDevicesUpdated += (devices) => {}; OnDeviceAdded += (device) => {}; OnDeviceRemoved += (device) => {}; _devices = new List<SyncDevice>(); _deviceSpecifications = deviceSpecifications; _discoveryService = discoveryService; _discoveryService.OnDeviceFound += HandleOnDeviceFound; _discoveryService.OnDiscoveryProgress += HandleOnDiscoveryProgress; _webClient = new WebClientTimeout(3000); _webClientRemote = new WebClientTimeout(3000); }
public SyncListenerService(IAudioFileCacheService audioFileCacheService, ISyncDeviceSpecifications syncDeviceSpecifications) { Port = 53551; _audioFileCacheService = audioFileCacheService; _syncDeviceSpecifications = syncDeviceSpecifications; _syncDeviceSpecifications.OnNetworkStateChanged += delegate(NetworkState networkState) { //Console.WriteLine("SyncListenerService - NetworkStateChanged isNetworkAvailable: {0} isWifiAvailable: {1} isCellularAvailable: {2}", networkState.IsNetworkAvailable, networkState.IsWifiAvailable, networkState.IsCellularAvailable); //if (networkState.IsWifiAvailable && !IsRunning) //{ // Console.WriteLine("SyncListenerService - NetworkStateChanged - Wifi is now available; restarting HTTP service..."); // Start(); //} //else if (!networkState.IsWifiAvailable && IsRunning) //{ // Console.WriteLine("SyncListenerService - NetworkStateChanged - Wifi is no longer available; stopping HTTP service..."); // Stop(); //} }; Initialize(); }
public SyncListenerService(IAudioFileCacheService audioFileCacheService, ILibraryService libraryService, ISyncDeviceManagerService syncDeviceManagerService, ISyncDeviceSpecifications syncDeviceSpecifications) : base() { Console.WriteLine("SyncListenerService - AuthenticationCode: {0}", AuthenticationCode); _audioFileCacheService = audioFileCacheService; _libraryService = libraryService; _syncDeviceManagerService = syncDeviceManagerService; _syncDeviceSpecifications = syncDeviceSpecifications; _syncDeviceSpecifications.OnNetworkStateChanged += delegate(NetworkState networkState) { Console.WriteLine("SyncListenerService - NetworkStateChanged isNetworkAvailable: {0} isWifiAvailable: {1} isCellularAvailable: {2}", networkState.IsNetworkAvailable, networkState.IsWifiAvailable, networkState.IsCellularAvailable); if (networkState.IsWifiAvailable && !IsRunning) { Console.WriteLine("SyncListenerService - NetworkStateChanged - Wifi is now available; restarting HTTP service..."); Start(); } else if (!networkState.IsWifiAvailable && IsRunning) { Console.WriteLine("SyncListenerService - NetworkStateChanged - Wifi is no longer available; stopping HTTP service..."); Stop(); } }; }
public ConnectionChangeReceiver() { _messageHub = Bootstrapper.GetContainer().Resolve<ITinyMessengerHub>(); _deviceSpecifications = Bootstrapper.GetContainer().Resolve<ISyncDeviceSpecifications>(); }