private void llCreateAccount_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL(Puush.PuushRegisterURL); }
private void pbMikeURL_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_MIKE); }
private void rtb_LinkClicked(object sender, LinkClickedEventArgs e) { URLHelpers.OpenURL(e.LinkText); }
private void buttonFFmpegHelp_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/FFmpeg-options#additional-commands"); }
private void lblProductName_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_VERSION_HISTORY); }
private void llGoogleTranslate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL("https://translate.google.com/#auto/en/" + Uri.EscapeDataString(txtResult.Text)); this.Close(); }
private void btnFirefoxOpenAddonPage_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://addons.mozilla.org/en-US/firefox/addon/sharex/"); }
private void llForgottenPassword_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL(Puush.PuushResetPasswordURL); }
public void ShareURL(string url) { if (!string.IsNullOrEmpty(url)) { string encodedUrl = URLHelpers.URLEncode(url); switch (Info.TaskSettings.URLSharingServiceDestination) { case URLSharingServices.Email: if (Program.UploadersConfig.IsValid(URLSharingServices.Email)) { using (EmailForm emailForm = new EmailForm(Program.UploadersConfig.EmailRememberLastTo ? Program.UploadersConfig.EmailLastTo : string.Empty, Program.UploadersConfig.EmailDefaultSubject, url)) { if (emailForm.ShowDialog() == DialogResult.OK) { if (Program.UploadersConfig.EmailRememberLastTo) { Program.UploadersConfig.EmailLastTo = emailForm.ToEmail; } Email email = new Email { SmtpServer = Program.UploadersConfig.EmailSmtpServer, SmtpPort = Program.UploadersConfig.EmailSmtpPort, FromEmail = Program.UploadersConfig.EmailFrom, Password = Program.UploadersConfig.EmailPassword }; email.Send(emailForm.ToEmail, emailForm.Subject, emailForm.Body); } } } else { URLHelpers.OpenURL("mailto:?body=" + encodedUrl); } break; case URLSharingServices.Twitter: if (Program.UploadersConfig.IsValid(URLSharingServices.Twitter)) { OAuthInfo twitterOAuth = Program.UploadersConfig.TwitterOAuthInfoList[Program.UploadersConfig.TwitterSelectedAccount]; using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth, url)) { twitter.ShowDialog(); } } else { URLHelpers.OpenURL("https://twitter.com/intent/tweet?text=" + encodedUrl); } break; case URLSharingServices.Facebook: URLHelpers.OpenURL("https://www.facebook.com/sharer/sharer.php?u=" + encodedUrl); break; case URLSharingServices.GooglePlus: URLHelpers.OpenURL("https://plus.google.com/share?url=" + encodedUrl); break; case URLSharingServices.Reddit: URLHelpers.OpenURL("http://www.reddit.com/submit?url=" + encodedUrl); break; case URLSharingServices.Pinterest: URLHelpers.OpenURL(string.Format("http://pinterest.com/pin/create/button/?url={0}&media={0}", encodedUrl)); break; case URLSharingServices.Tumblr: URLHelpers.OpenURL("https://www.tumblr.com/share?v=3&u=" + encodedUrl); break; case URLSharingServices.LinkedIn: URLHelpers.OpenURL("https://www.linkedin.com/shareArticle?url=" + encodedUrl); break; case URLSharingServices.StumbleUpon: URLHelpers.OpenURL("http://www.stumbleupon.com/submit?url=" + encodedUrl); break; case URLSharingServices.Delicious: URLHelpers.OpenURL("https://delicious.com/save?v=5&url=" + encodedUrl); break; case URLSharingServices.VK: URLHelpers.OpenURL("http://vk.com/share.php?url=" + encodedUrl); break; } } }
private void ExecuteAction(ToastClickAction action) { switch (action) { case ToastClickAction.AnnotateImage: if (!string.IsNullOrEmpty(Config.FilePath) && Helpers.IsImageFile(Config.FilePath)) { TaskHelpers.AnnotateImageFromFile(Config.FilePath); } break; case ToastClickAction.CopyImageToClipboard: if (!string.IsNullOrEmpty(Config.FilePath)) { ClipboardHelpers.CopyImageFromFile(Config.FilePath); } break; case ToastClickAction.CopyFile: if (!string.IsNullOrEmpty(Config.FilePath)) { ClipboardHelpers.CopyFile(Config.FilePath); } break; case ToastClickAction.CopyFilePath: if (!string.IsNullOrEmpty(Config.FilePath)) { ClipboardHelpers.CopyText(Config.FilePath); } break; case ToastClickAction.CopyUrl: if (!string.IsNullOrEmpty(Config.URL)) { ClipboardHelpers.CopyText(Config.URL); } break; case ToastClickAction.OpenFile: if (!string.IsNullOrEmpty(Config.FilePath)) { Helpers.OpenFile(Config.FilePath); } break; case ToastClickAction.OpenFolder: if (!string.IsNullOrEmpty(Config.FilePath)) { Helpers.OpenFolderWithFile(Config.FilePath); } break; case ToastClickAction.OpenUrl: if (!string.IsNullOrEmpty(Config.URL)) { URLHelpers.OpenURL(Config.URL); } break; case ToastClickAction.Upload: if (!string.IsNullOrEmpty(Config.FilePath)) { UploadManager.UploadFile(Config.FilePath); } break; } }
private void NotificationForm_MouseClick(object sender, MouseEventArgs e) { tDuration.Stop(); Close(); if (e.Button == MouseButtons.Left) { switch (ToastConfig.Action) { case ToastClickAction.AnnotateImage: if (!string.IsNullOrEmpty(ToastConfig.FilePath) && Helpers.IsImageFile(ToastConfig.FilePath)) { TaskHelpers.AnnotateImageFromFile(ToastConfig.FilePath); } break; 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; } } }
public void AddNewsItem(NewsItem item) { RowStyle style = new RowStyle(SizeType.AutoSize); tlpMain.RowStyles.Add(style); int index = tlpMain.RowCount++ - 1; Label lblDateTime = new Label() { Anchor = AnchorStyles.Left | AnchorStyles.Right, AutoSize = true, BackColor = Color.Transparent, Font = new Font("Arial", 10), Margin = new Padding(0), Padding = new Padding(10, 8, 5, 8), Text = item.DateTime.ToShortDateString() }; string dateTimeTooltip; double days = (DateTime.Now - item.DateTime).TotalDays; if (days < 1) { dateTimeTooltip = "Today."; } else if (days < 2) { dateTimeTooltip = "Yesterday."; } else { dateTimeTooltip = (int)days + " days ago."; } tooltip.SetToolTip(lblDateTime, dateTimeTooltip); tlpMain.Controls.Add(lblDateTime, 0, index); Label lblText = new Label() { Anchor = AnchorStyles.Left | AnchorStyles.Right, AutoSize = true, BackColor = Color.Transparent, Font = new Font("Arial", 10), Margin = new Padding(0), Padding = new Padding(5, 8, 5, 8), Text = item.Text }; if (URLHelpers.IsValidURL(item.URL)) { tooltip.SetToolTip(lblText, item.URL); lblText.Cursor = Cursors.Hand; lblText.MouseEnter += (sender, e) => lblText.ForeColor = Color.Blue; lblText.MouseLeave += (sender, e) => lblText.ForeColor = SystemColors.ControlText; lblText.MouseClick += (sender, e) => { if (e.Button == MouseButtons.Left) { URLHelpers.OpenURL(item.URL); } }; } tlpMain.Controls.Add(lblText, 1, index); }
public override void ShareURL(string url, UploadersConfig config) { string encodedUrl = URLHelpers.URLEncode(url); URLHelpers.OpenURL(string.Format(UrlFormatString, encodedUrl)); }
private void pbGitHub_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://github.com/Jaex/Automate"); }
private void llTranslators_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/Translation"); }
private void pbBerkURL_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_JAEX); }
private void llAttribution_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL("https://ocr.space"); }
private void btnCustomUploadJsonPathHelp_Click(object sender, EventArgs e) { URLHelpers.OpenURL("http://goessner.net/articles/JsonPath/"); }
private void btnChromeOpenExtensionPage_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://chrome.google.com/webstore/detail/sharex/nlkoigbdolhchiicbonbihbphgamnaoc"); }
private void btnCustomUploaderXPathHelp_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://www.w3schools.com/xml/xpath_syntax.asp"); }
private void btnHelperDevicesHelp_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://github.com/rdp/screen-capture-recorder-to-video-windows-free"); }
private void txtCustomUploaderLog_LinkClicked(object sender, LinkClickedEventArgs e) { URLHelpers.OpenURL(e.LinkText); }
private void btnHelp_Click(object sender, EventArgs e) { URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/FFmpeg-options"); }
private void tsmiCustomUploaderExamples_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_CUSTOM_UPLOADERS); }
private void pbBerkSteamURL_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_BERK_STEAM); }
private void pbSteam_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_STEAM); }
private void pbMikeGooglePlus_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_MIKE_GOOGLE_PLUS); }
private void DoAfterUploadJobs() { try { if (Info.TaskSettings.UploadSettings.URLRegexReplace) { Info.Result.URL = Regex.Replace(Info.Result.URL, Info.TaskSettings.UploadSettings.URLRegexReplacePattern, Info.TaskSettings.UploadSettings.URLRegexReplaceReplacement); } if (Info.TaskSettings.AdvancedSettings.ResultForceHTTPS) { Info.Result.ForceHTTPS(); } if (Info.Job != TaskJob.ShareURL && (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.UseURLShortener) || Info.Job == TaskJob.ShortenURL || (Info.TaskSettings.AdvancedSettings.AutoShortenURLLength > 0 && Info.Result.URL.Length > Info.TaskSettings.AdvancedSettings.AutoShortenURLLength))) { UploadResult result = ShortenURL(Info.Result.URL); if (result != null) { Info.Result.ShortenedURL = result.ShortenedURL; Info.Result.Errors.AddRange(result.Errors); } } if (Info.Job != TaskJob.ShortenURL && (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.ShareURL) || Info.Job == TaskJob.ShareURL)) { UploadResult result = ShareURL(Info.Result.ToString()); if (result != null) { Info.Result.Errors.AddRange(result.Errors); } if (Info.Job == TaskJob.ShareURL) { Info.Result.IsURLExpected = false; } } if (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.CopyURLToClipboard)) { string txt; if (!string.IsNullOrEmpty(Info.TaskSettings.AdvancedSettings.ClipboardContentFormat)) { txt = new UploadInfoParser().Parse(Info, Info.TaskSettings.AdvancedSettings.ClipboardContentFormat); } else { txt = Info.Result.ToString(); } if (!string.IsNullOrEmpty(txt)) { ClipboardHelpers.CopyText(txt); } } if (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.OpenURL)) { string result; if (!string.IsNullOrEmpty(Info.TaskSettings.AdvancedSettings.OpenURLFormat)) { result = new UploadInfoParser().Parse(Info, Info.TaskSettings.AdvancedSettings.OpenURLFormat); } else { result = Info.Result.ToString(); } URLHelpers.OpenURL(result); } if (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.ShowQRCode)) { threadWorker.InvokeAsync(() => new QRCodeForm(Info.Result.ToString()).Show()); } } catch (Exception e) { DebugHelper.WriteException(e); AddErrorMessage(e.ToString()); } }
public void OpenShortenedURL() { if (IsItemSelected && SelectedItem.IsShortenedURLExist) URLHelpers.OpenURL(SelectedItem.Info.Result.ShortenedURL); }
private void btnImageEffects_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_IMAGE_EFFECTS); }