Esempio n. 1
0
        void analog_AnalogChanged(object sender, AnalogChangeEventArgs e)
        {
            {
                double v = Convert.ToDouble(e.Channels[0]);
                result.Enqueue(v);

                if (result.Count > 22)
                {
                    AsyncWorker.ReportProgress(-1, null);

                    result.Dequeue();
                }
            }
        }
Esempio n. 2
0
        private void backgroundEntryWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BeginInvoke(new MethodInvoker(delegate
            {
                progressBar.Visible   = true;
                progressBar.Value     = 5;
                pageIndex             = 0;
                button_search.Enabled = false;
            }));

            animeEntries = GetAnimes();
            pages        = (int)Math.Ceiling(animeEntries.Count() * 1.0 / entriesPerPage);
            AsyncWorker.ReportProgress(10);

            LoadPage.RunWorkerAsync();
        }