public BadgeElementViewModel(Badge obj) { if (obj == null) { throw new ArgumentNullException("Badge"); } this.Model = obj; }
private static void DrawBadgeElement(Badge badge, XGraphics gfx) { var color = ConverterManager.HexToColorConverter(badge.ForegroundColor); XColor borderColor = new XColor { R = color.R, G = color.G, B = color.B }; color = ConverterManager.HexToColorConverter(badge.BackgroundColor); XColor backColor = new XColor { R = color.R, G = color.G, B = color.B }; color = ConverterManager.HexToColorConverter(badge.FontColor); XColor fontColor = new XColor { R = color.R, G = color.G, B = color.B }; XPen pen = new XPen(borderColor, double.Parse(badge.BorderWidth.ToString())); DrawRectangle(gfx, backColor, borderColor, pen, badge.Width, badge.Height, badge.PositionX1, badge.PositionY1); DrawText(gfx, badge.Value, badge.Font, badge.FontStyle, badge.FontSize, badge.FontColor, badge.Width, badge.Height, badge.PositionX1, badge.PositionY1); }
/// <summary> /// Deprecated Method for adding a new object to the Badges EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBadges(Badge badge) { base.AddObject("Badges", badge); }
/// <summary> /// Create a new Badge object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="badgeTypeId">Initial value of the BadgeTypeId property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="positionX1">Initial value of the PositionX1 property.</param> /// <param name="positionY1">Initial value of the PositionY1 property.</param> /// <param name="width">Initial value of the Width property.</param> /// <param name="height">Initial value of the Height property.</param> /// <param name="roundCorner">Initial value of the RoundCorner property.</param> /// <param name="foregroundColor">Initial value of the ForegroundColor property.</param> /// <param name="backgroundColor">Initial value of the BackgroundColor property.</param> /// <param name="font">Initial value of the Font property.</param> /// <param name="fontColor">Initial value of the FontColor property.</param> /// <param name="fontSize">Initial value of the FontSize property.</param> /// <param name="value">Initial value of the Value property.</param> /// <param name="sourceId">Initial value of the SourceId property.</param> public static Badge CreateBadge(global::System.Guid id, global::System.Guid badgeTypeId, global::System.String name, global::System.Int32 positionX1, global::System.Int32 positionY1, global::System.Int32 width, global::System.Int32 height, global::System.Int32 roundCorner, global::System.String foregroundColor, global::System.String backgroundColor, global::System.String font, global::System.String fontColor, global::System.Int32 fontSize, global::System.String value, global::System.Int32 sourceId) { Badge badge = new Badge(); badge.Id = id; badge.BadgeTypeId = badgeTypeId; badge.Name = name; badge.PositionX1 = positionX1; badge.PositionY1 = positionY1; badge.Width = width; badge.Height = height; badge.RoundCorner = roundCorner; badge.ForegroundColor = foregroundColor; badge.BackgroundColor = backgroundColor; badge.Font = font; badge.FontColor = fontColor; badge.FontSize = fontSize; badge.Value = value; badge.SourceId = sourceId; return badge; }