public void Copy(ListingAgent newListingAgent) { if (newListingAgent == null) { throw new ArgumentNullException("newListingAgent"); } if (newListingAgent.IsNameModified) { Name = newListingAgent.Name; } if (newListingAgent.IsCommunicationsModified) { if (newListingAgent.Communications == null) { Communications = newListingAgent.Communications; } else { Communications = new List<Communication>(); foreach (var newCommunication in newListingAgent.Communications) { var communication = new Communication(); communication.Copy(newCommunication); Communications.Add(communication); } } } if (newListingAgent.IsOrderModified) { Order = newListingAgent.Order; } }
public void Copy(Communication newCommunication) { if (newCommunication == null) { throw new ArgumentNullException("newCommunication"); } if (newCommunication.IsDetailsModified) { Details = newCommunication.Details; } if (newCommunication.IsCommunicationTypeModified) { CommunicationType = newCommunication.CommunicationType; } }