mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Using generic enum value in service
This commit is contained in:
parent
a59cd2f60b
commit
c37120813e
5 changed files with 7 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue