示例#1
0
        public static async Task <bool> RenameFileItemAsync(ListedItem item, string oldName, string newName, IShellPage associatedInstance)
        {
            IUserSettingsService userSettingsService = Ioc.Default.GetService <IUserSettingsService>();

            if (oldName == newName || string.IsNullOrEmpty(newName))
            {
                return(true);
            }

            ReturnResult renamed = ReturnResult.InProgress;

            if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
            {
                renamed = await associatedInstance.FilesystemHelpers.RenameAsync(StorageItemHelpers.FromPathAndType(item.ItemPath, FilesystemItemType.Directory),
                                                                                 newName, NameCollisionOption.FailIfExists, true);
            }
            else
            {
                if (item.IsShortcutItem || !userSettingsService.PreferencesSettingsService.ShowFileExtensions)
                {
                    newName += item.FileExtension;
                }

                renamed = await associatedInstance.FilesystemHelpers.RenameAsync(StorageItemHelpers.FromPathAndType(item.ItemPath, FilesystemItemType.File),
                                                                                 newName, NameCollisionOption.FailIfExists, true);
            }

            if (renamed == ReturnResult.Success)
            {
                associatedInstance.NavToolbarViewModel.CanGoForward = false;
                return(true);
            }
            return(false);
        }
示例#2
0
 public UserSession(IUserSettingsService userSettingsService, IDataService dataService, IAppSettings appSettings)
 {
     _userSettingsService = userSettingsService;
     _loginSettings       = _userSettingsService.GetSettings();
     _dataService         = dataService;
     _appSettings         = appSettings;
 }
示例#3
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="configJsonService"></param>
        /// <param name="userSettingsService"></param>
        /// <param name="executionService"></param>
        public PresetControlViewModel(IConfigJsonService configJsonService, IUserSettingsService userSettingsService, IExecutionService executionService)
        {
            ConfigJsonService   = configJsonService;
            UserSettingsService = userSettingsService;
            ExecutionService    = executionService;

            // モデルのプロパティ更新イベントリスナ登録
            CompositeDisposable.Add(new PropertyChangedEventListener(UserSettingsService.UserSettings)
            {
                { nameof(UserSettings.PresetInfos), (_, __) => RaisePropertyChanged(nameof(Presets)) },
            });
            CompositeDisposable.Add(new PropertyChangedEventListener(ConfigJsonService)
            {
                {
                    nameof(IConfigJsonService.CurrentPreset),
                    (_, __) =>
                    {
                        RaisePropertyChanged(nameof(CurrentPreset));
                        RaisePropertyChanged(nameof(SaveEnable));
                        RaisePropertyChanged(nameof(DeleteEnable));
                    }
                },
                {
                    nameof(IConfigJsonService.ConfigJson), (_, __) => SetConfigJsonEventListenr()
                }
            });
            SetConfigJsonEventListenr();
        }
 public HomeController(IRobotsService robotsService,
                       IManifestService manifestService,
                       IContactUsService contactUsService,
                       IUserSettingsService userSettingsService,
                       IUserProfileService userProfileService,
                       ILogService logService, IMapper mapper,
                       IVideoAttributesService videoAttributesService,
                       IBannerDetailsService bannerDetailsService,
                       ISitemapService sitemapService,
                       IOpenSearchService openSearchService,
                       IBrowserConfigService browserConfigService,
                       IFeedService feedService)
     : base(logService, mapper)
 {
     _videoAttributesService = videoAttributesService;
     _mapper = mapper;
     _userSettingsService  = userSettingsService;
     _userProfileService   = userProfileService;
     _bannerDetailsService = bannerDetailsService;
     _contactUsService     = contactUsService;
     _manifestService      = manifestService;
     _robotsService        = robotsService;
     _sitemapService       = sitemapService;
     _openSearchService    = openSearchService;
     _browserConfigService = browserConfigService;
     _feedService          = feedService;
 }
        public ConnectionScreenViewModel(IConnectionService connectionService, IDialogService dialogService, IUserSettingsService userSettingsService)
        {
            mConnectionService   = connectionService;
            mDialogService       = dialogService;
            mUserSettingsService = userSettingsService;
            DisplayName          = "Welcome";

            var recentLaunches = new ObservableCollection <LaunchInfo>();

            RecentLaunches = new ReadOnlyObservableCollection <LaunchInfo>(recentLaunches);

            BrowseExecutableCommand = ReactiveCommand.CreateFromTask(BrowseExecutableAsync);
            LaunchCommand           = ReactiveCommand.CreateFromTask(
                LaunchExecutableAsync,
                this.WhenAnyValue(x => x.LaunchExecutablePath).Select(path => !string.IsNullOrWhiteSpace(path)));
            BrowseDataFileCommand = ReactiveCommand.CreateFromTask(BrowseDataFileAsync);

            this.WhenAnyValue(x => x.SelectedRecentLaunch)
            .Where(launch => launch != null)
            .Subscribe(launch =>
            {
                LaunchExecutablePath = launch.FileName;
                LaunchArguments      = launch.Arguments;
                MonitorAllOnLaunch   = launch.Options.HasFlag(LaunchOptions.MonitorAllFromStart);
            });

            WhenActivated(observables =>
            {
                recentLaunches.Clear();
                recentLaunches.AddRange(userSettingsService.GetMostRecentLaunches());
            });
        }
示例#6
0
        public void Initialize()
        {
            var context = new CustomDashboardsContext();
            var uow     = new UserSettingsUOW(context);

            service = new UserSettingsService(uow);
        }
示例#7
0
        public ShellViewModel(IMenuService menuService
            , IAppConfiguration appConfiguration
            , IUserSettingsService settings)
            : base()
        {
            this.PageLoadingCommand = DelegateCommand.FromAsyncHandler(PageLoading);
            this.UserSettingsService = settings;
            this.AppName = appConfiguration.AppName;
            this.WriteReadyStatus();

            this.ToggleFullScreenCommand = new DelegateCommand<object>(o =>
            {
                if (o is IToggleFullScreen)
                {
                    var tfs = o as IToggleFullScreen;
                    tfs.ToggleFullScreen = !tfs.ToggleFullScreen;
                }
                this.ToggleFullScreen = !this.ToggleFullScreen;
            });

            Menu = menuService.Menu.ToObservableCollection();
            EventAggregator.GetEvent<MenuUpdated>().Subscribe(m =>
            {
                Menu.Clear();
                Menu.AddRange(m.ToObservableCollection());
            });
            EventAggregator.GetEvent<SubMenuVisibilityChanged>().Subscribe(m => this.IsSubMenuVisible = m);
        }
示例#8
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="MainViewModel" /> class
        /// </summary>
        /// <param name="eventAggregator">The events</param>
        public MainViewModel(
            IEventAggregator eventAggregator,
            IMediator mediator,
            IUserSettingsService userSettingsService
            )
        {
            _eventAggregator = eventAggregator;
            _mediator        = mediator;
            _eventAggregator.Subscribe(this);
            _settings = userSettingsService.GetUserSettings();

            this.WhenAnyValue(x => x.SearchText)
            .Throttle(TimeSpan.FromSeconds(0.10), RxApp.TaskpoolScheduler)
            .Select(query => query?.Trim())
            .DistinctUntilChanged()
            .ObserveOn(RxApp.MainThreadScheduler)
            .Subscribe(x => UpdateSearch());


            Header = $"Search - {Version}";
            using (var sha = SHA256.Create())
            {
                var buffer =
                    Encoding.UTF8.GetBytes(Assembly.GetExecutingAssembly().GetName()?.Version?.ToString() ?? "");
                Version = sha.ComputeHash(buffer).Select(x => x.ToString("x2")).Take(3)
                          .Aggregate(string.Empty, (c, c1) => c + c1);
            }
        }
 public RoundStockController(ISldWorks app, RoundStockModel model,
                             IUserSettingsService opts)
 {
     m_App       = app;
     m_Model     = model;
     m_UserSetts = opts;
 }
示例#10
0
        public SettingsViewModel(IUserSettingsService userConfig)
            : base()
        {
            this.UserConfig = userConfig;
            // create metro theme color menu items for the demo
            this.ApplicationThemes = ThemeManager.AppThemes
                                                 .Select(a => new ApplicationTheme()
                                                 {
                                                     Name = a.Name,
                                                     BorderColorBrush = a.Resources["BlackColorBrush"] as Brush,
                                                     ColorBrush = a.Resources["WhiteColorBrush"] as Brush
                                                 })
                                                 .ToList();

            // create accent colors list
            this.AccentColors = ThemeManager.Accents
                                            .Select(a => new AccentColor()
                                            {
                                                Name = a.Name,
                                                ColorBrush = a.Resources["AccentColorBrush"] as Brush
                                            })
                                            .ToList();

            this.SelectedTheme = (from t in this.ApplicationThemes
                                  where t.Name.ToLower() == UserConfig.Theme.ToLower()
                                  select t).FirstOrDefault();
            this.SelectedAccentColor = (from a in this.AccentColors
                                        where a.Name.ToLower() == UserConfig.Accent.ToLower()
                                        select a).FirstOrDefault();
        }
        public override bool OnConnect()
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
                m_Container = new ServicesContainer(App);

                m_UserSettings = m_Container.GetService <IUserSettingsService>();

                m_Controller = m_Container.GetService <RoundStockController>();
                m_Controller.FeatureInsertionCompleted += OnFeatureInsertionCompleted;

                AddCommandGroup <Commands_e>(OnCommandClick);

                return(true);
            }
            catch (Exception ex)
            {
                try
                {
                    m_Container.GetService <ILogService>().LogException(ex);
                }
                catch
                {
                }

                App.SendMsgToUser2($"Failed to load {Resources.AppTitle}. Please see log for more details",
                                   (int)swMessageBoxIcon_e.swMbStop, (int)swMessageBoxBtn_e.swMbOk);

                return(false);
            }
        }
 public GameDataRepository(IFileStorageService fileStorageService, IMapperFactory mapperFactory, ISerializationService serializationService, IUserSettingsService userSettingsService)
 {
     _fileStorageService   = fileStorageService;
     _mapperFactory        = mapperFactory;
     _serializationService = serializationService;
     _userSettingsService  = userSettingsService;
 }
示例#13
0
        public static void SaveSessionTabs() // Enumerates through all tabs and gets the Path property and saves it to AppSettings.LastSessionPages
        {
            IUserSettingsService    userSettingsService    = Ioc.Default.GetService <IUserSettingsService>();
            IBundlesSettingsService bundlesSettingsService = Ioc.Default.GetService <IBundlesSettingsService>();

            if (bundlesSettingsService != null)
            {
                bundlesSettingsService.FlushSettings();
            }
            if (userSettingsService?.PreferencesSettingsService != null)
            {
                userSettingsService.PreferencesSettingsService.LastSessionTabList = MainPageViewModel.AppInstances.DefaultIfEmpty().Select(tab =>
                {
                    if (tab != null && tab.TabItemArguments != null)
                    {
                        return(tab.TabItemArguments.Serialize());
                    }
                    else
                    {
                        var defaultArg = new TabItemArguments()
                        {
                            InitialPageType = typeof(PaneHolderPage), NavigationArg = "Home".GetLocalized()
                        };
                        return(defaultArg.Serialize());
                    }
                }).ToList();
            }
        }
示例#14
0
        public SettingsWindow(IUserSettingsService userSettingsService, IModuleCatalog moduleCatalog)
        {
            userSettingsService.ThrowIfNull(nameof(userSettingsService));
            _userSettingsService = userSettingsService;

            InitializeComponent();
            CommandGrid.DataContext = _userSettingsService;

            if (ModuleSettingsTabControl.Items.Count == 0)
            {
                foreach (var module in moduleCatalog.Modules)
                {
                    var contentControl = new ContentControl
                    {
                        Margin = new Thickness(5, 5, 5, 5)
                    };
                    contentControl.SetValue(RegionManager.RegionNameProperty, $"{module.ModuleName}{RegionNames.ModuleSettingsRegion}");

                    var tabItem = new TabItem
                    {
                        Header  = module.ModuleName,
                        Name    = $"{module.ModuleName}TabItem",
                        Content = contentControl
                    };

                    ModuleSettingsTabControl.Items.Add(tabItem);
                }
            }
        }
示例#15
0
 public ProfileViewModel(UsersDatabase usersDatabase, WasabeeApiV1Service wasabeeApiV1Service,
                         IUserSettingsService userSettingsService)
 {
     _usersDatabase       = usersDatabase;
     _wasabeeApiV1Service = wasabeeApiV1Service;
     _userSettingsService = userSettingsService;
 }
示例#16
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="userSettingService">ユーザー設定情報サービス</param>
 /// <param name="fileService">ファイルサービス</param>
 public ConfigJsonService(IUserSettingsService userSettingService, IConfigJsonFileService fileService)
 {
     UserSettingsService = userSettingService;
     UserSettings        = userSettingService.UserSettings;
     FileService         = fileService;
     ConfigJson          = new ConfigJson();
     IsBusy = false;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="XmlKeyboardManagerService"/> class.
        /// </summary>
        /// <param name="fallbackKeyboardService"></param>
        /// <param name="userSettingsService">
        /// The url where is the xml mapping file.
        /// </param>
        public XmlKeyboardManagerService([Dependency("DefaultKeyboardManager")] KeyboardManagerService fallbackKeyboardService, IUserSettingsService userSettingsService)
        {
            this.fallbackKeyboardService              = fallbackKeyboardService;
            this.userSettingsService                  = userSettingsService;
            this.userSettingsService.SettingsChanged += this.OnSettingsChanged;

            this.LoadMappings();
        }
示例#18
0
        public SettingsWindow(IUserSettingsService userSettingsService)
        {
            userSettingsService.ThrowIfNull(nameof(userSettingsService));
            _userSettingsService = userSettingsService;

            InitializeComponent();
            CommandGrid.DataContext = _userSettingsService;
        }
示例#19
0
        //public static void RegisterMe()
        //{
        //    var routes = RouteTable.Routes;

        //    using (routes.GetWriteLock())
        //    {
        //        routes.MapRoute("UserSettingsRoute",
        //          "UserSettings/{action}",
        //          new { controller = "UserSettings", action = "GetIncludeExternal" },
        //          new string[] { "MvcRQUser.UserSettings" });
        //    }
        //}

        /// <summary>
        /// Initialize controller and the settings service
        /// </summary>
        /// <param name="requestContext">Current http request context</param>
        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);

            if (this._settingsService == null)
            {
                this._settingsService = new UserSettingsService();
            }
        }
示例#20
0
        public Sqlite(IUserSettingsService userSettingsService, IMessageboxService messageboxService, IDBCreator creator, IDBUpdater updater)
        {
            m_UserSettingsService = userSettingsService;
            m_MessageboxService   = messageboxService;
            InitLocal(creator, updater);

            m_Creator = creator;
            m_Updater = updater;
        }
示例#21
0
 public HomeAssembler(
     IEntryService entryService, 
     ITimeService timeService,
     IUserSettingsService userSettingService)
 {
     _entryService = entryService;
     _timeService = timeService;
     _userSettingsService = userSettingService;
 }
示例#22
0
 public UserSession(IUserService userService, IUserPreferences userPreferences, IUserSettingsService userSettingsService,
                    IConnectivityService connectivityService)
 {
     _userService = userService;
     _userSettingsService = userSettingsService;
     _userPreferences = userPreferences;
     _connectivityService = connectivityService;
     UserStatistics = new UserStatistics();
 }
示例#23
0
 public OperationDetailViewModel(OperationsDatabase operationsDatabase, TeamsDatabase teamsDatabase, UsersDatabase usersDatabase,
                                 IUserSettingsService userSettingsService, IMvxNavigationService navigationService)
 {
     _operationsDatabase  = operationsDatabase;
     _teamsDatabase       = teamsDatabase;
     _usersDatabase       = usersDatabase;
     _userSettingsService = userSettingsService;
     _navigationService   = navigationService;
 }
示例#24
0
 public AuthenticationService(
     IAuthenticationCryptographer authenticationCryptographer,
     IMedicalInformationService medicalService,
     IUserSettingsService userSettingsService)
 {
     _authenticatioCryptographer = authenticationCryptographer;
     _medicalService             = medicalService;
     _userSettingsService        = userSettingsService;
 }
 public NotesController(
     INoteService noteService,
     IUserSettingsService userSettingsService,
     ITestDataService testDataService)
 {
     _noteService         = noteService;
     _userSettingsService = userSettingsService;
     _testDataService     = testDataService;
 }
示例#26
0
 public SettingsViewModel(ISettings settingsModel, IUserSettingsService userSettingsService, IModuleCatalog moduleCatalog)
     : base(settingsModel as IUserSettings, userSettingsService)
 {
     ModuleNameCollection = new ObservableCollection <string>(moduleCatalog.Modules.Select(module => module.ModuleName));
     if (string.IsNullOrEmpty(ModuleName))
     {
         ModuleName = ModuleNameCollection[0];
     }
 }
示例#27
0
 public LimitHandler(Mediator mediator,
                     IUserSettingsService userSettingsService,
                     ILogger logger,
                     IShutdownService shutdownService)
 {
     this.mediator            = mediator;
     this.userSettingsService = userSettingsService;
     this.logger          = logger;
     this.shutdownService = shutdownService;
 }
 public OpenClearanceCommandHandler(
     IRepository <ClearanceRoot> clearanceRepository,
     IMediator mediator,
     IUserSettingsService userSettingsService,
     IClearanceDtoRepository clearanceDtoRepository)
     : base(clearanceRepository, mediator)
 {
     this.userSettingsService    = userSettingsService;
     this.clearanceDtoRepository = clearanceDtoRepository;
 }
示例#29
0
        public AppDetailsView()
        {
            InitializeComponent();
            xmlService = ServiceLocator.Instance.Resolve <IUserSettingsService>();
            var width = xmlService.LogsViewSettings.VerticalSeparatorPosition;

            if (width != default(double))
            {
                rootLayout.ColumnDefinitions[0].Width = new GridLength(width);
            }
        }
示例#30
0
 public LinkAssignmentDialogViewModel(IDialogNavigationService dialogNavigationService, IUserDialogs userDialogs, IClipboard clipboard,
                                      IMap map, IMvxMessenger messenger, LinksDatabase linksDatabase, WasabeeApiV1Service wasabeeApiV1Service, IUserSettingsService userSettingsService) : base(dialogNavigationService)
 {
     _userDialogs         = userDialogs;
     _clipboard           = clipboard;
     _map                 = map;
     _messenger           = messenger;
     _linksDatabase       = linksDatabase;
     _wasabeeApiV1Service = wasabeeApiV1Service;
     _userSettingsService = userSettingsService;
 }
        /// <summary>
        ///     When disposing, actually dipose the store
        /// </summary>
        /// <param name="disposing"></param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                //todo ensure the services are disposed / nulled.

                _settingsService = null;
                _userRepository  = null;
                _disposed        = true;
            }
        }
        public GenericUserService(IUserSettingsService settingsService, IUserRepository <TRepositoryUser, TKey> userRepository, IPasswordHasher passwordHasher, IPasswordValidator passwordValidator, IUserValidator <TServiceUser, TKey> userValidator, IClaimsIndentityService <TServiceUser, TKey> claimsIndentityService)
        {
            _settingsService = settingsService;
            _userRepository  = userRepository;

            _passwordHasher         = passwordHasher;
            _passwordValidator      = passwordValidator;
            _userValidator          = userValidator;
            _claimsIndentityService = claimsIndentityService;
            _userValidator.AllowOnlyAlphanumericUserNames = _settingsService.UsernameOnlyAlphaNumerics;
        }
示例#33
0
        public UserSettingsServiceTests(CustomWebApplicationFactory <TaxFormGeneratorApi.Startup> factory)
        {
            _factory = factory;
            _factory.CreateClient();

            _scope           = _factory.Server.Host.Services.CreateScope();
            _serviceProvider = _scope.ServiceProvider;

            _service = _serviceProvider.GetRequiredService <IUserSettingsService>();
            _userSettingsRepository = _serviceProvider.GetRequiredService <IRepository <UserSettings> >();

            _newUserSettingsDto = new UserSettingsDto
            {
                City = new CitySettingsDto
                {
                    CityName = "Split",
                    CityCode = "fdsfs",
                    CityIban = "HR128888024894203",
                    Surtax   = 0.05
                },
                Company = new CompanySettingsDto
                {
                    CompanyCity   = "Split",
                    CompanyEmail  = "*****@*****.**",
                    CompanyName   = "Best company",
                    CompanyOib    = "654576464",
                    CompanyStreet = "Mazuraniceva 12"
                },
                Dividend = new DividendSettingsDto
                {
                    DividendTax = 0.12
                },
                Personal = new PersonalSettingsDto
                {
                    City         = "Split",
                    PersonalOib  = "5645454343",
                    Postcode     = "21000",
                    StreetName   = "Sukoisanska",
                    StreetNumber = "2"
                },
                Salary = new SalarySettingsDto
                {
                    Amount   = 1000,
                    Currency = "EUR",
                    EmploymentContribution      = 0,
                    HealthInsuranceContribution = 0,
                    NonTaxableAmount            = 3800,
                    PensionPillar1Contribution  = 0,
                    PensionPillar2Contribution  = 0,
                    SalaryTax = 0,
                    WorkSafetyContribution = 0.02
                }
            };
        }
        public WorkAreaViewModel(IEventAggregator eventAggregator, ILayoutEditorPopulationService layoutEditorPopulationService)
            : base(eventAggregator)
        {
            _layoutEditorPopulationService = layoutEditorPopulationService;
            _userSettingsService = ServiceLocator.Current.GetInstance<IUserSettingsService>();

            SaveCommand = new DelegateCommand<SingleLayoutEditor>(OnSaveAndClose);
            CurrentStateChangeCommand = new DelegateCommand<SingleLayoutEditor>(OnUpdateCurrentState);

            //To Delete
            _userLayoutService = ServiceLocator.Current.GetInstance<IUserLayoutService>();
            LoadUserLayoutCommand = new DelegateCommand<LoadUserLayoutModel>(OnLoadUserLayout);
            //End of To Delete

            EventsSubscribe();
            LoadData();
        }
示例#35
0
        //public static void RegisterMe()
        //{
        //    var routes = RouteTable.Routes;

        //    using (routes.GetWriteLock())
        //    {
        //        routes.MapRoute("UserSettingsRoute",
        //          "UserSettings/{action}",
        //          new { controller = "UserSettings", action = "GetIncludeExternal" },
        //          new string[] { "MvcRQUser.UserSettings" });
        //    }
        //}

        /// <summary>
        /// Initialize controller and the settings service
        /// </summary>
        /// <param name="requestContext">Current http request context</param>
        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);

            if (this._settingsService == null) this._settingsService = new UserSettingsService();
        }
示例#36
0
 public AccountController(IUserSettingsService userSettingsService)
     : base(userSettingsService)
 {
 }
示例#37
0
 public SettingsService(IApplicationSettingsService applicationSettings, IUserSettingsService userSettings)
 {
     ApplicationSettings = applicationSettings;
     UserSettings = userSettings;
 }
 public UserLayoutService()
 {
     _messageService = ServiceLocator.Current.GetInstance<IMessageService>();
     _userSettingsService = ServiceLocator.Current.GetInstance<IUserSettingsService>();
 }
示例#39
0
 public AccountController(IUserSettingsService userSettingsService)
 {
     _userSettingsService = userSettingsService;
 }