コード例 #1
0
ファイル: PuushLoginForm.cs プロジェクト: xixikaikai/ShareX
 private void llCreateAccount_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     URLHelpers.OpenURL(Puush.PuushRegisterURL);
 }
コード例 #2
0
 private void pbMikeURL_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_MIKE);
 }
コード例 #3
0
 private void rtb_LinkClicked(object sender, LinkClickedEventArgs e)
 {
     URLHelpers.OpenURL(e.LinkText);
 }
コード例 #4
0
 private void buttonFFmpegHelp_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/FFmpeg-options#additional-commands");
 }
コード例 #5
0
 private void lblProductName_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_VERSION_HISTORY);
 }
コード例 #6
0
ファイル: OCRSpaceForm.cs プロジェクト: yuqi-sy/ShareX
 private void llGoogleTranslate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     URLHelpers.OpenURL("https://translate.google.com/#auto/en/" + Uri.EscapeDataString(txtResult.Text));
     this.Close();
 }
コード例 #7
0
 private void btnFirefoxOpenAddonPage_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://addons.mozilla.org/en-US/firefox/addon/sharex/");
 }
コード例 #8
0
ファイル: PuushLoginForm.cs プロジェクト: zz110/ShareX
 private void llForgottenPassword_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     URLHelpers.OpenURL(Puush.PuushResetPasswordURL);
 }
コード例 #9
0
ファイル: UploadTask.cs プロジェクト: DaveCS1/ShareX
        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;
                }
            }
        }
コード例 #10
0
ファイル: NotificationForm.cs プロジェクト: rzflybird/ShareX
        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;
            }
        }
コード例 #11
0
        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;
                }
            }
        }
コード例 #12
0
ファイル: NewsListControl.cs プロジェクト: TFB12332/ShareX1
        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);
        }
コード例 #13
0
        public override void ShareURL(string url, UploadersConfig config)
        {
            string encodedUrl = URLHelpers.URLEncode(url);

            URLHelpers.OpenURL(string.Format(UrlFormatString, encodedUrl));
        }
コード例 #14
0
 private void pbGitHub_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://github.com/Jaex/Automate");
 }
コード例 #15
0
 private void llTranslators_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/Translation");
 }
コード例 #16
0
ファイル: AboutForm.cs プロジェクト: simonporte/ShareX
 private void pbBerkURL_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_JAEX);
 }
コード例 #17
0
ファイル: OCRSpaceForm.cs プロジェクト: yuqi-sy/ShareX
 private void llAttribution_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     URLHelpers.OpenURL("https://ocr.space");
 }
コード例 #18
0
 private void btnCustomUploadJsonPathHelp_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("http://goessner.net/articles/JsonPath/");
 }
コード例 #19
0
 private void btnChromeOpenExtensionPage_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://chrome.google.com/webstore/detail/sharex/nlkoigbdolhchiicbonbihbphgamnaoc");
 }
コード例 #20
0
 private void btnCustomUploaderXPathHelp_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://www.w3schools.com/xml/xpath_syntax.asp");
 }
コード例 #21
0
 private void btnHelperDevicesHelp_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://github.com/rdp/screen-capture-recorder-to-video-windows-free");
 }
コード例 #22
0
 private void txtCustomUploaderLog_LinkClicked(object sender, LinkClickedEventArgs e)
 {
     URLHelpers.OpenURL(e.LinkText);
 }
コード例 #23
0
 private void btnHelp_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL("https://github.com/ShareX/ShareX/wiki/FFmpeg-options");
 }
コード例 #24
0
 private void tsmiCustomUploaderExamples_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_CUSTOM_UPLOADERS);
 }
コード例 #25
0
 private void pbBerkSteamURL_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_BERK_STEAM);
 }
コード例 #26
0
ファイル: AboutForm.cs プロジェクト: HUMATA/ShareX-master
 private void pbSteam_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_STEAM);
 }
コード例 #27
0
 private void pbMikeGooglePlus_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_MIKE_GOOGLE_PLUS);
 }
コード例 #28
0
ファイル: WorkerTask.cs プロジェクト: vsujeesh/ShareX
        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());
            }
        }
コード例 #29
0
ファイル: UploadInfoManager.cs プロジェクト: wathiq-iq/ShareX
 public void OpenShortenedURL()
 {
     if (IsItemSelected && SelectedItem.IsShortenedURLExist) URLHelpers.OpenURL(SelectedItem.Info.Result.ShortenedURL);
 }
コード例 #30
0
 private void btnImageEffects_Click(object sender, EventArgs e)
 {
     URLHelpers.OpenURL(Links.URL_IMAGE_EFFECTS);
 }