Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
        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;
        }
Exemple #4
0
        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;
        }
Exemple #5
0
        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;
        }
Exemple #6
0
        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;
        }