Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Utils/Styling/SolidPaintStyle.cs

    r2768 r4068  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    41using System.Drawing;
    5 using System.Drawing.Drawing2D;
    62
    7 namespace Netron.Diagramming.Core
    8 {
    9     // ----------------------------------------------------------------------
     3namespace Netron.Diagramming.Core {
     4  // ----------------------------------------------------------------------
     5  /// <summary>
     6  /// The solid paint style.
     7  /// </summary>
     8  // ----------------------------------------------------------------------
     9  public partial class SolidPaintStyle : IPaintStyle, IVersion {
     10    // ------------------------------------------------------------------
    1011    /// <summary>
    11     /// The solid paint style.
     12    /// Event raised when this paint style is changed.
    1213    /// </summary>
    13     // ----------------------------------------------------------------------
    14     public partial class SolidPaintStyle : IPaintStyle, IVersion
    15     {
    16         // ------------------------------------------------------------------
    17         /// <summary>
    18         /// Event raised when this paint style is changed.
    19         /// </summary>
    20         // ------------------------------------------------------------------
    21         public event PaintStyleChangedEventHandler PaintStyleChanged;
     14    // ------------------------------------------------------------------
     15    public event PaintStyleChangedEventHandler PaintStyleChanged;
    2216
    23         #region Fields
     17    #region Fields
    2418
    25         // ------------------------------------------------------------------
    26         /// <summary>
    27         /// Implementation of IVersion - the current version of
    28         /// SolidPaintStyle.
    29         /// </summary>
    30         // ------------------------------------------------------------------
    31         protected const double solidPaintStyleVersion = 1.0;
     19    // ------------------------------------------------------------------
     20    /// <summary>
     21    /// Implementation of IVersion - the current version of
     22    /// SolidPaintStyle.
     23    /// </summary>
     24    // ------------------------------------------------------------------
     25    protected const double solidPaintStyleVersion = 1.0;
    3226
    33         // ------------------------------------------------------------------
    34         /// <summary>
    35         /// the SolidColor field
    36         /// </summary>
    37         // ------------------------------------------------------------------
    38         private Color mSolidColor;
     27    // ------------------------------------------------------------------
     28    /// <summary>
     29    /// the SolidColor field
     30    /// </summary>
     31    // ------------------------------------------------------------------
     32    private Color mSolidColor;
    3933
    40         // ------------------------------------------------------------------
    41         /// <summary>
    42         /// the Alpha field
    43         /// </summary>
    44         // ------------------------------------------------------------------
    45         private int mAlpha = 255;
     34    // ------------------------------------------------------------------
     35    /// <summary>
     36    /// the Alpha field
     37    /// </summary>
     38    // ------------------------------------------------------------------
     39    private int mAlpha = 255;
    4640
    47         #endregion
     41    #endregion
    4842
    49         #region Properties
     43    #region Properties
    5044
    51         // ------------------------------------------------------------------
    52         /// <summary>
    53         /// Gets the current version.
    54         /// </summary>
    55         // ------------------------------------------------------------------
    56         public virtual double Version
    57         {
    58             get
    59             {
    60                 return solidPaintStyleVersion;
    61             }
    62         }
     45    // ------------------------------------------------------------------
     46    /// <summary>
     47    /// Gets the current version.
     48    /// </summary>
     49    // ------------------------------------------------------------------
     50    public virtual double Version {
     51      get {
     52        return solidPaintStyleVersion;
     53      }
     54    }
    6355
    64         // ------------------------------------------------------------------
    65         /// <summary>
    66         /// Gets or sets the SolidColor
    67         /// </summary>
    68         // ------------------------------------------------------------------
    69         public Color SolidColor
    70         {
    71             get
    72             {
    73                 return mSolidColor;
    74             }
    75             set
    76             {
    77                 mSolidColor = value;
    78                 RaisePaintStyleChanged();
    79             }
    80         }
     56    // ------------------------------------------------------------------
     57    /// <summary>
     58    /// Gets or sets the SolidColor
     59    /// </summary>
     60    // ------------------------------------------------------------------
     61    public Color SolidColor {
     62      get {
     63        return mSolidColor;
     64      }
     65      set {
     66        mSolidColor = value;
     67        RaisePaintStyleChanged();
     68      }
     69    }
    8170
    82         // ------------------------------------------------------------------
    83         /// <summary>
    84         /// Gets or sets the Alpha
    85         /// </summary>
    86         // ------------------------------------------------------------------
    87         public int Alpha
    88         {
    89             get
    90             {
    91                 return mAlpha;
    92             }
    93             set
    94             {
    95                 mAlpha = value;
    96                 RaisePaintStyleChanged();
    97             }
    98         }
     71    // ------------------------------------------------------------------
     72    /// <summary>
     73    /// Gets or sets the Alpha
     74    /// </summary>
     75    // ------------------------------------------------------------------
     76    public int Alpha {
     77      get {
     78        return mAlpha;
     79      }
     80      set {
     81        mAlpha = value;
     82        RaisePaintStyleChanged();
     83      }
     84    }
    9985
    100         #endregion
     86    #endregion
    10187
    102         #region Constructor
     88    #region Constructor
    10389
    104         // ------------------------------------------------------------------
    105         ///<summary>
    106         ///Default constructor.
    107         ///</summary>
    108         // ------------------------------------------------------------------
    109         public SolidPaintStyle(Color color)
    110         {
    111             mSolidColor = color;
    112         }
     90    // ------------------------------------------------------------------
     91    ///<summary>
     92    ///Default constructor.
     93    ///</summary>
     94    // ------------------------------------------------------------------
     95    public SolidPaintStyle(Color color) {
     96      mSolidColor = color;
     97    }
    11398
    114         // ------------------------------------------------------------------
    115         /// <summary>
    116         /// Initializes a new instance of the
    117         /// <see cref="T:SolidPaintStyle"/> class.
    118         /// </summary>
    119         // ------------------------------------------------------------------
    120         public SolidPaintStyle()
    121         {
    122             mSolidColor = ArtPalette.RandomLowSaturationColor;
    123         }
     99    // ------------------------------------------------------------------
     100    /// <summary>
     101    /// Initializes a new instance of the
     102    /// <see cref="T:SolidPaintStyle"/> class.
     103    /// </summary>
     104    // ------------------------------------------------------------------
     105    public SolidPaintStyle() {
     106      mSolidColor = ArtPalette.RandomLowSaturationColor;
     107    }
    124108
    125         #endregion
     109    #endregion
    126110
    127         // ------------------------------------------------------------------
    128         /// <summary>
    129         /// Gets the brush with which an entity can fe painted.
    130         /// </summary>
    131         /// <param name="rectangle">Rectangle: The rectangle.</param>
    132         /// <returns>Brush</returns>
    133         // ------------------------------------------------------------------
    134         public Brush GetBrush(Rectangle rectangle)
    135         {
    136             return new SolidBrush(Color.FromArgb(mAlpha, mSolidColor));
    137         }
     111    // ------------------------------------------------------------------
     112    /// <summary>
     113    /// Gets the brush with which an entity can fe painted.
     114    /// </summary>
     115    /// <param name="rectangle">Rectangle: The rectangle.</param>
     116    /// <returns>Brush</returns>
     117    // ------------------------------------------------------------------
     118    public Brush GetBrush(Rectangle rectangle) {
     119      return new SolidBrush(Color.FromArgb(mAlpha, mSolidColor));
     120    }
    138121
    139         // ------------------------------------------------------------------
    140         /// <summary>
    141         /// Raises the PaintStyleChanged event.
    142         /// </summary>
    143         // ------------------------------------------------------------------
    144         protected virtual void RaisePaintStyleChanged()
    145         {
    146             if (this.PaintStyleChanged != null)
    147             {
    148                 // Raise the event
    149                 this.PaintStyleChanged(
    150                     this,
    151                     new PaintStyleChangedEventArgs(this, FillType.Solid));
    152             }
    153         }
     122    // ------------------------------------------------------------------
     123    /// <summary>
     124    /// Raises the PaintStyleChanged event.
     125    /// </summary>
     126    // ------------------------------------------------------------------
     127    protected virtual void RaisePaintStyleChanged() {
     128      if (this.PaintStyleChanged != null) {
     129        // Raise the event
     130        this.PaintStyleChanged(
     131            this,
     132            new PaintStyleChangedEventArgs(this, FillType.Solid));
     133      }
    154134    }
     135  }
    155136}
Note: See TracChangeset for help on using the changeset viewer.