コード例 #1
0
        public static async Task <HttpResponseMessage> GetGame(SyncedGame SyncedGame)
        {
            var content = new Request()
            {
                Command    = "GetGame",
                SyncedGame = SyncedGame
            };

            return(await POSTContent(content));
        }
コード例 #2
0
        public static async Task <bool?> AddGame(SyncedGame SyncedGame)
        {
            var content = new Request()
            {
                Command    = "AddGameInfo",
                SyncedGame = SyncedGame
            };
            var result = await POSTContent(content);

            return(result?.IsSuccessStatusCode);
        }
コード例 #3
0
        public static async Task <HttpResponseMessage> GetFile(SyncedGame SyncedGame, string RelativePath)
        {
            var content = new Request()
            {
                Command    = "GetFile",
                SyncedGame = SyncedGame,
                Note       = RelativePath
            };

            return(await POSTContent(content));
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 private void buttonOK_Click(object sender, RoutedEventArgs e)
 {
     SelectedGame = (SyncedGame)listGames.SelectedItem;
 }
コード例 #6
0
 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));
 }
コード例 #7
0
 public GameInfo(SyncedGame game)
 {
     Game = game ?? throw new ArgumentNullException(nameof(game));
 }