Refactor theme code to support different types

This commit is contained in:
azakhi
2018-08-24 22:07:24 +03:00
parent d0bc0b6864
commit 8ba3433dcf
17 changed files with 122 additions and 64 deletions

View File

@@ -16,7 +16,15 @@ namespace Filtration.ObjectModel.ThemeEditor
return Items.FirstOrDefault(t => t.ComponentName == componentName && t.ComponentType == componentType);
}
var component = new ThemeComponent(componentType, componentName, componentColor);
ThemeComponent component = null;
switch(componentType)
{
case ThemeComponentType.BackgroundColor:
case ThemeComponentType.BorderColor:
case ThemeComponentType.TextColor:
component = new ColorThemeComponent(componentType, componentName, componentColor);
break;
}
Items.Add(component);
return component;