本文整理汇总了C#中ApiClient.AddUserSleeves方法的典型用法代码示例。如果您正苦于以下问题:C# ApiClient.AddUserSleeves方法的具体用法?C# ApiClient.AddUserSleeves怎么用?C# ApiClient.AddUserSleeves使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiClient
的用法示例。
在下文中一共展示了ApiClient.AddUserSleeves方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddSleeveToAccount
public bool AddSleeveToAccount(int id)
{
try
{
var req = new UpdateUserSleevesRequest();
req.Add(new ApiSleeve()
{
Id = id
});
var c = new ApiClient();
AuthorizedResponse<int[]> result;
result = Program.LobbyClient.IsConnected == false ? c.AddUserSleeves(Prefs.Username, Prefs.Password.Decrypt(), req) : c.AddUserSleeves(Program.LobbyClient.Username, Program.LobbyClient.Password, req);
if (result == null || result.Authorized == false || result.Response == null)
{
WindowManager.GrowlWindow.AddNotification(new ErrorNotification("There was a problem adding the sleeve to your account. Please check your internet settings."));
return false;
}
if (result.Response.Contains(id))
return true;
}
catch (Exception e)
{
Log.Error("AddSleeveToAccount", e);
}
WindowManager.GrowlWindow.AddNotification(new ErrorNotification("There was a problem adding the sleeve to your account. Please check your internet settings."));
return false;
}