Back to Devexpress

PaletteRepository.RegisterPalette(String, Palette) Method

corelibraries-devexpress-dot-xtracharts-dot-paletterepository-dot-registerpalette-x28-system-dot-string-devexpress-dot-xtracharts-dot-palette-x29.md

latest3.3 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[Obsolete("This method is now obsolete. Use the \"void RegisterPalette(Palette paletteInstance)\" constructor instead.")]
public void RegisterPalette(
    string name,
    Palette palette
)
vb
<Obsolete("This method is now obsolete. Use the ""void RegisterPalette(Palette paletteInstance)"" constructor instead.")>
Public Sub RegisterPalette(
    name As String,
    palette As Palette
)

Parameters

NameTypeDescription
nameString

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 TypeException TextReason and Solution
ArgumentNullExceptionValue cannot be null.The specified palette is null ( Nothing in Visual Basic). Make sure that you are specifying a non-null Palette object.
PaletteExceptionCan’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.
PaletteExceptionA 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

PaletteRepository Class

PaletteRepository Members

DevExpress.XtraCharts Namespace