Ejemplo n.º 1
0
        /// <summary>
        /// Initalizes and shows all the parts of our overlay
        /// </summary>
        internal void ShowPad()
        {
            // If the forms are uninitalized, set them up
            if (isBasicHidden.Equals(MsoTriState.msoCTrue))
            {
                // this does not actually show the window, it just initializes it. Misleading! TODO FIXME fix name
                InitBasic();
                basicform.Disposed += new EventHandler(basicform_Disposed);
            }
            if (isButtonHidden.Equals(MsoTriState.msoCTrue))
            {
                // this does not actually show the window, it just initializes it. Misleading! TODO FIXME fix name
                InitButton();
                buttonform.Disposed += new EventHandler(buttonform_Disposed);
            }

            // Actually show the forms

            if (basicform.Visible == false || buttonform.Visible == false)
            {
                try
                {
                    buttonform.Show();
                    basicform.Show();
                    cornerform.Show();
                }
                catch (Exception e)
                {
                    System.Windows.Forms.MessageBox.Show(e.ToString());
                }
            }
            else
            {
                buttonform.Hide();
                basicform.Hide();
                cornerform.Hide();
            }

            // initialize all the members to let the forms talk to one another
            pptController.myButton = buttonform;
            pptController.myForm   = basicform;
            basicform.buttonForm   = buttonform;
            buttonform.myBasicForm = basicform;
            cornerform.buttonform  = buttonform;

            basicform.Activate();
        }