Exemplo n.º 1
0
        /// <summary>
        /// Filters a <see cref="ReadOnlyOrganizationCollection"/> for a given <see cref="BoardFilter"/>.
        /// </summary>
        /// <param name="orgs">The <see cref="ReadOnlyOrganizationCollection"/></param>
        /// <param name="filter">The new <see cref="BoardFilter"/> by which to filter.</param>
        /// <returns>The filtered collection.</returns>
        public static ReadOnlyOrganizationCollection Filter(this ReadOnlyOrganizationCollection orgs, OrganizationFilter filter)
        {
            var collection = new ReadOnlyOrganizationCollection(orgs, orgs.Auth);

            collection.SetFilter(filter);
            return(collection);
        }
 internal ReadOnlyOrganizationCollection(ReadOnlyOrganizationCollection source, TrelloAuthorization auth)
     : this(() => source.OwnerId, auth)
 {
     if (source._additionalParameters != null)
     {
         _additionalParameters = new Dictionary <string, object>(source._additionalParameters);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Limits a <see cref="ReadOnlyOrganizationCollection"/> to a specified count of items.
        /// </summary>
        /// <param name="organizations">The <see cref="ReadOnlyOrganizationCollection"/></param>
        /// <param name="limit">The limit.</param>
        /// <returns>The limited collection.</returns>
        public static ReadOnlyOrganizationCollection Limit(this ReadOnlyOrganizationCollection organizations, int limit)
        {
            if (limit <= 0)
            {
                throw new ArgumentException("limit");
            }

            return(new ReadOnlyOrganizationCollection(organizations, organizations.Auth)
            {
                Limit = limit
            });
        }