Beispiel #1
0
        /// <summary>
        /// Button pressed
        /// </summary>
        private void OnButtonDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            Button b = sender as Button;

            if (m_SelectingDecoLight)
            {
                int index = 0;

                for (int i = 0; i < 10; i++)
                {
                    if (m_Buttons[i] == b)
                    {
                        index = i;
                        break;
                    }
                }

                Pandora.Profile.Deco.Light = Pandora.Lights.Names[index];
                lnkDecoLight.Text          = Pandora.Lights.Names[index];
            }
            else
            {
                CommandCallback callback = b.Tag as CommandCallback;

                callback.DynamicInvoke(new object[] { null });
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles the selection of a specific modifier
        /// </summary>
        private static void OnModifierMenu(object sender, EventArgs e)
        {
            if (m_cmModifiers.SourceControl.Tag != null)
            {
                CommandCallback callback = m_cmModifiers.SourceControl.Tag as CommandCallback;

                if (callback != null)
                {
                    MenuItem mi = sender as MenuItem;

                    int index = m_cmModifiers.MenuItems.IndexOf(mi);

                    if (Pandora.Profile.General.ModifiersWarnings[index])
                    {
                        if (MessageBox.Show(Pandora.BoxForm as Form,
                                            string.Format(Pandora.Localization.TextProvider["Errors.ModifierWarn"], mi.Text),
                                            "",
                                            MessageBoxButtons.YesNo) == DialogResult.No)
                        {
                            return;
                        }
                    }

                    // Do
                    callback.DynamicInvoke(new object[] { mi.Text });
                }
            }
        }