public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JArray ja = JArray.Load(reader); double angle = ja[1].Value <double>(); Spin spin = Spin.Create(angle); return(spin); }
private void SpinTimer_Tick(object sender, EventArgs e) { Send(JsonConvert.SerializeObject(Spin.Create(spinAngle))); spinTimer.Enabled = true; }