Esempio n. 1
0
    protected override ObjectInfoArgs GetBorderArgs(Rectangle bounds)
    {
        MyObjectInfoArgs pi = new MyObjectInfoArgs();

        pi.Bounds = bounds;
        return(pi);
    }
Esempio n. 2
0
 protected internal virtual void UpdateProgressInfo(MyObjectInfoArgs info)
 {
     info.Bounds          = ContentRect;
     info.BarColor        = Item.BarColor;
     info.BackgroundColor = Item.Appearance.BackColor;
     info.Percent         = this.Percents;
 }
Esempio n. 3
0
 public override void Reset()
 {
     base.Reset();
     this.progressInfo = CreateInfoArgs();
     this.position     = 0;
     this.percents     = 0;
 }
Esempio n. 4
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);
    }
Esempio n. 5
0
    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;
        }
    }
Esempio n. 6
0
    protected virtual void DrawBar(MyObjectInfoArgs e)
    {
        Brush brush = e.Cache.GetSolidBrush(e.BarColor);

        e.Cache.Paint.FillGradientRectangle(e.Graphics, brush, CalcProgressBounds(e));
    }