コード例 #1
0
        private void lblCompanyName_LinkClicked(object sender, Infragistics.Win.FormattedLinkLabel.LinkClickedEventArgs e)
        {
            string url = e.LinkRef;

            Process.Start(url);
        }
コード例 #2
0
        private void ReportFormattedTextEditor_LinkClicked(object sender, Infragistics.Win.FormattedLinkLabel.LinkClickedEventArgs e)
        {
            try
            {
                // Show report
                HelpEngineData reportList = new HelpEngineData();
                reportList = WSHelper.ListHelpDocumentForm(e.LinkText.Trim());

                Process process = new Process();

                if (reportList.ListHelpDocumentForm.Rows.Count > 0)
                {
                    this.GetFileName();
                    HelpEngineData.ListHelpDocumentFormRow reportDocumentRow = (HelpEngineData.ListHelpDocumentFormRow)reportList.ListHelpDocumentForm.Rows[0];

                    if (reportDocumentRow.IsFile)
                    {
                        if (!string.IsNullOrEmpty(this.tempFilePath))
                        {
                            if (!this.tempFilePath.EndsWith(@"\"))
                            {
                                this.tempFilePath = this.tempFilePath + @"\";
                            }

                            FileInfo fileInfo = new FileInfo(this.tempFilePath + reportDocumentRow.FileName);
                            if (fileInfo.Exists)
                            {
                                process.StartInfo.FileName        = this.tempFilePath + reportDocumentRow.FileName;
                                process.StartInfo.UseShellExecute = true;
                                process.Start();
                            }
                            else
                            {
                                MessageBox.Show("Specified file/path does not exist.", ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Could not access the shared location.", ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        process.StartInfo.FileName  = "iexplore";
                        process.StartInfo.Arguments = reportDocumentRow.FileName;
                        process.Start();
                    }
                }
            }
            catch (System.UnauthorizedAccessException)
            {
                MessageBox.Show(SharedFunctions.GetResourceString("FileAccessDenied"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (IOException)
            {
                MessageBox.Show(SharedFunctions.GetResourceString("FileAccessDenied"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Win32Exception)
            {
                MessageBox.Show(SharedFunctions.GetResourceString("FileAccessDenied"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }