コード例 #1
0
ファイル: Storage.cs プロジェクト: yonyonson604/ChronoZoom
        // Recursively deletes every child timeline and exhibit (with references and content items) form timeline with given guid.
        public void DeleteTimeline(Guid id)
        {
            var timelineIDs = GetChildTimelinesIds(id); // list of ids of child timelines
            var exhibitIDs  = GetChildExhibitsIds(id);  // list of ids of exhibits

            // recursively delete timelines
            while (timelineIDs.Count != 0)
            {
                DeleteTimeline(timelineIDs.First());
                timelineIDs.RemoveAt(0);
            }

            // recursively delete exhibits
            while (exhibitIDs.Count != 0)
            {
                DeleteExhibit(exhibitIDs.First());
                exhibitIDs.RemoveAt(0);
            }

            Timeline removeTimeline = Timelines.Find(id);

            Timelines.Remove(removeTimeline);
        }