Changeset 2663 for trunk/sources/HeuristicLab.Data/3.3/IntData.cs
- Timestamp:
- 01/21/10 01:31:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/IntData.cs
r2526 r2663 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using System.Globalization;28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 28 30 29 namespace HeuristicLab.Data { 31 /// <summary>32 /// The representation of an int value.33 /// </summary>34 30 [EmptyStorableClass] 35 public class IntData : ObjectData { 36 /// <summary> 37 /// Gets or sets the int value. 38 /// </summary> 39 /// <remarks>Uses property <see cref="ObjectData.Data"/> of base class <see cref="ObjectData"/>. 40 /// No own data storage present.</remarks> 41 public new int Data { 42 get { return (int)base.Data; } 43 set { base.Data = value; } 31 [Item("Int Data", "Represents an integer value.")] 32 [Creatable("Test")] 33 public sealed class IntData : ValueTypeData<int> { 34 public IntData() : base() { } 35 public IntData(int value) 36 : base() { 37 Value = value; 44 38 } 45 39 46 /// <summary> 47 /// Initializes a new instance of <see cref="IntData"/> with default value <c>0</c>. 48 /// </summary> 49 public IntData() { 50 Data = 0; 51 } 52 /// <summary> 53 /// Initializes a new instance of <see cref="IntData"/>. 54 /// </summary> 55 /// <param name="data">The int value the current instance should represent.</param> 56 public IntData(int data) { 57 Data = data; 58 } 59 60 /// <summary> 61 /// Clones the current instance. 62 /// </summary> 63 /// <remarks>Adds the cloned instance to the dictionary <paramref name="clonedObjects"/>.</remarks> 64 /// <param name="clonedObjects">Dictionary of all already cloned objects.</param> 65 /// <returns>The cloned instance as <see cref="IntData"/>.</returns> 66 public override IItem Clone(ICloner cloner) { 67 IntData clone = new IntData(); 40 public override IDeepCloneable Clone(Cloner cloner) { 41 IntData clone = new IntData(Value); 68 42 cloner.RegisterClonedObject(this, clone); 69 clone.Data = Data;70 43 return clone; 71 44 }
Note: See TracChangeset
for help on using the changeset viewer.