AppointmentLabel.ColorId Property

Gets or sets the label identifier in a Scheduler legacy color scheme.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v20.1.dll

Declaration

[Browsable(false)]
public SchedulerColorId ColorId { get; set; }
<Browsable(False)>
Public Property ColorId As SchedulerColorId

Property Value

Type Description
SchedulerColorId

A SchedulerColorId enumeration member that specifies the label color.

Remarks

Use the ColorId property to set the label color to the color defined in the label color scheme. The label color scheme can be a legacy default scheme or can be obtained from a skin.

Examples

This example changes the label colors. For each label it attempts to get a label color defined in a specified skin. If it fails, a default legacy color is used.

IAppointmentLabelStorage labelStorage = scheduler.Storage.Appointments.Labels;
foreach (IAppointmentLabel label in labelStorage) {
    AppointmentLabel appLabel = label as AppointmentLabel;
    if (appLabel != null) {
        string skinElemName = AppointmentLabel.GetSkinElementName(appLabel.ColorId);
        Color skinColor = DevExpress.Skins.SkinManager.Default.Skins["Office 2016 Colorful"].GetSkin(DevExpress.Skins.SkinProductId.Scheduler).Colors.GetPrimaryColor(skinElemName, Color.Empty);
        if (skinColor == Color.Empty)
            skinColor = AppointmentLabel.GetDefaultColorByStringId(appLabel.ColorId);
        appLabel.SetColor(skinColor);
    }

}
See Also