Exemplo n.º 1
0
        public void AddTooltip(string title, string text, Color titleColor, Color textColor)
        {
            title = title ?? String.Empty;
            text  = text ?? String.Empty;

            if (titleColor.IsEmpty || titleColor == Color.Transparent)
            {
                titleColor = Color.Yellow;
            }

            if (textColor.IsEmpty || textColor == Color.Transparent)
            {
                textColor = Color.White;
            }

            Spoof spoof;

            if (!_TextTooltips.TryGetValue(text, out spoof) || spoof == null || spoof.Deleted)
            {
                spoof = Spoof.Acquire();
            }

            if (!String.IsNullOrWhiteSpace(title))
            {
                spoof.Text = String.Concat(title.WrapUOHtmlColor(titleColor, false), '\n', text.WrapUOHtmlColor(textColor, false));
            }
            else
            {
                spoof.Text = text.WrapUOHtmlColor(textColor, false);
            }

            AddProperties(spoof);
        }
Exemplo n.º 2
0
        public void AddTooltip(int[] clilocs, string[] args)
        {
            Dictionary<int, string> dictionary = new Dictionary<int, string>();
            int emptyIndex = 0;

            for (int i = 0; i < clilocs.Length; i++)
            {
                string str = String.Empty;

                if (i < args.Length)
                {
                    str = args[i] ?? String.Empty;
                }

                int cliloc = clilocs[i];

                if (cliloc <= 0)
                {
                    if (emptyIndex <= Spoof.EmptyClilocs.Length)
                    {
                        cliloc = Spoof.EmptyClilocs[emptyIndex];
                        emptyIndex++;
                    }
                }

                if (cliloc > 0)
                {
                    dictionary[cliloc] = str;
                }
            }

            Spoof spoof;

            if (!_ClilocTooltips.TryGetValue(dictionary, out spoof) || spoof == null || spoof.Deleted)
            {
                spoof = Spoof.Acquire();
            }

            spoof.ClilocTable = dictionary;

            _ClilocTooltips[dictionary] = spoof;
            AddProperties(spoof);
        }
Exemplo n.º 3
0
        public void AddTooltip(string title, string text, System.Drawing.Color titleColor, System.Drawing.Color textColor)
        {
            title = title ?? String.Empty;
            text = text ?? String.Empty;

            if (titleColor.IsEmpty || titleColor == System.Drawing.Color.Transparent)
            {
                titleColor = System.Drawing.Color.White;
            }

            if (textColor.IsEmpty || textColor == System.Drawing.Color.Transparent)
            {
                textColor = System.Drawing.Color.White;
            }

            Spoof spoof;

            if (!_TextTooltips.TryGetValue(text, out spoof) || spoof == null || spoof.Deleted)
            {
                spoof = Spoof.Acquire();
            }

            if (!String.IsNullOrWhiteSpace(title))
            {
                spoof.Text = String.Concat(String.Format("<basefont color=#{0:X}>{1}", titleColor.ToArgb(), title),
                            '\n',
                            String.Format("<basefont color=#{0:X}>{1}", textColor.ToArgb(), text));
            }
            else
            {
                spoof.Text = String.Format("<basefont color=#{0:X}>{1}", textColor.ToArgb(), text); //  text.WrapUOHtmlColor(textColor, false);
            }

            _TextTooltips[text] = spoof;
            AddProperties(spoof);
        }