Add new filter fuatures
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.ThemeEditor
|
||||
{
|
||||
[Serializable]
|
||||
public class EffectColorThemeComponent : ThemeComponent
|
||||
{
|
||||
private EffectColor _effectColor;
|
||||
private bool _temporary;
|
||||
|
||||
public EffectColorThemeComponent(ThemeComponentType componentType, string componentName, EffectColor componentEffectColor, bool componentTemporary)
|
||||
{
|
||||
if (componentName == null)
|
||||
{
|
||||
throw new ArgumentException("Null parameters not allowed in EffectColorThemeComponent constructor");
|
||||
}
|
||||
|
||||
ComponentType = componentType;
|
||||
ComponentName = componentName;
|
||||
EffectColor = componentEffectColor;
|
||||
Temporary = componentTemporary;
|
||||
}
|
||||
|
||||
public EffectColor EffectColor
|
||||
{
|
||||
get { return _effectColor; }
|
||||
set
|
||||
{
|
||||
_effectColor = value;
|
||||
OnPropertyChanged();
|
||||
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Temporary
|
||||
{
|
||||
get { return _temporary; }
|
||||
set
|
||||
{
|
||||
_temporary = value;
|
||||
OnPropertyChanged();
|
||||
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Filtration.ObjectModel/ThemeEditor/IconThemeComponent.cs
Normal file
60
Filtration.ObjectModel/ThemeEditor/IconThemeComponent.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.ThemeEditor
|
||||
{
|
||||
[Serializable]
|
||||
public class IconThemeComponent : ThemeComponent
|
||||
{
|
||||
private IconSize _iconSize;
|
||||
private IconColor _iconColor;
|
||||
private IconShape _iconShape;
|
||||
|
||||
public IconThemeComponent(ThemeComponentType componentType, string componentName, IconSize componentIconSize, IconColor componentIconColor, IconShape componentIconShape)
|
||||
{
|
||||
if (componentName == null)
|
||||
{
|
||||
throw new ArgumentException("Null parameters not allowed in IconThemeComponent constructor");
|
||||
}
|
||||
|
||||
ComponentType = componentType;
|
||||
ComponentName = componentName;
|
||||
IconSize = componentIconSize;
|
||||
IconColor = componentIconColor;
|
||||
IconShape = componentIconShape;
|
||||
}
|
||||
|
||||
public IconSize IconSize
|
||||
{
|
||||
get { return _iconSize; }
|
||||
set
|
||||
{
|
||||
_iconSize = value;
|
||||
OnPropertyChanged();
|
||||
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public IconColor IconColor
|
||||
{
|
||||
get { return _iconColor; }
|
||||
set
|
||||
{
|
||||
_iconColor = value;
|
||||
OnPropertyChanged();
|
||||
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public IconShape IconShape
|
||||
{
|
||||
get { return _iconShape; }
|
||||
set
|
||||
{
|
||||
_iconShape = value;
|
||||
OnPropertyChanged();
|
||||
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,32 @@ namespace Filtration.ObjectModel.ThemeEditor
|
||||
return component;
|
||||
}
|
||||
|
||||
public ThemeComponent AddComponent(ThemeComponentType componentType, string componentName, IconSize componentIconSize, IconColor componentIconColor, IconShape componentIconShape)
|
||||
{
|
||||
if (ComponentExists(componentType, componentName))
|
||||
{
|
||||
return Items.FirstOrDefault(t => t.ComponentName == componentName && t.ComponentType == componentType);
|
||||
}
|
||||
|
||||
var component = new IconThemeComponent(componentType, componentName, componentIconSize, componentIconColor, componentIconShape);
|
||||
Items.Add(component);
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
public ThemeComponent AddComponent(ThemeComponentType componentType, string componentName, EffectColor componentEffectColor, bool componentTemporary)
|
||||
{
|
||||
if (ComponentExists(componentType, componentName))
|
||||
{
|
||||
return Items.FirstOrDefault(t => t.ComponentName == componentName && t.ComponentType == componentType);
|
||||
}
|
||||
|
||||
var component = new EffectColorThemeComponent(componentType, componentName, componentEffectColor, componentTemporary);
|
||||
Items.Add(component);
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
private bool ComponentExists(ThemeComponentType componentType, string componentName)
|
||||
{
|
||||
var componentCount =
|
||||
|
||||
Reference in New Issue
Block a user