Beispiel #1
0
        internal int getRelativeSlideIndexOfEntry(Presentation.TableOfContentsModel.Entry entry)
        {
            int index = this.m_Entries.IndexOf(entry);

            if (index != -1)
            {
                int count = 1;
                for (int i = 0; i < index; i++)
                {
                    count += this.m_Entries[i].SlideCount;
                }
                return(count);
            }
            else
            {
                //We did not find that entry
                return(-1);
            }
        }
Beispiel #2
0
        private int getAbsoluteSlideIndex(Presentation.TableOfContentsModel.Entry entry)
        {
            if (entry == null)
            {
                return(-1);
            }

            Presentation.TableOfContentsModel.Entry currentEntry = entry;
            int count = 0;

            while (currentEntry.Parent != null)
            {
                //Goto the parent and calculate how many Entries are before this one
                count       += currentEntry.Parent.getRelativeSlideIndexOfEntry(currentEntry);
                currentEntry = currentEntry.Parent;
            }
            //We are now at the top, do this on the TOC now
            count += currentEntry.TableOfContents.getRelativeSlideIndexOfEntry(currentEntry);
            //Done
            return(count);
        }