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); }
private void SelectDirectoryGTA5_Click(object sender, EventArgs e) { if (SelectDirectory.ShowDialog() == DialogResult.OK) { showDirectory.Text = SelectDirectory.SelectedPath; } }
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); }
private void ContentLB_DoubleClick(object sender, EventArgs e) { SelectDirectory?.Invoke(); }