public void Remove(IModel model) { modelsList.Remove(model); if (NewModels.Contains(model)) { NewModels.Remove(model); } RemovedModels.Add(model); }
public void Clear() { foreach (var model in modelsList) { if (NewModels.Contains(model)) { NewModels.Remove(model); } else { RemovedModels.Add(model); } } modelsList.Clear(); }
/// <inheritdoc/> public void AggregateFrom(IEnumerable <IChangeset> changesets) { Clear(); foreach (var changeset in changesets.OfType <Changeset>()) { NewModels.AddRangeInternal(changeset.NewModels); ChangedModels.AddRangeInternal(changeset.ChangedModels); DeletedModels.AddRangeInternal(changeset.DeletedModels); ModelsToAutoAlign.AddRangeInternal(changeset.ModelsToAutoAlign); } NewModels.RemoveWhere(m => DeletedModels.Contains(m)); ChangedModels.RemoveWhere(m => NewModels.Contains(m)); ChangedModels.RemoveWhere(m => DeletedModels.Contains(m)); ModelsToAutoAlign.RemoveWhere(m => DeletedModels.Contains(m)); }