Exemplo n.º 1
0
        public Tests()
        {
            _adminSubsonicServer       = new SubsonicServer(SubsonicServer, AdminUser, Password, ClientName);
            _downloadSubsonicServer    = new SubsonicServer(SubsonicServer, DownloadUser, Password, ClientName);
            _noPlaySubsonicServer      = new SubsonicServer(SubsonicServer, NoPlayUser, Password, ClientName);
            _playSubsonicServer        = new SubsonicServer(SubsonicServer, PlayUser, Password, ClientName);
            _nonexistentSubsonicServer = new SubsonicServer(NonexistentServer, AdminUser, Password, ClientName);

            var imageFormatFactory = new ImageFormatFactory();

            _adminSubsonicClient       = new SubsonicClient(_adminSubsonicServer, imageFormatFactory);
            _downloadSubsonicClient    = new SubsonicClient(_downloadSubsonicServer, imageFormatFactory);
            _noPlaySubsonicClient      = new SubsonicClient(_noPlaySubsonicServer, imageFormatFactory);
            _playSubsonicClient        = new SubsonicClient(_playSubsonicServer, imageFormatFactory);
            _nonexistentSubsonicClient = new SubsonicClient(_nonexistentSubsonicServer, imageFormatFactory);
            _random = new Random(DateTime.UtcNow.Millisecond * DateTime.UtcNow.Second * DateTime.UtcNow.Minute);
        }
Exemplo n.º 2
0
 public SubsonicRequest(ISubsonicServer subsonicServer, IImageFormatFactory <T> imageFormatFactory) : base(subsonicServer, imageFormatFactory)
 {
 }
Exemplo n.º 3
0
        public static ISubsonicClient<SoftwareBitmapSource> GetSubsonicClient()
        {
            if (_settingsModel == null)
                GetSettings();

            if (string.IsNullOrWhiteSpace(GetServerUrl()))
                return null;

            if (_subsonicClient != null)
                return _subsonicClient;

            _subsonicServer = new SubsonicServer(new Uri(GetServerUrl()), GetUsername(), GetPassword(), "UltraSonic.Universal");
            _imageFormatFactory = new ImageFormatFactory();
            _subsonicClient = new SubsonicClient(_subsonicServer, _imageFormatFactory);

            return _subsonicClient;
        }
Exemplo n.º 4
0
 public SubsonicResponse(ISubsonicServer subsonicServer, IImageFormatFactory <T> imageFormatFactory) : base(subsonicServer, new SubsonicRequest <T>(subsonicServer, imageFormatFactory))
 {
 }
Exemplo n.º 5
0
 protected SubsonicResponse(ISubsonicServer subsonicServer, ISubsonicRequest <T> subsonicRequest)
 {
     SubsonicServer  = subsonicServer;
     SubsonicRequest = subsonicRequest;
 }
Exemplo n.º 6
0
 public SubsonicClient(ISubsonicServer subsonicServer) : base(subsonicServer)
 {
     SubsonicResponse = new SubsonicResponse <SoftwareBitmapSource>(subsonicServer, new ImageFormatFactory());
 }
Exemplo n.º 7
0
 public SubsonicClient(ISubsonicServer subsonicServer) : base(subsonicServer)
 {
     SubsonicResponse = new SubsonicResponse <Image>(subsonicServer, new ImageFormatFactory());
 }
Exemplo n.º 8
0
 public SubsonicClient(ISubsonicServer subsonicServer, IImageFormatFactory <Image> imageFormatFactory) : base(subsonicServer)
 {
     SubsonicResponse = new SubsonicResponse <Image>(subsonicServer, imageFormatFactory);
 }
Exemplo n.º 9
0
 protected SubsonicRequest(ISubsonicServer subsonicServer, IImageFormatFactory <T> imageFormatFactory)
 {
     SubsonicServer     = subsonicServer;
     ImageFormatFactory = imageFormatFactory;
 }