Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/ConnectionInfo.cs

    r4068 r4722  
    2828  [StorableClass]
    2929  public class ConnectionInfo : DeepCloneable, IConnectionInfo {
    30     private ConnectionInfo() {
     30    [StorableConstructor]
     31    protected ConnectionInfo(bool deserializing) : base() { }
     32    protected ConnectionInfo(ConnectionInfo original, Cloner cloner)
     33      : base(original, cloner) {
     34      from = cloner.Clone(original.from);
     35      connectorFrom = original.ConnectorFrom;
     36      to = cloner.Clone(original.To);
     37      connectorTo = original.ConnectorTo;
     38    }
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new ConnectionInfo(this, cloner);
    3141    }
    3242    public ConnectionInfo(IShapeInfo from, string connectorFrom, IShapeInfo to, string connectorTo)
    33       : this() {
     43      : base() {
    3444      if (from == to)
    3545        throw new ArgumentException("Could not create connections between the same shape info.");
     
    7080    protected virtual void OnChanged() {
    7181      EventHandler handler = this.Changed;
    72       if (handler != null)
    73         this.Changed(this, EventArgs.Empty);
    74     }
    75 
    76     public override IDeepCloneable Clone(Cloner cloner) {
    77       ConnectionInfo clone = (ConnectionInfo)base.Clone(cloner);
    78       clone.from = (IShapeInfo)cloner.Clone(this.from);
    79       clone.connectorFrom = this.ConnectorFrom;
    80       clone.to = (IShapeInfo)cloner.Clone(this.To);
    81       clone.connectorTo = this.ConnectorTo;
    82       return clone;
     82      if (handler != null) this.Changed(this, EventArgs.Empty);
    8383    }
    8484  }
Note: See TracChangeset for help on using the changeset viewer.