spectre.console/src/Spectre.Console/IExclusivityMode.cs
Patrik Svensson 52c1d9122b
Add global usings (#668)
* Use global usings

* Fix namespace declarations for test projects
2021-12-23 16:50:31 +01:00

23 lines
767 B
C#

namespace Spectre.Console;
/// <summary>
/// Represents an exclusivity mode.
/// </summary>
public interface IExclusivityMode
{
/// <summary>
/// Runs the specified function in exclusive mode.
/// </summary>
/// <typeparam name="T">The result type.</typeparam>
/// <param name="func">The func to run in exclusive mode.</param>
/// <returns>The result of the function.</returns>
T Run<T>(Func<T> func);
/// <summary>
/// Runs the specified function in exclusive mode asynchronously.
/// </summary>
/// <typeparam name="T">The result type.</typeparam>
/// <param name="func">The func to run in exclusive mode.</param>
/// <returns>The result of the function.</returns>
Task<T> RunAsync<T>(Func<Task<T>> func);
}