提交 3be7a1f8 编写于 作者: C CyrusNajmabadi

Simplify code.

上级 971b4a30
......@@ -71,32 +71,10 @@ private static TaskHandlerOptions GetOptions(string title)
{
var options = new TaskHandlerOptions
{
Title = title
Title = title,
RetentionAfterCompletion = CompletionRetention.Faulted
};
try
{
// A breaking change was made to the Options struct. So safely try to set the
// retention mode in a try/catch so that if we can't even load that code on VS
// we won't crash.
//
// Note: not setting the retention mode is fine. It just means the VSTask will be
// removed once it completes in any way. The desired behavior is for it to stay
// around if there was a failure. And that's the behavior you get if your VS
// has the same version of this API that roslyn is targetting.
options = SetRetentionMode(options);
}
catch
{
}
return options;
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static TaskHandlerOptions SetRetentionMode(TaskHandlerOptions options)
{
options.ActionsAfterCompletion = CompletionActions.RetainOnFaulted;
return options;
}
......@@ -127,4 +105,4 @@ public Task OnDownloadFullDatabaseFailedAsync(string message)
}
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册