コード例 #1
0
ファイル: IEHelper.cs プロジェクト: YHZX2013/exchange_diff
        private void StartIEByProcess(string url, IUIService uiService)
        {
            bool flag = false;

            try
            {
                this.helpProcess = new Process
                {
                    StartInfo = new ProcessStartInfo("iexplore.exe", this.IsIE8OrNewer() ? " -new -nomerge " : " -new ")
                };
                if (this.helpProcess.Start())
                {
                    this.helpProcess.WaitForInputIdle(2000);
                    flag = true;
                }
            }
            catch (InvalidOperationException)
            {
            }
            catch (Win32Exception)
            {
            }
            if (!flag)
            {
                try
                {
                    WinformsHelper.OpenUrl(new Uri(url));
                }
                catch (UrlHandlerNotFoundException ex)
                {
                    uiService.ShowError(ex.Message);
                }
            }
        }
コード例 #2
0
 private void OpenURL(string url)
 {
     try
     {
         WinformsHelper.OpenUrl(new Uri(url));
     }
     catch (UrlHandlerNotFoundException ex)
     {
         base.ShowError(ex.Message);
     }
 }
コード例 #3
0
        private void contentLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string text = e.Link.LinkData as string;

            if (!string.IsNullOrEmpty(text))
            {
                try
                {
                    WinformsHelper.OpenUrl(new Uri(text));
                }
                catch (UrlHandlerNotFoundException ex)
                {
                    base.ShowError(ex.Message);
                }
                catch (UriFormatException)
                {
                }
            }
        }