Beispiel #1
0
        private void Delay(int days)
        {
            DelayForm delay = new DelayForm(_order.OrderId, days);

            delay.ShowDialog(this);
        }
        protected void btnDelay_MouseClick(object sender, MouseEventArgs e)
        {
            int ch_num = int.Parse(((PictureButton)sender).Name.Substring(5, 1));
            int settings_index = 268 + (ch_num - 1);

            DelayConfig cached_delay = (DelayConfig)PROGRAMS[CURRENT_PROGRAM].delays[ch_num - 1].Clone();

            if (e.Button == MouseButtons.Right)
            {
                TempConfig = cached_delay;

                temp_from_ch = ch_num;
                temp_from_index = 0;
                temp_from_preset = CURRENT_PROGRAM;

                ShowCopyMenu(sender);
                return;
            }
            using (DelayForm delayForm = new DelayForm(this, ch_num, settings_index))
            {

                DialogResult showBlock = delayForm.ShowDialog(this);

                if (showBlock == DialogResult.Cancel)
                {

                    if (!PROGRAMS[CURRENT_PROGRAM].delays[ch_num - 1].Equals(cached_delay))
                    {
                        PROGRAMS[CURRENT_PROGRAM].delays[ch_num - 1] = (DelayConfig)cached_delay.Clone();

                        if (LIVE_MODE)
                        {
                            PROGRAMS[CURRENT_PROGRAM].delays[ch_num - 1].QueueChange(this, settings_index);
                        }
                    }

                }
                else
                {
                    UpdateTooltips();
                }

            }
        }