2013-11-03 23:53:49 +13:00
#region License Information ( GPL v3 )
/ *
ShareX - A program that allows you to take screenshots and share any file type
2022-01-12 05:32:17 +13:00
Copyright ( c ) 2007 - 2022 ShareX Team
2013-11-03 23:53:49 +13:00
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
Optionally you can also view the license at < http : //www.gnu.org/licenses/>.
* /
#endregion License Information ( GPL v3 )
2014-12-11 11:59:27 +13:00
using Newtonsoft.Json ;
2014-12-11 09:25:20 +13:00
using ShareX.HelpersLib ;
using ShareX.ImageEffectsLib ;
using ShareX.IndexerLib ;
2015-08-25 03:30:49 +12:00
using ShareX.MediaLib ;
2014-12-11 09:25:20 +13:00
using ShareX.ScreenCaptureLib ;
2014-12-11 11:59:27 +13:00
using ShareX.UploadersLib ;
2014-01-18 06:41:01 +13:00
using System ;
2013-11-03 23:53:49 +13:00
using System.Collections.Generic ;
using System.ComponentModel ;
2014-11-13 07:19:50 +13:00
using System.ComponentModel.Design ;
2013-12-29 22:13:50 +13:00
using System.Drawing ;
2014-04-01 01:20:12 +13:00
using System.Drawing.Design ;
2015-03-08 14:13:55 +13:00
using System.Linq ;
2013-11-03 23:53:49 +13:00
namespace ShareX
{
public class TaskSettings
{
2015-08-31 22:44:23 +12:00
[JsonIgnore]
public TaskSettings TaskSettingsReference { get ; private set ; }
2020-08-26 07:43:27 +12:00
[JsonIgnore]
public bool IsSafeTaskSettings = > TaskSettingsReference ! = null ;
2016-05-25 06:15:45 +12:00
public string Description = "" ;
2015-01-17 09:22:41 +13:00
2013-11-03 23:53:49 +13:00
public HotkeyType Job = HotkeyType . None ;
public bool UseDefaultAfterCaptureJob = true ;
2014-11-21 23:09:13 +13:00
public AfterCaptureTasks AfterCaptureJob = AfterCaptureTasks . CopyImageToClipboard | AfterCaptureTasks . SaveImageToFile | AfterCaptureTasks . UploadImageToHost ;
2014-05-11 14:33:46 +12:00
2014-05-11 23:47:37 +12:00
public bool UseDefaultAfterUploadJob = true ;
public AfterUploadTasks AfterUploadJob = AfterUploadTasks . CopyURLToClipboard ;
2014-05-11 14:33:46 +12:00
2014-05-11 23:47:37 +12:00
public bool UseDefaultDestinations = true ;
2014-12-28 23:07:34 +13:00
public ImageDestination ImageDestination = ImageDestination . Imgur ;
2014-09-14 19:08:05 +12:00
public FileDestination ImageFileDestination = FileDestination . Dropbox ;
2013-11-03 23:53:49 +13:00
public TextDestination TextDestination = TextDestination . Pastebin ;
2014-09-14 19:08:05 +12:00
public FileDestination TextFileDestination = FileDestination . Dropbox ;
2013-11-03 23:53:49 +13:00
public FileDestination FileDestination = FileDestination . Dropbox ;
public UrlShortenerType URLShortenerDestination = UrlShortenerType . BITLY ;
2014-07-14 08:59:17 +12:00
public URLSharingServices URLSharingServiceDestination = URLSharingServices . Twitter ;
2014-05-31 13:27:47 +12:00
2013-11-08 20:23:55 +13:00
public bool OverrideFTP = false ;
2013-11-09 05:12:56 +13:00
public int FTPIndex = 0 ;
2013-11-03 23:53:49 +13:00
2014-12-11 11:59:27 +13:00
public bool OverrideCustomUploader = false ;
public int CustomUploaderIndex = 0 ;
2020-04-23 00:26:04 +12:00
public bool OverrideScreenshotsFolder = false ;
public string ScreenshotsFolder = "" ;
2013-11-03 23:53:49 +13:00
public bool UseDefaultGeneralSettings = true ;
public TaskSettingsGeneral GeneralSettings = new TaskSettingsGeneral ( ) ;
public bool UseDefaultImageSettings = true ;
public TaskSettingsImage ImageSettings = new TaskSettingsImage ( ) ;
2017-10-15 02:13:24 +13:00
[JsonIgnore]
public TaskSettingsImage ImageSettingsReference
{
get
{
if ( UseDefaultImageSettings )
{
return Program . DefaultTaskSettings . ImageSettings ;
}
return TaskSettingsReference . ImageSettings ;
}
}
2013-11-03 23:53:49 +13:00
public bool UseDefaultCaptureSettings = true ;
public TaskSettingsCapture CaptureSettings = new TaskSettingsCapture ( ) ;
2015-08-31 22:44:23 +12:00
[JsonIgnore]
public TaskSettingsCapture CaptureSettingsReference
{
get
{
if ( UseDefaultCaptureSettings )
{
return Program . DefaultTaskSettings . CaptureSettings ;
}
return TaskSettingsReference . CaptureSettings ;
}
}
2013-11-03 23:53:49 +13:00
public bool UseDefaultUploadSettings = true ;
public TaskSettingsUpload UploadSettings = new TaskSettingsUpload ( ) ;
public bool UseDefaultActions = true ;
public List < ExternalProgram > ExternalPrograms = new List < ExternalProgram > ( ) ;
2015-08-25 03:30:49 +12:00
public bool UseDefaultToolsSettings = true ;
public TaskSettingsTools ToolsSettings = new TaskSettingsTools ( ) ;
2013-11-03 23:53:49 +13:00
2014-05-11 23:47:37 +12:00
[JsonIgnore]
2015-08-31 22:44:23 +12:00
public TaskSettingsTools ToolsSettingsReference
2014-07-10 11:16:27 +12:00
{
get
{
2015-08-31 22:44:23 +12:00
if ( UseDefaultToolsSettings )
2014-07-10 11:16:27 +12:00
{
2015-08-31 22:44:23 +12:00
return Program . DefaultTaskSettings . ToolsSettings ;
2014-07-10 11:16:27 +12:00
}
2015-08-31 22:44:23 +12:00
return TaskSettingsReference . ToolsSettings ;
2014-07-10 11:16:27 +12:00
}
}
2015-08-31 22:44:23 +12:00
public bool UseDefaultAdvancedSettings = true ;
public TaskSettingsAdvanced AdvancedSettings = new TaskSettingsAdvanced ( ) ;
public bool WatchFolderEnabled = false ;
public List < WatchFolderSettings > WatchFolderList = new List < WatchFolderSettings > ( ) ;
2013-11-03 23:53:49 +13:00
public override string ToString ( )
{
2015-01-17 12:29:52 +13:00
return ! string . IsNullOrEmpty ( Description ) ? Description : Job . GetLocalizedDescription ( ) ;
2013-11-03 23:53:49 +13:00
}
public bool IsUsingDefaultSettings
{
get
{
2020-11-15 10:35:00 +13:00
return UseDefaultAfterCaptureJob & & UseDefaultAfterUploadJob & & UseDefaultDestinations & & ! OverrideFTP & & ! OverrideCustomUploader & &
! OverrideScreenshotsFolder & & UseDefaultGeneralSettings & & UseDefaultImageSettings & & UseDefaultCaptureSettings & & UseDefaultUploadSettings & &
UseDefaultActions & & UseDefaultToolsSettings & & UseDefaultAdvancedSettings & & ! WatchFolderEnabled ;
2013-11-03 23:53:49 +13:00
}
}
2014-05-11 23:40:39 +12:00
public static TaskSettings GetDefaultTaskSettings ( )
{
2014-09-11 20:45:30 +12:00
TaskSettings taskSettings = new TaskSettings ( ) ;
taskSettings . SetDefaultSettings ( ) ;
taskSettings . TaskSettingsReference = Program . DefaultTaskSettings ;
return taskSettings ;
2014-05-11 23:40:39 +12:00
}
2014-05-11 14:33:46 +12:00
public static TaskSettings GetSafeTaskSettings ( TaskSettings taskSettings )
{
2014-07-25 07:28:59 +12:00
TaskSettings safeTaskSettings ;
2014-05-11 23:47:37 +12:00
2014-09-13 18:10:36 +12:00
if ( taskSettings . IsUsingDefaultSettings & & Program . DefaultTaskSettings ! = null )
2014-05-11 23:40:39 +12:00
{
2014-07-25 07:28:59 +12:00
safeTaskSettings = Program . DefaultTaskSettings . Copy ( ) ;
safeTaskSettings . Description = taskSettings . Description ;
safeTaskSettings . Job = taskSettings . Job ;
2014-05-11 23:40:39 +12:00
}
else
{
2014-07-25 07:28:59 +12:00
safeTaskSettings = taskSettings . Copy ( ) ;
safeTaskSettings . SetDefaultSettings ( ) ;
2014-05-11 23:40:39 +12:00
}
2014-05-11 23:47:37 +12:00
2014-07-25 07:28:59 +12:00
safeTaskSettings . TaskSettingsReference = taskSettings ;
return safeTaskSettings ;
2013-11-03 23:53:49 +13:00
}
private void SetDefaultSettings ( )
{
if ( Program . DefaultTaskSettings ! = null )
{
TaskSettings defaultTaskSettings = Program . DefaultTaskSettings . Copy ( ) ;
if ( UseDefaultAfterCaptureJob )
{
AfterCaptureJob = defaultTaskSettings . AfterCaptureJob ;
}
if ( UseDefaultAfterUploadJob )
{
AfterUploadJob = defaultTaskSettings . AfterUploadJob ;
}
if ( UseDefaultDestinations )
{
ImageDestination = defaultTaskSettings . ImageDestination ;
2014-03-18 21:30:25 +13:00
ImageFileDestination = defaultTaskSettings . ImageFileDestination ;
2013-11-03 23:53:49 +13:00
TextDestination = defaultTaskSettings . TextDestination ;
2014-03-18 21:30:25 +13:00
TextFileDestination = defaultTaskSettings . TextFileDestination ;
2013-11-03 23:53:49 +13:00
FileDestination = defaultTaskSettings . FileDestination ;
URLShortenerDestination = defaultTaskSettings . URLShortenerDestination ;
2014-07-14 08:59:17 +12:00
URLSharingServiceDestination = defaultTaskSettings . URLSharingServiceDestination ;
2013-11-03 23:53:49 +13:00
}
if ( UseDefaultGeneralSettings )
{
GeneralSettings = defaultTaskSettings . GeneralSettings ;
}
if ( UseDefaultImageSettings )
{
ImageSettings = defaultTaskSettings . ImageSettings ;
}
if ( UseDefaultCaptureSettings )
{
CaptureSettings = defaultTaskSettings . CaptureSettings ;
}
2013-12-29 22:13:50 +13:00
2013-11-03 23:53:49 +13:00
if ( UseDefaultUploadSettings )
{
UploadSettings = defaultTaskSettings . UploadSettings ;
}
if ( UseDefaultActions )
{
ExternalPrograms = defaultTaskSettings . ExternalPrograms ;
}
2015-08-25 03:30:49 +12:00
if ( UseDefaultToolsSettings )
2013-11-03 23:53:49 +13:00
{
2015-08-25 03:30:49 +12:00
ToolsSettings = defaultTaskSettings . ToolsSettings ;
2013-11-03 23:53:49 +13:00
}
if ( UseDefaultAdvancedSettings )
{
AdvancedSettings = defaultTaskSettings . AdvancedSettings ;
}
}
}
2014-04-01 01:20:12 +13:00
2016-04-04 21:53:11 +12:00
public FileDestination GetFileDestinationByDataType ( EDataType dataType )
2014-04-01 01:20:12 +13:00
{
2016-04-04 21:53:11 +12:00
switch ( dataType )
2014-04-01 01:20:12 +13:00
{
2016-04-04 21:53:11 +12:00
case EDataType . Image :
return ImageFileDestination ;
case EDataType . Text :
return TextFileDestination ;
default :
case EDataType . File :
return FileDestination ;
2014-04-01 01:20:12 +13:00
}
}
2013-11-03 23:53:49 +13:00
}
public class TaskSettingsGeneral
{
2021-03-13 07:45:19 +13:00
#region General / Notifications
2013-11-03 23:53:49 +13:00
public bool PlaySoundAfterCapture = true ;
public bool PlaySoundAfterUpload = true ;
2021-03-13 07:45:19 +13:00
public bool ShowToastNotificationAfterTaskCompleted = true ;
2021-03-13 10:16:46 +13:00
public float ToastWindowDuration = 3f ;
public float ToastWindowFadeDuration = 1f ;
public ContentAlignment ToastWindowPlacement = ContentAlignment . BottomRight ;
public Size ToastWindowSize = new Size ( 400 , 300 ) ;
public ToastClickAction ToastWindowLeftClickAction = ToastClickAction . OpenUrl ;
public ToastClickAction ToastWindowRightClickAction = ToastClickAction . CloseNotification ;
public ToastClickAction ToastWindowMiddleClickAction = ToastClickAction . AnnotateImage ;
2022-01-13 10:06:42 +13:00
public bool ToastWindowAutoHide = true ;
2021-03-13 10:36:04 +13:00
public bool UseCustomCaptureSound = false ;
public string CustomCaptureSoundPath = "" ;
public bool UseCustomTaskCompletedSound = false ;
public string CustomTaskCompletedSoundPath = "" ;
public bool UseCustomErrorSound = false ;
public string CustomErrorSoundPath = "" ;
2021-03-13 10:16:46 +13:00
public bool DisableNotifications = false ;
public bool DisableNotificationsOnFullscreen = false ;
2014-01-13 01:13:52 +13:00
public PopUpNotificationType PopUpNotification = PopUpNotificationType . ToastNotification ;
2021-03-13 07:45:19 +13:00
#endregion
2013-11-03 23:53:49 +13:00
}
public class TaskSettingsImage
{
2014-03-13 22:13:02 +13:00
#region Image / General
2013-11-03 23:53:49 +13:00
public EImageFormat ImageFormat = EImageFormat . PNG ;
2017-06-18 23:33:21 +12:00
public PNGBitDepth ImagePNGBitDepth = PNGBitDepth . Default ;
2013-11-03 23:53:49 +13:00
public int ImageJPEGQuality = 90 ;
2014-10-14 14:21:08 +13:00
public GIFQuality ImageGIFQuality = GIFQuality . Default ;
2016-07-22 19:22:18 +12:00
public bool ImageAutoUseJPEG = true ;
public int ImageAutoUseJPEGSize = 2048 ;
2021-07-19 05:41:33 +12:00
public bool ImageAutoJPEGQuality = false ;
2014-03-13 22:13:02 +13:00
public FileExistAction FileExistAction = FileExistAction . Ask ;
2013-11-03 23:53:49 +13:00
2014-03-13 22:13:02 +13:00
#endregion Image / General
2013-11-03 23:53:49 +13:00
#region Image / Effects
2017-09-24 00:07:18 +12:00
public List < ImageEffectPreset > ImageEffectPresets = new List < ImageEffectPreset > ( ) { ImageEffectPreset . GetDefaultPreset ( ) } ;
public int SelectedImageEffectPreset = 0 ;
2013-11-03 23:53:49 +13:00
public bool ShowImageEffectsWindowAfterCapture = false ;
2014-09-16 18:32:28 +12:00
public bool ImageEffectOnlyRegionCapture = false ;
2013-11-03 23:53:49 +13:00
#endregion Image / Effects
2014-04-23 08:44:58 +12:00
#region Image / Thumbnail
public int ThumbnailWidth = 200 ;
public int ThumbnailHeight = 0 ;
public string ThumbnailName = "-thumbnail" ;
public bool ThumbnailCheckSize = false ;
#endregion Image / Thumbnail
2013-11-03 23:53:49 +13:00
}
public class TaskSettingsCapture
{
#region Capture / General
public bool ShowCursor = true ;
2018-12-18 03:16:38 +13:00
public decimal ScreenshotDelay = 0 ;
2015-01-27 22:11:31 +13:00
public bool CaptureTransparent = false ;
2013-11-03 23:53:49 +13:00
public bool CaptureShadow = true ;
2021-06-30 20:47:45 +12:00
public int CaptureShadowOffset = 100 ;
2013-11-03 23:53:49 +13:00
public bool CaptureClientArea = false ;
public bool CaptureAutoHideTaskbar = false ;
2015-04-27 07:52:01 +12:00
public Rectangle CaptureCustomRegion = new Rectangle ( 0 , 0 , 0 , 0 ) ;
2013-11-03 23:53:49 +13:00
#endregion Capture / General
2014-07-10 11:16:27 +12:00
#region Capture / Region capture
2013-11-03 23:53:49 +13:00
2016-06-22 19:51:57 +12:00
public RegionCaptureOptions SurfaceOptions = new RegionCaptureOptions ( ) ;
2013-11-03 23:53:49 +13:00
2014-07-10 11:16:27 +12:00
#endregion Capture / Region capture
2013-11-03 23:53:49 +13:00
#region Capture / Screen recorder
2022-09-11 18:40:14 +12:00
public FFmpegOptions FFmpegOptions = new FFmpegOptions ( ) ;
2016-04-24 06:38:52 +12:00
public int ScreenRecordFPS = 30 ;
2017-04-06 03:02:33 +12:00
public int GIFFPS = 15 ;
public bool ScreenRecordShowCursor = true ;
2014-10-31 15:44:54 +13:00
public bool ScreenRecordAutoStart = true ;
2016-04-24 06:38:52 +12:00
public float ScreenRecordStartDelay = 0f ;
2017-04-06 03:02:33 +12:00
public bool ScreenRecordFixedDuration = false ;
public float ScreenRecordDuration = 3f ;
2018-10-02 05:46:17 +13:00
public bool ScreenRecordTwoPassEncoding = false ;
2018-11-19 23:19:26 +13:00
public bool ScreenRecordAskConfirmationOnAbort = false ;
2020-03-27 12:54:20 +13:00
public bool ScreenRecordTransparentRegion = false ;
2014-05-21 04:12:52 +12:00
2013-11-03 23:53:49 +13:00
#endregion Capture / Screen recorder
2015-02-10 04:17:04 +13:00
2015-09-25 20:12:03 +12:00
#region Capture / Scrolling capture
public ScrollingCaptureOptions ScrollingCaptureOptions = new ScrollingCaptureOptions ( ) ;
#endregion Capture / Scrolling capture
2018-11-15 14:10:54 +13:00
#region Capture / OCR
public OCROptions OCROptions = new OCROptions ( ) ;
2018-12-18 03:16:38 +13:00
#endregion Capture / OCR
2013-11-03 23:53:49 +13:00
}
public class TaskSettingsUpload
{
2020-02-22 23:29:31 +13:00
#region Upload / File naming
2013-11-03 23:53:49 +13:00
2015-03-12 11:35:31 +13:00
public bool UseCustomTimeZone = false ;
public TimeZoneInfo CustomTimeZone = TimeZoneInfo . Utc ;
2018-09-03 07:13:41 +12:00
public string NameFormatPattern = "%ra{10}" ;
public string NameFormatPatternActiveWindow = "%pn_%ra{10}" ;
2013-11-03 23:53:49 +13:00
public bool FileUploadUseNamePattern = false ;
2018-04-25 18:01:58 +12:00
public bool FileUploadReplaceProblematicCharacters = false ;
2020-09-13 08:44:35 +12:00
public bool URLRegexReplace = false ;
public string URLRegexReplacePattern = "^https?://(.+)$" ;
public string URLRegexReplaceReplacement = "https://$1" ;
2013-11-03 23:53:49 +13:00
2020-02-22 23:29:31 +13:00
#endregion Upload / File naming
2013-11-03 23:53:49 +13:00
#region Upload / Clipboard upload
2014-05-08 04:26:14 +12:00
public bool ClipboardUploadURLContents = false ;
2014-05-08 00:33:36 +12:00
public bool ClipboardUploadShortenURL = false ;
2014-07-08 04:02:32 +12:00
public bool ClipboardUploadShareURL = false ;
2014-05-01 00:12:28 +12:00
public bool ClipboardUploadAutoIndexFolder = false ;
2013-11-03 23:53:49 +13:00
#endregion Upload / Clipboard upload
2016-10-28 23:05:56 +13:00
2020-02-22 23:29:31 +13:00
#region Upload / Uploader filters
2016-10-28 23:05:56 +13:00
public List < UploaderFilter > UploaderFilters = new List < UploaderFilter > ( ) ;
2020-02-22 23:29:31 +13:00
#endregion Upload / Uploader filters
2013-11-03 23:53:49 +13:00
}
2015-08-25 03:30:49 +12:00
public class TaskSettingsTools
{
2018-02-01 14:45:29 +13:00
public string ScreenColorPickerFormat = "$hex" ;
2020-10-17 03:21:59 +13:00
public string ScreenColorPickerFormatCtrl = "$r255, $g255, $b255" ;
public string ScreenColorPickerInfoText = "RGB: $r255, $g255, $b255$nHex: $hex$nX: $x Y: $y" ;
2015-08-25 03:30:49 +12:00
public IndexerSettings IndexerSettings = new IndexerSettings ( ) ;
2015-10-01 01:44:19 +13:00
public ImageCombinerOptions ImageCombinerOptions = new ImageCombinerOptions ( ) ;
2019-11-22 21:26:08 +13:00
public VideoConverterOptions VideoConverterOptions = new VideoConverterOptions ( ) ;
2015-08-25 03:30:49 +12:00
public VideoThumbnailOptions VideoThumbnailOptions = new VideoThumbnailOptions ( ) ;
2021-09-16 12:17:07 +12:00
public BorderlessWindowSettings BorderlessWindowSettings = new BorderlessWindowSettings ( ) ;
2015-08-25 03:30:49 +12:00
}
2013-11-03 23:53:49 +13:00
public class TaskSettingsAdvanced
{
2015-08-17 12:01:10 +12:00
[Category("General"), DefaultValue(false), Description("Allow after capture tasks for image files by loading them as bitmap when files are handled during file upload, clipboard file upload, drag && drop file upload, watch folder and other image file tasks.")]
2013-11-03 23:53:49 +13:00
public bool ProcessImagesDuringFileUpload { get ; set ; }
2015-03-07 11:49:11 +13:00
[Category("General"), DefaultValue(false), Description("Use after capture tasks for clipboard image upload.")]
2013-11-03 23:53:49 +13:00
public bool ProcessImagesDuringClipboardUpload { get ; set ; }
2015-08-17 12:01:10 +12:00
[Category("General"), DefaultValue(true), Description("Allows file related after capture tasks (\"Perform actions\", \"Copy file to clipboard\" etc.) to be used when doing file upload.")]
public bool UseAfterCaptureTasksDuringFileUpload { get ; set ; }
2014-07-23 08:32:28 +12:00
2015-07-27 03:42:14 +12:00
[Category("General"), DefaultValue(true), Description("Save text as file for tasks such as clipboard text upload, drag and drop text upload, index folder etc.")]
public bool TextTaskSaveAsFile { get ; set ; }
2015-08-17 12:01:10 +12:00
[Category("General"), DefaultValue(false), Description("If task contains upload job then this setting will clear clipboard when task start.")]
public bool AutoClearClipboard { get ; set ; }
2017-05-16 04:54:04 +12:00
[Category("Capture"), DefaultValue(false), Description("Disable annotation support in region capture.")]
2017-02-04 13:18:12 +13:00
public bool RegionCaptureDisableAnnotation { get ; set ; }
2015-08-16 20:34:46 +12:00
[ Category ( "Upload" ) , Description ( "Files with these file extensions will be uploaded using image uploader." ) ,
Editor ( "System.Windows.Forms.Design.StringCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" , typeof ( UITypeEditor ) ) ]
2015-03-08 14:13:55 +13:00
public List < string > ImageExtensions { get ; set ; }
2015-08-16 20:34:46 +12:00
[ Category ( "Upload" ) , Description ( "Files with these file extensions will be uploaded using text uploader." ) ,
Editor ( "System.Windows.Forms.Design.StringCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" , typeof ( UITypeEditor ) ) ]
2015-03-08 14:13:55 +13:00
public List < string > TextExtensions { get ; set ; }
2021-07-15 03:30:26 +12:00
[Category("Upload"), DefaultValue(false), Description("Copy URL before start upload. Only works for FTP, FTPS, SFTP, Amazon S3, Google Cloud Storage and Azure Storage.")]
public bool EarlyCopyURL { get ; set ; }
[Category("Upload text"), DefaultValue("txt"), Description("File extension when saving text to the local hard disk.")]
public string TextFileExtension { get ; set ; }
[Category("Upload text"), DefaultValue("text"), Description("Text format e.g. csharp, cpp, etc.")]
public string TextFormat { get ; set ; }
[ Category ( "Upload text" ) , DefaultValue ( "" ) , Description ( "Custom text input. Use %input for text input. Example you can create web page with your text in it." ) ,
Editor ( typeof ( MultilineStringEditor ) , typeof ( UITypeEditor ) ) ]
public string TextCustom { get ; set ; }
[Category("Upload text"), DefaultValue(true), Description("HTML encode custom text input.")]
public bool TextCustomEncodeInput { get ; set ; }
2015-06-10 06:26:11 +12:00
[Category("After upload"), DefaultValue(false), Description("If result URL starts with \"http://\" then replace it with \"https://\".")]
public bool ResultForceHTTPS { get ; set ; }
2014-06-26 11:14:39 +12:00
[ Category ( "After upload" ) , DefaultValue ( "$result" ) ,
2013-11-03 23:53:49 +13:00
Description ( "Clipboard content format after uploading. Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc." ) ]
public string ClipboardContentFormat { get ; set ; }
2014-06-26 11:14:39 +12:00
[Category("After upload"), DefaultValue("$result"), Description("Balloon tip content format after uploading. Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc.")]
2013-11-03 23:53:49 +13:00
public string BalloonTipContentFormat { get ; set ; }
2014-06-26 11:14:39 +12:00
[Category("After upload"), DefaultValue("$result"), Description("After upload task \"Open URL\" format. Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc.")]
public string OpenURLFormat { get ; set ; }
2015-08-17 12:01:10 +12:00
[Category("After upload"), DefaultValue(0), Description("Automatically shorten URL if the URL is longer than the specified number of characters. 0 means automatic URL shortening is not active.")]
2014-01-19 17:27:27 +13:00
public int AutoShortenURLLength { get ; set ; }
2013-11-03 23:53:49 +13:00
[Category("After upload"), DefaultValue(false), Description("After upload form will be automatically closed after 60 seconds.")]
public bool AutoCloseAfterUploadForm { get ; set ; }
2014-01-13 19:38:53 +13:00
[Category("Name pattern"), DefaultValue(100), Description("Maximum name pattern length for file name.")]
public int NamePatternMaxLength { get ; set ; }
[Category("Name pattern"), DefaultValue(50), Description("Maximum name pattern title (%t) length for file name.")]
public int NamePatternMaxTitleLength { get ; set ; }
2020-04-23 01:13:41 +12:00
// TEMP: For backward compatibility
public string CapturePath ;
2013-11-03 23:53:49 +13:00
public TaskSettingsAdvanced ( )
{
this . ApplyDefaultPropertyValues ( ) ;
2022-05-03 18:34:18 +12:00
ImageExtensions = FileHelpers . ImageFileExtensions . ToList ( ) ;
TextExtensions = FileHelpers . TextFileExtensions . ToList ( ) ;
2013-11-03 23:53:49 +13:00
}
}
}