Example #1
0
 public ColorService(
     IBricklinkCatalogApi bricklinkCatalogService,
     IAppDataService appDataService)
     : base(appDataService)
 {
     _bricklinkCatalogService = bricklinkCatalogService;
 }
        public EnsureStartupService(ISaveFileService saveFileService, IMessageService messageService, INavigationService navigationService,
            IAppDataService appDataService)
        {
            Argument.IsNotNull(() => saveFileService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => appDataService);

            _saveFileService = saveFileService;
            _messageService = messageService;
            _navigationService = navigationService;
            _appDataService = appDataService;

            var checkFile = GetCheckFileName();
            SuccessfullyStarted = !File.Exists(checkFile);

            // Always create the file
            Log.Debug("Creating fail safe file check");

            using (File.Create(checkFile))
            {
                // Dispose required
            }
        }
Example #3
0
        public MainPageViewModel(INavigationService navigationService, IAppDataService appDataService)
            : base(navigationService, appDataService)
        {
            Title = "Random Stripes Generator";

            NextCommand = new Command(NextPage);
        }
Example #4
0
        public MapPageViewModel(INavigationService navigationService, IPermissionService permissionService,
                                IStringLocalizer <MapPageViewModel> stringLocalizer, IEventAggregator eventAggregator, IApiClient apiClient,
                                IAppDataService appDataService, IMapper mapper, INotificationService notificationService, ISensorService sensorService)
            : base(navigationService, permissionService, stringLocalizer)
        {
            EventAggregator     = eventAggregator;
            ApiClient           = apiClient;
            AppDataService      = appDataService;
            Mapper              = mapper;
            NotificationService = notificationService;
            SensorService       = sensorService;

            SamplePointsViewModel = new SamplePointsViewModel
            {
                Points = new ObservableCollection <SamplePointViewModel>().OnObservableCollectionChildrenPropertyChanged((sender, args) =>
                {
                    if (args.PropertyName == nameof(ISelectable.Selected))
                    {
                        OnPointSelectedChanged((SamplePointViewModel)sender);
                    }
                }),
            };

            NavigateToValidationUploadCommand = new DelegateCommand(() =>
            {
                NavigationService.NavigateToValidationUploadAsync(ValidationSessionId);
            });

            ToogleTileLayerCommand = new DelegateCommand(() => { ShowTileLayer = !ShowTileLayer; });
        }
Example #5
0
        public StripesPageViewModel(IAppDataService appDataService, IStripesGenerator stripesGenerator)
        {
            _appDataService   = appDataService;
            _stripesGenerator = stripesGenerator;

            GenerateStripesCommand = new Command(GetStripes);
        }
        public static void RegisterApiAuthentication(this IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton <IApiAuthentication, ApiAuthentication>();
            containerRegistry.GetContainer()
            .RegisterInitializer <IApiAuthentication>((apiAuthentication, resolver) =>
            {
                apiAuthentication.Authenticated += async(sender, args) =>
                {
                    IAppDataService appDataService = resolver.Resolve <IAppDataService>();
                    await appDataService.EnsureUserExistsAsync();
                };

                // Start signed out
                ////Task task = Task.Run(async () =>
                ////{
                ////	if (await apiAuthentication.IsAuthenticatedAsync())
                ////	{
                ////		await apiAuthentication.SignOutAsync();
                ////	}
                ////});

                ////task.Wait();

                // Start with expired access token
                ////Task task = Task.Run(async () =>
                ////{
                ////	string accessToken =
                ////		"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IndwWDRxblFtTzVOWG1kbExUUXd6Vk53WWlZMCIsImtpZCI6IndwWDRxblFtTzVOWG1kbExUUXd6Vk53WWlZMCJ9.eyJpc3MiOiJodHRwczovL2xhY28td2lraS5uZXQvaWRlbnRpdHkiLCJhdWQiOiJodHRwczovL2xhY28td2lraS5uZXQvaWRlbnRpdHkvcmVzb3VyY2VzIiwiZXhwIjoxNTI5OTIxMDI3LCJuYmYiOjE1Mjk5MTc0MjcsImNsaWVudF9pZCI6IndlYmFwaSIsInNjb3BlIjoid2ViYXBpIiwic3ViIjoiNDYzIiwiYXV0aF90aW1lIjoxNTI5OTA5MTQ2LCJpZHAiOiJHZW9XaWtpIiwibmFtZSI6ImRyZXNlbCIsImVtYWlsIjoiZHJlc2VsQGlpYXNhLmFjLmF0Iiwicm9sZSI6IlVzZXIiLCJhbXIiOlsiZXh0ZXJuYWwiXX0.uwMcATLLWDQ967jUFmgr6SALuUu4BJ9Gdui671skver6Mev4jGy4W8aJPXyQ-yTaw0i_qqHPw75cA2IvGAZDMhVWEbboUUyDVapS6ukwOwcRpfmpSLeBzDQi99drVTKpfvn5KuVVuWUMWHaEfVf22PD-9ohpSC2S2ZNT8AVEVYlz1U4Vp1inV0R2wB3Z9PBg-OoZhExa3gP1yYqBxlBz3dt6moEgEGOYMsw2M8g81k3HX6F1SXatV-gc4ls6T1hCxDatk1tXj-mHwVZh85YmBAb5kZJ5crWdioXCCy_0r32AD6qx5d3wz_MkK68m4JI2UG5WfthVlt8eCWPPTSGrmA";
                ////	await SecureStorage.SetAsync("access_token", accessToken);
                ////});

                ////task.Wait();
            });
        }
Example #7
0
 public CategoryService(
     IAppDataService appDataService,
     IBricklinkCatalogApi bricklinkCatalogService)
     : base(appDataService)
 {
     _bricklinkCatalogService = bricklinkCatalogService;
 }
Example #8
0
 public CredentialService(
     IBricklinkLoginApi bricklinkLoginApi,
     IAppDataService appDataService)
 {
     _bricklinkLoginApi = bricklinkLoginApi;
     _appDataService    = appDataService;
 }
Example #9
0
 public ItemTypeService(
     IAppDataService appDataService,
     IBricklinkCatalogApi bricklinkCatalogService)
     : base(appDataService)
 {
     _bricklinkCatalogService = bricklinkCatalogService;
 }
        public RegisterPageViewModel(
            INavigationService navigationService,
            IAppDataService appDataService,
            IPageDialogService pageDialogService,
            IEventAggregator eventAggregator,
            IFileUploadService fileUploadService
            )
        {
            this.navigationService = navigationService; // ページ遷移に必要
            this.appDataService    = appDataService;    // データの登録に必要
            this.pageDialogService = pageDialogService; // アラートを出すために必要な人
            this.eventAggregator   = eventAggregator;   // 登録完了イベントを発行するために必要
            this.fileUploadService = fileUploadService; // ファイルをアップロードするために必要

            // 登録ボタンが押された時のコマンドを定義
            this.RegisterCommand = new DelegateCommand(
                executeMethod:    async() => await this.RegisterAppDataAsync(),
                canExecuteMethod: () => !this.IsBusy && this.IsValidEnrtry()                 /* コマンドが実行可能のときに true を返す */
                )
                                   .ObservesProperty(propertyExpression: () => this.IsBusy); // IsBusyプロパティを監視し、IsBusyに変化があったら、CanExecuteChangedイベントを発行する

            // プロパティの値が変わった時の処理
            this.RegisteringAppData.PropertyChanged += (sender, e) => {
                // コマンドが実行可能かどうか再度評価してください
                this.RegisterCommand.RaiseCanExecuteChanged();
            };
        }
        public EnsureStartupService(ISaveFileService saveFileService, IMessageService messageService, INavigationService navigationService,
                                    IAppDataService appDataService)
        {
            Argument.IsNotNull(() => saveFileService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => appDataService);

            _saveFileService   = saveFileService;
            _messageService    = messageService;
            _navigationService = navigationService;
            _appDataService    = appDataService;

            var checkFile = GetCheckFileName();

            SuccessfullyStarted = !File.Exists(checkFile);

            // Always create the file
            Log.Debug("Creating fail safe file check");

            using (File.Create(checkFile))
            {
                // Dispose required
            }
        }
        public static string GetRootAppDataFolder(this IAppDataService appDataService)
        {
            Argument.IsNotNull(() => appDataService);

            var currentCompanyDir = Path.GetParentDirectory(appDataService.ApplicationDataDirectory);

            return(Path.GetParentDirectory(currentCompanyDir));
        }
        public RowNumberPageViewModel(INavigationService navigationService, IAppDataService appDataService, IPageDialogService dialogService)
            : base(navigationService, appDataService)
        {
            Title          = "Row Number";
            _dialogService = dialogService;

            NextCommand = new Command <string>(NextPage);
        }
Example #14
0
 public PlotMainPageViewModel(
     INavigationService navigationService,
     IAppDataService appDataService,
     IStringLocalizer <PlotMainPageViewModel> localizer)
     : base(navigationService, localizer)
 {
     AppDataService = appDataService;
 }
        public NuGetConfigurationService(IConfigurationService configurationService, IAppDataService appDataService)
        {
            Argument.IsNotNull(() => configurationService);

            _configurationService = configurationService;

            _defaultDestinationFolder = Path.Combine(appDataService.GetApplicationDataDirectory(Catel.IO.ApplicationDataTarget.UserRoaming), "plugins");
        }
Example #16
0
        public AddPlotPageViewModel(
            INavigationService navigationService,
            IStringLocalizer <AddPlotPageViewModel> stringLocalizer,
            IAppDataService appDataService) : base(navigationService, stringLocalizer)
        {
            randomColor    = new Random();
            AppDataService = appDataService;

            Plot              = new Core.Entities.Plot();
            PlantingDate      = DateTime.Today;
            CropSelected      = false;
            CropPickerEnabled = true;

            PickerCropTypesSelectedIndex       = -1;
            PickerClimateTypesSelectedIndex    = -1;
            PickerMaturityClassesSelectedIndex = -1;

            ClimateTypes = new List <string>
            {
                StringLocalizer.GetString("cold"),
                StringLocalizer.GetString("tempered"),
                StringLocalizer.GetString("tropical"),
                StringLocalizer.GetString("hybrid")
            };

            CropTypes = new List <string>
            {
                StringLocalizer.GetString("none"),
                StringLocalizer.GetString("maize"),
                StringLocalizer.GetString("barley"),
                StringLocalizer.GetString("bean"),
                StringLocalizer.GetString("wheat"),
                StringLocalizer.GetString("triticale"),
                StringLocalizer.GetString("sorghum"),
                StringLocalizer.GetString("alfalfa"),
                StringLocalizer.GetString("oats"),
                StringLocalizer.GetString("sesame"),
                StringLocalizer.GetString("amaranth"),
                StringLocalizer.GetString("rice"),
                StringLocalizer.GetString("canola"),
                StringLocalizer.GetString("cartamo"),
                StringLocalizer.GetString("zucchini"),
                StringLocalizer.GetString("chickpea"),
                StringLocalizer.GetString("havabean"),
                StringLocalizer.GetString("soy"),
                StringLocalizer.GetString("other")
            };

            MaturityClasses = new List <string>
            {
                StringLocalizer.GetString("early"),
                StringLocalizer.GetString("semi_early"),
                StringLocalizer.GetString("intermediate"),
                StringLocalizer.GetString("semi_late"),
                StringLocalizer.GetString("late")
            };
        }
 public EventInfoPopupViewModel(IAppDataService appDataService, INavigationService navigationService)
 {
     DeleteActivityCommand = new DelegateCommand(async() =>
     {
         await DeleteActivity();
     });
     AppDataService    = appDataService;
     NavigationService = navigationService;
 }
Example #18
0
 public AppDataController(
     IAppDataService appDataService,
     IStringsResourcesService stringsResourcesService,
     IInMemoryCache inMemoryCache)
 {
     _appDataService          = appDataService;
     _stringsResourcesService = stringsResourcesService;
     _inMemoryCache           = inMemoryCache;
 }
        public FileWatcherService(IProjectWatcherRepository projectWatcherRepository, ITestRunnerService testRunnerService, IAppDataService appDataService)
        {
            _projectWatcherRepository = projectWatcherRepository;
            _appDataService           = appDataService;
            _testRunnerService        = testRunnerService;
            _fileWatcherLookUp        = new Dictionary <Guid, CustomFileWatcher>();

            _memoryCache = MemoryCache.Default;
        }
 public ValidationSessionDetailPageViewModel(INavigationService navigationService, IPermissionService permissionService,
                                             IStringLocalizer <ValidationSessionDetailPageViewModel> localizer, IApiClient apiClient, IAppDataService appDataService,
                                             IMapper mapper)
     : base(navigationService, permissionService, localizer)
 {
     ApiClient      = apiClient;
     AppDataService = appDataService;
     Mapper         = mapper;
 }
Example #21
0
        public ColourSelectPageViewModel(INavigationService navigationService, IAppDataService appDataService)
            : base(navigationService, appDataService)
        {
            Title = "Colour Selection";

            RowCount = _appDataService.RowCount;

            NextCommand = new Command <string>(NextPage);
        }
        public ValidatePageViewModel(INavigationService navigationService, IPermissionService permissionService,
                                     IStringLocalizer <ValidatePageViewModel> stringLocalizer, IEventAggregator eventAggregator, IApiClient apiClient,
                                     IAppDataService appDataService, IMapper mapper, INotificationService notificationService)
            : base(navigationService, permissionService, stringLocalizer)
        {
            EventAggregator     = eventAggregator;
            ApiClient           = apiClient;
            AppDataService      = appDataService;
            Mapper              = mapper;
            NotificationService = notificationService;

            LegendItems = new ObservableCollection <ItemViewModel>();
            ((INotifyCollectionChanged)LegendItems).CollectionChanged += ObservableCollectionExtension.OnItemsAddedOrRemovedEventHandler(
                (sender, itemsAdded) =>
            {
                foreach (ItemViewModel item in itemsAdded)
                {
                    item.ItemSelected += ItemOnItemSelected;
                }
            }, (sender, itemsRemoved) =>
            {
                foreach (ItemViewModel item in itemsRemoved)
                {
                    item.ItemSelected -= ItemOnItemSelected;
                }
            }, (sender) => { Helper.RunOnMainThreadIfRequired(() => throw new InvalidOperationException()); });

            IsCorrectTappedCommand = new DelegateCommand(() =>
            {
                if (Correct != true)
                {
                    SelectedLegendItem = null;

                    foreach (ItemViewModel itemViewModel in LegendItems)
                    {
                        itemViewModel.IsSelected = false;
                    }
                }

                Correct = Correct != true ? (bool?)true : null;
            });
            IsNotCorrectTappedCommand = new DelegateCommand(() =>
            {
                if (Correct == false)
                {
                    SelectedLegendItem = null;

                    foreach (ItemViewModel itemViewModel in LegendItems)
                    {
                        itemViewModel.IsSelected = false;
                    }
                }

                Correct = Correct != false ? (bool?)false : null;
            });
        }
Example #23
0
        public EnsureStartupService(IAppDataService appDataService, IUIVisualizerService uiVisualizerService, IFileService fileService)
        {
            Argument.IsNotNull(() => appDataService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => fileService);

            _appDataService      = appDataService;
            _uiVisualizerService = uiVisualizerService;
            _fileService         = fileService;
        }
Example #24
0
 public DataController(IAppDataService appDataService, IAccountService accountService, IWebStorageService webStorageService, ICryptographicService cryptographicService,
                       IMessageService messageService, IResourceService resourceService)
 {
     this.appDataService       = appDataService;
     this.accountService       = accountService;
     this.webStorageService    = webStorageService;
     this.cryptographicService = cryptographicService;
     this.messageService       = messageService;
     this.resourceService      = resourceService;
     feedManagerCompletion     = new TaskCompletionSource <FeedManager>();
 }
Example #25
0
 public SettingsController(ILauncherService launcherService, IAppInfoService appInfoService, IAppDataService appDataService, Lazy <SettingsLayoutViewModel> settingsLayoutViewModel,
                           Lazy <GeneralSettingsViewModel> generalSettingsViewModel, Lazy <InfoSettingsViewModel> infoSettingsViewModel)
 {
     this.launcherService           = launcherService;
     this.appInfoService            = appInfoService;
     this.appDataService            = appDataService;
     this.settingsLayoutViewModel   = new Lazy <SettingsLayoutViewModel>(() => InitializeSettingsLayoutViewModel(settingsLayoutViewModel));
     this.generalSettingsViewModel  = new Lazy <GeneralSettingsViewModel>(() => InitializeGeneralSettingsViewModel(generalSettingsViewModel));
     this.infoSettingsViewModel     = new Lazy <InfoSettingsViewModel>(() => InitializeInfoSettingsViewModel(infoSettingsViewModel));
     this.launchWindowsStoreCommand = new AsyncDelegateCommand(LaunchWindowsStore);
 }
        public RowHeightsPageViewModel(INavigationService navigationService, IAppDataService appDataService, IPageDialogService dialogService)
            : base(navigationService, appDataService)
        {
            Title = "Row Heights";

            _dialogService = dialogService;
            rowHeights     = new List <int>();

            NextCommand    = new Command(NextPage);
            ToggledCommand = new Command <string>(HeightToggled);
        }
Example #27
0
        public LicenseLocationService(IApplicationIdService applicationIdService, IFileService fileService,
                                      IAppDataService appDataService)
        {
            Argument.IsNotNull(() => applicationIdService);
            Argument.IsNotNull(() => fileService);
            Argument.IsNotNull(() => appDataService);

            _applicationIdService = applicationIdService;
            _fileService          = fileService;
            _appDataService       = appDataService;
        }
 public AccountService(
     NavigationManager navigationManager,
     IHttpService httpService,
     ILocalStorageService localStorageService,
     IAppDataService appDataService)
 {
     this.navigationManager   = navigationManager;
     this.httpService         = httpService;
     this.localStorageService = localStorageService;
     this.appDataService      = appDataService;
 }
Example #29
0
 public DataController(IAppDataService appDataService, IAccountService accountService, IWebStorageService webStorageService, ICryptographicService cryptographicService,
     IMessageService messageService, IResourceService resourceService)
 {
     this.appDataService = appDataService;
     this.accountService = accountService;
     this.webStorageService = webStorageService;
     this.cryptographicService = cryptographicService;
     this.messageService = messageService;
     this.resourceService = resourceService;
     feedManagerCompletion = new TaskCompletionSource<FeedManager>();
 }
Example #30
0
 public SettingsController(ILauncherService launcherService, IAppInfoService appInfoService, IAppDataService appDataService, Lazy<SettingsLayoutViewModel> settingsLayoutViewModel, 
     Lazy<GeneralSettingsViewModel> generalSettingsViewModel, Lazy<InfoSettingsViewModel> infoSettingsViewModel)
 {
     this.launcherService = launcherService;
     this.appInfoService = appInfoService;
     this.appDataService = appDataService;
     this.settingsLayoutViewModel = new Lazy<SettingsLayoutViewModel>(() => InitializeSettingsLayoutViewModel(settingsLayoutViewModel));
     this.generalSettingsViewModel = new Lazy<GeneralSettingsViewModel>(() => InitializeGeneralSettingsViewModel(generalSettingsViewModel));
     this.infoSettingsViewModel = new Lazy<InfoSettingsViewModel>(() => InitializeInfoSettingsViewModel(infoSettingsViewModel));
     this.launchWindowsStoreCommand = new AsyncDelegateCommand(LaunchWindowsStore);
 }
Example #31
0
        public FilterSchemeManager(IFilterSerializationService filterSerializationService, IAppDataService appDataService)
        {
            Argument.IsNotNull(() => filterSerializationService);
            Argument.IsNotNull(() => appDataService);

            _filterSerializationService = filterSerializationService;
            _appDataService             = appDataService;

            AutoSave      = true;
            FilterSchemes = new FilterSchemes();
        }
Example #32
0
        public JsonResult InsertAppData(NodeRequestParam param)
        {
            JsonData        json          = new JsonData();
            IAppDataService appSetService = IocMvcFactoryHelper.GetInterface <IAppDataService>();

            json = appSetService.Add(new AppModel()
            {
                AppName = param.Name,
                AppCode = param.Code
            });
            return(Json(json));
        }
Example #33
0
 public ActivityDetailViewModel(INavigationService navigationService, IAppDataService appDataService,
                                IStringLocalizer <ActivityDetailViewModel> localizer) : base(navigationService, localizer)
 {
     ListSownVariety = new List <string>
     {
         "Criollo",
         "Mejorado"
     };
     ActivityDate    = DateTime.Now;
     ActivityNameSet = false;
     _appDataService = appDataService;
 }
Example #34
0
        public CrashWarningViewModel(IAppDataService appDataService, IMessageService messageService, INavigationService navigationService)
        {
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => appDataService);

            _appDataService = appDataService;
            _messageService = messageService;
            _navigationService = navigationService;

            _assembly = AssemblyHelper.GetEntryAssembly();

            Continue = new TaskCommand(OnContinueExecuteAsync);
            ResetUserSettings = new TaskCommand(OnResetUserSettingsExecuteAsync);
            BackupAndReset = new TaskCommand(OnResetAndBackupExecuteAsync);
        }
Example #35
0
        public EnsureStartupService(IAppDataService appDataService, IUIVisualizerService uiVisualizerService)
        {
            Argument.IsNotNull(() => appDataService);
            Argument.IsNotNull(() => uiVisualizerService);

            _appDataService = appDataService;
            _uiVisualizerService = uiVisualizerService;

            var checkFile = GetCheckFileName();
            SuccessfullyStarted = !File.Exists(checkFile);
            
            // Always create the file
            Log.Debug("Creating fail safe file check");

            using (File.Create(checkFile))
            {
                // Dispose required
            }
        }
Example #36
0
        public LogNavigatorViewModel(ISelectDirectoryService selectDirectoryService, IMessageService messageService, IAppDataService appDataService,
            IFileBrowserService fileBrowserService, IFileBrowserConfigurationService fileBrowserConfigurationService, IFileNodeService fileNodeService)
        {
            Argument.IsNotNull(() => selectDirectoryService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => appDataService);
            Argument.IsNotNull(() => fileBrowserConfigurationService);
            Argument.IsNotNull(() => fileNodeService);

            _selectDirectoryService = selectDirectoryService;
            _messageService = messageService;
            _appDataService = appDataService;
            _fileBrowserConfigurationService = fileBrowserConfigurationService;
            _fileNodeService = fileNodeService;

            FileBrowser = fileBrowserService.FileBrowserModel;

            AddFolder = new Command(OnAddFolderExecute);
            DeleteFolder = new Command(OnDeleteFolderExecute, OnDeleteFolderCanExecute);
        }
Example #37
0
 public AppDataHandler()
 {
     Type serviceType = Type.GetType(Pesta.Utilities.PestaSettings.DbServiceName);
     service = serviceType.GetField("Instance", BindingFlags.Static | BindingFlags.Public).GetValue(null) as IAppDataService;
 }
        public SettingsPageViewModel(IAppDataService appData, ISqlLiteService db, INavigationService nav)
        {
            _appData = appData;
            _db = db;
            _nav = nav;

            Regions = new ObservableCollection<Region>();
            Distances = new ObservableCollection<string>();
            Distances.Add("500 m");
            Distances.Add("1 km");
            Distances.Add("2 km");
            Distances.Add("5 km");

            PolicyText = "While using our New Zealand Schools app, we may collect GPS data from your location to determine any nearby schools in your area. This GPS data will not be stored or transmitted, and will be automatically erased from memory every time the app is closed.";
            Policy2Text = "All information displayed has been gathered from the New Zealand Ministry of Education, where it is available under the Creative Commons Attribution 3.0 New Zealand licence. Therefore Mosu Apps will not be responsible for the accuracy, availability, completeneess of the information and shall not have any legal liability for any loss resulting in the use of such information.";

            InfoVersion = "aug 2015";

            BackCommand = new DelegateCommand(ExecuteBackCommand);
        }