sonarr-repo-only/NzbDrone.Common/Messaging/Tracking/TrackedCommand.cs

38 lines
985 B
C#
Raw Normal View History

using System;
namespace NzbDrone.Common.Messaging.Tracking
{
public class TrackedCommand
{
public String Id { get; private set; }
public String Name { get; private set; }
2013-08-28 15:05:41 +00:00
public String Type { get; private set; }
public ICommand Command { get; private set; }
public CommandState State { get; set; }
public DateTime StateChangeTime { get; set; }
public TimeSpan Runtime { get; set; }
public Exception Exception { get; set; }
public TrackedCommand()
{
}
public TrackedCommand(ICommand command, CommandState state)
{
Id = command.CommandId;
Name = command.GetType().Name;
Type = command.GetType().FullName;
Command = command;
State = state;
StateChangeTime = DateTime.UtcNow;
}
}
public enum CommandState
{
Running = 0,
Completed = 1,
Failed = 2
}
}