public void CopyFileNameWithExtension() { if (HistoryItem != null && IsFilePathValid) { ZAppHelper.CopyTextSafely(Path.GetFileName(HistoryItem.Filepath)); } }
public void CopyShortenedURL() { if (HistoryItem != null && IsShortenedURLExist) { ZAppHelper.CopyTextSafely(HistoryItem.ShortenedURL); } }
public void CopyFilePath() { if (HistoryItem != null && IsFilePathValid) { ZAppHelper.CopyTextSafely(HistoryItem.Filepath); } }
public void CopyForumLink() { if (HistoryItem != null && IsURLExist) { ZAppHelper.CopyTextSafely(string.Format("[url]{0}[/url]", HistoryItem.URL)); } }
public void CopyForumImage() { if (HistoryItem != null && IsImageURL) { ZAppHelper.CopyTextSafely(string.Format("[img]{0}[/img]", HistoryItem.URL)); } }
public void CopyHTMLImage() { if (HistoryItem != null && IsImageURL) { ZAppHelper.CopyTextSafely(string.Format("<img src=\"{0}\"/>", HistoryItem.URL)); } }
public void CopyHTMLLinkedImage() { if (HistoryItem != null && IsImageURL && IsThumbnailURLExist) { ZAppHelper.CopyTextSafely(string.Format("<a href=\"{0}\"><img src=\"{1}\"/></a>", HistoryItem.URL, HistoryItem.ThumbnailURL)); } }
public void CopyHTMLLink() { if (HistoryItem != null && IsURLExist) { ZAppHelper.CopyTextSafely(string.Format("<a href=\"{0}\">{0}</a>", HistoryItem.URL)); } }
public void CopyDeletionURL() { if (HistoryItem != null && IsDeletionURLExist) { ZAppHelper.CopyTextSafely(HistoryItem.DeletionURL); } }
public void CopyThumbnailURL() { if (HistoryItem != null && IsThumbnailURLExist) { ZAppHelper.CopyTextSafely(HistoryItem.ThumbnailURL); } }
public void CopyForumLinkedImage() { if (HistoryItem != null && IsImageURL && IsThumbnailURLExist) { ZAppHelper.CopyTextSafely(string.Format("[url={0}][img]{1}[/img][/url]", HistoryItem.URL, HistoryItem.ThumbnailURL)); } }
private void CopyErrors() { string errors = GetErrors(); if (!string.IsNullOrEmpty(errors)) { ZAppHelper.CopyTextSafely(errors); } }
private void CopyDeletionURL() { UploadResult result = GetCurrentUploadResult(); if (result != null && !string.IsNullOrEmpty(result.DeletionURL)) { ZAppHelper.CopyTextSafely(result.DeletionURL); } }
private void PropertyListView_Click_Value(object sender, EventArgs e) { if (this.SelectedItems.Count > 0) { string text = this.SelectedItems[0].SubItems[1].Text; if (!string.IsNullOrEmpty(text)) { ZAppHelper.CopyTextSafely(text); } } }
private void CopyURL() { if (lvUploads.SelectedItems.Count > 0) { string[] array = lvUploads.SelectedItems.Cast <ListViewItem>().Select(x => x.Tag as UploadResult). Where(x => x != null && !string.IsNullOrEmpty(x.URL)).Select(x => x.URL).ToArray(); if (array != null && array.Length > 0) { string urls = string.Join("\r\n", array); if (!string.IsNullOrEmpty(urls)) { ZAppHelper.CopyTextSafely(urls); } } } }
public void CopyURL() { if (HistoryItem != null && IsURLExist) { string[] array = lv.SelectedItems.Cast <ListViewItem>().Select(x => x.Tag as HistoryItem). Where(x => x != null && !string.IsNullOrEmpty(x.URL)).Select(x => x.URL).ToArray(); if (array != null && array.Length > 0) { string urls = string.Join("\r\n", array); if (!string.IsNullOrEmpty(urls)) { ZAppHelper.CopyTextSafely(urls); } } } }
private static void task_UploadCompleted(UploadInfo info) { try { if (ListViewControl != null && info != null && info.Result != null) { ListViewItem lvi = ListViewControl.Items[info.ID]; lvi.Tag = info.Result; if (info.Result.IsError) { string errors = string.Join("\r\n\r\n", info.Result.Errors.ToArray()); Program.MyLogger.WriteLine("Upload failed. ID: {0}, Filename: {1}, Errors:\r\n{2}", info.ID, info.FileName, errors); lvi.SubItems[1].Text = "Error"; lvi.SubItems[8].Text = string.Empty; lvi.ImageIndex = 1; if (Program.Settings.AutoPlaySound) { SystemSounds.Asterisk.Play(); } } else { Program.MyLogger.WriteLine("Upload completed. ID: {0}, Filename: {1}, URL: {2}, Duration: {3}ms", info.ID, info.FileName, info.Result.URL, (int)info.UploadDuration.TotalMilliseconds); lvi.SubItems[1].Text = info.Status; lvi.ImageIndex = 2; if (!string.IsNullOrEmpty(info.Result.URL)) { string url = string.IsNullOrEmpty(info.Result.ShortenedURL) ? info.Result.URL : info.Result.ShortenedURL; lvi.SubItems[8].Text = url; if (Program.Settings.ClipboardAutoCopy) { ZAppHelper.CopyTextSafely(url); } if (Program.Settings.SaveHistory) { HistoryManager.AddHistoryItemAsync(Program.HistoryFilePath, info.GetHistoryItem()); } if (Program.mainForm.niTray.Visible) { Program.mainForm.niTray.Tag = url; Program.mainForm.niTray.ShowBalloonTip(5000, "ZUploader - Upload completed", url, ToolTipIcon.Info); } } if (Program.Settings.AutoPlaySound) { SystemSounds.Exclamation.Play(); } } lvi.EnsureVisible(); } } finally { StartTasks(); UpdateTrayIcon(); } }
private static void task_UploadCompleted(WorkerTask task) { try { if (ListViewControl != null && task != null && task.Result != null) { ListViewItem lvi = ListViewControl.Items[task.Id]; lvi.Tag = task.Result; if (task.Result.IsError) { string errors = string.Join("\r\n\r\n", task.Result.Errors.ToArray()); DebugHelper.WriteLine("Upload failed. ID: {0}, Filename: {1}, Errors:\r\n{2}", task.Id, task.Info.FileName, errors); lvi.SubItems[1].Text = "Error"; lvi.SubItems[8].Text = string.Empty; lvi.ImageIndex = 1; if (Engine.ConfigOptions.CompleteSound) { SystemSounds.Asterisk.Play(); } } else { DebugHelper.WriteLine("Upload completed. ID: {0}, Filename: {1}, URL: {2}, Duration: {3}ms", task.Id, task.Info.FileName, task.Result.URL, (int)task.UploadDuration); lvi.SubItems[1].Text = task.Status.GetDescription(); lvi.ImageIndex = 2; if (!string.IsNullOrEmpty(task.Result.URL)) { string url = string.IsNullOrEmpty(task.Result.ShortenedURL) ? task.Result.URL : task.Result.ShortenedURL; lvi.SubItems[8].Text = url; if (Engine.ConfigWorkflow.ClipboardOverwrite) { ZAppHelper.CopyTextSafely(url); } if (Engine.ConfigOptions.HistorySave) { HistoryManager.AddHistoryItemAsync(Engine.HistoryPath, task.GenerateHistoryItem()); } } if (Engine.ConfigOptions.CompleteSound) { SystemSounds.Exclamation.Play(); } } lvi.EnsureVisible(); } } finally { StartTasks(); // UpdateTrayIcon(); } }