Esempio n. 1
0
        private void addChannelIntencity_Button_Click(object sender, EventArgs e)
        {
            using (EnterValueForm valueForm = new EnterValueForm(1))
            {
                valueForm.ShowDialog();

                if (valueForm.DialogResult == DialogResult.OK)
                {
                    AddChannelIntencity(valueForm.Value);
                    if (showNotify)
                    {
                        ShowWarning("Подсказка", "Для редактирования пропускной способности канала используйте двойной клик мышью.");
                        showNotify = false;
                    }
                }
            }
        }
Esempio n. 2
0
        private void channelIntencites_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = channelIntencites.IndexFromPoint(e.Location);

            if (index == ListBox.NoMatches)
            {
                return;
            }

            var tmpValue = channelIntencites.Items[channelIntencites.SelectedIndex].ToString();

            using (EnterValueForm valueForm = new EnterValueForm(int.Parse(tmpValue.Substring(3))))
            {
                valueForm.ShowDialog();

                if (valueForm.DialogResult == DialogResult.OK)
                {
                    channelIntencites.Items[channelIntencites.SelectedIndex] = string.Format("{0}. {1}", index + 1, valueForm.Value);
                }
            }
        }