parent
b81c3ee4a8
commit
2e784c7f36
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using Equ;
|
||||||
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Download.Clients
|
||||||
|
{
|
||||||
|
public abstract class DownloadClientSettingsBase<TSettings> : IProviderConfig, IEquatable<TSettings>
|
||||||
|
where TSettings : DownloadClientSettingsBase<TSettings>
|
||||||
|
{
|
||||||
|
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||||
|
|
||||||
|
public abstract NzbDroneValidationResult Validate();
|
||||||
|
|
||||||
|
public bool Equals(TSettings other)
|
||||||
|
{
|
||||||
|
return Comparer.Equals(this as TSettings, other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return Equals(obj as TSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Comparer.GetHashCode(this as TSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using Equ;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.ImportLists
|
||||||
|
{
|
||||||
|
public abstract class ImportListSettingsBase<TSettings> : IImportListSettings, IEquatable<TSettings>
|
||||||
|
where TSettings : ImportListSettingsBase<TSettings>
|
||||||
|
{
|
||||||
|
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||||
|
|
||||||
|
public abstract string BaseUrl { get; set; }
|
||||||
|
|
||||||
|
public abstract NzbDroneValidationResult Validate();
|
||||||
|
|
||||||
|
public bool Equals(TSettings other)
|
||||||
|
{
|
||||||
|
return Comparer.Equals(this as TSettings, other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return Equals(obj as TSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Comparer.GetHashCode(this as TSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using Equ;
|
||||||
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Notifications
|
||||||
|
{
|
||||||
|
public abstract class NotificationSettingsBase<TSettings> : IProviderConfig, IEquatable<TSettings>
|
||||||
|
where TSettings : NotificationSettingsBase<TSettings>
|
||||||
|
{
|
||||||
|
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||||
|
|
||||||
|
public abstract NzbDroneValidationResult Validate();
|
||||||
|
|
||||||
|
public bool Equals(TSettings other)
|
||||||
|
{
|
||||||
|
return Comparer.Equals(this as TSettings, other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return Equals(obj as TSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return Comparer.GetHashCode(this as TSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue