未验证 提交 64e92e4b 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #28515 from sharwell/remove-duplication

Remove duplication of command group/id constants
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.VisualStudio.LanguageServices.CSharp.Interactive
{
internal static class CSharpInteractiveCommands
{
public const int InteractiveToolWindow = 0x0001;
public const int ResetInteractiveFromProject = 0x0002;
public const string InteractiveCommandSetIdString = "1492DB0A-85A2-4E43-BF0D-CE55B89A8CC6";
public static readonly Guid InteractiveCommandSetId = new Guid(InteractiveCommandSetIdString);
}
}
......@@ -38,7 +38,7 @@ protected override void InitializeMenuCommands(OleMenuCommandService menuCommand
{
var openInteractiveCommand = new MenuCommand(
(sender, args) => this.InteractiveWindowProvider.Open(instanceId: 0, focus: true),
new CommandID(CSharpInteractiveCommands.InteractiveCommandSetId, CSharpInteractiveCommands.InteractiveToolWindow));
new CommandID(ID.InteractiveCommands.CSharpInteractiveCommandSetId, ID.InteractiveCommands.InteractiveToolWindow));
menuCommandService.AddCommand(openInteractiveCommand);
}
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System
Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Interactive
Friend Module VisualBasicInteractiveCommands
Public Const InteractiveToolWindow = &H1
Public Const ResetInteractiveFromProject = &H2
Public Const InteractiveCommandSetIdString As String = "93DF185E-D75B-4FDB-9D47-E90F111971C5"
Public ReadOnly InteractiveCommandSetId As Guid = New Guid(InteractiveCommandSetIdString)
End Module
End Namespace
......@@ -21,11 +21,11 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Interactive
Inherits VsInteractiveWindowPackage(Of VisualBasicVsInteractiveWindowProvider)
Friend Const IdString As String = "0A6D502E-93F7-4FCC-90D9-D5020BD54D69"
Friend Shared ReadOnly Id As New Guid(IdString)
Friend Shared ReadOnly IdGuid As New Guid(IdString)
Protected Overrides ReadOnly Property ToolWindowId As Guid
Get
Return Id
Return IdGuid
End Get
End Property
......@@ -38,7 +38,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Interactive
Protected Overrides Sub InitializeMenuCommands(menuCommandService As OleMenuCommandService)
Dim openInteractiveCommand = New MenuCommand(
handler:=Sub(sender, args) Me.InteractiveWindowProvider.Open(instanceId:=0, focus:=True),
command:=New CommandID(VisualBasicInteractiveCommands.InteractiveCommandSetId, VisualBasicInteractiveCommands.InteractiveToolWindow))
command:=New CommandID(ID.InteractiveCommands.VisualBasicInteractiveCommandSetId, ID.InteractiveCommands.InteractiveToolWindow))
menuCommandService.AddCommand(openInteractiveCommand)
End Sub
......
......@@ -40,7 +40,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Interactive
Protected Overrides ReadOnly Property Id As Guid
Get
Return VisualBasicVsInteractiveWindowPackage.Id
Return VisualBasicVsInteractiveWindowPackage.IdGuid
End Get
End Property
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册