2012-02-05 07:34:36 +01:00
|
|
|
|
using System;
|
2012-02-16 07:16:57 +01:00
|
|
|
|
using System.Collections.Generic;
|
2012-02-05 07:34:36 +01:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Contract
|
|
|
|
|
{
|
|
|
|
|
public abstract class ReportBase
|
|
|
|
|
{
|
|
|
|
|
[JsonProperty("v")]
|
|
|
|
|
public string Version { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty("p")]
|
|
|
|
|
public bool IsProduction { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty("u")]
|
|
|
|
|
public Guid UGuid { get; set; }
|
2012-02-16 07:16:57 +01:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
var childString = "";
|
|
|
|
|
foreach (var keyValue in GetString())
|
|
|
|
|
{
|
|
|
|
|
childString += string.Format("{0}: {1} ", keyValue.Key, keyValue.Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return string.Format("[{0} Prd:{1} V:{2} ID:{3} | {4}]", GetType().Name, IsProduction, Version, UGuid, childString.Trim());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract Dictionary<string,string> GetString();
|
2012-02-05 07:34:36 +01:00
|
|
|
|
}
|
|
|
|
|
}
|