Example #1
0
        public ConfigureGameForm(GameDto game, CarouselClient client)
        {
            InitializeComponent();

            this._CarouselClient = client;
            this._Game           = game;
            this._Game.Load();
            this.ExePathLabel.Text            = this._Game.ExePath;
            _BindingSource                    = new BindingSource();
            _BindingSource.DataSource         = this._Game.LocalFiles;
            this.GameFileDataTable.DataSource = _BindingSource;

            if (this.GameFileDataTable.RowCount >= 1)
            {
                for (int i = GameFileDataTable.ColumnCount - 1; i >= 0; i--)
                {
                    if (i == GameFileDataTable.ColumnCount - 1)
                    {
                        GameFileDataTable.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                    }
                    else
                    {
                        GameFileDataTable.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                    }
                }
            }
        }
Example #2
0
        internal async Task Initialize()
        {
            try
            {
                // var worker = new ProgressWorker();
                // await worker.Run((cts) =>
                // {
                var cts = new CancellationTokenSource();
                _Client = CarouselClient.CreateInstance(cts, () =>
                {
                    var prompt = new TextPrompt("Please enter your Google username");
                    prompt.ShowDialog();
                    return(prompt.TextResult);
                }).Result;
                // });
            }
            catch (Exception)
            {
                MessageBox.Show("Error authorizing Google Drive API. Please check configuration files.");
                return;
            }

            using (var cts = new CancellationTokenSource())
            {
                this.GamesListBox.DataSource = _Client.GetGamesList();
            }
        }
Example #3
0
 /// <summary>
 /// uploads game's local files to remote directory
 /// </summary>
 /// <param name="client">carousel client</param>
 public async Task UploadLocalFiles(CarouselClient client)
 {
     client.UploadFiles(this.LocalFiles, this.Id);
 }
Example #4
0
 /// <summary>
 /// downloads each remote game file to its respective local path
 /// </summary>
 /// <param name="client">carousel client</param>
 private void DownloadRemoteFiles(CarouselClient client)
 {
     client.DownloadFiles(this.LocalFiles);
 }
Example #5
0
 /// <summary>
 /// backs up local and downloads remote files
 /// </summary>
 /// <param name="client">carousel client</param>
 public void SetupGame(CarouselClient client)
 {
     BackupLocalFiles();
     DownloadRemoteFiles(client);
 }
Example #6
0
        public SettingsForm(CarouselClient client)
        {
            InitializeComponent();

            _CarouselClient = client;
        }