Beispiel #1
0
        public void loads_when_tabs_have_been_persisted_to_settings_previously()
        {
            // ARRANGE
            var dtos = _strategies.Select(x =>
            {
                var viewModel = x.Create();
                var dtoTab    = new Dtos.Tab(viewModel.Tab.TypeId, viewModel.Tab.Name);

                return(dtoTab);
            }).ToArray();

            var settings = new Mock <ISettings>();

            settings.Setup(x => x[It.IsAny <string>()]).Returns(dtos);

            ISettings settingsInstance = settings.Object;

            _settingsService.Setup(x => x.TryGet("Tabs", out settingsInstance)).Returns(true);

            var service = new TabsService(_strategies, _settingsService.Object);

            // ACT
            var tabs = service.GetTabs();

            // ASSERT
            CollectionAssert.AreEquivalent(tabs.Select(x => x.Tab), _strategies.Select(x => x.Create().Tab));
        }
Beispiel #2
0
        public AvaloniaPlatformService(TabsService tabs)
        {
            Tabs = tabs;

            MapPageToType(Pages.FirstRun, typeof(FirstRunPage));
            MapPageToType(Pages.HostTab, typeof(HostTabPage));
            MapPageToType(Pages.Loading, typeof(LoadingPage));
        }
Beispiel #3
0
 public ArchivesPageViewModel(
     SettingsService settings,
     ArchivesService archives,
     TabsService tabs,
     IDispatcherService dispatcher,
     ApiService api) : base(settings, archives, dispatcher, api)
 {
     Tabs = tabs;
 }
Beispiel #4
0
        public HostTabPage()
        {
            this.InitializeComponent();
            Data     = DataContext as TabsService;
            Settings = Service.Settings;

            CoreView = CoreApplication.GetCurrentView();
            AppView  = ApplicationView.GetForCurrentView();
            lang     = ResourceLoader.GetForCurrentView("Pages");
        }
Beispiel #5
0
        public UWPlatformService(TabsService tabs, ILoggerFactory loggerFactory, IFilesService files)
        {
            Tabs = tabs;

            MapPageToType(Pages.Loading, typeof(LoadingPage));
            MapPageToType(Pages.FirstRun, typeof(FirstRunPage));
            MapPageToType(Pages.HostTab, typeof(HostTabPage));

            MapTransitionToType(PagesTransition.None, typeof(SuppressNavigationTransitionInfo));
            MapTransitionToType(PagesTransition.DrillIn, typeof(DrillInNavigationTransitionInfo));
#if DEBUG
            loggerFactory.AddFile(files.LocalCache + string.Format("/Logs/{0:yyyy}-{0:MM}-{0:dd}.log", DateTime.UtcNow));
#endif
        }
Beispiel #6
0
        public void creates_when_tabs_have_not_persisted_to_settings_previously()
        {
            // ARRANGE
            ISettings settings = new Settings(Enumerable.Empty <Setting>(), new Subject <bool>());

            _settingsService.Setup(x => x.TryGet("Tabs", out settings)).Returns(false);
            _settingsService.Setup(x => x.CreateOrUpdate("Tabs")).Returns(settings);

            var service = new TabsService(_strategies, _settingsService.Object);

            // ACT
            var tabs = service.GetTabs();

            // ASSERT
            CollectionAssert.AreEquivalent(tabs.Select(x => x.Tab), _strategies.Select(x => x.Create().Tab));
        }
 public CategoryBaseViewModel(PlatformService platform, TabsService tabs, SettingsService settings)
 {
     Platform = platform;
     Tabs     = tabs;
     Settings = settings;
 }
Beispiel #8
0
 public ArchiveItemViewModel(SettingsService settings, ArchivesService archives, ApiService api, PlatformService platform, TabsService tabs, ImageProcessingService imageProcessing) : base(settings, archives, api, platform, tabs)
 {
     ImageProcessing = imageProcessing;
 }
Beispiel #9
0
 public HostTabPage()
 {
     InitializeComponent();
     Data = DataContext as TabsService;
 }