Esempio n. 1
0
 protected override void Dispose(bool Disposing)
 {
     if (!IsDisposed)
     {
         if (Disposing)
         {
             PCDown.Dispose();
             PCUp.Dispose();
             PCDown = null;
             PCUp   = null;
         }
     }
 }
Esempio n. 2
0
            public override System.Drawing.Bitmap Draw()
            {
                Bitmap   B = new Bitmap(Size.Width * 18 - 2, Size.Height * 18 - 2);
                Graphics G = Graphics.FromImage(B);

                G.DrawImage(Resources.down16, Point.Empty);
                G.DrawImage(Resources.up16, new Point(73, 0));
                G.TextRenderingHint = TextRenderingHint.AntiAlias;
                if (PCDown != null)
                {
                    G.DrawString((PCDown.NextValue() / 1024).ToString("F00") + "KB/s", new System.Drawing.Font("Tahoma", 9), new SolidBrush(Color.FromArgb(COL_TEXT)), new PointF(18, 0));
                    G.DrawString((PCUp.NextValue() / 1024).ToString("F00") + "KB/s", new System.Drawing.Font("Tahoma", 9), new SolidBrush(Color.FromArgb(COL_TEXT)), new PointF(90, 0));
                }
                G.Flush(FlushIntention.Sync);
                G.Dispose();
                return(B);
            }