Exemplo n.º 1
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Undoes all changes that are currently queued up to be saved.
        /// </summary>
        //------------------------------------------------------------------------------------
        public void UndoChanges()
        {
            AsyncObservableCollection <StoreItem> changedItems = m_changedItems.ToCollection();

            changedItems.Sort((x, y) => StoreItemTypeSort.Compare(x, y));

            UndoInProgress = true;
            foreach (StoreItem item in changedItems)
            {
                if (item.IsNew)
                {
                    m_changedItems.Remove(item);
                    RemoveFromCache(item);
                }
                else
                {
                    item.UndoChanges();
                }
            }

            UndoInProgress = false;
        }