Exemplo n.º 1
0
 public static Size DrawHelpTip(Control control, Graphics graphics, Font font, string countMessage, string basicDescription, string documentation)
 {
     if (TipPainterTools.IsVisibleText(countMessage) || TipPainterTools.IsVisibleText(basicDescription) || TipPainterTools.IsVisibleText(documentation))
     {
         CountTipText countTipText = new CountTipText(graphics, font, countMessage);
         TipSpacer    tipSpacer    = new TipSpacer(graphics, new SizeF((float)(TipPainterTools.IsVisibleText(countMessage) ? 4 : 0), 0f));
         TipText      tipText      = new TipText(graphics, font, basicDescription);
         TipSpacer    tipSpacer2   = new TipSpacer(graphics, new SizeF(0f, (float)(TipPainterTools.IsVisibleText(documentation) ? 4 : 0)));
         TipText      tipText2     = new TipText(graphics, font, documentation);
         TipSplitter  tipSplitter  = new TipSplitter(graphics, false, new TipSection[]
         {
             tipText,
             tipSpacer2
         });
         TipSplitter tipSplitter2 = new TipSplitter(graphics, true, new TipSection[]
         {
             countTipText,
             tipSpacer,
             tipSplitter
         });
         TipSplitter tipData = new TipSplitter(graphics, false, new TipSection[]
         {
             tipSplitter2,
             tipText2
         });
         Size result = TipPainter.DrawTip(control, graphics, tipData);
         TipPainterTools.DrawingRectangle1 = countTipText.DrawingRectangle1;
         TipPainterTools.DrawingRectangle2 = countTipText.DrawingRectangle2;
         return(result);
     }
     return(Size.Empty);
 }
Exemplo n.º 2
0
        public static Size DrawHelpTipFromCombinedDescription(Control control, Graphics graphics, Font font, string countMessage, string description)
        {
            string basicDescription = null;
            string documentation    = null;

            if (TipPainterTools.IsVisibleText(description))
            {
                string[] array = description.Split(new char[]
                {
                    '\n'
                }, 2);
                if (array.Length > 0)
                {
                    basicDescription = array[0];
                    if (array.Length > 1)
                    {
                        documentation = array[1].Trim();
                    }
                }
            }
            return(TipPainterTools.DrawHelpTip(control, graphics, font, countMessage, basicDescription, documentation));
        }