Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AppointmentLabel.GetSkinElementName(SchedulerColorId) Method

Obtain the skin element name for the specified Scheduler label color scheme identifier.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#Declaration

public static string GetSkinElementName(
    SchedulerColorId colorId
)

#Parameters

Name Type Description
colorId SchedulerColorId

A SchedulerColorId enumeration member that is the Scheduler label color scheme identifier.

#Returns

Type Description
String

A string that is the name of a skin element.

#Remarks

The GetSkinElementName method allows you to obtain the name of a skin element which defines the label’s color.

#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.

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