Exemplo n.º 1
0
        private async void btnAsyncAwait_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.Aquamarine;
            this.btnAsyncAwait.BackColor = Color.Blue;

            var operationA = new LongTimeOperationA().GetValue();
            var operationB = new LongTimeOperationB().GetValue();

            var valueA = await operationA;

            Text = valueA;
        }
Exemplo n.º 2
0
        private async void btnAsyncAwait_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.Aquamarine;
            this.btnAsyncAwait.BackColor = Color.Blue;

            var operationA = new LongTimeOperationA().GetValue();
            var operationB = new LongTimeOperationB().GetValue();

            var valueA =await operationA;
            Text = valueA;
           
        }
Exemplo n.º 3
0
        private void btnTaskResult_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.Beige;
            this.btnTaskResult.BackColor = Color.BlueViolet;

            var operationA = new LongTimeOperationA().GetValue();
            var operationB = new LongTimeOperationB().GetValue();

            var valueA = operationA.Result;

            Text = valueA;
        }
Exemplo n.º 4
0
        private void btnTaskResult_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.Beige;
            this.btnTaskResult.BackColor = Color.BlueViolet;

            var operationA=new LongTimeOperationA().GetValue();
            var operationB=new LongTimeOperationB().GetValue();

            var valueA = operationA.Result;
            Text = valueA;
          
        }