public static async Task <HttpResponseMessage> GetGame(SyncedGame SyncedGame) { var content = new Request() { Command = "GetGame", SyncedGame = SyncedGame }; return(await POSTContent(content)); }
public static async Task <bool?> AddGame(SyncedGame SyncedGame) { var content = new Request() { Command = "AddGameInfo", SyncedGame = SyncedGame }; var result = await POSTContent(content); return(result?.IsSuccessStatusCode); }
public static async Task <HttpResponseMessage> GetFile(SyncedGame SyncedGame, string RelativePath) { var content = new Request() { Command = "GetFile", SyncedGame = SyncedGame, Note = RelativePath }; return(await POSTContent(content)); }
public static async Task <bool?> UploadFile(SyncedGame SyncedGame, string FilePath, string RelativePath) { var webClient = new WebClient(); webClient.Headers.Add("Command", "UploadFile"); webClient.Headers.Add("AuthenticationToken", Settings.Current.AuthenticationToken); webClient.Headers.Add("AccountName", AccountInfo.Current.AccountName); webClient.Headers.Add("GameName", SyncedGame.Name); webClient.Headers.Add("RelativePath", RelativePath); try { await webClient.UploadFileTaskAsync(ServicePath, FilePath); return(true); } catch { return(false); } }
private void buttonOK_Click(object sender, RoutedEventArgs e) { SelectedGame = (SyncedGame)listGames.SelectedItem; }
public GameSubscription(int gameCode, SyncedGame game, Action <GameSubscription> disposer) { GameCode = gameCode; Game = game ?? throw new ArgumentNullException(nameof(game)); Disposer = disposer ?? throw new ArgumentNullException(nameof(disposer)); }
public GameInfo(SyncedGame game) { Game = game ?? throw new ArgumentNullException(nameof(game)); }