public string ToJson()
{
DataContractJsonSerializer s = new DataContractJsonSerializer(typeof(SerializerClass));
var sc = new SerializerClass()
{
Id = this.Id,
Name = Name,
IsDimmable = LampDetails_Dimmable,
SupportsColor = LampDetails_Color,
SupportsTemperature = LampDetails_VariableColorTemp,
Hue = LampState_Hue,
Saturation = LampState_Saturation,
Brightness = LampState_Brightness,
ColorTemp = LampState_ColorTemp,
IsOn = LampState_OnOff,
};
using (MemoryStream ms = new MemoryStream())
{
s.WriteObject(ms, sc);
return System.Text.Encoding.UTF8.GetString(ms.ToArray());
}
}
public static MockLightingServiceHandler FromJson(string json, Windows.UI.Core.CoreDispatcher dispatcher)