sonarr-repo-only/NzbDrone.Core/ThingiProvider/ProviderBase.cs

67 lines
1.6 KiB
C#
Raw Normal View History

2013-09-21 00:18:11 +00:00

using FluentValidation.Results;
2013-09-21 00:18:11 +00:00
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Indexers;
2013-09-21 00:18:11 +00:00
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Notifications;
2013-09-21 00:18:11 +00:00
namespace NzbDrone.Core.ThingiProvider
{
public class NotificationProviderRepository : BasicRepository<NotificationDefinition>
2013-09-21 00:18:11 +00:00
{
public NotificationProviderRepository(IDatabase database, IEventAggregator eventAggregator)
2013-09-21 00:18:11 +00:00
: base(database, eventAggregator)
{
}
}
public class IndexerProviderRepository : BasicRepository<IndexerDefinition>
{
public IndexerProviderRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
2013-09-21 00:18:11 +00:00
}
public abstract class ProviderBase
2013-09-21 00:18:11 +00:00
{
public ProviderDefinition Definition { get; set; }
2013-09-21 00:18:11 +00:00
}
public abstract class ProviderDefinition : ModelBase
2013-09-21 00:18:11 +00:00
{
public string Name { get; set; }
2013-09-21 00:18:11 +00:00
public string Implementation { get; set; }
public string ConfigContract
{
get
{
if (Settings == null) return null;
return Settings.GetType().Name;
}
set
{
}
}
2013-09-21 00:18:11 +00:00
public IProviderConfig Settings { get; set; }
2013-09-21 00:18:11 +00:00
}
public interface IProviderConfig
2013-09-21 00:18:11 +00:00
{
ValidationResult Validate();
}
public class NullSetting : IProviderConfig
{
public static readonly NullSetting Instance = new NullSetting();
public ValidationResult Validate()
{
return new ValidationResult();
}
2013-09-21 00:18:11 +00:00
}
}