Ejemplo n.º 1
0
        /// <summary>
        /// Decides whether or not to have opacity be enabled.
        /// </summary>
        private void DecideOpacitySetting()
        {
            if (UserSessions.IsRemote() || !PdnBaseForm.globalEnableOpacity || !this.EnableInstanceOpacity)
            {
                if (this.enableOpacity)
                {
                    try
                    {
                        UI.SetFormOpacity(this, 1.0);
                    }

                    // This fails in certain odd situations (bug #746), so we just eat the exception.
                    catch (System.ComponentModel.Win32Exception)
                    {
                    }
                }

                this.enableOpacity = false;
            }
            else
            {
                if (!this.enableOpacity)
                {
                    // This fails in certain odd situations (bug #746), so we just eat the exception.
                    try
                    {
                        UI.SetFormOpacity(this, this.ourOpacity);
                    }

                    catch (System.ComponentModel.Win32Exception)
                    {
                    }
                }

                this.enableOpacity = true;
            }
        }