コード例 #1
0
        public TilesManagerViewModel(IBandService bandService, IBandTileService tileService)
        {
            this.bandService = bandService;
            this.tileService = tileService;

            GetTilesCommand = new DelegateCommand(GetTiles);
        }
コード例 #2
0
        public TilesManagerViewModel(IBandService bandService, IBandTileService tileService)
        {
            this.bandService = bandService;
            this.tileService = tileService;

            GetTilesCommand = new DelegateCommand(GetTiles);
        }
コード例 #3
0
        public BandsManagerViewModel(IBandService bandService)
        {
            this.bandService = bandService;

            GetBandsCommand      = new DelegateCommand(GetBands);
            ConnectToBandCommand = new DelegateCommand(ConnectToBand);
        }
コード例 #4
0
        public BandsManagerViewModel(IBandService bandService)
        {
            this.bandService = bandService;

            GetBandsCommand = new DelegateCommand(GetBands);
            ConnectToBandCommand = new DelegateCommand(ConnectToBand);
        }
コード例 #5
0
        public AddBandPresenter(IAddBandView view, IGenreService genreService, ICountryService countryService, IBandService bandService)
            : base(view)
        {
            if (bandService == null)
            {
                throw new ArgumentNullException(nameof(bandService));
            }

            if (countryService == null)
            {
                throw new ArgumentNullException(nameof(countryService));
            }

            if (genreService == null)
            {
                throw new ArgumentNullException(nameof(genreService));
            }

            this.genreService   = genreService;
            this.countryService = countryService;
            this.bandService    = bandService;

            this.View.NeedGenres    += View_NeedGenres;
            this.View.NeedCountries += View_NeedCountries;
            this.View.RegisterBand  += View_RegisterBand;
        }
コード例 #6
0
 public MediaPlayerController(IBandService bandService, IAlbumService albumService,
                              ITrackService trackService)
 {
     BandService  = bandService;
     AlbumService = albumService;
     TrackService = trackService;
 }
コード例 #7
0
 public AlbumService(IUnitOfWork unitOfWork, IMapper mapper,
                     ITrackService trackService, IBandService bandService)
 {
     UnitOfWork   = unitOfWork;
     this.mapper  = mapper;
     TrackService = trackService;
     BandService  = bandService;
 }
コード例 #8
0
        public void Constructor_ShouldThowsArgumentNullExceptionWhenBandServiceIsNull()
        {
            //Arange
            IBandService bandService = null;
            var          viewMock    = new Mock <ISearchDisplayView>();

            //Act & Assert
            Assert.That(() => new SearchDisplayPresenter(viewMock.Object, bandService), Throws.Exception.TypeOf <ArgumentNullException>());
        }
コード例 #9
0
        public void ThrowArgumentNullException_IfBandServiceIsNull()
        {
            var          viewMock    = new Mock <IBandListView>();
            IBandService serviceMock = null;

            Assert.Throws <ArgumentNullException>(() =>
            {
                BandListPresenter bandPresenter = new BandListPresenter(viewMock.Object, serviceMock);
            });
        }
コード例 #10
0
        public void Constructor_ShouldThowsArgumentNullExceptionWhenBandServiceIsNull()
        {
            //Arange
            var          genreServiceMock   = new Mock <IGenreService>();
            var          countryServiceMock = new Mock <ICountryService>();
            IBandService bandService        = null;
            var          viewMock           = new Mock <IAddBandView>();

            //Act & Assert
            Assert.That(() => new AddBandPresenter(viewMock.Object, genreServiceMock.Object, countryServiceMock.Object, bandService), Throws.Exception.TypeOf <ArgumentNullException>());
        }
コード例 #11
0
        public SearchDisplayPresenter(ISearchDisplayView view, IBandService bandService)
            : base(view)
        {
            if (bandService == null)
            {
                throw new ArgumentNullException(nameof(bandService));
            }
            this.bandService = bandService;

            this.View.OnSearchDisplayBands += View_OnSearchDisplayBands;
        }
コード例 #12
0
        public BandListPresenter(IBandListView view, IBandService bandService)
            : base(view)
        {
            if (bandService == null)
            {
                throw new ArgumentNullException(nameof(bandService));
            }

            this.bandService = bandService;

            this.View.LoadBands    += View_LoadBands;
            this.View.LoadAllBands += View_LoadAllBands;
        }
コード例 #13
0
        public void ThrowArgumentNullException_WhenBandServiceIsNull()
        {
            var          viewMock        = new Mock <ISingleBandDisplayView>();
            var          userServiceMock = new Mock <IUserService>();
            IBandService bandServiceMock = null;

            Assert.Throws <ArgumentNullException>(() =>
            {
                SingleBandDisplayPresenter presenter = new SingleBandDisplayPresenter(
                    viewMock.Object,
                    userServiceMock.Object,
                    bandServiceMock);
            });
        }
コード例 #14
0
        public void ThrowArgumentNullException_WhenBandService_IsNull()
        {
            var          viewMock        = new Mock <IBandsByGenreDisplayView>();
            var          genreService    = new Mock <IGenreService>();
            IBandService bandServiceMock = null;

            Assert.Throws <ArgumentNullException>(() =>
            {
                var bandsByGenrePresenter = new BandsByGenreDisplayPresenter(
                    viewMock.Object,
                    genreService.Object,
                    bandServiceMock);
            });
        }
コード例 #15
0
        public MainPageViewModel(IBandService bandService, IEventAggregator events)
        {
            _bandService = bandService;
            _events = events;
            _enumerateBandsCmd = new Lazy<ICommand>(() =>
            {
                return new AsyncDelegateCommand<object>(EnumerateBands, CanEnumerateBands);
            });

            EnumerateBandsCmd.Execute(null);

            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                // designtime data
                Value = "Designtime value";
                return;
            }
        }
コード例 #16
0
        public BandsByGenreDisplayPresenter(IBandsByGenreDisplayView view, IGenreService genreService, IBandService bandService)
            : base(view)
        {
            if (genreService == null)
            {
                throw new ArgumentNullException(nameof(genreService));
            }

            if (bandService == null)
            {
                throw new ArgumentNullException(nameof(bandService));
            }

            this.genreService = genreService;
            this.bandService  = bandService;

            this.View.LoadGenres       += View_LoadGenres;
            this.View.LoadBandsByGenre += View_LoadBandsByGenre;
        }
コード例 #17
0
        public SingleBandDisplayPresenter(ISingleBandDisplayView view, IUserService userService, IBandService bandService)
            : base(view)
        {
            if (userService == null)
            {
                throw new ArgumentNullException(nameof(userService));
            }

            if (bandService == null)
            {
                throw new ArgumentNullException(nameof(bandService));
            }

            this.userService = userService;
            this.bandService = bandService;

            this.View.OnFormGetBand  += this.View_OnFormGetBand;
            this.View.AddToFavorites += this.View_AddToFavorites;
        }
コード例 #18
0
        public MainPageViewModel(IBandService bandService, IEventAggregator events, Services.INavigationService naviagtionService,
                                 IComponentContext container)
        {
            _container         = container;
            _navigation        = naviagtionService;
            _bandService       = bandService;
            _events            = events;
            _enumerateBandsCmd = new Lazy <ICommand>(() =>
            {
                return(new AsyncDelegateCommand <object>(EnumerateBands, CanEnumerateBands));
            });

            EnumerateBandsCmd.Execute(null);

            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                // designtime data
                Value = "Designtime value";
                return;
            }
        }
コード例 #19
0
 public BandsController(IBandService bandService, IMemoryCache cache)
 {
     this.bandService = bandService;
     this.cache       = cache;
 }
コード例 #20
0
ファイル: ListBand.cs プロジェクト: vtoan/watch-shop-3layer
 public ListBand(IBandService bandSer)
 {
     _bandSer = bandSer;
 }
コード例 #21
0
 // maps the generic repo to my EFRepository
 public BandsController(IBandService bandService)
 {
     _bandService = bandService;
 }
コード例 #22
0
 public BandsController(IBandService service, IMapper mapper)
 {
     _service = service;
     _mapper  = mapper;
 }
コード例 #23
0
 public BandsManagerDesignViewModel(IBandService bandService)
 {
     this.bandService = bandService;
 }
コード例 #24
0
ファイル: SettingsViewModel.cs プロジェクト: haefele/CTime2
        public SettingsViewModel(IBiometricsService biometricsService, IApplicationStateService applicationStateService, IBandService bandService, IShell shell)
        {
            Guard.NotNull(biometricsService, nameof(biometricsService));
            Guard.NotNull(applicationStateService, nameof(applicationStateService));
            Guard.NotNull(bandService, nameof(bandService));

            this._biometricsService = biometricsService;
            this._applicationStateService = applicationStateService;
            this._bandService = bandService;
            this._shell = shell;

            var hasUser = new ReplaySubject<bool>(1);
            hasUser.OnNext(this._applicationStateService.GetCurrentUser() != null);
            var deviceAvailable = this._biometricsService.BiometricAuthDeviceIsAvailableAsync().ToObservable();
            var canRememberLogin = hasUser.CombineLatest(deviceAvailable, (hasUsr, deviceAvail) => hasUsr && deviceAvail);
            this.RememberLogin = UwCoreCommand.Create(canRememberLogin, this.RememberLoginImpl)
                .ShowLoadingOverlay(CTime2Resources.Get("Loading.RememberedLogin"))
                .HandleExceptions()
                .TrackEvent("SetupRememberLogin");

            var canToggleTile = this.WhenAnyValue(f => f.State, state => state != BandState.NotConnected);
            this.ToggleBandTile = UwCoreCommand.Create(canToggleTile, this.ToggleTileImpl)
                .ShowLoadingOverlay(() => this.State == BandState.Installed
                    ? CTime2Resources.Get("Loading.RemoveTileFromBand")
                    : CTime2Resources.Get("Loading.AddTileToBand"))
                .HandleExceptions()
                .TrackEvent("ToggleBandTile");

            this.Reload = UwCoreCommand.Create(this.ReloadImpl)
                .ShowLoadingOverlay(CTime2Resources.Get("Loading.Settings"))
                .HandleExceptions()
                .TrackEvent("ReloadSettings");

            this.Theme = this._applicationStateService.GetApplicationTheme();
            this.SelectedWorkTime = this._applicationStateService.GetWorkDayHours();
            this.SelectedBreakTime = this._applicationStateService.GetWorkDayBreak();
            this.CompanyId = this._applicationStateService.GetCompanyId();

            this.WhenAnyValue(f => f.Theme)
                .Subscribe(theme =>
                {
                    this._shell.Theme = theme;
                    this._applicationStateService.SetApplicationTheme(theme);
                });

            this.WhenAnyValue(f => f.SelectedWorkTime)
                .Subscribe(workTime =>
                {
                    this._applicationStateService.SetWorkDayHours(workTime);
                });

            this.WhenAnyValue(f => f.SelectedBreakTime)
                .Subscribe(breakTime =>
                {
                    this._applicationStateService.SetWorkDayBreak(breakTime);
                });

            this.WhenAnyValue(f => f.CompanyId)
                .Subscribe(companyId =>
                {
                    this._applicationStateService.SetCompanyId(companyId);
                });

            this.DisplayName = CTime2Resources.Get("Navigation.Settings");

            this.WorkTimes = new ReactiveList<TimeSpan>(Enumerable
                .Repeat((object)null, 4 * 24)
                .Select((_, i) => TimeSpan.FromHours(0.25 * i)));

            this.BreakTimes = new ReactiveList<TimeSpan>(Enumerable
                .Repeat((object)null, 4 * 24)
                .Select((_, i) => TimeSpan.FromHours(0.25 * i)));
        }
コード例 #25
0
 public BandController(IMapper mapper, IBandService bandService)
 {
     _mapper      = mapper;
     _bandService = bandService;
 }
コード例 #26
0
 public HomeController(IUserService service, IConcertService concService, IBandService bandService)
 {
     UserService = service;
     ConcertService = concService;
     BandService = bandService;
 }
コード例 #27
0
 public BandsController( IBandService bandService ){
     this.bandService = bandService;
 }//END constructor
コード例 #28
0
 public BandsManagerDesignViewModel(IBandService bandService)
 {
     this.bandService = bandService;
 }
コード例 #29
0
ファイル: Band.cs プロジェクト: sudarshanb/ms-band-azure
 public Band(IBandInfo info, IBandService bandService, IComponentContext container)
 {
     _container   = container;
     _info        = info;
     _bandService = bandService;
 }
コード例 #30
0
 public BandsController(IBandService bandService, IMapper mapper)
 {
     _bandService = bandService;
     _mapper      = mapper;
 }
コード例 #31
0
 public BandController(IBandService serv)
 {
     bandService = serv;
 }
コード例 #32
0
 public BandsController(IBandService service)
 {
     _bandservice = service;
 }