/// <summary> /// Gets or sets the element at the specified index. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index of the element to get or set.</param> /// <returns cref="PointF" href="http://msdn.microsoft.com/en-us/library/system.drawing.pointf.aspx">The element at the specified index.</returns> public PointF this[int index] { get { if (index < 0 || index >= _array.Count / 2) { throw new IndexOutOfRangeException(); } PDFNumber numberX = _array[index * 2] as PDFNumber; PDFNumber numberY = _array[index * 2 + 1] as PDFNumber; if (numberX == null) { numberX = new PDFNumber(0); } if (numberY == null) { numberY = new PDFNumber(0); } float numX = (float)numberX.GetValue(); float numY = (float)numberY.GetValue(); if (_page != null) { numX = numX - _page.PageRect.Left; numY = _page.PageRect.Bottom - numY; } return(new PointF(numX, numY)); } set { if (index < 0 || index >= _array.Count / 2) { throw new IndexOutOfRangeException(); } if (_page != null) { value.X = value.X + _page.PageRect.Left; value.Y = _page.PageRect.Bottom - value.Y; } _array.RemoveItem(index * 2); _array.RemoveItem(index * 2); _array.Insert(index * 2, new PDFNumber(value.Y)); _array.Insert(index * 2, new PDFNumber(value.X)); if (ChangedPointsArray != null) { ChangedPointsArray(this); } } }
private void parsePage(PDFArray arr, IDocumentEssential owner) { IPDFObject page = arr[0]; if (page == null) { return; } if (page is PDFNumber) { _page = owner.GetPage((int)(page as PDFNumber).GetValue()); } else if (page is PDFDictionary) { _page = owner.GetPage(page as PDFDictionary); } else { _page = null; } arr.RemoveItem(0); if (_page != null) { arr.Insert(0, _page.GetDictionary()); } else { arr.Insert(0, new PDFNull()); } }
internal void Remove(int index) { if (index >= 0 && index < Count) { _fields.RemoveItem(index); } }
/// <summary> /// Removes the element with the specified index from this collection. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index of the element to be removed.</param> public void Remove(int index) { if (index < 0 || index >= Count) { throw new IndexOutOfRangeException(); } _items.RemoveAt(index); _array.RemoveItem(index); }
private void deleteItem(PDFArray array, IPDFObject key) { if (array == null) { return; } int number = (int)(key as PDFNumber).GetValue(); for (int i = 0; i < array.Count; i += 2) { PDFNumber val = array[i] as PDFNumber; if (val != null && ((int)val.GetValue()) == number) { array.RemoveItem(i + 1); array.RemoveItem(i); return; } } }
private void remove(PDFDictionary annotDict) { for (int i = 0; i < _array.Count; ++i) { if (_array[i] == annotDict) { _array.RemoveItem(i); return; } } }
/// <summary> /// Removes the element at the specified index of the collection. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index of the element to remove.</param> public void Remove(int index) { if (index < 0 || index >= Count) { throw new IndexOutOfRangeException(); } _items.RemoveItem(index); if (ChangedChoiceItems != null) { ChangedChoiceItems(this); } }
/// <summary> /// Removes the element at the specified index of the collection. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index of the element to remove.</param> public void RemoveArray(int index) { if (index < 0 || index >= _array.Count) { throw new IndexOutOfRangeException(); } _listArrays[index].ChangedPointsArray -= changedPointsArray; _array.RemoveItem(index); _listArrays.RemoveAt(index); if (ChangedInkList != null) { ChangedInkList(this); } }
/// <summary> /// Removes the action with the specified index from the collection. /// </summary> /// <param name="index" href="http://msdn.microsoft.com/en-us/library/system.int32.aspx">The zero-based index of the action to be removed.</param> public void Remove(int index) { if (index < 0 || index >= Count) { throw new IndexOutOfRangeException(); } _actions.RemoveAt(index); if (_actions.Count == 0) { _parent.RemoveItem(_key); } else { PDFArray arr = _parent[_key] as PDFArray; arr.RemoveItem(index); } }