2017-11-21 17:33:44 +01:00
|
|
|
|
using System.Collections.Generic;
|
2017-11-21 20:32:49 +01:00
|
|
|
|
using WatchFace.Elements.BasicElements;
|
2017-11-21 17:33:44 +01:00
|
|
|
|
using WatchFace.Models;
|
|
|
|
|
|
|
|
|
|
namespace WatchFace.Elements
|
2017-11-20 08:11:33 +01:00
|
|
|
|
{
|
|
|
|
|
public class Background
|
|
|
|
|
{
|
2017-11-21 17:33:44 +01:00
|
|
|
|
public Image Image { get; set; }
|
2017-11-20 08:11:33 +01:00
|
|
|
|
|
2017-11-21 17:33:44 +01:00
|
|
|
|
public static Background Parse(List<Parameter> parameters)
|
2017-11-20 08:11:33 +01:00
|
|
|
|
{
|
2017-11-21 17:33:44 +01:00
|
|
|
|
var result = new Background();
|
|
|
|
|
foreach (var parameter in parameters)
|
|
|
|
|
switch (parameter.Id)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
result.Image = Image.Parse(parameter.Children);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new InvalidParameterException(parameter);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
2017-11-20 08:11:33 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|