Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removes the given language from the current catalog.
Namespace: Microsoft.CommerceServer.Catalog
Assembly: Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)
Syntax
'Declaration
Public Sub RemoveLanguage ( _
languageToRemove As String _
)
'Usage
Dim instance As ProductCatalog
Dim languageToRemove As String
instance.RemoveLanguage(languageToRemove)
public void RemoveLanguage(
string languageToRemove
)
public:
void RemoveLanguage(
String^ languageToRemove
)
public function RemoveLanguage(
languageToRemove : String
)
Parameters
- languageToRemove
Type: System..::.String
The language to remove.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The languageToAdd is nullNothingnullptra null reference (Nothing in Visual Basic). |
ValidationException | The languageToAdd is invalid. |
LanguageRemoveException | The ActiveLanguage cannot be removed from the catalog. |
EntityDoesNotExistException | The languageToRemove does not exist in the catalog. |
Remarks
This method will remove the language from the current catalog. After you remove a language you should call the Save method to save the changes to the catalog system.
The languageToRemove should:
Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.
Not exceed 10 characters.
Not contain the ,'[] characters.
Already exist in the catalog.
Examples
internal void AddRemoveLanguages(string catalogName, string languagetoAdd, string languageToRemove)
{
try
{
// Get the base catalog for the specified catalog name
ProductCatalog productCatalog = catalogContext.GetCatalog(catalogName);
// Call AddLanguage to add the language
// Call RemoveLanguage to remove the language
productCatalog.AddLanguage(languagetoAdd);
productCatalog.RemoveLanguage(languageToRemove);
// Call Save to save the information to the catalog system
productCatalog.Save();
}
catch (EntityAlreadyExistsException ex)
{
// The language already exists
Console.WriteLine(ex.Message);
throw;
}
catch (EntityDoesNotExistException ex)
{
// The language does not exist
Console.WriteLine(ex.Message);
throw;
}
}
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.