In a comment, you wrote:
this relatively simplified-looking code is actually a full real function in my program.
If you look around the site, you will notice that very few of the questions are single functions. And most of those that are are self contained. E.g. this question. The input and output are clear there.
I have the following questions reading your original question:
What input and output does your function take? I'm still not sure after the edits. Part of this may be C# — I don't know anything about how C# works.
What does ProcessCommand()
return? It's hard to know what ContinueWith
does if I don't know in what class it is.
What's a t
?
Does Wait
do more than its name?
For the revised version, what does onClick
have to do with anything?
More context can make this more obvious. Ideally a question should be self-contained. If we can run it, it's much easier to understand how it works and modify it.
Sometimes people use explanation or comments to fill in the gap. So you might say ProcessCommand()
returns a ... which has an interface as described at this URL. Here's what t
is. Etc.
There is an argument that there is still insufficient context to review that code. That you already have an answer is probably the strongest counter-argument.
In the future, you may want to spend more time thinking about how people will see your code. Can they run it? Do you describe the input and output? If you can't post all the code within the 65k character limit, can you post a runnable fraction? Perhaps you can write a test harness for the code (both good practice and makes reviewing easier) so that the code can be run separately from the application.