Ejemplo n.º 1
0
 private void FormOpenContent_LoadSteps(object sender, EventArgs e)
 {
     this.AddStep(new Search(documentType));
     this.AddStep(new SelectVersionToOpen(documentType.ToString().ToLower()));
     select = new SelectDirectory(application);
     this.AddStep(select);
 }
Ejemplo n.º 2
0
 private void SelectDirectoryGTA5_Click(object sender, EventArgs e)
 {
     if (SelectDirectory.ShowDialog() == DialogResult.OK)
     {
         showDirectory.Text = SelectDirectory.SelectedPath;
     }
 }
Ejemplo n.º 3
0
        public SettingsViewModel(IScreen screen, AppSettingsService?settingsService = null) : base(screen, "settings")
        {
            this.settingsService = settingsService ?? Locator.Current.GetService <AppSettingsService>();

            SavedSettings = this.settingsService.GetSettings();

            SelectDirectory = ReactiveCommand.CreateFromObservable(() => GetDirectory.Handle(SoulstormDirectory));

            SelectDirectory.Where(dir => dir != null)
            .ToPropertyEx(this, x => x.SoulstormDirectory, initialValue: SavedSettings.InstallLocation);

            IObservable <bool> canSave = this.WhenAnyValue(x => x.SoulstormDirectory, x => x.SavedSettings,
                                                           (dir, settings) => !string.Equals(settings.InstallLocation, dir, StringComparison.OrdinalIgnoreCase))
                                         .DistinctUntilChanged();

            SaveSettings = ReactiveCommand.Create(() =>
            {
                SavedSettings = new AppSettings()
                {
                    InstallLocation = SoulstormDirectory
                };
                this.settingsService.SaveSettings(SavedSettings);
            }, canSave);
        }
Ejemplo n.º 4
0
 private void ContentLB_DoubleClick(object sender, EventArgs e)
 {
     SelectDirectory?.Invoke();
 }