protected override void OnPaint(PaintEventArgs e)
 {
     using (e)
     {
         ProgressBarRenderEventArgs args = new ProgressBarRenderEventArgs(e.Graphics, this);
         this.FRenderer.DrawBackground(args);
         if (base.Style == ProgressBarStyle.Marquee)
         {
             ProgressBarMarqueeRenderEventArgs args2 = new ProgressBarMarqueeRenderEventArgs(e.Graphics, this, this.MarqueeTag);
             this.FRenderer.DrawMarquee(args2);
         }
         else
         {
             ProgressBarValueRenderEventArgs args3 = new ProgressBarValueRenderEventArgs(e.Graphics, this);
             this.FRenderer.DrawBarValue(args3);
         }
     }
 }
 public void DrawMarquee(ProgressBarMarqueeRenderEventArgs e)
 {
     e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
     e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
     int position = (e.MarqueeTag is int) ? ((int) e.MarqueeTag) : -120;
     this.DrawMarquee(e.Graphics, e.Bounds, position);
     this.DrawBarHighlight(e.Graphics, e.Bounds);
     this.DrawInnerStroke(e.Graphics, e.Bounds);
     this.DrawOuterStroke(e.Graphics, e.Bounds);
 }
 public void DrawMarquee(ProgressBarMarqueeRenderEventArgs e)
 {
     int num2;
     int num3;
     int num = e.Bounds.Width - 7;
     MarqueeData marqueeData = this.GetMarqueeData(e.MarqueeTag);
     if (marqueeData.StartChunk < 0)
     {
         num2 = 0;
         num3 = (this.MarqueeChunks + Math.Max(-this.MarqueeChunks, marqueeData.StartChunk)) * this.ChunkWidth;
     }
     else
     {
         num2 = marqueeData.StartChunk * this.ChunkWidth;
         num3 = this.ChunkWidth * this.MarqueeChunks;
     }
     if ((num2 + num3) > num)
     {
         num3 = num - num2;
     }
     Rectangle rect = new Rectangle((e.Bounds.Left + 3) + num2, e.Bounds.Top + 2, num3, e.Bounds.Bottom - 4);
     if (rect.Width > 0)
     {
         using (LinearGradientBrush brush = new LinearGradientBrush(rect, this.BarBackgroundColor, this.BarColor, 90f))
         {
             brush.Blend = this.BarBlend;
             e.Graphics.FillRectangle(brush, rect);
         }
         using (Pen pen = new Pen(this.BarBackgroundColor, 2f))
         {
             for (int i = 0; (i < this.MarqueeChunks) && ((num2 + (this.ChunkWidth * i)) < num); i++)
             {
                 int num5 = ((e.Bounds.Left + num2) + (this.ChunkWidth * i)) + 3;
                 e.Graphics.DrawLine(pen, num5, e.Bounds.Top + 2, num5, e.Bounds.Bottom - 2);
             }
         }
     }
 }