예제 #1
0
        public PlayerViewModel(
            AudioPlayerHelper helper,
            ICollectionService service,
            IAppSettingsHelper appSettingsHelper)
        {
            _helper            = helper;
            _service           = service;
            _appSettingsHelper = appSettingsHelper;

            if (!IsInDesignMode)
            {
                helper.TrackChanged         += HelperOnTrackChanged;
                helper.PlaybackStateChanged += HelperOnPlaybackStateChanged;
                helper.Shutdown             += HelperOnShutdown;

                _nextRelayCommand      = new RelayCommand(NextSong);
                _prevRelayCommand      = new RelayCommand(PrevSong);
                _playPauseRelayCommand = new RelayCommand(PlayPauseToggle);

                _timer = new DispatcherTimer {
                    Interval = TimeSpan.FromSeconds(1)
                };
                _timer.Tick += TimerOnTick;
            }
            else
            {
                CurrentQueue  = service.PlaybackQueue.FirstOrDefault();
                PlayPauseIcon = Symbol.Play;
            }
        }
예제 #2
0
 public CollectionService(
     ISqlService sqlService,
     ISqlService bgSqlService,
     IAppSettingsHelper appSettingsHelper,
     IDispatcherHelper dispatcher,
     IBitmapFactory bitmapFactory,
     IBitmapImage missingArtwork,
     string localFilePrefix,
     string artworkFilePath,
     string artistArtworkFilePath)
 {
     _bgSqlService          = bgSqlService;
     _sqlService            = sqlService;
     _dispatcher            = dispatcher;
     _appSettingsHelper     = appSettingsHelper;
     _bitmapFactory         = bitmapFactory;
     _missingArtwork        = missingArtwork;
     _localFilePrefix       = localFilePrefix;
     _artworkFilePath       = artworkFilePath;
     _artistArtworkFilePath = artistArtworkFilePath;
     Songs                = new OptimizedObservableCollection <Song>();
     Artists              = new OptimizedObservableCollection <Artist>();
     Albums               = new OptimizedObservableCollection <Album>();
     Playlists            = new OptimizedObservableCollection <Playlist>();
     PlaybackQueue        = new OptimizedObservableCollection <QueueSong>();
     ShufflePlaybackQueue = new OptimizedObservableCollection <QueueSong>();
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthnStateController"/> class.
 /// </summary>
 public AuthnStateController(AuthenticationClient client, IAppSettingsHelper appSettingsHelper, string userName)
 {
     this.authnClient                = client;
     this.appSettingsHelper          = appSettingsHelper;
     this.username                   = userName;
     this.signOnPolicyRegistryHelper = new SignOnPolicyRegistryHelper();
 }
예제 #4
0
        public AudioticaService(
            ICredentialHelper credentialHelper,
            IAppSettingsHelper appSettingsHelper,
            IDispatcherHelper dispatcherHelper,
            INotificationManager notificationManager)
        {
            _credentialHelper    = credentialHelper;
            _appSettingsHelper   = appSettingsHelper;
            _dispatcherHelper    = dispatcherHelper;
            _notificationManager = notificationManager;

            var cred = _credentialHelper.GetCredentials("AudioticaCloud");

            if (cred == null)
            {
                return;
            }

            AuthenticationToken = cred.GetPassword();

            CurrentUser = _appSettingsHelper.ReadJsonAs <AudioticaUser>("AudioticaCloudUser");

            var refreshCred = _credentialHelper.GetCredentials("AudioticaCloudRefreshToken");

            if (refreshCred == null)
            {
                return;
            }

            _refreshToken = refreshCred.GetPassword();
        }
예제 #5
0
 public CollectionService(
     ISqlService sqlService,
     ISqlService bgSqlService,
     IAppSettingsHelper appSettingsHelper,
     IDispatcherHelper dispatcher,
     IBitmapFactory bitmapFactory,
     IBitmapImage missingArtwork,
     string localFilePrefix,
     string artworkFilePath,
     string artistArtworkFilePath)
 {
     _bgSqlService = bgSqlService;
     _sqlService = sqlService;
     _dispatcher = dispatcher;
     _appSettingsHelper = appSettingsHelper;
     _bitmapFactory = bitmapFactory;
     _missingArtwork = missingArtwork;
     _localFilePrefix = localFilePrefix;
     _artworkFilePath = artworkFilePath;
     _artistArtworkFilePath = artistArtworkFilePath;
     Songs = new OptimizedObservableCollection<Song>();
     Artists = new OptimizedObservableCollection<Artist>();
     Albums = new OptimizedObservableCollection<Album>();
     Playlists = new OptimizedObservableCollection<Playlist>();
     PlaybackQueue = new OptimizedObservableCollection<QueueSong>();
     ShufflePlaybackQueue = new OptimizedObservableCollection<QueueSong>();
 }
예제 #6
0
        public PlayerViewModel(
            AudioPlayerHelper helper,
            ICollectionService service,
            IAppSettingsHelper appSettingsHelper)
        {
            _helper = helper;
            _service = service;
            _appSettingsHelper = appSettingsHelper;

            if (!IsInDesignMode)
            {
                helper.TrackChanged += HelperOnTrackChanged;
                helper.PlaybackStateChanged += HelperOnPlaybackStateChanged;
                helper.Shutdown += HelperOnShutdown;

                _nextRelayCommand = new RelayCommand(NextSong);
                _prevRelayCommand = new RelayCommand(PrevSong);
                _playPauseRelayCommand = new RelayCommand(PlayPauseToggle);

                _timer = new DispatcherTimer {Interval = TimeSpan.FromSeconds(1)};
                _timer.Tick += TimerOnTick;
            }
            else
            {
                CurrentQueue = service.PlaybackQueue.FirstOrDefault();
                PlayPauseIcon = Symbol.Play;
            }
        }
예제 #7
0
 public QueueManager(IAppSettingsHelper appSettingsHelper)
 {
     _appSettingsHelper = appSettingsHelper;
     BackgroundMediaPlayer.Current.MediaOpened += Current_MediaOpened;
     BackgroundMediaPlayer.Current.MediaFailed += Current_MediaFailed;
     BackgroundMediaPlayer.Current.MediaEnded  += Current_MediaEnded;
 }
예제 #8
0
 public Mp3MatchEngine(IAppSettingsHelper settingsHelper, IAudioticaService audioticaService,
                       INotificationManager notificationManager, IDispatcherHelper dispatcherHelper)
 {
     _audioticaService    = audioticaService;
     _notificationManager = notificationManager;
     _dispatcherHelper    = dispatcherHelper;
     _service             = new Mp3SearchService(settingsHelper);
 }
예제 #9
0
 public Mp3MatchEngine(IAppSettingsHelper settingsHelper, IAudioticaService audioticaService,
     INotificationManager notificationManager, IDispatcherHelper dispatcherHelper)
 {
     _audioticaService = audioticaService;
     _notificationManager = notificationManager;
     _dispatcherHelper = dispatcherHelper;
     _service = new Mp3SearchService(settingsHelper);
 }
예제 #10
0
 public SettingViewModel(IAppSettingsHelper _helper, ICredentialHelper credential)
 {
     _appSettingsHelper = _helper;
     _credential        = credential;
     //LoginClickRelay = new Command(LoginButtonClicked);
     Glyph = "\uE1E2";
     LoginAsync();
 }
예제 #11
0
 public AudioticaCloudViewModel(IAudioticaService service, IAppSettingsHelper appSettingsHelper)
 {
     _appSettingsHelper    = appSettingsHelper;
     this.Service          = service;
     this.SignInCommand    = new RelayCommand(this.SignInExecute);
     this.SignUpCommand    = new RelayCommand(this.SignUpExecute);
     this.SubscribeCommand = new RelayCommand(this.SubscribeExecute);
     this.LogoutCommand    = new RelayCommand(this.LogoutExecute);
 }
 public AudioticaCloudViewModel(IAudioticaService service, IAppSettingsHelper appSettingsHelper)
 {
     _appSettingsHelper = appSettingsHelper;
     this.Service = service;
     this.SignInCommand = new RelayCommand(this.SignInExecute);
     this.SignUpCommand = new RelayCommand(this.SignUpExecute);
     this.SubscribeCommand = new RelayCommand(this.SubscribeExecute);
     this.LogoutCommand = new RelayCommand(this.LogoutExecute);
 }
예제 #13
0
 public DatabaseHelper(
     IDispatcherHelper dispatcher,
     IAppSettingsHelper appSettingsHelper,
     IBitmapFactory bitmapFactory)
 {
     _dispatcher        = dispatcher;
     _appSettingsHelper = appSettingsHelper;
     _bitmapFactory     = bitmapFactory;
     folderPath         = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
 }
        public SiteSearchService(BaseLuceneSearcher searcher, NameValueCollection entryIndexSets = null,
                                 IAppSettingsHelper configHelper = null, IUmbracoTreeTraverser umbracoTree = null)
        {
            _searcher = entryIndexSets != null
                ? InitMultiIndexSearcher(searcher, entryIndexSets)
                : searcher;

            _configHelper = configHelper ?? new AppSettingsHelper();
            _umbracoTree  = umbracoTree ?? new UmbracoTreeTraverser();
        }
예제 #15
0
        public DbContext(IAppSettingsHelper helper)
        {
            if (helper == null)
            {
                throw new ArgumentNullException(nameof(helper));
            }

            _settings = helper.Settings.MongoDB;
            _dbClient = new MongoClient(connectionString: _settings.ConnectionString);
        }
예제 #16
0
        public Form1()
        {
            InitializeComponent();
            userName = UserNameTextBox.Text;
            password = PasswordTextBox.Text;

            this.securityHelper    = new SecurityHelper(userName, password);
            this.appSettingsHelper = new RegistryAppSettingsHelper(this.securityHelper);
            this.client            = AuthenticationClientUtils.CreateAuthenticationClient(this.appSettingsHelper);
            this.stateController   = new AuthnStateController(this.client, this.appSettingsHelper, userName);
        }
예제 #17
0
        public QueueManager(IAppSettingsHelper appSettingsHelper, SystemMediaTransportControls transportControls)
        {
            _appSettingsHelper = appSettingsHelper;
            _transportControls = transportControls;
            UpdateScrobblerInstance();

            _mediaPlayer                      = BackgroundMediaPlayer.Current;
            _mediaPlayer.MediaOpened         += MediaPlayer_MediaOpened;
            _mediaPlayer.MediaEnded          += MediaPlayer_MediaEnded;
            _mediaPlayer.CurrentStateChanged += mediaPlayer_CurrentStateChanged;
            _mediaPlayer.MediaFailed         += mediaPlayer_MediaFailed;
        }
예제 #18
0
 public CloudSyncService(
     MobileServiceClient mobileServiceClient,
     ICollectionService collectionService,
     IAppSettingsHelper appSettingsHelper,
     ISqlService sqlService,
     IDispatcherHelper dispatcherHelper)
 {
     _mobileServiceClient = mobileServiceClient;
     _collectionService   = collectionService;
     _appSettingsHelper   = appSettingsHelper;
     _sqlService          = sqlService;
     _dispatcherHelper    = dispatcherHelper;
 }
예제 #19
0
        public SettingsViewModel(IScrobblerService service, ICredentialHelper credentialHelper, IAppSettingsHelper appSettingsHelper)
        {
            _service = service;
            _appSettingsHelper = appSettingsHelper;
            LoginClickRelay = new RelayCommand(LoginButtonClicked);
            DeveloperModeClickRelay = new RelayCommand(DeveloperModeExecute);

            var creds = credentialHelper.GetCredentials("lastfm");
            if (creds == null) return;

            LastFmUsername = creds.GetUsername();
            LastFmPassword = creds.GetPassword();
            IsLoggedIn = true;
        }
예제 #20
0
        public ClientService(IHostingHelper hostingHelper, IStringHelper stringHelper,
                             IAppSettingsHelper appSettingsHelper)
        {
            this.appSettingsHelper = appSettingsHelper;
            this.stringHelper      = stringHelper;
            validationItems        = new Dictionary <string, List <ValidationItem> >();
            pathToFile             = hostingHelper.GetRootPath("App_Data\\clients.json");

            using (TextReader reader = new StreamReader(pathToFile, Encoding.UTF8))
            {
                clientItems =
                    JsonConvert.DeserializeObject <Dictionary <string, ClientItem> >(reader.ReadToEnd());
            }
        }
예제 #21
0
        public PlayerViewModel(AudioPlayerHelper helper, ICollectionService service, RootViewModel root, SettingViewModel settingViewModel,
                               Helpers.CollectionCommandHelper commands, IAppSettingsHelper appSettingsHelper, NowPlayingViewModel _nowPlaying)
        {
            _helper            = helper;
            _service           = service;
            _root              = root;
            _commands          = commands;
            _appSettingsHelper = appSettingsHelper;
            SettingViewModel   = settingViewModel;
            NowPlaying         = _nowPlaying;


            Add();
        }
예제 #22
0
        public AudioticaFactory(
            IDispatcherHelper dispatcher, 
            IAppSettingsHelper appSettingsHelper, 
            IBitmapFactory bitmapFactory)
        {
            this.dispatcher = dispatcher;
            this.appSettingsHelper = appSettingsHelper;
            this.bitmapFactory = bitmapFactory;

#if __ANDROID__
            folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
#elif WINRT
            this.folderPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
#endif
        }
예제 #23
0
        public AudioticaFactory(
            IDispatcherHelper dispatcher,
            IAppSettingsHelper appSettingsHelper,
            IBitmapFactory bitmapFactory)
        {
            this.dispatcher        = dispatcher;
            this.appSettingsHelper = appSettingsHelper;
            this.bitmapFactory     = bitmapFactory;

#if __ANDROID__
            folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
#elif WINRT
            this.folderPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
#endif
        }
예제 #24
0
        public SettingsViewModel(IScrobblerService service, ICredentialHelper credentialHelper, IAppSettingsHelper appSettingsHelper)
        {
            _service                = service;
            _appSettingsHelper      = appSettingsHelper;
            LoginClickRelay         = new RelayCommand(LoginButtonClicked);
            DeveloperModeClickRelay = new RelayCommand(DeveloperModeExecute);

            var creds = credentialHelper.GetCredentials("lastfm");

            if (creds == null)
            {
                return;
            }

            LastFmUsername = creds.GetUsername();
            LastFmPassword = creds.GetPassword();
            IsLoggedIn     = true;
        }
예제 #25
0
        public static CustomAuthnClient CreateAuthenticationClient(IAppSettingsHelper appSettingsHelper)
        {
            string urlDetails = appSettingsHelper.GetBaseUrl();

            if (urlDetails != null)
            {
                OktaClientConfiguration oktaClientConfiguration = new OktaClientConfiguration
                {
                    OktaDomain = urlDetails,
                };
                var customClientParams = GetDefaultCustomClientParams(oktaClientConfiguration);
                CustomAuthnClient customAuthnClient = new CustomAuthnClient(customClientParams.Item1, customClientParams.Item2, customClientParams.Item3);
                return(customAuthnClient);
            }
            else
            {
                throw new Exception("Could not reach out registry to get okta base URL");
            }
        }
예제 #26
0
 public AudioticaService(
     ICredentialHelper credentialHelper,
     IAppSettingsHelper appSettingsHelper) : this(credentialHelper, appSettingsHelper, null, null)
 {
 }
예제 #27
0
 public ManualMatchViewModel(IAppSettingsHelper appSettingsHelper, IDispatcherHelper dispatcherHelper)
 {
     this.dispatcherHelper = dispatcherHelper;
     searchService = new Mp3SearchService(appSettingsHelper);
     MessengerInstance.Register<Song>(this, "manual-match", ReceiveSong);
 }
예제 #28
0
 public ManualMatchViewModel(IAppSettingsHelper appSettingsHelper, IDispatcherHelper dispatcherHelper)
 {
     this.dispatcherHelper = dispatcherHelper;
     searchService         = new Mp3SearchService(appSettingsHelper);
     MessengerInstance.Register <Song>(this, "manual-match", ReceiveSong);
 }
 public EventoReadOnlyRepository(IAppSettingsHelper appSettingsHelper) : base(appSettingsHelper)
 {
 }
예제 #30
0
 public NHibernateBlogRepository(IAppSettingsHelper appSettingsHelper)
 {
     appSettings = appSettingsHelper;
 }
예제 #31
0
 public ScrobblerHelper(IAppSettingsHelper appSettingsHelper, IScrobblerService scrobblerService)
 {
     _appSettingsHelper = appSettingsHelper;
     _service = scrobblerService;
 }
예제 #32
0
 public AudioPlayerHelper(IAppSettingsHelper appSettings)
 {
     _appSettings = appSettings;
 }
 public UsuarioReadOnlyRepository(IAppSettingsHelper appSettingsHelper) : base(appSettingsHelper)
 {
 }
예제 #34
0
        public QueueManager(IAppSettingsHelper appSettingsHelper, SystemMediaTransportControls transportControls)
        {
            _appSettingsHelper = appSettingsHelper;
            _transportControls = transportControls;
            UpdateScrobblerInstance();

            _mediaPlayer = BackgroundMediaPlayer.Current;
            _mediaPlayer.MediaOpened += MediaPlayer_MediaOpened;
            _mediaPlayer.MediaEnded += MediaPlayer_MediaEnded;
            _mediaPlayer.CurrentStateChanged += mediaPlayer_CurrentStateChanged;
            _mediaPlayer.MediaFailed += mediaPlayer_MediaFailed;
        }
예제 #35
0
 public NHibernateConfigurator(IAppSettingsHelper appSettingsHelper)
 {
     this.appSettingsHelper = appSettingsHelper;
 }
 public CaprimulgidaeContext()
 {
     appSettingsHelper = new AppSettingsHelper();
 }
예제 #37
0
 public AppVersionHelper(IAppSettingsHelper settingsHelper)
 {
     _appSettingsHelper = settingsHelper;
 }
예제 #38
0
 public ReadOnlyRepository(IAppSettingsHelper appSettingsHelper) : base(appSettingsHelper.GetConnectionString())
 {
 }
예제 #39
0
 public FrameworkService(IHostingHelper hostingHelper, IAppSettingsHelper appSettingsHelper)
 {
     this.hostingHelper     = hostingHelper;
     this.appSettingsHelper = appSettingsHelper;
 }
예제 #40
0
 public AppVersionHelper(IAppSettingsHelper settingsHelper)
 {
     _appSettingsHelper = settingsHelper;
 }
예제 #41
0
 public Mp3SearchService(IAppSettingsHelper appSettingsHelper)
 {
     this._appSettingsHelper = appSettingsHelper;
     HtmlNode.ElementsFlags.Remove("form");
 }
예제 #42
0
 public AudioPlayerHelper(IAppSettingsHelper appSettings)
 {
     _appSettings = appSettings;
 }
예제 #43
0
 public CredentialHelper(IAppSettingsHelper appSettingsHelper)
 {
     _appSettingsHelper = appSettingsHelper;
 }
예제 #44
0
 public ScrobblerHelper(IAppSettingsHelper appSettingsHelper, IScrobblerService scrobblerService)
 {
     _appSettingsHelper = appSettingsHelper;
     _service           = scrobblerService;
 }
예제 #45
0
 public Mp3SearchService(IAppSettingsHelper appSettingsHelper)
 {
     this._appSettingsHelper = appSettingsHelper;
     HtmlNode.ElementsFlags.Remove("form");
 }
예제 #46
0
 public DapperBlogRepository(IAppSettingsHelper appSettingsHelper)
 {
     appSettings = appSettingsHelper;
 }