예제 #1
0
 public void Remove(IModel model)
 {
     modelsList.Remove(model);
     if (NewModels.Contains(model))
     {
         NewModels.Remove(model);
     }
     RemovedModels.Add(model);
 }
예제 #2
0
        public void Clear()
        {
            foreach (var model in modelsList)
            {
                if (NewModels.Contains(model))
                {
                    NewModels.Remove(model);
                }
                else
                {
                    RemovedModels.Add(model);
                }
            }

            modelsList.Clear();
        }
예제 #3
0
            /// <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));
            }