Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (13 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.Data/3.3/StringMatrix.cs

    r3431 r4722  
    134134    }
    135135
     136    [StorableConstructor]
     137    protected StringMatrix(bool deserializing) : base(deserializing) { }
     138    protected StringMatrix(StringMatrix original, Cloner cloner)
     139      : base(original, cloner) {
     140      this.matrix = (string[,])original.matrix.Clone();
     141      this.columnNames = new List<string>(original.columnNames);
     142      this.rowNames = new List<string>(original.rowNames);
     143      this.sortableView = original.sortableView;
     144      this.readOnly = original.readOnly;
     145    }
    136146    public StringMatrix() {
    137147      matrix = new string[0, 0];
     
    182192
    183193    public override IDeepCloneable Clone(Cloner cloner) {
    184       StringMatrix clone = new StringMatrix();
    185       cloner.RegisterClonedObject(this, clone);
    186       clone.matrix = (string[,])matrix.Clone();
    187       clone.columnNames = new List<string>(columnNames);
    188       clone.rowNames = new List<string>(rowNames);
    189       clone.sortableView = sortableView;
    190       clone.readOnly = readOnly;
    191       return clone;
     194      return new StringMatrix(this, cloner);
    192195    }
    193196
Note: See TracChangeset for help on using the changeset viewer.