Пример #1
0
 public void Add(PDFObject obj)
 {
     base._Changing();
     this._Inserting(this.Count, obj);
     obj = CorePDFObject.TreatNewCollectionObject(this, obj);
     this.mArray.Add(obj);
     this.Dirty = true;
     this._Inserted((this.Count - 1), obj);
     base._Changed();
 }
Пример #2
0
 public void Insert(int pos, PDFObject obj)
 {
     base._Changing();
     this._Inserting(pos, obj);
     obj = CorePDFObject.TreatNewCollectionObject(this, obj);
     this.mArray.Insert(pos, obj);
     this.Dirty = true;
     this._Inserted(pos, obj);
     base._Changed();
 }
Пример #3
0
 public PDFObject this[int index]
 {
     get
     {
         return(this[index, 1]);
     }
     set
     {
         base._Changing();
         CorePDFObject obj1 = null;
         if (index < this.mArray.Count)
         {
             obj1 = (this.mArray[index] as CorePDFObject);
         }
         else
         {
             obj1 = null;
         }
         if (obj1 != null)
         {
             this._Replacing(index, value);
             if (!obj1.IsIndirect)
             {
                 obj1.Parent = null;
             }
         }
         else
         {
             this._Inserting(index, value);
         }
         value = CorePDFObject.TreatNewCollectionObject(this, value);
         if (index == this.mArray.Count)
         {
             this.mArray.Add(value);
         }
         else
         {
             this.mArray[index] = ((object)value);
         }
         this.Dirty = true;
         if (obj1 != null)
         {
             this._Replaced(index, value);
         }
         else
         {
             this._Inserted(index, value);
         }
         base._Changed();
     }
 }
Пример #4
0
        public PDFObject RemoveAt(int index)
        {
            base._Changing();
            this._Removing(index);
            CorePDFObject obj1 = (this.mArray[index] as CorePDFObject);

            if ((obj1 != null) && !obj1.IsIndirect)
            {
                obj1.Parent = null;
            }
            this.mArray.RemoveAt(index);
            this.Dirty = true;
            this._Removed(index);
            base._Changed();
            return(obj1);
        }
Пример #5
0
        public PDFObject Remove(PDFName key)
        {
            base._Changing();
            this._Removing(key.Value);
            CorePDFObject obj1 = (this.mHash[key] as CorePDFObject);

            if ((obj1 != null) && !obj1.IsIndirect)
            {
                obj1.Parent = null;
            }
            this.mHash.Remove(key);
            this.Dirty = true;
            this._Removed(key.Value);
            base._Changed();
            return(obj1);
        }
Пример #6
0
 public PDFObject this[PDFName key]
 {
     get
     {
         return(this[key, 1]);
     }
     set
     {
         base._Changing();
         CorePDFObject obj1 = (this.mHash[key] as CorePDFObject);
         if (obj1 != null)
         {
             this._Replacing(key.Value, value);
             if (!obj1.IsIndirect)
             {
                 obj1.Parent = null;
             }
         }
         else
         {
             this._Inserting(key.Value, value);
         }
         value = CorePDFObject.TreatNewCollectionObject(this, value);
         if (!this.mHash.ContainsKey(key))
         {
             if (key.Parent != null)
             {
                 key = new CorePDFName(key.Value);
             }
             key.Parent = this;
         }
         this.mHash[key] = ((object)value);
         this.Dirty      = true;
         if (obj1 != null)
         {
             this._Replaced(key.Value, value);
         }
         else
         {
             this._Inserted(key.Value, value);
         }
         base._Changed();
     }
 }