public static bool InCategories(this TargetEntry target, string[] categoryIds)
        {
            categoryIds = categoryIds.Where(x => x != null).ToArray();

            if (categoryIds.Count() > 0)
            {
                return(IsTargetInCategories(target, categoryIds));
            }

            return(true);
        }
        private static bool IsTargetInCategories(TargetEntry target, string[] categoryIds)
        {
            var retVal = CatalogOutlineBuilder.GetCategoriesHierarchy(target.Outline).Any(x => categoryIds.Contains(x, StringComparer.OrdinalIgnoreCase));

            return(retVal);
        }
 public static bool ExcludeCategories(this TargetEntry target, string[] categoryIds)
 {
     return(!IsTargetInCategories(target, categoryIds));
 }
 public static bool InCategory(this TargetEntry target, string categoryId)
 {
     return(target.InCategories(new string[] { categoryId }));
 }
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
			TargetEntry entry = new TargetEntry((Hashtable)this.Storage.Clone());
            return entry;
        }
		private static bool IsTargetInCategories(TargetEntry target, string[] categoryIds)
		{
			var retVal = CatalogOutlineBuilder.GetCategoriesHierarchy(target.Outline).Any(x => categoryIds.Contains(x, StringComparer.OrdinalIgnoreCase));
			return retVal;
		}
Esempio n. 7
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            TargetEntry entry = new TargetEntry((Hashtable)this.Storage.Clone());

            return(entry);
        }