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 90e37bf commit 4aad529
Showing 1 changed file with 40 additions and 48 deletions.
88 changes: 40 additions & 48 deletions PixivFSUWP/IllustDetailPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,17 @@ private async void BtnBookmark_Click(object sender, RoutedEventArgs e)
btnSender.IsChecked = false;
//进行关注
txtBtnBookmark.Text = "请求中";
var res = await Task.Run(() =>
bool res;
try
{
try
{
new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.csfriendly_illust_bookmark_add(illustID.ToString());
return true;
}
catch
{
return false;
}
});
await new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.IllustBookmarkAdd(illustID.ToString());
res = true;
}
catch
{
res = false;
}
if (res)
{
btnSender.IsChecked = true;
Expand All @@ -193,19 +191,17 @@ private async void BtnBookmark_Click(object sender, RoutedEventArgs e)
btnSender.IsChecked = true;
//取消关注
txtBtnBookmark.Text = "请求中";
var res = await Task.Run(() =>
bool res;
try
{
try
{
new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.csfriendly_illust_bookmark_delete(illustID.ToString());
return true;
}
catch
{
return false;
}
});
await new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.IllustBookmarkDelete(illustID.ToString());
res = true;
}
catch
{
res = false;
}
if (res)
{
btnSender.IsChecked = false;
Expand All @@ -225,19 +221,17 @@ private async void BtnFollow_Click(object sender, RoutedEventArgs e)
btnSender.IsChecked = false;
//进行关注
txtBtnFollow.Text = "请求中";
var res = await Task.Run(() =>
bool res;
try
{
try
{
new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.csfriendly_user_follow_add(illust.AuthorID.ToString());
return true;
}
catch
{
return false;
}
});
await new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.UserFollowAdd(illust.AuthorID.ToString());
res = true;
}
catch
{
res = false;
}
if (res)
{
btnSender.IsChecked = true;
Expand All @@ -250,19 +244,17 @@ private async void BtnFollow_Click(object sender, RoutedEventArgs e)
btnSender.IsChecked = true;
//取消关注
txtBtnFollow.Text = "请求中";
var res = await Task.Run(() =>
bool res;
try
{
try
{
new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.csfriendly_user_follow_delete(illust.AuthorID.ToString());
return true;
}
catch
{
return false;
}
});
await new PixivAppAPI(Data.OverAll.GlobalBaseAPI)
.UserFollowDelete(illust.AuthorID.ToString());
res = true;
}
catch
{
res = false;
}
if (res)
{
btnSender.IsChecked = false;
Expand Down

0 comments on commit 4aad529

Please sign in to comment.