다음을 통해 공유


CatalogEnumerationPropertyValuesDataSet Class

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

The strongly typed DataSet that is used to access the Catalog enumerations in the Catalog system.

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

Syntax

'Declaration
<SerializableAttribute> _
Public Class CatalogEnumerationPropertyValuesDataSet _
    Inherits DataSet
'Usage
Dim instance As CatalogEnumerationPropertyValuesDataSet
[SerializableAttribute]
public class CatalogEnumerationPropertyValuesDataSet : DataSet
[SerializableAttribute]
public ref class CatalogEnumerationPropertyValuesDataSet : public DataSet
public class CatalogEnumerationPropertyValuesDataSet extends DataSet

Remarks

Returns the CatalogEnumerationPropertyValuesDataSet containing the enumeration values. This allows you to get the enumeration values of the Property data.

Examples

CatalogEnumerationProperty property = null;
try
{
  // Create the property 
  property = (CatalogEnumerationProperty)catalogContext.CreateProperty(propertyName, CatalogDataType.Enumeration, 0);
  // Add values for the enumeration property. The language should be specified only if the 
  // property is language sensitive. You can also assign a rank to each of the enumeration values
  int rank = 0;
  property.AddEnumerationPropertyValue("Small", rank);
  property.AddEnumerationPropertyValue("Big", ++rank);
  property.AddEnumerationPropertyValue("Large", ++rank);
  property.AddEnumerationPropertyValue("Extra Large", ++rank);
  // Call property.Save to Save the changes to the catalog system
  property.Save();
  // Accessing the enumeration values
  foreach (CatalogEnumerationPropertyValuesDataSet.EnumerationPropertyValue enumValue in property.EnumerationValues.EnumerationPropertyValues)
  {
    Console.WriteLine(enumValue.PropertyName);
    Console.WriteLine(enumValue.PropertyValue);
    Console.WriteLine(enumValue.Rank);
  }

  // Remove an enumeration value
  property.RemoveEnumerationPropertyValue("Small");
  // Call property.Save to Save the changes to the catalog system
  property.Save();

}
catch (EntityAlreadyExistsException ex)
{
  string message = string.Format("The property {0} already exists", ex.EntityName);
  Console.WriteLine(message);
}
return property;

Inheritance Hierarchy

System..::.Object
  System.ComponentModel..::.MarshalByValueComponent
    System.Data..::.DataSet
      Microsoft.CommerceServer.Catalog..::.CatalogEnumerationPropertyValuesDataSet

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CatalogEnumerationPropertyValuesDataSet Members

Microsoft.CommerceServer.Catalog Namespace