/// <summary> /// Retrieve the page ranges. /// </summary> public CefRange[] GetPageRanges() { var count = GetPageRangesCount(); if (count == 0) { return(new CefRange[0]); } var n_ranges = new cef_range_t[count]; UIntPtr n_count = (UIntPtr)count; fixed(cef_range_t *n_ranges_ptr = n_ranges) { cef_print_settings_t.get_page_ranges(_self, &n_count, n_ranges_ptr); } count = (int)n_count; if (count == 0) { return(new CefRange[0]); } var ranges = new CefRange[count]; for (var i = 0; i < count; i++) { ranges[i].From = n_ranges[i].from; ranges[i].To = n_ranges[i].to; } return(ranges); }
/// <summary> /// Set the page ranges. /// </summary> public void SetPageRanges(CefRange[] ranges) { var count = ranges != null ? ranges.Length : 0; var n_ranges = new cef_range_t[count]; for (var i = 0; i < count; i++) { n_ranges[i].from = ranges[i].From; n_ranges[i].to = ranges[i].To; } fixed(cef_range_t *n_ranges_ptr = n_ranges) { cef_print_settings_t.set_page_ranges(_self, (UIntPtr)count, n_ranges_ptr); } }
/// <summary> /// Instantiates a new <see cref="CefRange"/> instance with the specified starting and ending indexes. /// </summary> /// <param name="from">The inclusive start index of the range.</param> /// <param name="to">The exclusive end index of the range.</param> public CefRange(int from, int to) { _instance = new cef_range_t { from = from, to = to }; }