public class CategoryHelper
{
public static Category RecreateCategory(string categoryName)
{
Category category = null;
switch (categoryName)
{
case "Red Category":
category = new Category("Red Category", new SolidColorBrush(Colors.Red));
break;
case "Orange Category":
category = new Category("Orange Category", new SolidColorBrush(Colors.Orange));
break;
case "Green Category":
category = new Category("Green Category", new SolidColorBrush(Colors.Green));
break;
case "Blue Category":
category = new Category("Blue Category", new SolidColorBrush(Colors.Blue));
break;
case "Purple Category":
category = new Category("Purple Category", new SolidColorBrush(Colors.Purple));
break;
case "Yellow Category":
category = new Category("Yellow Category", new SolidColorBrush(Colors.Yellow));
break;
case "Olive Category":
category = new Category("Olive Category", new SolidColorBrush(Colors.Brown));
break;
case "Pink Category":
category = new Category("Pink Category", new SolidColorBrush(Colors.Red));
break;
default:
category = new Category("White Category", new SolidColorBrush(Colors.White));
break;
}
return category;
}
public static string MakeCategoryString(ICategory category)
{
return category == null ? String.Empty : category.CategoryName;
}