/// <summary> /// 設定を保存します /// </summary> public async Task Save() { await Task.Run(() => { // Serialize var json = new JsonObject(); JsonPrimitive element; JsonPrimitive.TryCreate(Account.BaseUrl, out element); json.Add("BaseUrl", element); JsonPrimitive.TryCreate(Account.UserKey, out element); json.Add("UserKey", element); JsonPrimitive.TryCreate(PostTextFormat, out element); json.Add("PostTextFormat", element); JsonPrimitive.TryCreate((int)TargetPlayer, out element); json.Add("TargetPlayer", element); JsonPrimitive.TryCreate(IsAutoPost, out element); json.Add("IsAutoPost", element); JsonPrimitive.TryCreate(AutoPostInterval, out element); json.Add("AutoPostInterval", element); // Save using (var sw = new System.IO.StreamWriter("setting.json")) { json.Save(sw); } }); }