Esempio n. 1
0
 /// <summary>
 /// Allocs the pens and brushes.
 /// </summary>
 private void AllocPensAndBrushes()
 {
     if (borderBrush == null)
     {
         borderBrush = new SolidBrush(Color.Black /*gradientBorderColor*/);
     }
     if (backGradientBrush == null)
     {
         backGradientBrush = new HatchBrush(HatchStyle.DiagonalCross, gradientHatchColor, gradientBackColor);
     }
     if (gradientBrush == null)
     {
         gradientBrush = new LinearGradientBrush2(gradientRect, Blend, LinearGradientMode.Horizontal);
     }
     if (markerBorderPen == null)
     {
         markerBorderPen = new Pen(markerBorderColor, markerBorderSize);
     }
     if (markerFillBrush == null)
     {
         markerFillBrush = new SolidBrush(markerFillColor);
     }
     if (selMarkerFillBrush == null)
     {
         selMarkerFillBrush = new SolidBrush(selMarkerFillColor);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Clears the gradient brush.
 /// </summary>
 private void ClearGradientBrush()
 {
     if (gradientBrush != null)
     {
         gradientBrush.Dispose();
         gradientBrush = null;
     }
 }
 /// <summary>
 /// Redraws this instance.
 /// </summary>
 private void Redraw()
 {
     if (br != null)
     {
         br.Dispose();
         br = null;
     }
     Invalidate(true);
 }
 /// <summary>
 /// Handles the Paint event of the this control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="PaintEventArgs"/> instance containing the event data.</param>
 private void this_Paint(object sender, PaintEventArgs e)
 {
     if (blend != null)
     {
         if (br == null)
         {
             br = new LinearGradientBrush2(this.ClientRectangle, blend, mode);
         }
         br.FillRectangle(e.Graphics, this.ClientRectangle, SystemBrushes.Window);
     }
 }