CraftSynth.ImageEditor – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | using System.Windows.Forms; |
||
3 | |||
4 | namespace CraftSynth.ImageEditor |
||
5 | { |
||
6 | /// <summary> |
||
7 | /// Base class for all drawing tools |
||
8 | /// </summary> |
||
9 | internal abstract class Tool:IDisposable |
||
10 | { |
||
11 | /// <summary> |
||
12 | /// Left nous button is pressed |
||
13 | /// </summary> |
||
14 | /// <param name="drawArea"></param> |
||
15 | /// <param name="e"></param> |
||
16 | public virtual void OnMouseDown(DrawArea drawArea, MouseEventArgs e) |
||
17 | { |
||
18 | } |
||
19 | |||
20 | |||
21 | /// <summary> |
||
22 | /// Mouse is moved, left mouse button is pressed or none button is pressed |
||
23 | /// </summary> |
||
24 | /// <param name="drawArea"></param> |
||
25 | /// <param name="e"></param> |
||
26 | public virtual void OnMouseMove(DrawArea drawArea, MouseEventArgs e) |
||
27 | { |
||
28 | } |
||
29 | |||
30 | |||
31 | /// <summary> |
||
32 | /// Left mouse button is released |
||
33 | /// </summary> |
||
34 | /// <param name="drawArea"></param> |
||
35 | /// <param name="e"></param> |
||
36 | public virtual void OnMouseUp(DrawArea drawArea, MouseEventArgs e) |
||
37 | { |
||
38 | } |
||
39 | |||
40 | #region Destruction |
||
41 | public void Dispose() |
||
42 | { |
||
43 | this.Dispose(true); |
||
44 | GC.SuppressFinalize(this); |
||
45 | } |
||
46 | |||
47 | private bool _disposed = false; |
||
48 | |||
49 | protected virtual void Dispose(bool disposing) |
||
50 | { |
||
51 | if (!this._disposed) |
||
52 | { |
||
53 | if (disposing) |
||
54 | { |
||
55 | // Free any managed objects here. |
||
56 | } |
||
57 | |||
58 | // Free any unmanaged objects here. |
||
59 | |||
60 | this._disposed = true; |
||
61 | } |
||
62 | } |
||
63 | |||
64 | ~Tool() |
||
65 | { |
||
66 | this.Dispose(false); |
||
67 | } |
||
68 | #endregion |
||
69 | } |
||
70 | } |