Пример #1
0
        public PurchaseViewModel(IPurchaseService purchaseService, INavigationService navigationService,
                                 IDialogsService dialogsService, ILocService locService)
        {
            _purchaseService   = purchaseService;
            _navigationService = navigationService;
            _dialogsService    = dialogsService;
            _locService        = locService;

            _screenItems = new ScreenItem[]
            {
                new ScreenItem(_locService["PurchaseView_Screen1_Line1_Text"],
                               _locService["PurchaseView_Screen1_Line2_Text"], 1),
                new ScreenItem(_locService["PurchaseView_Screen2_Line1_Text"],
                               _locService["PurchaseView_Screen2_Line2_Text"], 2),
                new ScreenItem(_locService["PurchaseView_Screen3_Line1_Text"],
                               _locService["PurchaseView_Screen3_Line2_Text"], 3),
                new ScreenItem(_locService["PurchaseView_Screen4_Line1_Text"],
                               _locService["PurchaseView_Screen4_Line2_Text"], 4),
                new ScreenItem(_locService["PurchaseView_Screen5_Line1_Text"],
                               _locService["PurchaseView_Screen5_Line2_Text"], 5),
                new ScreenItem(_locService["PurchaseView_Screen0_Line1_Text"],
                               _locService["PurchaseView_Screen0_Line2_Text"], 0, true)
                {
                    BuyPermanentCommand = new DelegateCommand(OnBuyPermanentCommand),
                    BuyMonthlyCommand   = new DelegateCommand(OnBuyMonthlyCommand)
                }
            };
        }
Пример #2
0
        public AudioSearchViewModel(
            InTouch inTouch,
            INavigationService navigationService,
            ILocService locService,
            ISettingsService settingsService,
            IDialogsService dialogsService,
            IPlayerService playerService,
            IAppLoaderService appLoaderService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IInTouchWrapper inTouchWrapper,
            IPurchaseService purchaseService)
            : base(inTouch, navigationService, locService, settingsService, dialogsService, inTouchWrapper)
        {
            _playerService          = playerService;
            _appLoaderService       = appLoaderService;
            _downloadsServiceHelper = downloadsServiceHelper;
            _purchaseService        = purchaseService;

            DownloadCommand         = new DelegateCommand <Audio>(OnDownloadCommand);
            DownloadSelectedCommand = new DelegateCommand(OnDownloadSelectedCommand, HasSelectedItems);

            AddToMyAudiosCommand         = new DelegateCommand <Audio>(OnAddToMyAudiosCommand, CanAddToMyAudios);
            AddSelectedToMyAudiosCommand = new DelegateCommand(OnAddSelectedToMyAudiosCommand, HasSelectedItems);

            DeleteCommand         = new DelegateCommand <Audio>(OnDeleteCommand, CanDeleteAudio);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);

            PlaySelectedCommand        = new DelegateCommand(OnPlaySelectedCommand, HasSelectedItems);
            ShowPerformerFlyoutCommand = new DelegateCommand(OnShowPerformerFlyoutCommand);
            ShowTrackInfoCommand       = new DelegateCommand <Audio>(OnShowTrackInfoCommand);
        }
Пример #3
0
 public static string ToFormattedString(this FileSize size, ILocService locService)
 {
     if (size.Kilobytes < 1024)
     {
         return(String.Format(locService["FileSize_KB_Mask_Text"], size.Kilobytes));
     }
     else if (size.Megabytes >= 1 && size.Megabytes < 1024)
     {
         return(String.Format(locService["FileSize_MB_Mask_Text"], Math.Round(size.Megabytes, 2)));
     }
     else if (size.Gigabytes >= 1 && size.Gigabytes < 1024)
     {
         return(String.Format(locService["FileSize_GB_Mask_Text"], Math.Round(size.Gigabytes, 2)));
     }
     else if (size.Terabytes >= 1 && size.Terabytes < 1024)
     {
         return(String.Format(locService["FileSize_TB_Mask_Text"], Math.Round(size.Terabytes, 2)));
     }
     else if (size.Petabytes >= 1 && size.Petabytes < 1024)
     {
         return(String.Format(locService["FileSize_PB_Mask_Text"], Math.Round(size.Petabytes, 2)));
     }
     else if (size.Exabytes >= 1 && size.Exabytes < 1024)
     {
         return(String.Format(locService["FileSize_EB_Mask_Text"], Math.Round(size.Exabytes, 2)));
     }
     else
     {
         return(String.Format(locService["FileSize_Bytes_Mask_Text"], size.Bytes));
     }
 }
Пример #4
0
        public TransferViewModel(
            IDownloadsService downloadsService,
            IUploadsService uploadsService,
            IDialogsService dialogsService,
            IAppLoaderService appLoaderService,
            ILocService locService,
            IDispatcherWrapper dispatcherWrapper)
        {
            _downloadsService  = downloadsService;
            _uploadsService    = uploadsService;
            _dialogsService    = dialogsService;
            _appLoaderService  = appLoaderService;
            _locService        = locService;
            _dispatcherWrapper = dispatcherWrapper;

            Downloads = new ObservableCollection <TransferItemViewModel>();
            Uploads   = new ObservableCollection <TransferItemViewModel>();

            ShowInfoCommand           = new DelegateCommand <TransferItemViewModel>(OnShowInfoCommand);
            CancelDownloadCommand     = new DelegateCommand <TransferItemViewModel>(OnCancelDownloadCommand);
            CancelUploadCommand       = new DelegateCommand <TransferItemViewModel>(OnCancelUploadCommand);
            PauseDownloadCommand      = new DelegateCommand <TransferItemViewModel>(OnPauseResumeDownloadCommand);
            ResumeDownloadCommand     = new DelegateCommand <TransferItemViewModel>(OnPauseResumeDownloadCommand);
            CancelAllDownloadsCommand = new DelegateCommand(OnCancelAllDownloadsCommand, CanExecuteCancelAllDownloadsCommand);
            CancelAllUploadsCommand   = new DelegateCommand(OnCancelAllUploadsCommand, CanExecuteCancelAllUploadsCommand);
        }
Пример #5
0
        public SettingsViewModel(
            INavigationService navigationService,
            IVKLoginService vkLoginService,
            ISettingsService settingsService,
            ILastFmLoginService lastFmLoginSevice,
            ILocService locService,
            IDialogsService dialogsService,
            IInTouchWrapper inTouchWrapper,
            InTouch inTouch,
            ILaunchViewResolver launchViewResolver,
            INotificationsService notificationsService)
        {
            _navigationService    = navigationService;
            _vkLoginService       = vkLoginService;
            _settingsService      = settingsService;
            _lastFmLoginService   = lastFmLoginSevice;
            _inTouchWrapper       = inTouchWrapper;
            _inTouch              = inTouch;
            _locService           = locService;
            _dialogsService       = dialogsService;
            _launchViewResolver   = launchViewResolver;
            _notificationsService = notificationsService;

            Authorizations            = new ObservableCollection <IServiceAuthorization>();
            UpdateDatabaseCommand     = new DelegateCommand(OnUpdateDatabaseCommand);
            ExtractMp3FromVksmCommand = new DelegateCommand(OnExtractMp3FromVksmCommand);
        }
Пример #6
0
 public DialogsService(IDispatcherWrapper dispatcherWrapper,
                       ILocService locService)
 {
     _dispatcherWrapper = dispatcherWrapper;
     _locService        = locService;
     _queue             = new TaskQueue();
 }
Пример #7
0
        public PopularVKAudioViewModel(
            InTouch inTouch,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            IInTouchWrapper inTouchWrapper,
            IDownloadsServiceHelper downloadsServiceHelper,
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            ISettingsService settingsService,
            IPurchaseService purchaseService)
            : base(inTouch, appLoaderService, dialogsService, inTouchWrapper,
                   downloadsServiceHelper, playerService, locService, navigationService, purchaseService)
        {
            _settingsService = settingsService;

            IsReloadButtonSupported  = true;
            IsPlayButtonSupported    = true;
            IsShuffleButtonSupported = true;

            ShowFilterFlyoutCommand   = new DelegateCommand(OnShowFilterFlyoutCommand);
            FilterFlyoutClosedCommand = new DelegateCommand(OnFilterFlyoutClosedCommand);

            CreateFilters();
        }
Пример #8
0
 protected AudioViewModel(
     IPlayerService playerService,
     ILocService locService,
     INavigationService navigationService,
     IAppLoaderService appLoaderService,
     int maxPlayingTracks = -1)
     : this(locService, navigationService, playerService, appLoaderService, true, true, maxPlayingTracks)
 {
 }
Пример #9
0
 public DownloadsServiceHelper(
     IDialogsService dialogsService,
     IDownloadsService downloadsService,
     ILocService locService,
     IAppNotificationsService appNotificationsService)
 {
     _dialogsService          = dialogsService;
     _downloadsService        = downloadsService;
     _locService              = locService;
     _appNotificationsService = appNotificationsService;
 }
Пример #10
0
 public UploadsPreprocessor(
     InTouch inTouch,
     IInTouchWrapper inTouchWrapper,
     ILocService locService,
     IDialogsService dialogsService)
 {
     _inTouch        = inTouch;
     _inTouchWrapper = inTouchWrapper;
     _locService     = locService;
     _dialogsService = dialogsService;
 }
Пример #11
0
        protected SelectionViewModel(ILocService locService)
        {
            _locService = locService;

            IsItemClickEnabled = true;
            SelectedItems      = new List <object>();

            SelectionChangedCommand = new DelegateCommand(OnSelectionChangedCommand);
            ActivateSelectionMode   = new DelegateCommand(SetSelectionMode);
            ReloadContentCommand    = new DelegateCommand(OnReloadContentCommand);
        }
Пример #12
0
        public TrackLyricsViewModel(InTouch inTouch, INavigationService navigationService,
                                    IDialogsService dialogService, ILocService locService, IInTouchWrapper inTouchWrapper)
        {
            _inTouch           = inTouch;
            _navigationService = navigationService;
            _dialogService     = dialogService;
            _locService        = locService;
            _inTouchWrapper    = inTouchWrapper;

            ReloadLyricsCommand = new DelegateCommand(OnReloadLyricsCommand);
        }
Пример #13
0
 public FeedbackService(
     ISettingsService settingsService,
     IDialogsService dialogsService,
     IDispatcherWrapper dispatcherWrapper,
     ILocService locService)
 {
     _settingsService   = settingsService;
     _dialogsService    = dialogsService;
     _dispatcherWrapper = dispatcherWrapper;
     _locService        = locService;
 }
Пример #14
0
 public UploadsServiceHelper(
     IUploadsPreprocessor uploadsPreprocessor,
     IUploadsService uploadsService,
     ILocService locService,
     IDialogsService dialogsService)
 {
     _uploadsPreprocessor = uploadsPreprocessor;
     _uploadsService      = uploadsService;
     _locService          = locService;
     _dialogsService      = dialogsService;
 }
Пример #15
0
        public ArtistsSearchViewModel(LastfmClient lastfmClient, ILocService locService,
                                      INavigationService navigationService, ISettingsService settingsService)
        {
            _lastfmClient      = lastfmClient;
            _locService        = locService;
            _navigationService = navigationService;
            _settingsService   = settingsService;

            QueryBoxKeyDownCommand = new DelegateCommand <KeyRoutedEventArgs>(OnQueryBoxKeyDownCommand);
            GoToArtistInfoCommand  = new DelegateCommand <LastArtist>(OnGoToArtistInfoCommand);
            ReloadCommand          = new DelegateCommand(Search);
        }
Пример #16
0
        public VideoPlayerViewModel(INavigationService navigationService, ILocService locService,
                                    IDialogsService dialogsService, IAppLoaderService appLoaderService)
        {
            _navigationService = navigationService;
            _locService        = locService;
            _dialogsService    = dialogsService;
            _appLoaderService  = appLoaderService;

            MediaOpenedCommand = new DelegateCommand(OnMediaOpenedCommand);
            MediaEndedCommand  = new DelegateCommand(OnMediaEndedCommand);
            MediaFailedCommand = new DelegateCommand(OnMediaFailedCommand);
        }
Пример #17
0
        public LocalGenreViewModel(
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IAppLoaderService appLoaderService,
            ILibraryDatabaseService libraryDatabaseService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _libraryDatabaseService = libraryDatabaseService;

            DeleteItemCommand = new DelegateCommand <object>(OnDeleteItemCommand);
        }
Пример #18
0
 public VksmExtractionViewModel(
     INavigationService navigationService,
     IVksmExtractionService vksmExtractionService,
     ISettingsService settingsService,
     ILocService locService,
     IDispatcherWrapper dispatcherWrapper)
 {
     _navigationService     = navigationService;
     _vksmExtractionService = vksmExtractionService;
     _settingsService       = settingsService;
     _locService            = locService;
     _dispatcherWrapper     = dispatcherWrapper;
 }
Пример #19
0
 public UpdatingDatabaseViewModel(
     INavigationService navigationService,
     ILibraryDatabaseService musicDatabaseService,
     ISettingsService settingsService,
     ILocService locService,
     ILaunchViewResolver launchViewResolver)
 {
     _navigationService      = navigationService;
     _libraryDatabaseService = musicDatabaseService;
     _settingsService        = settingsService;
     _locService             = locService;
     _launchViewResolver     = launchViewResolver;
 }
Пример #20
0
        public TransferNotificationsService(
            IDownloadsService downloadsService,
            IUploadsService uploadsService,
            ILocService locService,
            IAppNotificationsService appNotificationsService)
        {
            _downloadsService        = downloadsService;
            _uploadsService          = uploadsService;
            _locService              = locService;
            _appNotificationsService = appNotificationsService;

            _notifications = new Dictionary <Guid, AppNotification>(4);
        }
Пример #21
0
 /// <summary>
 /// Инициализирует ноый экземпляр класса <see cref="AppNotificationsService"/>.
 /// </summary>
 /// <param name="presenter">Презентер уведомлений.</param>
 /// <param name="soundService">Сервис воспроизведения звуковых эффектов.</param>
 /// <param name="deviceVibrationService">Сервис вибрации.</param>
 /// <param name="settingsService">Сервис настроек приложения.</param>
 /// <param name="locService">Сервис локализаций.</param>
 public AppNotificationsService(
     IAppNotificationsPresenter presenter,
     ISoundService soundService,
     IDeviceVibrationService deviceVibrationService,
     ISettingsService settingsService,
     ILocService locService)
 {
     _presenter              = presenter;
     _soundService           = soundService;
     _deviceVibrationService = deviceVibrationService;
     _settingsService        = settingsService;
     _locService             = locService;
 }
Пример #22
0
        public UserContentViewModel(
            InTouch inTouch,
            INavigationService navigationService,
            IPlayerService playerService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            IVKLoginService vkLoginService,
            IDialogsService dialogsService,
            ILocService locService,
            IInTouchWrapper inTouchWrapper,
            ILaunchViewResolver launchViewResolver,
            IPurchaseService purchaseService)
        {
            _inTouch                = inTouch;
            _navigationService      = navigationService;
            _playerService          = playerService;
            _downloadsServiceHelper = downloadsServiceHelper;
            _appLoaderService       = appLoaderService;
            _vkLoginService         = vkLoginService;
            _dialogsService         = dialogsService;
            _locService             = locService;
            _inTouchWrapper         = inTouchWrapper;
            _launchViewResolver     = launchViewResolver;
            _purchaseService        = purchaseService;

            SelectedItems  = new List <object>();
            PrimaryItems   = new ObservableCollection <ICommandBarElement>();
            SecondaryItems = new ObservableCollection <ICommandBarElement>();

            ExecuteTracksListItemCommand = new DelegateCommand <object>(OnExecuteTracksListItemCommand);
            NotImplementedCommand        = new DelegateCommand(() => _navigationService.Navigate("AccessDeniedView", null));
            DownloadItemCommand          = new DelegateCommand <object>(OnDownloadItemCommand, CanExecuteDownloadItemCommand);
            ActivateSelectionMode        = new DelegateCommand(SetSelectionMode, CanSelectionMode);
            ReloadContentCommand         = new DelegateCommand(OnReloadContentCommand);
            DownloadSelectedCommand      = new DelegateCommand(OnDownloadSelectedCommand, CanExecuteDownloadSelectedCommand);
            SelectionChangedCommand      = new DelegateCommand(OnSelectionChangedCommand);
            SelectAllCommand             = new DelegateCommand(OnSelectAllCommand, CanSelectionMode);

            AddToMyCollectionCommand         = new DelegateCommand <object>(OnAddToMyCollection, CanAddToMyCollection);
            AddSelectedToMyCollectionCommand = new DelegateCommand(OnAddSelectedToMyCollection, CanAddSelected);
            PlaySelectedCommand = new DelegateCommand(OnPlaySelectedCommand, HasSelectedAudios);
            PlayShuffleCommand  = new DelegateCommand(OnPlayShuffleCommand);

            DeleteCommand         = new DelegateCommand <object>(OnDeleteCommand, CanDelete);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, CanDeleteSelected);

            OpenTransferManagerCommand = new DelegateCommand(OnOpenTransferManagerCommand);
            OpenMainViewCommand        = new DelegateCommand(OnOpenMainViewCommand);

            ShowTrackInfoCommand = new DelegateCommand <Audio>(OnShowTrackInfoCommand);
        }
Пример #23
0
        public UploadsService(
            ILogService logService,
            IUploadsPostprocessor uploadsPostprocessor,
            ILocService locService)
        {
            _logService           = logService;
            _uploadsPostprocessor = uploadsPostprocessor;
            _locService           = locService;

            _transferGroup = BackgroundTransferGroup.CreateGroup(UPLOAD_TRASNFER_GROUP_NAME);
            _transferGroup.TransferBehavior = BackgroundTransferBehavior.Serialized;
            _uploads = new Dictionary <UploadOperation, ICompletedUpload>(INIT_DOWNLOADS_LIST_CAPACITY);
            _cts     = new Dictionary <Guid, CancellationTokenSource>(INIT_DOWNLOADS_LIST_CAPACITY);
        }
Пример #24
0
        public LastFmLoginViewModel(ILastFmLoginService lastFmLoginService,
                                    IAppLoaderService appLoaderService, IDialogsService dialogsService,
                                    ILocService locService)
        {
            _lastFmLoginService = lastFmLoginService;
            _appLoaderService   = appLoaderService;
            _dialogsService     = dialogsService;
            _locService         = locService;

            JoinCommand = new DelegateCommand(async() => await Launcher.LaunchUriAsync(
                                                  new Uri("https://www.last.fm/join")));
            RestoreCommand = new DelegateCommand(async() => await Launcher.LaunchUriAsync(
                                                     new Uri("https://secure.last.fm/settings/lostpassword")));
        }
Пример #25
0
 protected VKAudioImplementedViewModel(
     InTouch inTouch,
     IAppLoaderService appLoaderService,
     IDialogsService dialogsService,
     IInTouchWrapper inTouchWrapper,
     IDownloadsServiceHelper downloadsServiceHelper,
     IPlayerService playerService,
     ILocService locService,
     INavigationService navigationService,
     IPurchaseService purchaseService)
     : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
            playerService, locService, navigationService, purchaseService)
 {
 }
Пример #26
0
        protected DownloadableAudioViewModel(
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            int maxPlayingTracks = -1)
            : base(playerService, locService, navigationService, appLoaderService, maxPlayingTracks)
        {
            _downloadsServiceHelper = downloadsServiceHelper;

            DownloadTrackCommand       = new DelegateCommand <T>(OnDownloadTrackCommand, CanDownloadTrack);
            DownloadSelectedCommand    = new DelegateCommand(OnDownloadSelectedCommand, () => HasSelectedItems() & CanDownloadSelected());
            OpenTransferManagerCommand = new DelegateCommand(OnOpenTransferManagerCommand);
        }
Пример #27
0
        public PromoViewModel(
            INavigationService navigationService,
            ILocService locService,
            IVKLoginService vkLoginService,
            ISettingsService settingsService,
            ILaunchViewResolver launchViewResolver)
        {
            _navigationService  = navigationService;
            _locService         = locService;
            _vkLoginService     = vkLoginService;
            _settingsService    = settingsService;
            _launchViewResolver = launchViewResolver;

            FillScreenItems();
        }
Пример #28
0
 public UploadsPostprocessor(
     InTouch inTouch, 
     IInTouchWrapper inTouchWrapper, 
     ILogService logService,
     IDialogsService dialogsService,
     ILocService locService,
     IAppNotificationsService appNotificationsService)
 {
     _inTouch = inTouch;
     _inTouchWrapper = inTouchWrapper;
     _logService = logService;
     _dialogsService = dialogsService;
     _locService = locService;
     _appNotificationsService = appNotificationsService;
 }
Пример #29
0
 public RecommendedViewModel(
     InTouch inTouch,
     INavigationService navigationService,
     IPlayerService playerService,
     IDownloadsServiceHelper downloadsServiceHelper,
     IAppLoaderService appLoaderService,
     IDialogsService dialogsService,
     ILocService locService,
     IInTouchWrapper inTouchWrapper,
     IPurchaseService purchaseService)
     : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
            playerService, locService, navigationService, purchaseService)
 {
     IsReloadButtonSupported = true;
 }
Пример #30
0
        public CachedViewModel(
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IAppLoaderService appLoaderService,
            IMusicCacheService musicCacheService,
            IDialogsService dialogsService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _musicCacheService = musicCacheService;
            _dialogsService    = dialogsService;

            DeleteTrackCommand    = new DelegateCommand <CachedTrack>(OnDeleteTrackCommand);
            DeleteAllCommand      = new DelegateCommand(OnDeleteAllCommand);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);
        }