Beispiel #1
0
        private void DeleteUnsynchronizedObjects()
        {
            // Save each synchronized object, and delete each unsynchronized object.
            this._synchStatus.Status = SynchronizationState.PersistingToDataStore;

            // Delete unsynchronized albums.
            foreach (KeyValuePair <String, IAlbum> albumKeyValue in this._albumsFromDataStore)
            {
                IAlbum album = albumKeyValue.Value;

                if (!album.IsSynchronized)
                {
                    album.DeleteFromGallery();
                }
            }

            // Delete unsynchronized  media objects.
            foreach (KeyValuePair <String, IGalleryObject> mediaObjectKeyValue in this._mediaObjectsFromDataStore)
            {
                IGalleryObject galleryObject = mediaObjectKeyValue.Value;

                if (!galleryObject.IsSynchronized)
                {
                    galleryObject.DeleteFromGallery();
                }
            }
        }