示例#1
0
 private void OK_Click(object sender, EventArgs e)
 {
     OK.Enabled = false;
     Controls.Remove(chart1);
     Controls.Remove(dataGridView);
     BW.RunWorkerAsync("OK");
 }
示例#2
0
        //Načtení anime
        private void LoadAnime()
        {
            Main_LB01.Visible = true;
            AnimeS.Columns.Clear();
            AnimeS.Rows.Clear();
            AnimeID.Clear();

            AnimeS.Width    = Convert.ToInt32(Math.Truncate((float)this.Width / 250) * 250);
            AnimeS.Height   = 240;
            AnimeS.Location = new Point((this.Width - AnimeS.Width) / 2, AnimeS.Location.Y);

            Anime.Location = new Point((this.Width - Anime.Width) / 2, AnimeS.Location.Y + AnimeS.Height + 20);

            AnimeS.Columns.Add(new DataGridViewImageColumn());
            AnimeS.Rows.Add();
            AnimeS.Rows[0].Height = 230;

            AnimeS.Rows.Add();
            AnimeS.Rows[1].Height = 5;

            AnimeS.Rows[1].DefaultCellStyle.SelectionBackColor = DesignColor;
            AnimeS.Rows[1].DefaultCellStyle.SelectionForeColor = DesignColor;

            if (BW.IsBusy)
            {
                BW.CancelAsync();
                Thread.Sleep(3000);
            }

            BW.RunWorkerAsync();
        }
示例#3
0
 private void start_Click(object sender, EventArgs e)
 {
     //выкл кнопку
     Cancel.Enabled = true;
     start.Enabled  = false;
     Controls.Remove(chart1);
     Controls.Remove(dataGridView);
     BW.RunWorkerAsync("START");//запуск кода в обработчике do_work, выполняется в отдельном потоке
 }
示例#4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     maStart.Value  = 10;
     maEnd.Value    = 20;
     rsiStart.Value = 8;
     rsiEnd.Value   = 12;
     ma2Start.Value = 12;
     ma2End.Value   = 15;
     BW.RunWorkerAsync();
 }
示例#5
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     ma2Start.Enabled = false;
     ma2End.Enabled   = false;
     rsiStart.Enabled = false;
     rsiEnd.Enabled   = false;
     maStart.Enabled  = false;
     maEnd.Enabled    = false;
     BW.RunWorkerAsync();
 }
示例#6
0
        private async void UserWindow_Load(object sender, EventArgs e)
        {
            // SelectedUser был без ID , тут мы его всего забираем из базы
            Variable.SelectedUser = ServiceClient.FindUser(Variable.SelectedUser);
            // подгрузить заметки юзера
            Variable.Notes = await ServiceClient.GetNotesOfUser(Variable.SelectedUser.Id_);

            listBoxNotesOfUser.Items.AddRange(Variable.Notes.Select(x => x.Title).ToArray());
            // Хаб для SignalR
            hubConnection       = new HubConnection("http://localhost:36932/");
            stockTickerHubProxy = hubConnection.CreateHubProxy("SignalRHub");
            stockTickerHubProxy.On("Update", () => BW.RunWorkerAsync());// BW - BackgroundWorker
            hubConnection.Start().Wait();
            // BackgroundWorker для клиентской обработки серверного метода от SignalR
            BW.DoWork             += update;
            BW.RunWorkerCompleted += BW_RunWorkerCompleted;
        }
示例#7
0
 /// <summary>
 /// Rename files
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BTRename_Click(object sender, EventArgs e)
 {
     // Rename if files
     if (LVFiles.Items.Count > 0)
     {
         DialogResult dialogResult = MessageBox.Show($"{LVFiles.Items.Count} files are about to be renamed. Do you want to continue ?", "Rename files", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
         if (dialogResult == DialogResult.Yes)
         {
             // Start (processing files) thread
             loading = true;
             new Thread(Loading).Start();
             BW.RunWorkerAsync();
             BTClear.Enabled  = false;
             BTRename.Enabled = false;
         }
     }
 }
示例#8
0
 private void MainMenu_Load(object sender, EventArgs e)
 {
     BW.RunWorkerAsync();
 }
示例#9
0
 private void btn_Get_Click(object sender, EventArgs e)
 {
     currChapter = first;
     BW.RunWorkerAsync();
 }
示例#10
0
 private void UserList_Load(object sender, EventArgs e)
 {
     BW.RunWorkerAsync();
 }