Adds a page to the list of pages to be included in the document. The page number to be included in the document. If is negative. If the requested page has already been added.
(int pageNumber)
| 112 | /// <exception cref="ArgumentOutOfRangeException">If <paramref name="pageNumber"/> is negative.</exception> |
| 113 | /// <exception cref="ArgumentException">If the requested page has already been added.</exception> |
| 114 | public void AddPageToPrint(int pageNumber) |
| 115 | { |
| 116 | if (pageNumber < 0) |
| 117 | { |
| 118 | throw new ArgumentOutOfRangeException(nameof(pageNumber), "Page number must be greater than or equal to zero"); |
| 119 | } |
| 120 | |
| 121 | if (this.pageRanges.Contains(pageNumber)) |
| 122 | { |
| 123 | throw new ArgumentException("Cannot add the same page number twice", nameof(pageNumber)); |
| 124 | } |
| 125 | |
| 126 | this.pageRanges.Add(pageNumber); |
| 127 | } |
| 128 | |
| 129 | /// <summary> |
| 130 | /// Adds a range of pages to be included in the document. |