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/UndoRedo/Commands/PenStyleCommand.cs

    r2768 r4068  
    1 using System;
    21using System.Collections.Generic;
    3 using System.Text;
    4 using System.Drawing;
    5 namespace Netron.Diagramming.Core
    6 {
    7     /// <summary>
    8     /// Pen style command
    9     /// </summary>
    10     class PenStyleCommand : Command
    11     {
    12         #region Fields
    13         CollectionBase<IDiagramEntity> bundle;
    14         IController controller;
     2namespace Netron.Diagramming.Core {
     3  /// <summary>
     4  /// Pen style command
     5  /// </summary>
     6  class PenStyleCommand : Command {
     7    #region Fields
     8    CollectionBase<IDiagramEntity> bundle;
     9    IController controller;
    1510
    16         IPenStyle newStyle;
    17         Dictionary<string, IPenStyle> previousStyles = new Dictionary<string, IPenStyle>();           
    18         #endregion
     11    IPenStyle newStyle;
     12    Dictionary<string, IPenStyle> previousStyles = new Dictionary<string, IPenStyle>();
     13    #endregion
    1914
    20         #region Properties
    21        
    22        
     15    #region Properties
    2316
    2417
    25         /// <summary>
    26         /// Gets the entities.
    27         /// </summary>
    28         /// <value>The shape.</value>
    29         public CollectionBase<IDiagramEntity> Entities
    30         {
    31             get { return bundle; }
    32         }
    33 
    34         #endregion
    35 
    36         #region Constructor
    37         /// <summary>
    38         /// Initializes a new instance of the <see cref="T:PenStyleCommand"/> class.
    39         /// </summary>
    40         /// <param name="controller">The controller.</param>
    41         /// <param name="bundle">The bundle.</param>
    42         /// <param name="penStyle">The pen style.</param>
    43         public PenStyleCommand(IController controller, CollectionBase<IDiagramEntity> bundle, IPenStyle penStyle)
    44             : base(controller)
    45         {
    46             this.Text = "Fill style";
    47             this.controller = controller;
    48             this.bundle = bundle;//the bundle should contain only IShape and IConnection entities!
    49             this.newStyle = penStyle;
    50         }
    51         #endregion
    52 
    53         #region Methods
    54 
    55         /// <summary>
    56         /// Perform redo of this command.
    57         /// </summary>
    58         public override void Redo()
    59         {
    60             if (bundle == null || bundle.Count == 0)
    61                 return;
    62             previousStyles.Clear();
    63             foreach (IDiagramEntity entity in bundle)
    64             {
    65                 if (entity is IConnection)
    66                 {
    67                     previousStyles.Add(entity.Uid.ToString(), entity.PenStyle);
    68                     (entity as IConnection).PenStyle  = newStyle;
    69                 }
    70             }
    71         }
    72 
    73         /// <summary>
    74         /// Perform undo of this command.
    75         /// </summary>
    76         public override void Undo()
    77         {
    78             if (bundle == null || bundle.Count == 0)
    79                 return;
    80             foreach (IDiagramEntity entity in bundle)
    81             {
    82                 if (entity is IConnection)
    83                     (entity as IConnection).PenStyle = previousStyles[entity.Uid.ToString()];
    84             }
    85 
    86            
    8718
    8819
     20    /// <summary>
     21    /// Gets the entities.
     22    /// </summary>
     23    /// <value>The shape.</value>
     24    public CollectionBase<IDiagramEntity> Entities {
     25      get { return bundle; }
     26    }
     27
     28    #endregion
     29
     30    #region Constructor
     31    /// <summary>
     32    /// Initializes a new instance of the <see cref="T:PenStyleCommand"/> class.
     33    /// </summary>
     34    /// <param name="controller">The controller.</param>
     35    /// <param name="bundle">The bundle.</param>
     36    /// <param name="penStyle">The pen style.</param>
     37    public PenStyleCommand(IController controller, CollectionBase<IDiagramEntity> bundle, IPenStyle penStyle)
     38      : base(controller) {
     39      this.Text = "Fill style";
     40      this.controller = controller;
     41      this.bundle = bundle;//the bundle should contain only IShape and IConnection entities!
     42      this.newStyle = penStyle;
     43    }
     44    #endregion
     45
     46    #region Methods
     47
     48    /// <summary>
     49    /// Perform redo of this command.
     50    /// </summary>
     51    public override void Redo() {
     52      if (bundle == null || bundle.Count == 0)
     53        return;
     54      previousStyles.Clear();
     55      foreach (IDiagramEntity entity in bundle) {
     56        if (entity is IConnection) {
     57          previousStyles.Add(entity.Uid.ToString(), entity.PenStyle);
     58          (entity as IConnection).PenStyle = newStyle;
    8959        }
     60      }
     61    }
     62
     63    /// <summary>
     64    /// Perform undo of this command.
     65    /// </summary>
     66    public override void Undo() {
     67      if (bundle == null || bundle.Count == 0)
     68        return;
     69      foreach (IDiagramEntity entity in bundle) {
     70        if (entity is IConnection)
     71          (entity as IConnection).PenStyle = previousStyles[entity.Uid.ToString()];
     72      }
    9073
    9174
    92         #endregion
     75
     76
    9377    }
    9478
     79
     80    #endregion
     81  }
     82
    9583}
Note: See TracChangeset for help on using the changeset viewer.