Skip to main content

PaletteRepository.RegisterPalette(String, Palette) Method

OBSOLETE

This method is now obsolete. Use the "void RegisterPalette(Palette paletteInstance)" constructor instead.

Adds the specified palette with the specified name to the repository.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v23.2.dll

NuGet Package: DevExpress.Charts

Declaration

[Obsolete("This method is now obsolete. Use the \"void RegisterPalette(Palette paletteInstance)\" constructor instead.")]
public void RegisterPalette(
    string name,
    Palette palette
)

Parameters

Name Type Description
name String

A String which specifies the name of the palette to register.

palette Palette

The Palette object to add.

Remarks

Use the RegisterPalette method to add a palette to a PaletteRepository. Note that in some cases an exception can occur when this method is called. Below is a list of the possible exceptions along with the reasons for them being raised.

Exception Type Exception Text Reason and Solution
ArgumentNullException Value cannot be null. The specified palette is null (Nothing in Visual Basic). Make sure that you are specifying a non-null Palette object.
PaletteException Can’t add a palette which has an empty name (“”) to the palette repository. Please, specify a name for the palette. You’re trying to add a palette with an empty name to the repository. Specify a non-empty name for the palette.
PaletteException A palette with the PaletteName name already exists in the repository. A palette with the specified name already exists, and this is one of the default palettes. Try to specify a different name for the palette.

Note

If you specify a name for a palette which is the same as another palette that isn’t one of the default palettes, then the new palette will replace the existing one of the same name in the palette repository.

See Also