protected override ObjectInfoArgs GetBorderArgs(Rectangle bounds) { MyObjectInfoArgs pi = new MyObjectInfoArgs(); pi.Bounds = bounds; return(pi); }
protected internal virtual void UpdateProgressInfo(MyObjectInfoArgs info) { info.Bounds = ContentRect; info.BarColor = Item.BarColor; info.BackgroundColor = Item.Appearance.BackColor; info.Percent = this.Percents; }
public override void Reset() { base.Reset(); this.progressInfo = CreateInfoArgs(); this.position = 0; this.percents = 0; }
protected virtual Rectangle CalcProgressBounds(MyObjectInfoArgs e) { Rectangle r = e.Bounds; if (e.Percent < 1) { Size size = r.Size; r.Width = Math.Min(Convert.ToInt32(e.Percent * (float)(size.Width)), size.Width); } return(r); }
public void DrawObject(GraphicsCache cache, ObjectInfoArgs e) { if (e == null) { return; } MyObjectInfoArgs ee = e as MyObjectInfoArgs; GraphicsCache prev = e.Cache; e.Cache = cache; try { e.Cache.Paint.FillRectangle(e.Graphics, new SolidBrush(ee.BackgroundColor), e.Bounds); DrawBar(ee); } finally { e.Cache = prev; } }
protected virtual void DrawBar(MyObjectInfoArgs e) { Brush brush = e.Cache.GetSolidBrush(e.BarColor); e.Cache.Paint.FillGradientRectangle(e.Graphics, brush, CalcProgressBounds(e)); }