Beispiel #1
0
        //@}

        #region The shadowed Show()
        /// <summary>
        /// The shadowed Show() method.
        /// In order to be compatible with some softwares, we must apply some
        /// extra property to the candidate window to let the canidate window
        /// could be able to be on the top of other windows. For example,
        /// Yahoo! Messanger and Yahoo! Widget may take over the focus and
        /// cover the candidate window.
        /// </summary>
        public new void Show()
        {
            if (base.Visible == true)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(this.Show));
            }
            else
            {
                if (this.m_isSetAlwaysOnTop == false)
                {
                    Win32FunctionHelper.ShowWindowTopMost(base.Handle);
                    this.m_isSetAlwaysOnTop = true;
                }
                base.Visible = true;
            }
        }
Beispiel #2
0
        /// <summary>
        /// The shadowed Show()
        /// </summary>
        public new void Show()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(this.Show));
                return;
            }

            BIServerConnector callback = BIServerConnector.SharedInstance;

            if (callback != null)
            {
                // Get the color schema of the canidate window.
                if (callback.hasLoaderConfigKey("HighlightColor"))
                {
                    string colorString = callback.stringValueForLoaderConfigKey("HighlightColor");
                    if (colorString.Equals("Green"))
                    {
                        this.m_hilightColor    = Color.Green;
                        this.m_hilightEndColor = Color.DarkGreen;
                    }
                    else if (colorString.Equals("Yellow"))
                    {
                        this.m_hilightColor    = Color.Yellow;
                        this.m_hilightEndColor = Color.DarkOrange;
                    }
                    else if (colorString.Equals("Red"))
                    {
                        this.m_hilightColor    = Color.Red;
                        this.m_hilightEndColor = Color.DarkRed;
                    }
                    else if (colorString.StartsWith("Color "))
                    {
                        string aString = colorString.Remove(0, 6);
                        Color  aColor  = Color.FromArgb(Int32.Parse(aString));
                        this.m_hilightColor    = aColor;
                        this.m_hilightEndColor = aColor;
                    }
                    else
                    {
                        this.m_hilightColor    = Color.FromArgb(140, 91, 156);
                        this.m_hilightEndColor = Color.FromArgb(140, 91, 156);
                    }
                }

                if (callback.hasLoaderConfigKey("BackgroundColor"))
                {
                    string colorString = callback.stringValueForLoaderConfigKey("BackgroundColor");
                    if (colorString.Equals("White"))
                    {
                        this.m_backgroundColor = Color.White;
                        this.m_patternColor    = Color.LightGray;
                    }
                    else if (colorString.StartsWith("Color "))
                    {
                        string aString = colorString.Remove(0, 6);
                        Color  aColor  = Color.FromArgb(Int32.Parse(aString));
                        this.m_backgroundColor = aColor;
                        int r = aColor.R - 32;
                        if (r < 0)
                        {
                            r = 0;
                        }
                        int g = aColor.G - 32;
                        if (g < 0)
                        {
                            g = 0;
                        }
                        int b = aColor.B - 32;
                        if (b < 0)
                        {
                            b = 0;
                        }
                        this.m_patternColor = Color.FromArgb(r, g, b);
                    }
                    else
                    {
                        this.m_backgroundColor = Color.Black;
                        this.m_patternColor    = Color.FromArgb(32, 32, 32);
                    }
                }

                if (callback.hasLoaderConfigKey("TextColor"))
                {
                    string colorString = callback.stringValueForLoaderConfigKey("TextColor");
                    if (colorString.Equals("Black"))
                    {
                        this.m_foregroundColor = Color.Black;
                    }
                    else if (colorString.StartsWith("Color "))
                    {
                        string aString = colorString.Remove(0, 6);
                        Color  aColor  = Color.FromArgb(Int32.Parse(aString));
                        this.m_foregroundColor = aColor;
                    }
                    else
                    {
                        this.m_foregroundColor = Color.White;
                    }
                }

                if (callback.hasLoaderConfigKey("BackgroundPattern"))
                {
                    string patternString = callback.stringValueForLoaderConfigKey("BackgroundPattern");
                    if (patternString.Equals("true"))
                    {
                        this.m_usePattern = true;
                    }
                    else
                    {
                        this.m_usePattern = false;
                    }
                }
                else
                {
                    this.m_usePattern = false;
                }
            }

            // The Candidate Window should be always on top.
            Win32FunctionHelper.ShowWindowTopMost(base.Handle);
            base.Visible = true;
        }