Пример #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));
 }