AppointmentLabel.ColorId Property
Gets or sets the label identifier in a Scheduler legacy color scheme.
Namespace: DevExpress.XtraScheduler
Assembly: DevExpress.XtraScheduler.v18.1.dll
Declaration
Property Value
Type | Description |
---|---|
SchedulerColorId | A SchedulerColorId enumeration member that specifies the label color. |
Available values:
Name | Description |
---|---|
Nothing | Indicates that the color is specified using the AppointmentLabel.Color property and does not correlate to SchedulerColorId enumeration members. |
NoneLabel | The None label color. The legacy default color is shown below: |
ImportantLabel | The Important label color. The legacy default color is shown below: |
BusinessLabel | The Business label color. The legacy default color is shown below: |
PersonalLabel | The Personal label color. The legacy default color is shown below: |
VacationLabel | The Vacation label color. The legacy default color is shown below: |
MustAttendLabel | The Must Attend label color. The legacy default color is shown below: |
TravelRequiredLabel | The Travel Required label color. The legacy default color is shown below: |
NeedsPreparationLabel | The Needs Preparation label color. The legacy default color is shown below: |
BirthdayLabel | The Birthday label color. The legacy default color is shown below: |
AnniversaryLabel | The Anniversary label color. The legacy default color is shown below: |
PhoneCallLabel | The Phone Call label color. The legacy default color is shown below: |
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.
Example
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/winforms-schedulercontrol-api-t224044
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);
}
scheduler.ActiveView.LayoutChanged();
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColorId property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.