using System;
namespace MediaBrowser.Common.Progress
{
///
/// Class ActionableProgress
///
///
public class ActionableProgress : IProgress
{
///
/// The _actions
///
private Action _action;
public event EventHandler ProgressChanged;
///
/// Registers the action.
///
/// The action.
public void RegisterAction(Action action)
{
_action = action;
}
public void Report(T value)
{
if (ProgressChanged != null)
{
ProgressChanged(this, value);
}
var action = _action;
if (action != null)
{
action(value);
}
}
}
public class SimpleProgress : IProgress
{
public event EventHandler ProgressChanged;
public void Report(T value)
{
if (ProgressChanged != null)
{
ProgressChanged(this, value);
}
}
}
}