public void CopyFrom(IRecurrenceRule other) { if (this.GetType().FullName != other.GetType().FullName) { throw new ArgumentException("Invalid type"); } if (other is SqlRecurrenceRule) { this.MasterAppointment = (other as SqlRecurrenceRule).MasterAppointment; } this.Pattern = other.Pattern.Copy(); this.Exceptions.Clear(); foreach (var exception in other.Exceptions) { this.Exceptions.Add(exception.Copy() as SqlExceptionOccurrence); } }
public void CopyFrom(IRecurrenceRule other) { if (this.GetType().FullName != other.GetType().FullName) { throw new ArgumentException("Invalid type"); } if (other is SqlRecurrenceRule) { this.MasterAppointment = (other as SqlRecurrenceRule).MasterAppointment; } this.Pattern = other.Pattern.Copy(); this.Exceptions.Clear(); var exceptions = other.Exceptions.ToList(); other.Exceptions.Clear(); this.Exceptions = exceptions; }