Merge remote-tracking branch 'origin/dev' into dev

Conflicts:
	HueUWP/MainPage.xaml.cs
This commit is contained in:
2015-11-27 13:36:08 +01:00
9 changed files with 176 additions and 40 deletions
+36
View File
@@ -0,0 +1,36 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
namespace HueUWP
{
class APIHandler
{
NetworkHandler nwh;
public APIHandler(NetworkHandler nwh)
{
this.nwh = nwh;
}
private JObject ObjectifyfJson(string json)
{
json = json.Replace("[", "").Replace("]", "");
return JObject.Parse(json);
}
public async void Register()
{
var json = await nwh.RegisterName("Hue", "Kenneth&Yorick");
JObject o = ObjectifyfJson(json);
string id= o["success"]["username"].ToString();
MainPage.LOCAL_SETTINGS.Values["id"] = id;
}
}
}