Merge remote-tracking branch 'origin/dev' into dev
Conflicts: HueUWP/MainPage.xaml.cs
This commit is contained in:
Executable
+36
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user