Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Utils/Styling/SimpleConnectorPaintStyle.cs @ 2768

Last change on this file since 2768 was 2768, checked in by mkommend, 14 years ago

added solution folders and sources for the netron library (ticket #867)

File size: 2.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Drawing;
5using System.Drawing.Drawing2D;
6
7namespace 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}
Note: See TracBrowser for help on using the repository browser.