/// <summary> /// Filters a <see cref="ReadOnlyListCollection"/> for a given <see cref="ListFilter"/>. /// </summary> /// <param name="lists">The <see cref="ReadOnlyListCollection"/></param> /// <param name="filter">The new <see cref="ListFilter"/> by which to filter.</param> /// <returns>The filtered collection.</returns> public static ReadOnlyListCollection Filter(this ReadOnlyListCollection lists, ListFilter filter) { var collection = new ReadOnlyListCollection(lists, lists.Auth); collection.SetFilter(filter); return(collection); }
internal ReadOnlyListCollection(ReadOnlyListCollection source, TrelloAuthorization auth) : this(() => source.OwnerId, auth) { if (source._additionalParameters != null) { _additionalParameters = new Dictionary <string, object>(source._additionalParameters); } }
/// <summary> /// Limits a <see cref="ReadOnlyListCollection"/> to a specified count of items. /// </summary> /// <param name="lists">The <see cref="ReadOnlyListCollection"/></param> /// <param name="limit">The limit.</param> /// <returns>The limited collection.</returns> public static ReadOnlyListCollection Limit(this ReadOnlyListCollection lists, int limit) { if (limit <= 0) { throw new ArgumentException("limit"); } return(new ReadOnlyListCollection(lists, lists.Auth) { Limit = limit }); }