public object Clone() { var newSegmentHistory = SegmentHistory.Clone(); return(new Segment(Name) { BestSegmentTime = BestSegmentTime, SplitTime = SplitTime, Icon = Icon, //TODO: Should be a clone //(this.Icon != null) ? this.Icon.Clone() as Image : null, SegmentHistory = newSegmentHistory, Comparisons = (IComparisons)Comparisons.Clone() }); }
public Segment Clone() { var newSegmentHistory = SegmentHistory.Clone(); return(new Segment(Name) { BestSegmentTime = BestSegmentTime, SplitTime = SplitTime, Icon = Icon, SegmentHistory = newSegmentHistory, Comparisons = (IComparisons)Comparisons.Clone() }); }
public ISegment CopySegment() { var newSegmentHistory = SegmentHistory.Clone(); return(new Segment(Name) { BestSegmentTime = BestSegmentTime, SplitTime = SplitTime, Icon = Icon, DeathCount = DeathCount, BestDeathCount = BestDeathCount, PersonalBestDeathCount = PersonalBestDeathCount, SegmentHistory = newSegmentHistory, Comparisons = (IComparisons)Comparisons.Clone(), Parent = Parent }); }
public object Clone() { var newSegmentHistory = new List <IIndexedTime>(); foreach (var element in SegmentHistory) { newSegmentHistory.Add(new IndexedTime(element.Time, element.Index)); } return(new Segment(Name) { BestSegmentTime = BestSegmentTime, SplitTime = SplitTime, Icon = Icon, //TODO: Should be a clone //(this.Icon != null) ? this.Icon.Clone() as Image : null, SegmentHistory = newSegmentHistory, Comparisons = (IComparisons)Comparisons.Clone() }); }