private void AddNew_Click(object sender, EventArgs e) { using (var dialog = new AddEndpointDialog(null)) { if (dialog.ShowDialog() != DialogResult.OK) return; Start(SaveEndpoint(dialog.Settings)); } }
private void AddNew_Click(object sender, EventArgs e) { using (var dialog = new AddEndpointDialog(null)) { if (dialog.ShowDialog() != DialogResult.OK) { return; } Start(SaveEndpoint(dialog.Settings)); } }
private IEnumerator<object> EditEndpoint(string endpointName) { EndpointSettings[] endpoints = null; using (var q = Program.Database.BuildQuery("SELECT * FROM jabber.endpoints WHERE name = ?")) yield return q.ExecuteArray<EndpointSettings>(endpointName).Bind(() => endpoints); if ((endpoints == null) || (endpoints.Length == 0)) yield break; using (var dialog = new AddEndpointDialog(endpoints[0])) { if (dialog.ShowDialog() != DialogResult.OK) yield break; yield return SaveEndpoint(dialog.Settings); } }
private IEnumerator <object> EditEndpoint(string endpointName) { EndpointSettings[] endpoints = null; using (var q = Program.Database.BuildQuery("SELECT * FROM jabber.endpoints WHERE name = ?")) yield return(q.ExecuteArray <EndpointSettings>(endpointName).Bind(() => endpoints)); if ((endpoints == null) || (endpoints.Length == 0)) { yield break; } using (var dialog = new AddEndpointDialog(endpoints[0])) { if (dialog.ShowDialog() != DialogResult.OK) { yield break; } yield return(SaveEndpoint(dialog.Settings)); } }