コード例 #1
0
ファイル: View3.cs プロジェクト: psacharuk/csharpTraining
 private void button2_Click(object sender, EventArgs e)
 {
     _asyncService.PerformAsyncAction(
         () =>
     {
         Thread.Sleep(1000);
         return(true);
     },
         flag => label1.Text = "1"
         );
 }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var col1 = _companyDataService.GetData().Take(100);

            _messageBoxService.ShowMessage(
                col1.First().GetHashCode().ToString()
                );
            _messageBoxService.ShowMessage(
                col1.First().GetHashCode().ToString()
                );

            var col2 = _companyDataService.GetData().Take(100).ToList();

            _messageBoxService.ShowMessage(
                col2.First().GetHashCode().ToString()
                );
            _messageBoxService.ShowMessage(
                col2.First().GetHashCode().ToString()
                );

            _asyncService.PerformAsyncAction(
                () =>
            {
                _data = _companyDataService.GetData().Take(100).ToList();
                return(_data);
            },
                data => dataGridView1.DataSource = data
                );
        }