private void bEditChannelName_Click(object sender, EventArgs e) { var dlg = new frmStringQuery { Text = "Новое имя канала", tbString = { Text = webhookDescController.Current.Name } }; if (dlg.ShowDialog(this) == DialogResult.OK) { webhookDescController.Current.Name = dlg.tbString.Text; } }
private void bEditName_Click(object sender, EventArgs e) { var dlg = new frmStringQuery { Text = "Новое имя пресета", tbString = { Text = presetsController.Current.Name } }; if (dlg.ShowDialog(this) == DialogResult.OK) { presetsController.Current.Name = dlg.tbString.Text; } }
private void bCreateChannel_Click(object sender, EventArgs e) { var dlg = new frmStringQuery { Text = "Имя нового канала", tbString = { Text = webhookDescController.FindNameFor("#general") } }; if (dlg.ShowDialog(this) != DialogResult.OK) { return; } var cur = new WebhookDesc { Name = dlg.tbString.Text }; webhookDescController.Add(cur); webhookDescController.Current = cur; }
private void bCreatePreset_Click(object sender, EventArgs e) { var dlg = new frmStringQuery { Text = "Имя нового пресета", tbString = { Text = presetsController.FindNameFor("Заготовка") } }; if (dlg.ShowDialog(this) != DialogResult.OK) { return; } var cur = new Preset { Name = dlg.tbString.Text }; presetsController.Add(cur); presetsController.Current = cur; }
private void bDuplicatePreset_Click(object sender, EventArgs e) { if (presetsController.Current == null) { return; } var dlg = new frmStringQuery { Text = "Новое имя пресета", tbString = { Text = presetsController.FindNameFor(presetsController.Current.Name) } }; if (dlg.ShowDialog(this) != DialogResult.OK) { return; } var preset = JsonConvert.DeserializeObject <Preset>(JsonConvert.SerializeObject(presetsController.Current)); preset.Name = dlg.tbString.Text; presetsController.Add(preset); presetsController.Current = preset; }
private void bDuplicateChannel_Click(object sender, EventArgs e) { if (webhookDescController.Current == null) { return; } var dlg = new frmStringQuery { Text = "Новое имя канала", tbString = { Text = webhookDescController.FindNameFor(webhookDescController.Current.Name) } }; if (dlg.ShowDialog(this) != DialogResult.OK) { return; } var webhook = JsonConvert.DeserializeObject <WebhookDesc>(JsonConvert.SerializeObject(webhookDescController.Current)); webhook.Name = dlg.tbString.Text; webhookDescController.Add(webhook); webhookDescController.Current = webhook; }