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/AddShapeCommand.cs

    r2768 r4068  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    42using System.Drawing;
    5 namespace Netron.Diagramming.Core
    6 {
    7     /// <summary>
    8     /// ICommand implementation of the AddShape action
    9     /// </summary>
    10     public class AddShapeCommand : Command
    11     {
    12         #region Fields
    13         IShape shape;       
    14         Point location;
    15         #endregion
     3namespace Netron.Diagramming.Core {
     4  /// <summary>
     5  /// ICommand implementation of the AddShape action
     6  /// </summary>
     7  public class AddShapeCommand : Command {
     8    #region Fields
     9    IShape shape;
     10    Point location;
     11    #endregion
    1612
    17         #region Properties
    18         public IShape Shape
    19         {
    20             get { return shape; }
    21         }
    22         #endregion
     13    #region Properties
     14    public IShape Shape {
     15      get { return shape; }
     16    }
     17    #endregion
    2318
    2419
    2520
    26         #region Methods
    27         /// <summary>
    28         /// Initializes a new instance of the <see cref="T:AddShapeCommand"/> class.
    29         /// </summary>
    30         /// <param name="controller">The controller.</param>
    31         /// <param name="shape">The shape.</param>
    32         /// <param name="location">The location.</param>
    33         public AddShapeCommand(
    34             IController controller,
    35             IShape shape,
    36             Point location) :base(controller)
    37         {
    38             if (shape == null)
    39                 throw new ArgumentNullException("The shape is 'null' and cannot be inserted.");           
    40             this.Text = "Add " + shape.EntityName;         
     21    #region Methods
     22    /// <summary>
     23    /// Initializes a new instance of the <see cref="T:AddShapeCommand"/> class.
     24    /// </summary>
     25    /// <param name="controller">The controller.</param>
     26    /// <param name="shape">The shape.</param>
     27    /// <param name="location">The location.</param>
     28    public AddShapeCommand(
     29        IController controller,
     30        IShape shape,
     31        Point location)
     32      : base(controller) {
     33      if (shape == null)
     34        throw new ArgumentNullException("The shape is 'null' and cannot be inserted.");
     35      this.Text = "Add " + shape.EntityName;
    4136
    42             this.location = location;
    43             this.shape = shape;
    44         }
     37      this.location = location;
     38      this.shape = shape;
     39    }
    4540
    46         /// <summary>
    47         /// Perform redo of this command.
    48         /// </summary>
    49         public override void Redo()
    50         {
    51             Controller.Model.AddShape(shape);
    52            
    53             shape.Transform(location.X, location.Y, shape.Width, shape.Height);
    54             Rectangle rec = shape.Rectangle;
    55             rec.Inflate(20, 20);
    56             Controller.View.Invalidate(rec);           
    57         }
     41    /// <summary>
     42    /// Perform redo of this command.
     43    /// </summary>
     44    public override void Redo() {
     45      Controller.Model.AddShape(shape);
    5846
    59         /// <summary>
    60         /// Perform undo of this command.
    61         /// </summary>
    62         public override void Undo()
    63         {
    64             Rectangle rec = shape.Rectangle;
    65             rec.Inflate(20, 20);
    66             Controller.Model.RemoveShape(shape);
     47      shape.Transform(location.X, location.Y, shape.Width, shape.Height);
     48      Rectangle rec = shape.Rectangle;
     49      rec.Inflate(20, 20);
     50      Controller.View.Invalidate(rec);
     51    }
    6752
    68             Controller.View.Invalidate(rec);
     53    /// <summary>
     54    /// Perform undo of this command.
     55    /// </summary>
     56    public override void Undo() {
     57      Rectangle rec = shape.Rectangle;
     58      rec.Inflate(20, 20);
     59      Controller.Model.RemoveShape(shape);
    6960
    70         }
    71 
    72         #endregion
     61      Controller.View.Invalidate(rec);
    7362
    7463    }
    7564
     65    #endregion
     66
     67  }
     68
    7669}
Note: See TracChangeset for help on using the changeset viewer.