예제 #1
0
        public override void Draw(CGRect rect)
        {
            var context = UIGraphics.GetCurrentContext();

            context.SaveState();

            BackgroundColor.SetColor();
            context.FillRect(rect);
            context.RestoreState();
            context.SaveState();

            context.BeginPath();
            context.MoveTo(0, rect.Size.Height);
            context.SetStrokeColor(DefaultStrokeColor.CGColor);
            context.SetLineWidth(1);
            context.AddLineToPoint(rect.Size.Width, rect.Size.Height);
            context.StrokePath();
            context.RestoreState();
            context.SaveState();

            CGSize descriptionLabelSize = MessageSize();

            if (HasMessage)
            {
                MessageTextColor.SetColor();

                var descriptionRectangle = new CGRect(
                    PADDING,
                    PADDING,
                    descriptionLabelSize.Width,
                    descriptionLabelSize.Height);

                Message.DrawString(
                    descriptionRectangle,
                    MessageFont,
                    UILineBreakMode.TailTruncation,
                    UITextAlignment.Left);
            }
        }
예제 #2
0
 /// <summary>
 /// Set the background to a specific color and fillstyle
 /// </summary>
 /// <param name="color">The theme color</param>
 /// <param name="fillStyle">The fillstyle. Default Solid</param>
 public void SetBackground(eThemeSchemeColor color, ExcelFillStyle fillStyle = ExcelFillStyle.Solid)
 {
     PatternType = fillStyle;
     BackgroundColor.SetColor(color);
 }
예제 #3
0
 /// <summary>
 /// Set the background to a specific color and fillstyle
 /// </summary>
 /// <param name="color">The indexed color</param>
 /// <param name="fillStyle">The fillstyle. Default Solid</param>
 public void SetBackground(ExcelIndexedColor color, ExcelFillStyle fillStyle = ExcelFillStyle.Solid)
 {
     PatternType = fillStyle;
     BackgroundColor.SetColor(color);
 }