- Timestamp:
- 10/29/10 17:38:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Core/3.3/NamedItem.cs
r4477 r4668 66 66 } 67 67 68 [StorableConstructor] 69 protected NamedItem(bool deserializing) : base(deserializing) { } 70 protected NamedItem(NamedItem original, Cloner cloner) 71 : base(original, cloner) { 72 name = original.name; 73 description = original.description; 74 } 68 75 /// <summary> 69 76 /// Initializes a new instance of <see cref="Variable"/> with name <c>Anonymous</c> … … 91 98 else this.description = description; 92 99 } 93 [StorableConstructor]94 protected NamedItem(bool deserializing) : base(deserializing) { }95 96 /// <summary>97 /// Clones the current instance (deep clone).98 /// </summary>99 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>100 /// <returns>The cloned object as <see cref="Variable"/>.</returns>101 public override IDeepCloneable Clone(Cloner cloner) {102 NamedItem clone = (NamedItem)base.Clone(cloner);103 clone.name = name;104 clone.description = description;105 return clone;106 }107 100 108 101 /// <summary> … … 121 114 /// <param name="e">The event arguments of the changing.</param> 122 115 protected virtual void OnNameChanging(CancelEventArgs<string> e) { 123 if (NameChanging != null)124 NameChanging(this, e);116 var handler = NameChanging; 117 if (handler != null) handler(this, e); 125 118 } 126 119 /// <inheritdoc/> … … 131 124 /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks> 132 125 protected virtual void OnNameChanged() { 133 if (NameChanged != null)134 NameChanged(this, EventArgs.Empty);126 var handler = NameChanged; 127 if (handler != null) handler(this, EventArgs.Empty); 135 128 OnToStringChanged(); 136 129 } … … 142 135 /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks> 143 136 protected virtual void OnDescriptionChanged() { 144 if (DescriptionChanged != null)145 DescriptionChanged(this, EventArgs.Empty);137 var handler = DescriptionChanged; 138 if (handler != null) handler(this, EventArgs.Empty); 146 139 } 147 140 }
Note: See TracChangeset
for help on using the changeset viewer.