Using generic enum value in service

This commit is contained in:
Jaex 2016-03-22 03:03:47 +02:00
parent a59cd2f60b
commit c37120813e
5 changed files with 7 additions and 13 deletions

View file

@ -25,10 +25,8 @@ You should have received a copy of the GNU General Public License
namespace ShareX.UploadersLib
{
public abstract class FileUploaderService : UploaderService
public abstract class FileUploaderService : UploaderService<FileDestination>
{
public abstract FileDestination EnumValue { get; }
public abstract FileUploader CreateUploader(UploadersConfig uploadersConfig);
}
}

View file

@ -25,10 +25,8 @@ You should have received a copy of the GNU General Public License
namespace ShareX.UploadersLib
{
public abstract class ImageUploaderService : UploaderService
public abstract class ImageUploaderService : UploaderService<ImageDestination>
{
public abstract ImageDestination EnumValue { get; }
public abstract ImageUploader CreateUploader(UploadersConfig uploadersConfig);
}
}

View file

@ -25,10 +25,8 @@ You should have received a copy of the GNU General Public License
namespace ShareX.UploadersLib
{
public abstract class TextUploaderService : UploaderService
public abstract class TextUploaderService : UploaderService<TextDestination>
{
public abstract TextDestination EnumValue { get; }
public abstract TextUploader CreateUploader(UploadersConfig uploadersConfig);
}
}

View file

@ -25,10 +25,8 @@ You should have received a copy of the GNU General Public License
namespace ShareX.UploadersLib
{
public abstract class URLShortenerService : UploaderService
public abstract class URLShortenerService : UploaderService<UrlShortenerType>
{
public abstract UrlShortenerType EnumValue { get; }
public abstract URLShortener CreateShortener(UploadersConfig uploadersConfig);
}
}

View file

@ -25,8 +25,10 @@ You should have received a copy of the GNU General Public License
namespace ShareX.UploadersLib
{
public abstract class UploaderService
public abstract class UploaderService<T>
{
public abstract T EnumValue { get; }
// This function is used in destinations menu to show invalid uploaders as disabled.
// For example if uploader is only allowed to upload with account and if account configuration is not valid then this function should return false.
public abstract bool CheckConfig(UploadersConfig uploadersConfig);