public void WithList(IList <string> values) { Observable.Return(values) .Select(_ => new SlotSelectionForm()) .SelectMany(popup => Observable.Return(popup.ShowDialog()) .Where(result => result == DialogResult.OK) .Do(result => CreationRequested?.Invoke(this))) .Subscribe(); }
private void Add() { if (_adapter != null && _adapter.Client != null) { try { buttonAdd.Enabled = false; buttonTest.Enabled = false; Repository repo = _adapter.Client.Repositories.Get(textBoxName.Text, textBoxRepo.Text).Result; _adapter.Repositories.Add(repo); CreationRequested?.Invoke(); } catch (Exception) { labelStatus.Text = "Failled"; buttonAdd.Enabled = true; buttonTest.Enabled = true; } } }