コード例 #1
0
ファイル: Favorites.cs プロジェクト: hartl3y94/ShikimoriSharp
        public async Task PostFavorite(FavoriteSettings s, AccessToken personalInformation)
        {
            if (s.linked_type != null && s.linked_type.ToLower() == "person" && s.kind is null)
            {
                throw new Exception("Kind can not be null, when linked_id is Person");
            }

            await NoResponseRequest($"favorites/{s.linked_type}/{s.linked_id}/{s.kind}", personalInformation);
        }
コード例 #2
0
        private void SaveSetting()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("EnableFavoriteFunction");

            FavoriteSettings favoriteSettings = new FavoriteSettings();

            favoriteSettings.EnableFavoriteFunction = _Request.Get <bool>("EnableFavoriteFunction", Method.Post, true);

            if (!msgDisplay.HasAnyError())
            {
                SettingManager.SaveSettings(favoriteSettings);
            }
        }
コード例 #3
0
ファイル: Favorites.cs プロジェクト: hartl3y94/ShikimoriSharp
 public async Task DeleteFavorite(FavoriteSettings s, AccessToken personalInformation)
 {
     await NoResponseRequest($"favorites/{s.linked_type}/{s.linked_id}", personalInformation, method : "DELETE");
 }