提交 8d1ef33a 编写于 作者: C CyrusNajmabadi

Add IOUtilities helper for calling IO methods that don't return values.

上级 c314f6fe
......@@ -8,6 +8,15 @@ namespace Microsoft.CodeAnalysis.Shared.Utilities
{
internal static class IOUtilities
{
public static void PerformIO(Action action)
{
PerformIO<object>(() =>
{
action();
return null;
});
}
public static T PerformIO<T>(Func<T> function, T defaultValue = default(T))
{
try
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册