I\'m trying to write some code that populates a List (actually, it\'s a series of Lists, but we can pretend it\'s just one List). The
If you only need a shallow copy, then you can write a quick-fix clone method:
public class PinnacleStock : ICloneable
{
public PinnacleStock Clone()
{
return (PinnacleStock)this.MemberwiseClone();
}
object ICloneable.Clone()
{
return Clone();
}
// Other methods
}
If you need a deep copy (i.e. if PinnacleStock has sub-objects that you want to be copied as well), then you will need to write one yourself.