Пример #1
0
 public async Task CreateSelection()
 {
     await SavedSelection.RunCreateSavedSelection(this.output);
 }
        private async void ButtonSubmit_Click(object sender, EventArgs e)
        {
            // check the case that
            if (this.comboBox1.Text != "Login" &&
                (AppConstants.ApiToken == "INVALID_KEY" || AppConstants.ApiToken == string.Empty))
            {
                this.label1.Text    = "Must be logged in to run this function...";
                this.label1.Visible = true;
                return;
            }

            this.label1.Text    = "Running " + this.comboBox1.Text + "...";
            this.label1.Visible = true;

            switch (this.comboBox1.Text)
            {
            case "DownloadShaped":
                await DownloadShaped.RunDownloadShapedAsync(this.output);

                break;

            case "DownloadShapedStream":
                await DownloadShaped.RunDownloadShapedStreamAsync(this.output);

                break;

            case "DownloadFile":
                await Download.RunDownloadFileAsync(this.output);

                break;

            case "GetVariables":
                await Info.RunGetVariablesAsync(this.output);

                break;

            case "GetRegions":
                await Info.RunGetRegionsAsync(this.output);

                break;

            case "RequestDownload":
                await Download.RunRequestDownloadAsync(this.output);

                break;

            case "GetSavedSelection":
                await SavedSelection.RunGetSavedSelection(AppConstants.SavedSelectionId, this.output);

                break;

            case "UpdateSavedSelection":
                await SavedSelection.RunUpdateSavedSelection(this.output);

                break;

            case "CreateSavedSelection":
                await SavedSelection.RunCreateSavedSelection(this.output);

                break;

            case "GetAllUsers":
                await Core.User.RunGetAllUsersAsync(this.output);

                break;

            case "Login":
                await Core.User.RunLoginAsync(this.output, this.textBox0.Text, this.textBox1.Text);

                break;

            case "GetUser":
                await Core.User.RunGetUserAsync(this.output);

                break;

            case "GetDatabanks":
                await Info.RunGetDatabanksAsync(this.output);

                break;

            case "Download":
                await Download.RunDownloadAsync(this.output);

                break;

            default:
                this.label1.Text = "Invalid selection";
                break;
            }
        }