1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Drawing.Drawing2D;
|
---|
6 |
|
---|
7 | namespace Netron.Diagramming.Core
|
---|
8 | {
|
---|
9 | public partial class SimpleConnectorPaintStyle : IPaintStyle
|
---|
10 | {
|
---|
11 | // ------------------------------------------------------------------
|
---|
12 | /// <summary>
|
---|
13 | /// Event raised when this paint style is changed.
|
---|
14 | /// </summary>
|
---|
15 | // ------------------------------------------------------------------
|
---|
16 | public event PaintStyleChangedEventHandler PaintStyleChanged;
|
---|
17 |
|
---|
18 | #region Fields
|
---|
19 |
|
---|
20 | // ------------------------------------------------------------------
|
---|
21 | /// <summary>
|
---|
22 | /// Implementation of IVersion - the current version of
|
---|
23 | /// SimpleConnectorPaintStyle.
|
---|
24 | /// </summary>
|
---|
25 | // ------------------------------------------------------------------
|
---|
26 | protected const double simpleConnectorPaintStyleVersion = 1.0;
|
---|
27 |
|
---|
28 | Color mSolidColor = Color.Transparent;
|
---|
29 |
|
---|
30 | #endregion
|
---|
31 |
|
---|
32 | // ------------------------------------------------------------------
|
---|
33 | /// <summary>
|
---|
34 | /// Gets the current version.
|
---|
35 | /// </summary>
|
---|
36 | // ------------------------------------------------------------------
|
---|
37 | public virtual double Version
|
---|
38 | {
|
---|
39 | get
|
---|
40 | {
|
---|
41 | return simpleConnectorPaintStyleVersion;
|
---|
42 | }
|
---|
43 | }
|
---|
44 |
|
---|
45 | // ------------------------------------------------------------------
|
---|
46 | /// <summary>
|
---|
47 | /// Constructor.
|
---|
48 | /// </summary>
|
---|
49 | // ------------------------------------------------------------------
|
---|
50 | public SimpleConnectorPaintStyle()
|
---|
51 | {
|
---|
52 | }
|
---|
53 |
|
---|
54 | #region IPaintStyle Members
|
---|
55 |
|
---|
56 | // ------------------------------------------------------------------
|
---|
57 | /// <summary>
|
---|
58 | /// Returns a brush that has a transparent color.
|
---|
59 | /// </summary>
|
---|
60 | /// <param name="rectangle">Rectangle</param>
|
---|
61 | /// <returns>Brush</returns>
|
---|
62 | // ------------------------------------------------------------------
|
---|
63 | public Brush GetBrush(Rectangle rectangle)
|
---|
64 | {
|
---|
65 | return new SolidBrush(mSolidColor);
|
---|
66 | }
|
---|
67 |
|
---|
68 | #endregion
|
---|
69 |
|
---|
70 | // ------------------------------------------------------------------
|
---|
71 | /// <summary>
|
---|
72 | /// Raises the PaintStyleChanged event.
|
---|
73 | /// </summary>
|
---|
74 | // ------------------------------------------------------------------
|
---|
75 | protected virtual void RaisePaintStyleChanged()
|
---|
76 | {
|
---|
77 | if (this.PaintStyleChanged != null)
|
---|
78 | {
|
---|
79 | // Raise the event
|
---|
80 | this.PaintStyleChanged(
|
---|
81 | this,
|
---|
82 | new PaintStyleChangedEventArgs(
|
---|
83 | this,
|
---|
84 | FillType.LinearGradient));
|
---|
85 | }
|
---|
86 | }
|
---|
87 | }
|
---|
88 | }
|
---|