mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-30 20:20:34 +12:00
Rename enum
This commit is contained in:
parent
c49ce8bb98
commit
6b9d74e60f
|
@ -411,13 +411,13 @@ public enum TaskViewMode // Localized
|
||||||
ThumbnailView
|
ThumbnailView
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum NativeMessagingContentType
|
public enum NativeMessagingAction
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
Image,
|
UploadImage,
|
||||||
Video,
|
UploadVideo,
|
||||||
Audio,
|
UploadAudio,
|
||||||
Text,
|
UploadText,
|
||||||
Link
|
ShortenURL
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ namespace ShareX
|
||||||
{
|
{
|
||||||
public class NativeMessagingInput
|
public class NativeMessagingInput
|
||||||
{
|
{
|
||||||
public NativeMessagingContentType ContentType { get; set; }
|
public NativeMessagingAction Action { get; set; }
|
||||||
public string URL { get; set; }
|
public string URL { get; set; }
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1926,7 +1926,7 @@ public static async Task HandleNativeMessagingInput(string filePath, TaskSetting
|
||||||
{
|
{
|
||||||
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
|
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
|
||||||
|
|
||||||
switch (nativeMessagingInput.ContentType)
|
switch (nativeMessagingInput.Action)
|
||||||
{
|
{
|
||||||
// TEMP: For backward compatibility
|
// TEMP: For backward compatibility
|
||||||
default:
|
default:
|
||||||
|
@ -1939,7 +1939,7 @@ public static async Task HandleNativeMessagingInput(string filePath, TaskSetting
|
||||||
UploadManager.UploadText(nativeMessagingInput.Text, taskSettings);
|
UploadManager.UploadText(nativeMessagingInput.Text, taskSettings);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NativeMessagingContentType.Image:
|
case NativeMessagingAction.UploadImage:
|
||||||
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
||||||
{
|
{
|
||||||
Bitmap bmp = null;
|
Bitmap bmp = null;
|
||||||
|
@ -1965,20 +1965,20 @@ public static async Task HandleNativeMessagingInput(string filePath, TaskSetting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NativeMessagingContentType.Video:
|
case NativeMessagingAction.UploadVideo:
|
||||||
case NativeMessagingContentType.Audio:
|
case NativeMessagingAction.UploadAudio:
|
||||||
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
||||||
{
|
{
|
||||||
UploadManager.DownloadAndUploadFile(nativeMessagingInput.URL, taskSettings);
|
UploadManager.DownloadAndUploadFile(nativeMessagingInput.URL, taskSettings);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NativeMessagingContentType.Text:
|
case NativeMessagingAction.UploadText:
|
||||||
if (!string.IsNullOrEmpty(nativeMessagingInput.Text))
|
if (!string.IsNullOrEmpty(nativeMessagingInput.Text))
|
||||||
{
|
{
|
||||||
UploadManager.UploadText(nativeMessagingInput.Text, taskSettings);
|
UploadManager.UploadText(nativeMessagingInput.Text, taskSettings);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NativeMessagingContentType.Link:
|
case NativeMessagingAction.ShortenURL:
|
||||||
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
if (!string.IsNullOrEmpty(nativeMessagingInput.URL))
|
||||||
{
|
{
|
||||||
UploadManager.ShortenURL(nativeMessagingInput.URL, taskSettings);
|
UploadManager.ShortenURL(nativeMessagingInput.URL, taskSettings);
|
||||||
|
|
Loading…
Reference in a new issue