Class ColorSchemeHelper
- Namespace
- Dynamicweb.Content.Styles.ColorSchemes
- Assembly
- Dynamicweb.dll
Helper class with supporting methods to work with color schemes.
public static class ColorSchemeHelper
- Inheritance
-
ColorSchemeHelper
- Inherited Members
Methods
Delete(string)
Deletes the color scheme group by id
public static void Delete(string schemeGroupId)
Parameters
schemeGroupId
stringThe color scheme group id
Exceptions
- ArgumentNullException
- InvalidOperationException
Thrown if the deleted color group is used
Delete(string, string)
Deletes the color scheme
public static void Delete(string schemeGroupId, string schemeId)
Parameters
Exceptions
- ArgumentNullException
- InvalidOperationException
Thrown if the deleted color is used
GetAllColorSchemeGroups()
Get all color scheme groups
public static IEnumerable<ColorSchemeGroup> GetAllColorSchemeGroups()
Returns
- IEnumerable<ColorSchemeGroup>
A list of ColorSchemeGroup
GetColorScheme(ColorSchemeGroup, string)
Gets the color scheme
public static ColorScheme? GetColorScheme(ColorSchemeGroup schemeGroup, string colorSchemeId)
Parameters
schemeGroup
ColorSchemeGroupThe color scheme group
colorSchemeId
stringThe color scheme id
Returns
GetColorScheme(string, string)
Gets the color scheme
public static ColorScheme? GetColorScheme(string schemeGroupId, string colorSchemeId)
Parameters
Returns
GetColorSchemeGroup(string)
Gets the color scheme group by id
public static ColorSchemeGroup? GetColorSchemeGroup(string schemeGroupId)
Parameters
schemeGroupId
stringThe color scheme group id
Returns
GetColorSchemeUsageCount(string)
Gets the list of using info of a color scheme group
public static IDictionary<string, int> GetColorSchemeUsageCount(string schemeGroupId)
Parameters
schemeGroupId
stringThe color scheme group id
Returns
GetColorSchemeUsageInfo(string, string)
Gets the list of using info of a ColorScheme
public static IEnumerable<ColorSchemeUsageInfo> GetColorSchemeUsageInfo(string schemeGroupId, string schemeId)
Parameters
Returns
IsInUse(string)
Check scheme group is used
public static bool IsInUse(string schemeGroupId)
Parameters
schemeGroupId
stringThe color scheme group id
Returns
ReplaceWithExistingId(string, string, string)
Replace colorscheme with other one everywhere in content
public static int ReplaceWithExistingId(string schemeGroupId, string schemeId, string existingSchemeId)
Parameters
schemeGroupId
stringThe color scheme group id
schemeId
stringThe color scheme id
existingSchemeId
stringThe existing color scheme id
Returns
- int
The number of records affected
Exceptions
ReplaceWithNewId(string, string, string)
Replace colorscheme Id and update all its usages everywhere in content
public static int ReplaceWithNewId(string schemeGroupId, string schemeId, string newSchemeId)
Parameters
schemeGroupId
stringThe color scheme group id
schemeId
stringThe color scheme id
newSchemeId
stringThe new color scheme id
Returns
- int
The number of records affected
Exceptions
Save(ColorSchemeGroup)
Saves the color scheme group
public static void Save(ColorSchemeGroup schemeGroup)
Parameters
schemeGroup
ColorSchemeGroupThe color scheme group