using System; namespace Crowdin.Editor { /// Reports synchronously on the calling thread, unlike System.Progress<T> which posts /// through the captured SynchronizationContext and so can deliver a report after the /// operation it describes has already completed or thrown. internal sealed class SynchronousProgress : IProgress { private readonly Action callback; public SynchronousProgress(Action callback) { this.callback = callback; } public void Report(T value) => callback(value); } }