Partilhar via


DefinitionPropertyType Enumeration

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

Specifies the definition property type.

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

Syntax

'Declaration
Public Enumeration DefinitionPropertyType
'Usage
Dim instance As DefinitionPropertyType
public enum DefinitionPropertyType
public enum class DefinitionPropertyType
public enum DefinitionPropertyType

Members

Member name Description
NormalProperty Normal property.
VariantProperty Variant property.

Remarks

The enumeration is a value for the definition property type, either a Normal property or a Variant property.

  • Normal

  • Variant

Examples

internal CatalogDefinition CreateCategoryDefinition(string definitionName, string description, string propertyToAddtoDefinition)
{
  CatalogDefinition definition = null;
  try
  {
    definition = catalogContext.CreateDefinition(definitionName, CatalogDefinitionType.CategoryDefinition);
    // Once the definition has been  created set the description
    definition.Description = description;
    definition.Save();
    /* Once a definition is created the properties can be added to the definition 
      When adding properties to a category definition the DefinitionPropertyType should always be
     DefinitionPropertyType.NormalProperty.
     */
    definition.AddProperty(propertyToAddtoDefinition, DefinitionPropertyType.NormalProperty);
    definition.Save();
    // Accessing the properties in a definiton
    foreach (CatalogDefinitionPropertiesDataSet.CatalogDefinitionProperty definitionProperty in definition.DefinitionProperties.CatalogDefinitionProperties)
    {
      Console.WriteLine(definitionProperty.DefinitionName);
      Console.WriteLine(definitionProperty.PropertyOrder);
    }
  }
  catch (EntityAlreadyExistsException ex)
  {
    Console.WriteLine(ex.Message);
  }
  return definition;
}

See Also

Reference

Microsoft.CommerceServer.Catalog Namespace