public ExpenseHeadDetailsViewModel(IExpenseHeadService documentTypeService, IFilePickerService filePickerService, ICommonServices commonServices, ExpenseHeadListViewModel documentTypeListViewModel, ExpenseHeadViewModel expenseHeadViewModel) : base(commonServices)
 {
     ExpenseHeadService       = documentTypeService;
     FilePickerService        = filePickerService;
     ExpenseHeadListViewModel = documentTypeListViewModel;
     ExpenseHeadViewModel     = expenseHeadViewModel;
 }
コード例 #2
0
        public CreateComplaintViewModel(Order order,
                                        IEntityUoWBuilder uowBuilder,
                                        IUnitOfWorkFactory unitOfWorkFactory,
                                        IEmployeeService employeeService,
                                        IEntityAutocompleteSelectorFactory counterpartySelectorFactory,
                                        ISubdivisionRepository subdivisionRepository,
                                        ICommonServices commonServices,
                                        INomenclatureRepository nomenclatureRepository,
                                        IUserRepository userRepository,
                                        IFilePickerService filePickerService,
                                        IOrderSelectorFactory orderSelectorFactory,
                                        IEmployeeJournalFactory employeeJournalFactory,
                                        ICounterpartyJournalFactory counterpartyJournalFactory,
                                        IDeliveryPointJournalFactory deliveryPointJournalFactory,
                                        ISubdivisionJournalFactory subdivisionJournalFactory,
                                        IGtkTabsOpener gtkDialogsOpener,
                                        IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener,
                                        INomenclatureSelectorFactory nomenclatureSelector,
                                        IUndeliveredOrdersRepository undeliveredOrdersRepository,
                                        string phone = null) : this(uowBuilder, unitOfWorkFactory, employeeService, counterpartySelectorFactory, subdivisionRepository,
                                                                    commonServices, nomenclatureRepository, userRepository, filePickerService, orderSelectorFactory,
                                                                    employeeJournalFactory, counterpartyJournalFactory, deliveryPointJournalFactory, subdivisionJournalFactory, gtkDialogsOpener,
                                                                    undeliveredOrdersJournalOpener, nomenclatureSelector, undeliveredOrdersRepository, phone)
        {
            var currentOrder = UoW.GetById <Order>(order.Id);

            Entity.Order        = currentOrder;
            Entity.Counterparty = currentOrder.Client;
            Entity.Phone        = phone;
        }
コード例 #3
0
 public CheckListDetailsViewModel(ICheckListService checkListService, IFilePickerService filePickerService, ICommonServices commonServices, CheckListListViewModel checkListListViewModel, CheckListViewModel checkListViewModel) : base(commonServices)
 {
     CheckListService       = checkListService;
     FilePickerService      = filePickerService;
     CheckListListViewModel = checkListListViewModel;
     CheckListViewModel     = checkListViewModel;
 }
コード例 #4
0
        public MainViewModel(INavigationService navigation,
                             IRegisteredDbsService register, IMappingEngine maps,
                             IFilePickerService picker, IEventAggregator events)
        {
            if (navigation == null)
            {
                throw new ArgumentNullException("navigation");
            }
            if (register == null)
            {
                throw new ArgumentNullException("register");
            }
            if (maps == null)
            {
                throw new ArgumentNullException("maps");
            }
            if (picker == null)
            {
                throw new ArgumentNullException("picker");
            }
            if (events == null)
            {
                throw new ArgumentNullException("events");
            }

            _maps       = maps;
            _picker     = picker;
            _events     = events;
            _register   = register;
            _navigation = navigation;
            _databases  = new BindableCollection <DatabaseItemViewModel>();
        }
コード例 #5
0
 public CreateComplaintViewModel(
     IEntityUoWBuilder uowBuilder,
     IUnitOfWorkFactory unitOfWorkFactory,
     IEmployeeService employeeService,
     IEntityAutocompleteSelectorFactory employeeSelectorFactory,
     IEntityAutocompleteSelectorFactory counterpartySelectorFactory,
     ISubdivisionRepository subdivisionRepository,
     ICommonServices commonServices,
     IEntityAutocompleteSelectorFactory nomenclatureSelectorFactory,
     INomenclatureRepository nomenclatureRepository,
     IUserRepository userRepository,
     IFilePickerService filePickerService,
     string phone = null
     ) : base(uowBuilder, unitOfWorkFactory, commonServices)
 {
     this.filePickerService       = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
     this.employeeSelectorFactory = employeeSelectorFactory ?? throw new ArgumentNullException(nameof(employeeSelectorFactory));
     EmployeeService             = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
     NomenclatureRepository      = nomenclatureRepository ?? throw new ArgumentNullException(nameof(nomenclatureRepository));
     UserRepository              = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
     CounterpartySelectorFactory = counterpartySelectorFactory ?? throw new ArgumentNullException(nameof(counterpartySelectorFactory));
     NomenclatureSelectorFactory = nomenclatureSelectorFactory ?? throw new ArgumentNullException(nameof(nomenclatureSelectorFactory));
     this.subdivisionRepository  = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
     Entity.ComplaintType        = ComplaintType.Client;
     Entity.SetStatus(ComplaintStatuses.Checking);
     ConfigureEntityPropertyChanges();
     Entity.Phone = phone;
     TabName      = "Новая клиентская рекламация";
 }
コード例 #6
0
ファイル: SettingsViewModel.cs プロジェクト: wondial/myFeed
        public SettingsViewModel(
            ITranslationsService translationsService,
            IFilePickerService filePickerService,
            IPackagingService packagingService,
            ISettingsService settingsService,
            IPlatformService platformService,
            IDialogService dialogService,
            IOpmlService opmlService)
        {
            Theme   = string.Empty;
            Version = packagingService.Version;
            (LoadImages, NeedBanners) = (true, true);
            (FontSize, NotifyPeriod, MaxArticlesPerFeed) = (0, 0, 0);
            LeaveFeedback = new ObservableCommand(packagingService.LeaveFeedback);
            LeaveReview   = new ObservableCommand(packagingService.LeaveReview);
            ImportOpml    = new ObservableCommand(async() =>
            {
                var stream = await filePickerService.PickFileForReadAsync();
                await opmlService.ImportOpmlFeedsAsync(stream);
            });
            ExportOpml = new ObservableCommand(async() =>
            {
                var stream = await filePickerService.PickFileForWriteAsync();
                await opmlService.ExportOpmlFeedsAsync(stream);
            });
            Reset = new ObservableCommand(async() =>
            {
                var response = await dialogService.ShowDialogForConfirmation(
                    translationsService.Resolve("ResetAppNoRestore"),
                    translationsService.Resolve("Notification"));
                if (response)
                {
                    await platformService.ResetApp();
                }
            });
            Load = new ObservableCommand(async() =>
            {
                await Task.WhenAll(
                    StartTracking(NotifyPeriod, "NotifyPeriod", platformService.RegisterBackgroundTask),
                    StartTracking(MaxArticlesPerFeed, "MaxArticlesPerFeed", o => Task.CompletedTask),
                    StartTracking(NeedBanners, "NeedBanners", o => Task.CompletedTask),
                    StartTracking(LoadImages, "LoadImages", o => Task.CompletedTask),
                    StartTracking(FontSize, "FontSize", o => Task.CompletedTask),
                    StartTracking(Theme, "Theme", platformService.RegisterTheme)
                    );
            });
            async Task StartTracking <T>(ObservableProperty <T> property, string key,
                                         Func <T, Task> callback) where T : IConvertible
            {
                property.Value = await settingsService.GetAsync <T>(key);

                property.PropertyChanged += async(o, args) =>
                {
                    var value = property.Value;
                    await callback.Invoke(value);

                    await settingsService.SetAsync(key, value);
                };
            }
        }
コード例 #7
0
 public PropertyTypeDetailsViewModel(IPropertyTypeService propertyTypeService, IFilePickerService filePickerService, ICommonServices commonServices, PropertyTypeListViewModel propertyTypeList, PropertyTypeViewModel propertyTypeViewModel) : base(commonServices)
 {
     PropertyTypeService   = propertyTypeService;
     FilePickerService     = filePickerService;
     PropertyTypeList      = propertyTypeList;
     PropertyTypeViewModel = propertyTypeViewModel;
 }
コード例 #8
0
        public PasswordViewModel(IFilePickerService picker,
                                 IRegisteredDbsService registrations, ICacheService cache,
                                 INavigationService navigation, IEventAggregator events)
        {
            if (picker == null)
            {
                throw new ArgumentNullException("picker");
            }
            if (registrations == null)
            {
                throw new ArgumentNullException("registrations");
            }
            if (cache == null)
            {
                throw new ArgumentNullException("cache");
            }
            if (navigation == null)
            {
                throw new ArgumentNullException("navigation");
            }
            if (events == null)
            {
                throw new ArgumentNullException("events");
            }

            _cache         = cache;
            _picker        = picker;
            _events        = events;
            _navigation    = navigation;
            _registrations = registrations;
            _password      = new PasswordData();
        }
コード例 #9
0
 public RegistrationViewModel(IFilePickerService filePicker, IDbService dataService, IMvxNavigationService navigationService)
     : base(navigationService)
 {
     _filePicker  = filePicker;
     _dataService = dataService;
     Title        = "Registration";
 }
コード例 #10
0
        public MainWindowViewModel(IConnpassClient connpassClient, IFilePickerService filePickerService, IClipBoardService clipBoardService, IArticleTemplateEngine articleTemplateEngine)
        {
            _connpassClient        = connpassClient;
            _filePickerService     = filePickerService;
            _clipBoardService      = clipBoardService;
            _articleTemplateEngine = articleTemplateEngine;

            ConnpassUrl.Subscribe(s => _connpassClient.ConnpassURL.Value = s);

            ArticleData = _connpassClient.Article;

            ArticleContent = TemplateContent.Merge(TranslateCommand)
                             //.Where(s => ArticleData != null && !string.IsNullOrWhiteSpace(TemplateContent.Value) && string.IsNullOrWhiteSpace(ConnpassUrl.Value))
                             .Select(s => _articleTemplateEngine.ReplaceArticleData(TemplateContent.Value, ArticleData.Value))
                             .ToReactiveProperty();

            CopyArticleContentCommand.Subscribe(() => _clipBoardService.CopyToClipBoard(ArticleContent.Value));

            TemplateContent = _filePickerService.FileContent;

            OpenTemplateFileFromLocal.Subscribe(() => _filePickerService.ShowFilePicker());

            SwitchTagView.Subscribe(() => IsOpenTagView.SwitchValue());

            CopyTag.Subscribe(() => _clipBoardService.CopyToClipBoard($"{{{SelectedTag.Value}}}"));

            AddTag.Subscribe(() => TemplateContent.Value += $"{{{SelectedTag.Value}}}");
        }
コード例 #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingsViewModel"/> class.
        /// </summary>
        public SettingsViewModel(
            INavigationService navigationService,
            ILanguageService languageService,
            ISvgIconService svgIconService,
            IThemeService themeService,
            IBaseUrlService webviewBaseUrl,
            ISettingsService settingsService,
            IStoryBoardService storyBoardService,
            IFeedbackService feedbackService,
            ICloudStorageClientFactory cloudStorageClientFactory,
            IFilePickerService filePickerService)
            : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl)
        {
            _settingsService           = settingsService;
            _storyBoardService         = storyBoardService;
            _feedbackService           = feedbackService;
            _cloudStorageClientFactory = cloudStorageClientFactory;
            _filePickerService         = filePickerService;
            _fontSizeConverter         = new SliderStepConverter(ReferenceFontSize, 1.0);
            _noteMaxHeightConverter    = new SliderStepConverter(ReferenceNoteMaxSize, 20.0);
            Model = _settingsService.LoadSettingsOrDefault();

            EncryptionAlgorithms = new List <DropdownItemViewModel>();
            FillAlgorithmList(EncryptionAlgorithms);

            // Initialize commands
            GoBackCommand = new RelayCommand(GoBack);
            ChangeCloudSettingsCommand = new RelayCommand(ChangeCloudSettings);
            ClearCloudSettingsCommand  = new RelayCommand(ClearCloudSettings);
            TestNewLocalizationCommand = new RelayCommand(TestNewLocalization);
        }
 public DocumentTypeDetailsViewModel(IDocumentTypeService documentTypeService, IFilePickerService filePickerService, ICommonServices commonServices, DocumentTypeListViewModel documentTypeListViewModel, DocumentTypeViewModel documentTypeViewModel) : base(commonServices)
 {
     DocumentTypeService       = documentTypeService;
     FilePickerService         = filePickerService;
     DocumentTypeListViewModel = documentTypeListViewModel;
     DocumentTypeViewModel     = documentTypeViewModel;
 }
コード例 #13
0
        public ComplaintDiscussionsViewModel(
            Complaint entity,
            ITdiTab dialogTab,
            IUnitOfWork uow,
            IFilePickerService filePickerService,
            IEmployeeService employeeService,
            ICommonServices commonServices,
            IEntityAutocompleteSelectorFactory employeeSelectorFactory,
            ISalesPlanJournalFactory salesPlanJournalFactory,
            INomenclatureSelectorFactory nomenclatureSelectorFactory,
            IUserRepository userRepository
            ) : base(entity, commonServices)
        {
            _employeeSelectorFactory = employeeSelectorFactory ?? throw new ArgumentNullException(nameof(employeeSelectorFactory));
            _filePickerService       = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
            _employeeService         = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            _dialogTab = dialogTab ?? throw new ArgumentNullException(nameof(dialogTab));
            _salesPlanJournalFactory     = salesPlanJournalFactory ?? throw new ArgumentNullException(nameof(salesPlanJournalFactory));
            _nomenclatureSelectorFactory = nomenclatureSelectorFactory ?? throw new ArgumentNullException(nameof(nomenclatureSelectorFactory));
            _userRepository = userRepository ?? throw new ArgumentNullException(nameof(userRepository));

            UoW = uow;
            CreateCommands();
            ConfigureEntityPropertyChanges();
            FillDiscussionsViewModels();
        }
コード例 #14
0
 public TalukDetailsViewModel(ITalukService talukService, IFilePickerService filePickerService, ICommonServices commonServices, TalukListViewModel talukListViewModel, TalukViewModel talukViewModel) : base(commonServices)
 {
     TalukService       = talukService;
     FilePickerService  = filePickerService;
     TalukListViewModel = talukListViewModel;
     TalukViewModel     = talukViewModel;
 }
コード例 #15
0
        public MainViewModel(IFilePickerService fileoPickerService, IOcrService ocrService, IDialogService dialogService)
        {
            _fileoPickerService = fileoPickerService;
            _ocrService         = ocrService;
            _dialogService      = dialogService;

            _fileoPickerService.Initialise();
        }
コード例 #16
0
 public RoleDetailsViewModel(IDropDownService dropDownService, IRoleService roleService, IFilePickerService filePickerService, ICommonServices commonServices, RoleListViewModel villageListViewModel, RoleViewModel roleViewModel) : base(commonServices)
 {
     DropDownService   = dropDownService;
     FilePickerService = filePickerService;
     RoleService       = roleService;
     RoleListViewModel = villageListViewModel;
     RoleViewModel     = roleViewModel;
 }
コード例 #17
0
 public ExpenseDetailViewModel(IDatabaseService databaseService, IDesktopBridgeService desktopBridgeService, IFilePickerService filePickerService, IDialogService dialogService, IShareService shareService)
 {
     this.databaseService      = databaseService;
     this.desktopBridgeService = desktopBridgeService;
     this.filePickerService    = filePickerService;
     this.dialogService        = dialogService;
     this.shareService         = shareService;
 }
コード例 #18
0
 public ProfileTabViewModel(IMvxNavigationService navigationService, IFilePickerService service, IDbService dataService, UserModel user)
     : base(navigationService)
 {
     Title        = "Profile";
     _dataService = dataService;
     _filePicker  = service;
     _user        = user;
     InitializeUserData();
 }
コード例 #19
0
        public EntryAttachmentViewModel(XElement element,
            IFilePickerService picker)
        {
            if (element == null) throw new ArgumentNullException("element");
            if (picker == null) throw new ArgumentNullException("picker");

            _picker = picker;
            _element = element;
        }
コード例 #20
0
        public EntryAttachmentsViewModel(IFilePickerService picker)
        {
            if (picker == null)
                throw new ArgumentNullException("picker");

            _picker = picker;
            DisplayName = "Attachments";
            _items = new BindableCollection<EntryAttachmentViewModel>();
        }
コード例 #21
0
 public AppService(ILogger <IAppService> logger, IImageLoaderService imageLoaderService, IImageAdapter imageAdapter, IFilePickerService filePickerService, ISolverService solverService, IImageDrawerService imageDrawerService)
 {
     _imageList          = new List <ImageListItem>();
     _imageLoaderService = imageLoaderService;
     _imageAdapter       = imageAdapter;
     _filePickerService  = filePickerService;
     _solverService      = solverService;
     _imageDrawerService = imageDrawerService;
     _logger             = logger;
 }
コード例 #22
0
 public ComparerViewModel(IFilePickerService filePickerService,
                          IDialogService dialogService,
                          IDarkThemeResolver darkThemeResolver)
 {
     _darkThemeResolver = darkThemeResolver ?? throw new ArgumentNullException(nameof(darkThemeResolver));
     _filePickerService = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
     _dialogService     = dialogService ?? throw new ArgumentNullException(nameof(dialogService));
     PickFile1          = new RelayCommand(async() => { File1 = (StorageFile)await _filePickerService.PickSingleAsync(); });
     PickFile2          = new RelayCommand(async() => { File2 = (StorageFile)await _filePickerService.PickSingleAsync(); });
 }
コード例 #23
0
        public CreateComplaintViewModel(
            IEntityUoWBuilder uowBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            IEmployeeService employeeService,
            IEntityAutocompleteSelectorFactory counterpartySelectorFactory,
            ISubdivisionRepository subdivisionRepository,
            ICommonServices commonServices,
            INomenclatureRepository nomenclatureRepository,
            IUserRepository userRepository,
            IFilePickerService filePickerService,
            IOrderSelectorFactory orderSelectorFactory,
            IEmployeeJournalFactory employeeJournalFactory,
            ICounterpartyJournalFactory counterpartyJournalFactory,
            IDeliveryPointJournalFactory deliveryPointJournalFactory,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            IGtkTabsOpener gtkDialogsOpener,
            IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener,
            INomenclatureSelectorFactory nomenclatureSelector,
            IUndeliveredOrdersRepository undeliveredOrdersRepository,
            string phone = null
            ) : base(uowBuilder, unitOfWorkFactory, commonServices)
        {
            _filePickerService          = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
            EmployeeService             = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            NomenclatureRepository      = nomenclatureRepository ?? throw new ArgumentNullException(nameof(nomenclatureRepository));
            UserRepository              = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
            CounterpartySelectorFactory = counterpartySelectorFactory ?? throw new ArgumentNullException(nameof(counterpartySelectorFactory));
            this.subdivisionRepository  = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));

            OrderSelectorFactory           = orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory));
            EmployeeJournalFactory         = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory));
            _employeeSelectorFactory       = employeeJournalFactory.CreateEmployeeAutocompleteSelectorFactory();
            CounterpartyJournalFactory     = counterpartyJournalFactory ?? throw new ArgumentNullException(nameof(counterpartyJournalFactory));
            DeliveryPointJournalFactory    = deliveryPointJournalFactory ?? throw new ArgumentNullException(nameof(deliveryPointJournalFactory));
            SubdivisionJournalFactory      = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory));
            GtkDialogsOpener               = gtkDialogsOpener ?? throw new ArgumentNullException(nameof(gtkDialogsOpener));
            UndeliveredOrdersJournalOpener =
                undeliveredOrdersJournalOpener ?? throw new ArgumentNullException(nameof(undeliveredOrdersJournalOpener));
            NomenclatureSelector        = nomenclatureSelector ?? throw new ArgumentNullException(nameof(nomenclatureSelector));
            UndeliveredOrdersRepository =
                undeliveredOrdersRepository ?? throw new ArgumentNullException(nameof(undeliveredOrdersRepository));

            Entity.ComplaintType = ComplaintType.Client;
            Entity.SetStatus(ComplaintStatuses.Checking);
            ConfigureEntityPropertyChanges();
            Entity.Phone = phone;

            _complaintKinds = complaintKindSource = UoW.GetAll <ComplaintKind>().Where(k => !k.IsArchive).ToList();

            UserHasOnlyAccessToWarehouseAndComplaints =
                ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("user_have_access_only_to_warehouse_and_complaints") &&
                !ServicesConfig.CommonServices.UserService.GetCurrentUser(UoW).IsAdmin;

            TabName = "Новая клиентская рекламация";
        }
コード例 #24
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command. If the command
        /// does not require data to be passed, this object can be set to
        /// null.</param>
        public override void Execute(object parameter)
        {
            IFilePickerService service = Container.Resolve <IFilePickerService>();

            service.Mode   = FilePickerMode.Open;
            service.Filter = "Xml Files (.xml)|*.xml";
            if (service.SelectPath())
            {
                _loadFile(service.Path);
            }
        }
コード例 #25
0
 public GroupViewModel(IGraphService graphService, IConfigService configService,
                       ILauncherService launcherService, IFilePickerService filePickerService)
 {
     _graphService      = graphService;
     _configService     = configService;
     _launcherService   = launcherService;
     _filePickerService = filePickerService;
     Files         = new ObservableCollection <FileModel>();
     Conversations = new ObservableCollection <ConversationModel>();
     Tasks         = new ObservableCollection <TaskModel>();
 }
コード例 #26
0
        public EntryAttachmentsViewModel(IFilePickerService picker)
        {
            if (picker == null)
            {
                throw new ArgumentNullException("picker");
            }

            _picker     = picker;
            DisplayName = "Attachments";
            _items      = new BindableCollection <EntryAttachmentViewModel>();
        }
コード例 #27
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command. If the command
        /// does not require data to be passed, this object can be set to
        /// null.</param>
        public override void Execute(object parameter)
        {
            IFilePickerService service = Container.Resolve <IFilePickerService>();

            service.Mode   = FilePickerMode.Open;
            service.Filter = "Assemblies (*.dll)|*.dll";
            if (service.SelectPath())
            {
                _tryLoadHandlersInAssembly(service.Path);
            }
        }
コード例 #28
0
ファイル: SettingViewModel.cs プロジェクト: sadboykaka/myFeed
        public SettingViewModel(
            IFilePickerService filePickerService,
            IPackagingService packagingService,
            IPlatformService platformService,
            ISettingManager settingManager,
            IOpmlService opmlService)
        {
            _filePickerService = filePickerService;
            _packagingService  = packagingService;
            _platformService   = platformService;
            _settingManager    = settingManager;
            _opmlService       = opmlService;

            Version  = _packagingService.Version;
            Feedback = ReactiveCommand.CreateFromTask(packagingService.LeaveFeedback);
            Review   = ReactiveCommand.CreateFromTask(packagingService.LeaveReview);

            ImportSuccess = new Interaction <Unit, bool>();
            ExportSuccess = new Interaction <Unit, bool>();
            Import        = ReactiveCommand.CreateFromTask(DoImport);
            Export        = ReactiveCommand.CreateFromTask(DoExport);

            ResetConfirm = new Interaction <Unit, bool>();
            Reset        = ReactiveCommand.CreateFromTask(DoReset);
            _settingManager.Read().ToObservable()
            .Do(x => Banners = x.Banners)
            .Do(x => Images  = x.Images)
            .Do(x => Period  = x.Period)
            .Do(x => Theme   = x.Theme)
            .Do(x => Read    = x.Read)
            .Do(x => Font    = x.Font)
            .Do(x => Max     = x.Max)
            .Subscribe();

            this.WhenAnyValue(x => x.Period).Skip(1)
            .SelectMany(platformService.RegisterBackgroundTask)
            .Subscribe();
            this.WhenAnyValue(x => x.Theme).Skip(1)
            .SelectMany(platformService.RegisterTheme)
            .Subscribe();
            this.WhenAnyValue(
                x => x.Period, x => x.Theme,
                x => x.Banners, x => x.Images,
                x => x.Read, x => x.Font, x => x.Max)
            .Skip(1).Select(x => new Settings
            {
                Period  = x.Item1, Theme = x.Item2,
                Banners = x.Item3, Images = x.Item4,
                Read    = x.Item5, Font = x.Item6, Max = x.Item7
            })
            .SelectMany(settingManager.Write)
            .Subscribe();
        }
コード例 #29
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command.</param>
        public override void Execute(object parameter)
        {
            IFilePickerService service = Container.Resolve <IFilePickerService>();

            service.Mode             = FilePickerMode.Create;
            service.DefaultExtension = ".xml";
            service.DefaultName      = _info.PipelineName;
            service.Filter           = "Xml Files (.xml)|*.xml";
            if (service.SelectPath())
            {
                _saveFile(service.Path);
            }
        }
コード例 #30
0
        public RegisterViewModel(
            INavigationManager navigationManager,
            IMembershipService membershipService,
            IFilePickerService filePickerService,
            ILocalizationService localizationService)
        {
            _membershipService   = membershipService;
            _navigationManager   = navigationManager;
            _filePickerService   = filePickerService;
            _localizationService = localizationService;

            InitializeField();

            RegisterModel = new RegisterModel();
        }
コード例 #31
0
        public EntryAttachmentViewModel(XElement element,
                                        IFilePickerService picker)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            if (picker == null)
            {
                throw new ArgumentNullException("picker");
            }

            _picker  = picker;
            _element = element;
        }
コード例 #32
0
 public ComplaintDiscussionViewModel(
     ComplaintDiscussion complaintDiscussion,
     IFilePickerService filePickerService,
     IEmployeeService employeeService,
     ICommonServices commonServices,
     IUnitOfWork uow
     ) : base(complaintDiscussion, commonServices)
 {
     this.filePickerService = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
     this.employeeService   = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
     this.commonServices    = commonServices ?? throw new ArgumentNullException(nameof(commonServices));
     newCommentFiles        = new GenericObservableList <ComplaintFile>();
     UoW = uow;
     CreateCommands();
     ConfigureEntityPropertyChanges();
 }
コード例 #33
0
        public PasswordViewModel(IFilePickerService picker,
            IRegisteredDbsService registrations, ICacheService cache,
            INavigationService navigation, IEventAggregator events)
        {
            if (picker == null) throw new ArgumentNullException("picker");
            if (registrations == null) throw new ArgumentNullException("registrations");
            if (cache == null) throw new ArgumentNullException("cache");
            if (navigation == null) throw new ArgumentNullException("navigation");
            if (events == null) throw new ArgumentNullException("events");

            _cache = cache;
            _picker = picker;
            _events = events;
            _navigation = navigation;
            _registrations = registrations;
            _password = new PasswordData();
        }