public ModelChangeSet CreateInvertedChangeSet()
        {
            var inverse = new ModelChangeSet();

            foreach (var change in Changes.Reverse())
            {
                foreach (var inverted in change.Invert())
                {
                    inverse.Changes.Add(inverted);
                }
            }
            return(inverse);
        }
Exemple #2
0
        /// <summary>
        /// Returns previously recorded changes in a tree hierarchy.
        /// </summary>
        /// <returns></returns>
        public ModelChangeSet GetModelChanges()
        {
            var changes     = new ModelChangeSet();
            var changeModel = new ChangeModel(uriMappings, elementSources);

            changeModel.RootElements.Add(changes);
            int currentIndex = 0;
            var list         = new List <IModelChange>();

            while (currentIndex < recordedEvents.Count)
            {
                ParseChange(list, ref currentIndex);
            }
            ConnectInsertionsAndDeletions(list);
#if DEBUG
            SanityCheckInsertionsAndDeletions(list);
#endif
            changes.Changes.AddRange(list);
            return(changes);
        }
Exemple #3
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public ModelChangeSetReferencedElementsCollection(ModelChangeSet parent)
 {
     this._parent = parent;
 }
Exemple #4
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public ModelChangeSetChildrenCollection(ModelChangeSet parent)
 {
     this._parent = parent;
 }