Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
完成一部分迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed May 18, 2019
1 parent 4aad529 commit 8b64d89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 12 additions & 12 deletions PixivFSUWP/Data/WaterfallItem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FSharp.Data;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Json;

namespace PixivFSUWP.Data
{
Expand All @@ -18,18 +18,18 @@ public class WaterfallItem
public bool IsBookmarked { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public static WaterfallItem FromJsonValue(JsonValue Source)
public static WaterfallItem FromJsonValue(JsonObject Source)
{
var toret = new WaterfallItem();
toret.Id = Source.TryGetProperty("id").Value.AsInteger();
toret.Title = Source.TryGetProperty("title").Value.AsString();
toret.Author = Source.TryGetProperty("user").Value.TryGetProperty("name").Value.AsString();
toret.ImageUri = Source.TryGetProperty("image_urls").Value.TryGetProperty("medium").Value.AsString();
toret.Stars = Source.TryGetProperty("total_bookmarks").Value.AsInteger();
toret.Pages = Source.TryGetProperty("page_count").Value.AsInteger();
toret.IsBookmarked = Source.TryGetProperty("is_bookmarked").Value.AsBoolean();
toret.Width = Source.TryGetProperty("width").Value.AsInteger();
toret.Height = Source.TryGetProperty("height").Value.AsInteger();
toret.Id = Convert.ToInt32(Source["id"].GetString());
toret.Title = Source["title"].GetString();
toret.Author = Source["user"].GetObject()["name"].GetString();
toret.ImageUri = Source["image_urls"].GetObject()["medium"].GetString();
toret.Stars = Convert.ToInt32(Source["total_bookmarks"].GetString());
toret.Pages = Convert.ToInt32(Source["page_count"].GetString());
toret.IsBookmarked = Source["is_bookmarked"].GetBoolean();
toret.Width = Convert.ToInt32(Source["width"].GetString());
toret.Height = Convert.ToInt32(Source["height"].GetString());
return toret;
}
}
Expand Down
2 changes: 0 additions & 2 deletions PixivFSUWP/ViewModels/WaterfallItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Threading.Tasks;
using PixivFSUWP.Data;
using Windows.UI.Xaml.Media.Imaging;
using PixivFSCS;
using PixivFS;
using System.IO;

namespace PixivFSUWP.ViewModels
Expand Down

0 comments on commit 8b64d89

Please sign in to comment.