Beispiel #1
0
            /// <summary>
            /// Removes a slide from the current deck at the current index.
            /// If no index is selected, does nothing.
            /// </summary>
            private void RemoveSlide()
            {
                ///get the index of the current slide that's selected,
                ///so that we can remove our blank slide
                int current_slide_index;

                using (Synchronizer.Lock(traversal_.SyncRoot)) {
                    ///-1 because of zero based indexing?
                    current_slide_index = traversal_.AbsoluteCurrentSlideIndex - 1;
                }

                ///don't do anything if no object is selected
                if (current_slide_index < 0)
                {
                    return;
                }
                //Update the current slide
                using (Synchronizer.Lock(this.traversal_.SyncRoot)) {
                    if (current_slide_index + 1 == this.m_WhereTheEntriesGo.Count)
                    {
                        this.traversal_.Current = this.traversal_.Previous;
                    }
                    else
                    {
                        this.traversal_.Current = this.traversal_.Next;
                    }
                }
                ///Remove slide from the Deck
                using (Synchronizer.Lock(m_Deck.SyncRoot)) {
                    this.m_Deck.Dirty = true;
                    m_Deck.DeleteSlide(m_WhereTheEntriesGo[current_slide_index].Slide);
                }

                ///Remove slide at current index from the TOC
                using (Synchronizer.Lock(this.m_Deck.TableOfContents.SyncRoot)) {
                    this.m_WhereTheEntriesGo.RemoveAt(current_slide_index);
                }
            }