Share via


Refresh Method

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

Refresh the authorized tasks for this catalog context.

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

Syntax

'Declaration
Public Sub Refresh
'Usage
Dim instance As CatalogContext

instance.Refresh()
public void Refresh()
public:
void Refresh()
public function Refresh()

Remarks

Refreshes the Product Catalog System. Ensures that the property caches are coherent with the current design-time view of the catalog.

This method is used to flush the cached data. The next time that data is queried, it will be retrieved from the Catalog APIs, and thereby the cache will gradually be filled with the coherent design-time view of the data.

The following properties on the catalog are refreshed:

  • CatalogNames

  • PropertyNames

  • CategoryDefinitions

  • ProductDefinitionNames

  • CatalogSetCollection

  • ProductCatalog, Product, Category cached data

Examples

// The ImportXml returns an  ImportProgress object
// Use the Status property to determine the current status
ImportProgress importProgress = this.catalogContext.ImportXml(catalogImportOptions, fileName);
while (importProgress.Status == CatalogOperationsStatus.InProgress)
{
  System.Threading.Thread.Sleep(3000);
  // Call the refresh method to refresh the current status
  importProgress.Refresh();
}
Console.WriteLine(importProgress.EndDate);
// If the import operation failed
if (importProgress.Status == CatalogOperationsStatus.Failed ||
  importProgress.Status == CatalogOperationsStatus.CompletedWithErrors)
{
  // Use the Errors property to get the errors that occurred during import
  foreach (CatalogError error in importProgress.Errors)
  {
    Console.WriteLine(error.LineNumber);
    Console.WriteLine(error.Message);
  }
}

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

Microsoft.CommerceServer.Catalog Namespace