root/plot/Pybrary.Plot/PenDescription.cs

Revision 746, 1.0 kB (checked in by mfenniak, 2 years ago)

--

Line 
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Drawing;
5
6 namespace Pybrary.Plot
7 {
8     public delegate void PenDescriptionChangedHandler();
9
10     public class PenDescription
11     {
12         public event PenDescriptionChangedHandler OnPenDescriptionChanged;
13
14         private Color color;
15         private float width;
16
17         public PenDescription(Color color, float width)
18         {
19             this.color = color;
20             this.width = width;
21         }
22
23         public Color Color
24         {
25             get
26             {
27                 return color;
28             }
29             set
30             {
31                 color = value;
32                 raiseChanged();
33             }
34         }
35
36         public Pen CreatePen()
37         {
38             return new Pen(color, width);
39         }
40
41         private void raiseChanged()
42         {
43             PenDescriptionChangedHandler tmp = OnPenDescriptionChanged;
44             if (tmp != null)
45                 tmp();
46         }
47     }
48 }
Note: See TracBrowser for help on using the browser.