public void AddWatchFolder(WatchFolderSettings watchFolderSetting, TaskSettings taskSettings) { if (!IsExist(watchFolderSetting)) { if (!taskSettings.WatchFolderList.Contains(watchFolderSetting)) { taskSettings.WatchFolderList.Add(watchFolderSetting); } WatchFolder watchFolder = new WatchFolder { Settings = watchFolderSetting, TaskSettings = taskSettings }; watchFolder.FileWatcherTrigger += path => { TaskSettings taskSettingsCopy = TaskSettings.GetSafeTaskSettings(taskSettings); UploadManager.UploadFile(path, taskSettingsCopy); }; WatchFolders.Add(watchFolder); if (taskSettings.WatchFolderEnabled) { watchFolder.Enable(); } } }
public static void OpenVideoThumbnailer(TaskSettings taskSettings = null) { if (taskSettings == null) { taskSettings = TaskSettings.GetDefaultTaskSettings(); } if (!CheckFFmpeg(taskSettings)) { return; } taskSettings.ToolsSettings.VideoThumbnailOptions.DefaultOutputDirectory = taskSettings.CaptureFolder; VideoThumbnailerForm thumbnailerForm = new VideoThumbnailerForm(taskSettings.CaptureSettings.FFmpegOptions.CLIPath, taskSettings.ToolsSettingsReference.VideoThumbnailOptions); thumbnailerForm.ThumbnailsTaken += thumbnails => { if (taskSettings.ToolsSettingsReference.VideoThumbnailOptions.UploadThumbnails) { foreach (VideoThumbnailInfo thumbnailInfo in thumbnails) { UploadManager.UploadFile(thumbnailInfo.Filepath, taskSettings); } } }; thumbnailerForm.Show(); }
public void Upload() { if (IsItemSelected && SelectedItem.IsFileExist) { UploadManager.UploadFile(SelectedItem.Info.FilePath); } }
private void NotificationForm_MouseClick(object sender, MouseEventArgs e) { tDuration.Stop(); if (e.Button == MouseButtons.Left) { switch (ToastConfig.Action) { case ToastClickAction.CopyImageToClipboard: if (!string.IsNullOrEmpty(ToastConfig.FilePath)) { ClipboardHelpers.CopyImageFromFile(ToastConfig.FilePath); } break; case ToastClickAction.CopyUrl: if (!string.IsNullOrEmpty(ToastConfig.URL)) { ClipboardHelpers.CopyText(ToastConfig.URL); } break; case ToastClickAction.OpenFile: if (!string.IsNullOrEmpty(ToastConfig.FilePath)) { URLHelpers.OpenURL(ToastConfig.FilePath); } break; case ToastClickAction.OpenFolder: if (!string.IsNullOrEmpty(ToastConfig.FilePath)) { Helpers.OpenFolderWithFile(ToastConfig.FilePath); } break; case ToastClickAction.OpenUrl: if (!string.IsNullOrEmpty(ToastConfig.URL)) { URLHelpers.OpenURL(ToastConfig.URL); } break; case ToastClickAction.Upload: if (!string.IsNullOrEmpty(ToastConfig.FilePath)) { UploadManager.UploadFile(ToastConfig.FilePath); } break; } } Close(); }