Example #1
0
        public int IndexOf(ArticleElement @object)
        {
            if (@object == null)
            {
                return(-1); // NOTE: By definition, no bead can be null.
            }
            ElementIndexer indexer = new ElementIndexer(@object.BaseDataObject);

            Iterate(indexer);
            return(indexer.Index);
        }
Example #2
0
        public void Insert(int index, ArticleElement @object)
        {
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            ElementGetter getter = new ElementGetter(index);

            Iterate(getter);
            PdfDictionary bead = getter.Bead;

            if (bead == null)
            {
                Add(@object);
            }
            else
            {
                Link(@object.BaseDataObject, bead);
            }
        }