| 231 | } |
| 232 | |
| 233 | private static int ParsePageRangePart(string pageRangePart, int defaultValue) |
| 234 | { |
| 235 | pageRangePart = pageRangePart.Trim(); |
| 236 | |
| 237 | if (string.IsNullOrEmpty(pageRangePart)) |
| 238 | { |
| 239 | return defaultValue; |
| 240 | } |
| 241 | |
| 242 | if (int.TryParse(pageRangePart, NumberStyles.Integer, CultureInfo.InvariantCulture, out int pageRangePartValue)) |
| 243 | { |
| 244 | return pageRangePartValue; |
| 245 | } |
| 246 | |
| 247 | throw new ArgumentException("Parts of a page range must be an empty string or an integer"); |
| 248 | } |
| 249 | |
| 250 | /// <summary> |
| 251 | /// An object representing the page size of the print options. |