Ejemplo n.º 1
0
        ///////////////////////////////////////////////////////////////////////////////
        // Defining Properties                                                       //
        ///////////////////////////////////////////////////////////////////////////////
        #region PROPERTIES
        #endregion //PROPERTIES

        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler                                                              //
        ///////////////////////////////////////////////////////////////////////////////
        #region EVENTS

        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler for UI, Menu, Buttons, Toolbars etc.                         //
        ///////////////////////////////////////////////////////////////////////////////
        #region WINDOWSEVENTHANDLER

        /// <summary>
        /// The <see cref="LinkLabel.LinkClicked"/> event handler for the
        /// <see cref="LinkLabel"/> <see cref="llbMailTo"/>.
        /// Starts a new browser with the given link.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">A <see cref="LinkLabelLinkClickedEventArgs"/> with the event data.</param>
        private void llbMailTo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.ExportLogFileToClipboard();

            // Determine which link was clicked within the LinkLabel.
            this.llbMailTo.Links[this.llbMailTo.Links.IndexOf(e.Link)].Visited = true;

            // Display the appropriate link based on the value of the
            // LinkData property of the Link object.
            var target = e.Link.LinkData as string;

            // If the value looks like a URL, navigate to it.
            // Otherwise, display it in a message box.
            if (null != target)
            {
                try
                {
                    System.Diagnostics.Process.Start(target);
                }
                catch (Win32Exception)
                {
                    ExceptionMethods.ProcessErrorMessage("You have no application associated for sending mails."
                                                         + " Please send the error.log and exception.log files in your local application data folder "
                                                         + " to [email protected] to help debugging.");
                }
            }
            else
            {
                MessageBox.Show("Item clicked: " + target);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method puts the content of the <see cref="txbLog"/>
 /// into the clipboard.
 /// </summary>
 private void ExportLogFileToClipboard()
 {
     try
     {
         if (this.txbLog.Text != null)
         {
             Clipboard.SetText(this.txbLog.Text);
         }
     }
     catch (Exception ex)
     {
         ExceptionMethods.HandleException(ex);
     }
 }