Partager via


CatalogClassTypes Enumeration

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Specifies the type of catalog object to return from a search. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
<FlagsAttribute> _
Public Enumeration CatalogClassTypes
'Usage
Dim instance As CatalogClassTypes
[FlagsAttribute]
public enum CatalogClassTypes
[FlagsAttribute]
public enum class CatalogClassTypes
public enum CatalogClassTypes

Members

Member name Description
None
CategoryClass Return categories.
ProductVariantClass Return product variants.
ProductClass Return products.
ProductFamilyClass Return product families (products with variants).
ProductFamilyForVariantsClass Return the product family that contains the specified variant.
ProductVariantsForFamilyClass Return all variants associated with a product family.
AllClassTypesClass Return all possible class types.

Remarks

The CatalogClassType enumeration represents the different class types that the Catalog controls can validate. You can combine class types by using the logical OR operator. For example:

classTypes = CatalogClassTypes.ProductFamilyClass | CatalogClassType.ProductFamilyForVariantsClass

The CatalogClassType is used as a parameter to perform a synch, search, delete, or an update.

Examples

ProductCatalog productCatalog = this.catalogContext.GetCatalog(catalogName);
// Use the category configuration object to configure the properties that are
// initialized in the category object. These properties will be preloaded by the catalog server
// All other properties will be lazy initialized.
CategoryConfiguration categoryConfiguration = new CategoryConfiguration();
categoryConfiguration.LoadChildProducts = true;
categoryConfiguration.ChildProducts.SearchOptions = new CatalogSearchOptions();
categoryConfiguration.ChildProducts.SearchOptions.ClassTypes = CatalogClassTypes.ProductClass | CatalogClassTypes.ProductFamilyClass;
categoryConfiguration.ChildProducts.SearchOptions.SetPaging(1, 20);

Category category = productCatalog.GetCategory(categoryName, categoryConfiguration);
// Iterating the Product Collection
foreach (Product product in category.ChildProducts)
{
 // Accessing the display name of the product
 Console.WriteLine(product.DisplayName);
}

foreach (Category parentCategory in category.ParentCategories)
{
 // Accessing the display name of the category
 Console.WriteLine(parentCategory.DisplayName);
}

// Accessing category relationships
foreach (CatalogRelationshipsDataSet.CatalogRelationship relationship in category.RelatedCategories.CatalogRelationships)
{
 Console.WriteLine(relationship.RelationshipName);
 Console.WriteLine(relationship.RelationshipDescription);
}

See Also

Reference

Microsoft.CommerceServer.Catalog Namespace