示例#1
0
        /// <summary>
        /// Returns true if the ItemDefinition belongs to the category with the specified index.
        /// </summary>
        /// <param name="itemDefinition">The ItemDefinition to determine if it belongs to the category.</param>
        /// <param name="categoryIndex">The index of the category which the ItemIdentifier may belong to.</param>
        /// <returns>True if the ItemDefinition belongs to the category with the specified index.</returns>
        public bool IsCategoryMember(ItemDefinitionBase itemDefinition, int categoryIndex)
        {
            // If an ItemDefinition doesn't have a category it is a member of every category.
            if (itemDefinition.GetItemCategory() == null)
            {
                return(true);
            }

            return(IsCategoryMember(itemDefinition.GetItemCategory(), categoryIndex));
        }
示例#2
0
        /// <summary>
        /// Returns true if the ItemDefinitionrepresents the default ItemCategory.
        /// </summary>
        /// <param name="itemIdentifier">The ItemDefinition to determine if it is the default ItemCategory.</param>
        /// <returns>True if the ItemDefinition represents the default ItemCategory.</returns>
        public bool IsDefaultItemCategory(ItemDefinitionBase itemDefinition)
        {
            if (itemDefinition == null)
            {
                return(false);
            }
            var category = itemDefinition.GetItemCategory();

            if (category == null)
            {
                return(false);
            }

            return(IsDefaultItemCategory(itemDefinition, category));
        }