提交 64b95c62 编写于 作者: R Ravi Chande

Revert "Merge pull request #20592 from sharwell/fix-options-page"

This reverts commit b76c7b4e, reversing
changes made to a526dba8.
上级 5f9c6e97
......@@ -7,12 +7,11 @@
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Navigation;
using EnvDTE;
using Microsoft.CodeAnalysis.Diagnostics.Log;
using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities;
using Roslyn.Utilities;
using Microsoft.CodeAnalysis.Editor.Implementation.Preview;
using IVsUIShell = Microsoft.VisualStudio.Shell.Interop.IVsUIShell;
using OLECMDEXECOPT = Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.PreviewPane
{
......@@ -25,7 +24,7 @@ internal partial class PreviewPane : UserControl, IDisposable
private readonly string _id;
private readonly bool _logIdVerbatimInTelemetry;
private readonly IVsUIShell _uiShell;
private readonly DTE _dte;
private bool _isExpanded;
private double _heightForThreeLineTitle;
......@@ -40,14 +39,14 @@ internal partial class PreviewPane : UserControl, IDisposable
string helpLinkToolTipText,
IReadOnlyList<object> previewContent,
bool logIdVerbatimInTelemetry,
IVsUIShell uiShell,
DTE dte,
Guid optionPageGuid = default(Guid))
{
InitializeComponent();
_id = id;
_logIdVerbatimInTelemetry = logIdVerbatimInTelemetry;
_uiShell = uiShell;
_dte = dte;
// Initialize header portion.
if ((severityIcon != null) && !string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(title))
......@@ -359,11 +358,7 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e)
{
if (_optionPageGuid != default(Guid))
{
ErrorHandler.ThrowOnFailure(_uiShell.PostExecCommand(
VSConstants.GUID_VSStandardCommandSet97,
(uint)VSConstants.VSStd97CmdID.ToolsOptions,
(uint)OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT,
_optionPageGuid.ToString()));
_dte.ExecuteCommand("Tools.Options", _optionPageGuid.ToString());
}
}
}
......
......@@ -18,20 +18,18 @@
using Microsoft.VisualStudio.Imaging.Interop;
using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities;
using Microsoft.VisualStudio.Shell;
using IVsUIShell = Microsoft.VisualStudio.Shell.Interop.IVsUIShell;
using SVsUIShell = Microsoft.VisualStudio.Shell.Interop.SVsUIShell;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.PreviewPane
{
[ExportWorkspaceServiceFactory(typeof(IPreviewPaneService), ServiceLayer.Host), Shared]
internal class PreviewPaneService : ForegroundThreadAffinitizedObject, IPreviewPaneService, IWorkspaceServiceFactory
{
private readonly IVsUIShell _uiShell;
private readonly EnvDTE.DTE _dte;
[ImportingConstructor]
public PreviewPaneService(SVsServiceProvider serviceProvider)
{
_uiShell = serviceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell;
_dte = serviceProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
}
IWorkspaceService IWorkspaceServiceFactory.CreateService(HostWorkspaceServices workspaceServices)
......@@ -109,7 +107,7 @@ private static Uri GetHelpLink(DiagnosticData diagnostic, string language, strin
return new PreviewPane(
severityIcon: null, id: null, title: null, description: null, helpLink: null, helpLinkToolTipText: null,
previewContent: previewContent, logIdVerbatimInTelemetry: false, uiShell: _uiShell);
previewContent: previewContent, logIdVerbatimInTelemetry: false, dte: _dte);
}
var helpLinkToolTipText = string.Empty;
......@@ -130,7 +128,7 @@ private static Uri GetHelpLink(DiagnosticData diagnostic, string language, strin
helpLinkToolTipText: helpLinkToolTipText,
previewContent: previewContent,
logIdVerbatimInTelemetry: diagnostic.CustomTags.Contains(WellKnownDiagnosticTags.Telemetry),
uiShell: _uiShell,
dte: _dte,
optionPageGuid: optionPageGuid);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册