Exemple #1
0
        private void txtLinq_MouseClick(object sender, MouseEventArgs e)
        {
            //
            // Get the position inside the textbox based on the mouse cursor position.
            //
            int i = txtLinq.GetCharIndexFromPosition(e.Location);

            //
            // Error selected?
            //
            if (txtLinq.Cursor == Cursors.Hand && currentError != null)
            {
                try
                {
                    //
                    // Obtain reference to the Help2 object and display help associated with the SP**** error code.
                    //
                    EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
                    Microsoft.VisualStudio.VSHelp80.Help2 help2 = (Microsoft.VisualStudio.VSHelp80.Help2)dte.GetObject("Help2");
                    help2.DisplayTopicFromKeyword(currentError.ErrorCode);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Couldn't load help information.\n\n" + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        /// <summary>
        /// Invoke the property page help in response to an end-user request.
        /// </summary>
        /// <param name="pszHelpDir"></param>
        public void Help(string pszHelpDir)
        {
            System.IServiceProvider iPropertyPageSite =
                this.PropertyPageSite as System.IServiceProvider;
            if (iPropertyPageSite != null)
            {
                Microsoft.VisualStudio.VSHelp80.Help2 service = iPropertyPageSite.GetService(
                    typeof(Microsoft.VisualStudio.VSHelp80.Help2)) as Microsoft.VisualStudio.VSHelp80.Help2;

                if (service != null)
                {
                    service.DisplayTopicFromF1Keyword(this.HelpKeyword);
                }
            }
        }
Exemple #3
0
 private void ShowHelp()
 {
     try
     {
         //
         // Obtain reference to the Help2 object and display help associated with the SP**** error code.
         //
         EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
         Microsoft.VisualStudio.VSHelp80.Help2 help2 = (Microsoft.VisualStudio.VSHelp80.Help2)dte.GetObject("Help2");
         help2.DisplayTopicFromKeyword(currentError.ErrorCode);
     }
     catch (Exception ex)
     {
         MessageBoxOptions options = IsRightToLeft(this) ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0;
         MessageBox.Show(Strings.CouldntLoadHelp + "\n\n" + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, options);
     }
 }