コード例 #1
0
 public override async Task ExecuteAsync(TaskCancellationToken cancellationToken = null)
 {
     if (!control.TryCommit(out var exception))
     {
         Console.WriteLine($"{exception.Message}\n{exception.StackTrace}");
     }
 }
コード例 #2
0
 public override async Task ExecuteAsync(TaskCancellationToken cancellationToken = null)
 {
     if (!control.TryInsert(Values, out var exception))
     {
         Console.WriteLine($"{exception.Message}\n{exception.StackTrace}");
     }
     else
     {
         control.insertBox.Reset();
     }
 }
コード例 #3
0
        public override async Task ExecuteAsync(TaskCancellationToken cancellationToken = null)
        {
            control.table.CellSelected += Table_CellSelected;

            while (selectedCells.Count < rowCount)
            {
                if (cancellationToken?.IsCancellationRequested ?? false)
                {
                    throw new TaskCanceledException();
                }

                await Task.Delay(100);
            }

            control.table.CellSelected -= Table_CellSelected;
        }
コード例 #4
0
        public override async Task ExecuteAsync(TaskCancellationToken cancellationToken = null)
        {
            var selection = new SelectCommand(rowCount, control);

            var task = selection.ExecuteAsync(cancellationToken);

            await task;

            if (task.IsCanceled)
            {
                throw new TaskCanceledException();
            }

            if (!control.TryDelete(selection.SelectedRows, out var exception))
            {
                Console.WriteLine($"{exception.Message}\n{exception.StackTrace}");
            }
        }
コード例 #5
0
 public override async Task ExecuteAsync(TaskCancellationToken cancellationToken = null)
 {
     control.Refresh();
 }
コード例 #6
0
 public abstract Task ExecuteAsync(TaskCancellationToken cancellationToken);