diff --git a/docs/repo/features.md b/docs/repo/features.md
index 2c3e8a39f56..c4c47580dbe 100644
--- a/docs/repo/features.md
+++ b/docs/repo/features.md
@@ -13,11 +13,6 @@ This repository contains the following broad features:
## Property Pages
[Source](/src/Microsoft.VisualStudio.Editors/PropPages)
-## Resources Editor
-[Source](/src/Microsoft.VisualStudio.Editors/ResourceEditor)
-
-
-
## Settings Designer
[Source](/src/Microsoft.VisualStudio.Editors/SettingsDesigner)
diff --git a/docs/repo/getting-started.md b/docs/repo/getting-started.md
index a5503f0b3ec..4e957932bc8 100644
--- a/docs/repo/getting-started.md
+++ b/docs/repo/getting-started.md
@@ -117,7 +117,7 @@ While the long term goal is to have all C#, F# and Visual Basic projects use thi
4. In __File Explorer__, rename project from _[project].csproj_ -> _[project].msbuildproj_
5. __File__ -> __Open__ -> __Project/Solution__ and browse to the project you just renamed and choose __Open__
-### AppDesigner, Settings, Resource Editors and Property Pages
+### AppDesigner, Settings and Property Pages
Both the new project system and the existing project system use the features built from this repository.
## Code Coverage
diff --git a/docs/repo/images/resourceseditor.png b/docs/repo/images/resourceseditor.png
deleted file mode 100644
index b0b3b02447b..00000000000
Binary files a/docs/repo/images/resourceseditor.png and /dev/null differ
diff --git a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerPanel.vb b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerPanel.vb
index 8e1a6170659..186409fb2d5 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerPanel.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerPanel.vb
@@ -53,7 +53,7 @@ Namespace Microsoft.VisualStudio.Editors.ApplicationDesigner
Private _docCookie As UInteger
Private _docData As Object
'The DocView for the designer, if we were able to retrieve it (if we understood the designer type). This would
- ' be a PropPageDesignerView for our hosted property pages, ResourceEditorView for the resource editor, etc.
+ ' be a PropPageDesignerView for our hosted property pages, etc.
Private _docView As Control
'This is Nothing if we're not displaying a property page
diff --git a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootComponent.vb b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootComponent.vb
index 0b5166f896e..200a914ab6e 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootComponent.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootComponent.vb
@@ -24,7 +24,7 @@ Namespace Microsoft.VisualStudio.Editors.ApplicationDesigner
''' designer which is showing the UI to the user which allows this component's
''' resx file to be edited by the user.
'''
- ''' The associated ResourceEditorRootDesigner.
+ ''' The associated ApplicationDesignerRootDesigner.
Public ReadOnly Property RootDesigner As ApplicationDesignerRootDesigner
Get
If _rootDesigner Is Nothing Then
diff --git a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootDesigner.vb b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootDesigner.vb
index 4038d93d338..bc79d147ab5 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootDesigner.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/ApplicationDesigner/ApplicationDesignerRootDesigner.vb
@@ -5,12 +5,8 @@ Imports System.ComponentModel.Design
Namespace Microsoft.VisualStudio.Editors.ApplicationDesigner
- ' {E18B7249-8322-44c3-9A57-FE5FF3889F89}
- 'static const GUID <> =
- '{ 0xe18b7249, 0x8322, 0x44c3, { 0x9a, 0x57, 0xfe, 0x5f, 0xf3, 0x88, 0x9f, 0x89 } };
-
'''
- ''' This is the designer for the top-level resource editor component (ApplicationDesigner). I.e., this
+ ''' This is the designer for the top-level editor component (ApplicationDesigner). I.e., this
''' is the top-level designer.
'''
Public NotInheritable Class ApplicationDesignerRootDesigner
@@ -69,7 +65,7 @@ Namespace Microsoft.VisualStudio.Editors.ApplicationDesigner
'''
''' Called by the managed designer mechanism to determine what kinds of view technologies we support.
- ''' We currently support only Windows Forms technology (i.e., our designer view, ResourceEditorView,
+ ''' We currently support only Windows Forms technology (i.e., our designer view which
''' inherits from System.Windows.Forms.Control)
'''
'''
@@ -83,11 +79,11 @@ Namespace Microsoft.VisualStudio.Editors.ApplicationDesigner
'''
''' Called by the managed designer technology to get our view, or the actual control that implements
- ''' our resource editor's designer surface. In this case, we return an instance of ResourceEditorView.
+ ''' our application designer surface. In this case, we return an instance of ApplicationDesignerView.
'''
'''
'''
- ''' The newly-instantiated ResourceEditorView object.
+ ''' The newly-instantiated ApplicationDesignerView object.
'''
Private Function RootDesigner_GetView(Technology As ViewTechnology) As Object Implements IRootDesigner.GetView
If Technology <> ViewTechnology.Default Then
diff --git a/src/Microsoft.VisualStudio.AppDesigner/Common/Utils.vb b/src/Microsoft.VisualStudio.AppDesigner/Common/Utils.vb
index 66e09d27a39..41c4bd3d575 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/Common/Utils.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/Common/Utils.vb
@@ -18,11 +18,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
Friend Module Utils
- 'The transparent color used for all bitmaps in the resource editor is lime (R=0, G=255, B=0).
- ' Any pixels of this color will be converted to transparent if StandardTransparentColor
- ' is passed to GetManifestBitmap
- Public ReadOnly StandardTransparentColor As Color = Color.Lime
-
Public VBPackageInstance As IVBPackage
' The maximal amount of files that can be added at one shot. (copied from other VS features)
@@ -109,17 +104,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
End If
End Function
- '''
- ''' Retrieves a transparent copy of a given bitmap from the manifest resources.
- '''
- ''' Name of the bitmap resource (not including the assembly name, e.g. "Link.bmp")
- ''' Name of assembly containing the manifest resource
- ''' The retrieved transparent bitmap
- ''' Throws an internal exception if the bitmap cannot be found or loaded.
- Public Function GetManifestBitmapTransparent(BitmapID As String, Optional ByRef assembly As Assembly = Nothing) As Bitmap
- Return GetManifestBitmapTransparent(BitmapID, StandardTransparentColor, assembly)
- End Function
-
'''
''' Retrieves a given image from the manifest resources.
'''
@@ -299,22 +283,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
End If
End Sub
- '''
- ''' Set the drop-down width of a datagridviewcomboboxcolumn wide enough to show the text of all entries in it
- '''
- ''' The column to change the width for
- '''
- ''' This does not take the current cell style into account - it uses the font from the parent datagridview (if any)
- ''' It also makes room for the scrollbar even though it may not be visible...
- '''
- Public Sub SetComboBoxColumnDropdownWidth(column As DataGridViewComboBoxColumn)
- If column IsNot Nothing AndAlso column.DataGridView IsNot Nothing Then
- column.DropDownWidth = Math.Max(MeasureMaxTextWidth(column.DataGridView, column.Items) + SystemInformation.VerticalScrollBarWidth, column.Width)
- Else
- Debug.Fail("SetComboBoxColumnDropdownWidth: No combobox column specified, or the column didn't have a parent datagridview!")
- End If
- End Sub
-
'''
''' Check whether the screen reader is running
'''
@@ -331,29 +299,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
Return False
End Function
- '''
- ''' Sets error code and error message through IVsUIShell interface
- '''
- ''' error code
- ''' error message
- Public Sub SetErrorInfo(sp As ServiceProvider, hr As Integer, errorMessage As String)
- Dim vsUIShell As IVsUIShell = Nothing
-
- If sp IsNot Nothing Then
- vsUIShell = CType(sp.GetService(GetType(IVsUIShell)), IVsUIShell)
- End If
-
- If vsUIShell Is Nothing AndAlso Not VBPackageInstance IsNot Nothing Then
- vsUIShell = CType(VBPackageInstance.GetService(GetType(IVsUIShell)), IVsUIShell)
- End If
-
- If vsUIShell IsNot Nothing Then
- vsUIShell.SetErrorInfo(hr, errorMessage, 0, Nothing, Nothing)
- Else
- Debug.Fail("Could not get IVsUIShell from service provider. Can't set specific error message.")
- End If
- End Sub
-
'''
''' Sets focus to the first (or last) control inside of a parent HWND.
'''
diff --git a/src/Microsoft.VisualStudio.AppDesigner/Common/switches.vb b/src/Microsoft.VisualStudio.AppDesigner/Common/switches.vb
index 153918e19b5..9a0a2e179c3 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/Common/switches.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/Common/switches.vb
@@ -21,7 +21,7 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
.
.
.
- Public Shared FileWatcher As New TraceSwitch("FileWatcher", "Trace the resource editor FileWatcher class.")
+ Public Shared FileWatcher As New TraceSwitch("FileWatcher", "Trace the property page editor FileWatcher class.")
.
.
.
@@ -145,48 +145,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
'''
Friend NotInheritable Class Switches
- '------------- Resource Editor -------------
-
- '''
- ''' Trace for the ResourceEditor.FileWatcher class
- '''
- Public Shared RSEFileWatcher As New TraceSwitch("RSEFileWatcher", "Trace the resource editor FileWatcher class.")
-
- '''
- ''' Tracing for the ResourceEditor.ResourceSerializationService class
- '''
- Public Shared RSEResourceSerializationService As New TraceSwitch("RSEResourceSerializationService", "Trace the resource editor ResourceSerializationService class.")
-
- '''
- ''' Track adding and removing resources in the resource editor
- '''
- Public Shared RSEAddRemoveResources As New TraceSwitch("RSEAddRemoveResources", "Trace adding/removing resources in the resource editor")
-
- '''
- ''' Trace virtual mode methods in the resource editor's string table
- '''
- Public Shared RSEVirtualStringTable As New TraceSwitch("RSEVirtualStringTable", "Trace virtual mode methods in the resource editor's string table")
-
- '''
- ''' Trace virtual mode methods in the resource editor's listview
- '''
- Public Shared RSEVirtualListView As New TraceSwitch("RSEVirtualListView", "Trace virtual mode methods in the resource editor's listview")
-
- '''
- ''' Trace the delayed checking of errors in resources
- '''
- Public Shared RSEDelayCheckErrors As New TraceSwitch("RSEDelayCheckErrors", "Trace the delayed checking of errors in resources")
-
- '''
- ''' Disable high-quality options on the Graphics object when creating thumbnails in the resource editor
- '''
- Public Shared RSEDisableHighQualityThumbnails As New BooleanSwitch("RSEDisableHighQualityThumbnails", "Disable high-quality options on the Graphics object when creating thumbnails in the resource editor")
-
- '''
- ''' Trace find/replace in the resource editor
- '''
- Public Shared RSEFindReplace As New TraceSwitch("RSEFindReplace", "Trace find/replace in the resource editor")
-
'------------- Designer Framework -------------
'''
@@ -614,71 +572,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
#End If
End Sub
- '''
- ''' Traces the access modifier combobox functionality
- '''
-
- Public Shared Sub TracePDAccessModifierCombobox(traceLevel As TraceLevel, message As String)
-#If DEBUG Then
- Trace.WriteLineIf(PDAccessModifierCombobox.Level >= traceLevel, "PDAccessModifierCombobox: " & message)
-#End If
- End Sub
-
- '''
- ''' Trace serialization of settings
- '''
- '''
- '''
-
- Public Overloads Shared Sub TraceSDSerializeSettings(tracelevel As TraceLevel, message As String)
-#If DEBUG Then
- Trace.WriteLineIf(SDSerializeSettings.Level >= tracelevel, message)
-#End If
- End Sub
-
- '''
- ''' Trace serialization of settings
- '''
- '''
- '''
- '''
-
- Public Overloads Shared Sub TraceSDSerializeSettings(tracelevel As TraceLevel, formatString As String, ParamArray parameters() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(SDSerializeSettings.Level >= tracelevel, String.Format(formatString, parameters))
-#End If
- End Sub
-
-
- Public Overloads Shared Sub TracePDLinqImports(tracelevel As TraceLevel, formatString As String, ParamArray parameters() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDLinqImports.Level >= tracelevel, Format(formatString, parameters))
-#End If
- End Sub
-
- '''
- ''' Trace changes to one of the monitored configuration files
- '''
- '''
-
- Public Overloads Shared Sub TraceWCFConfigFileChangeWatch(tracelevel As TraceLevel, formatString As String, ParamArray parameters() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(WCF_Config_FileChangeWatch.Level >= tracelevel, String.Format(formatString, parameters))
-#End If
- End Sub
-
- '''
- ''' Trace changes to one of the monitored configuration files
- '''
- '''
- '''
-
- Public Overloads Shared Sub TraceWCFConfigFileChangeWatch(tracelevel As TraceLevel, message As String)
-#If DEBUG Then
- Trace.WriteLineIf(WCF_Config_FileChangeWatch.Level >= tracelevel, message)
-#End If
- End Sub
-
Public Shared Sub TracePDPerfBegin(e As System.Windows.Forms.LayoutEventArgs, Message As String, ParamArray FormatArguments() As Object)
#If DEBUG Then
@@ -687,14 +580,6 @@ Namespace Microsoft.VisualStudio.Editors.AppDesCommon
#End If
End Sub
-
- Public Shared Sub TraceMyExtensibility(traceLevel As TraceLevel, message As String)
-#If DEBUG Then
- Trace.WriteLineIf(MyExtensibilityTraceSwitch.Level >= traceLevel, String.Format("MyExtensibility {0} {1}: ", Date.Now.ToLongDateString(), Date.Now.ToLongTimeString()))
- Trace.WriteLineIf(MyExtensibilityTraceSwitch.Level >= traceLevel, message)
-#End If
- End Sub
-
End Class
End Namespace
diff --git a/src/Microsoft.VisualStudio.AppDesigner/DesignerFramework/BaseRootDesigner.vb b/src/Microsoft.VisualStudio.AppDesigner/DesignerFramework/BaseRootDesigner.vb
index f826406ccce..118d72c7acf 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/DesignerFramework/BaseRootDesigner.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/DesignerFramework/BaseRootDesigner.vb
@@ -82,8 +82,7 @@ Namespace Microsoft.VisualStudio.Editors.AppDesDesignerFramework
''' TRUE to keep previously registered menu commands for this designer.
''' FALSE otherwise, the root designer will clear its menu commands list and add the new one.
'''
- ''' Child root designers call this method to register their own menu commands.
- ''' See ResourceEditorRootDesigner.
+ ''' Child root designers call this method to register their own menu commands.
Public Sub RegisterMenuCommands(MenuCommands As ArrayList,
Optional KeepRegisteredMenuCommands As Boolean = True)
' Clear the list of menu commands if specified.
diff --git a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerEditorFactory.vb b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerEditorFactory.vb
index f39f16526fa..3733ea598dc 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerEditorFactory.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerEditorFactory.vb
@@ -15,8 +15,8 @@ Namespace Microsoft.VisualStudio.Editors.PropPageDesigner
';PropPageDesignerEditorFactory
'
'Remarks:
- ' The editor factory for the resource editor. The job of this class is
- ' simply to create a new resource editor designer when requested by the
+ ' The editor factory for the property page editor. The job of this class is
+ ' simply to create a new property page editor designer when requested by the
' shell.
'**************************************************************************
- ''' The associated ResourceEditorRootDesigner.
+ ''' The associated PropPageDesignerRootDesigner.
Public ReadOnly Property RootDesigner As PropPageDesignerRootDesigner
Get
If _rootDesigner Is Nothing Then
diff --git a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerRootDesigner.vb b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerRootDesigner.vb
index 04d4884c22f..19f95d6adea 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerRootDesigner.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropPageDesignerRootDesigner.vb
@@ -4,12 +4,8 @@ Imports System.ComponentModel.Design
Namespace Microsoft.VisualStudio.Editors.PropPageDesigner
- ' {E18B7249-8322-44c3-9A57-FE5FF3889F89}
- 'static const GUID <> =
- '{ 0xe18b7249, 0x8322, 0x44c3, { 0x9a, 0x57, 0xfe, 0x5f, 0xf3, 0x88, 0x9f, 0x89 } };
-
'''
- ''' This is the designer for the top-level resource editor component (PropPageDesigner). I.e., this
+ ''' This is the designer for the top-level property page editor component (PropPageDesigner). I.e., this
''' is the top-level designer.
'''
Public NotInheritable Class PropPageDesignerRootDesigner
@@ -45,7 +41,7 @@ Namespace Microsoft.VisualStudio.Editors.PropPageDesigner
'''
''' Called by the managed designer mechanism to determine what kinds of view technologies we support.
- ''' We currently support only Windows Forms technology (i.e., our designer view, ResourceEditorView,
+ ''' We currently support only Windows Forms technology (i.e., our designer view which
''' inherits from System.Windows.Forms.Control)
'''
'''
@@ -59,11 +55,11 @@ Namespace Microsoft.VisualStudio.Editors.PropPageDesigner
'''
''' Called by the managed designer technology to get our view, or the actual control that implements
- ''' our resource editor's designer surface. In this case, we return an instance of ResourceEditorView.
+ ''' our property page editor's designer surface. In this case, we return an instance of PropPageDesignerView.
'''
'''
'''
- ''' The newly-instantiated ResourceEditorView object.
+ ''' The newly-instantiated PropPageDesignerView object.
'''
Private Function RootDesigner_GetView(Technology As ViewTechnology) As Object Implements IRootDesigner.GetView
If Technology <> ViewTechnology.Default Then
diff --git a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropertyPageSerializationService.vb b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropertyPageSerializationService.vb
index 8e5a911c55c..fe26073024d 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropertyPageSerializationService.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/PropPageDesigner/PropertyPageSerializationService.vb
@@ -131,7 +131,7 @@ Namespace Microsoft.VisualStudio.Editors.PropPageDesigner
Public Overrides Sub SerializeMemberAbsolute(Store As SerializationStore, OwningObject As Object, Member As MemberDescriptor)
'This method is intended for properties such as collections which might have had only some of their
' members changed.
- 'The resource editor doesn't have any such properties, so we just treat this the same
+ 'The property page editor doesn't have any such properties, so we just treat this the same
' as simple SerializeMember (ignoring OldValue)
SerializeMember(Store, OwningObject, Member)
diff --git a/src/Microsoft.VisualStudio.AppDesigner/Resources/Designer.Designer.vb b/src/Microsoft.VisualStudio.AppDesigner/Resources/Designer.Designer.vb
index cbba1fe15fd..e5dad4f4780 100644
--- a/src/Microsoft.VisualStudio.AppDesigner/Resources/Designer.Designer.vb
+++ b/src/Microsoft.VisualStudio.AppDesigner/Resources/Designer.Designer.vb
@@ -22,7 +22,7 @@ Namespace My.Resources
'''
''' A strongly-typed resource class, for looking up localized strings, etc.
'''
- _
Friend Class Designer
diff --git a/src/Microsoft.VisualStudio.Editors/Common/DTEUtils.vb b/src/Microsoft.VisualStudio.Editors/Common/DTEUtils.vb
index dfe6f5c8451..4e4f2dc94a8 100644
--- a/src/Microsoft.VisualStudio.Editors/Common/DTEUtils.vb
+++ b/src/Microsoft.VisualStudio.Editors/Common/DTEUtils.vb
@@ -3,6 +3,7 @@
Imports System.IO
Imports EnvDTE
+Imports EnvDTE.Constants
Imports Microsoft.VisualStudio.Shell.Interop
@@ -13,6 +14,14 @@ Namespace Microsoft.VisualStudio.Editors.Common
'''
Friend NotInheritable Class DTEUtils
+#Region "Constants from DTE.idl"
+
+ 'A Guid version of vsProjectItemKindPhysicalFolder, which as a projectitem kind indicates that the
+ ' projectitem is a physical folder on disk (as opposed to a virtual folder, etc.)
+ Private Shared ReadOnly s_guid_vsProjectItemKindPhysicalFolder As New Guid(vsProjectItemKindPhysicalFolder)
+
+#End Region
+
Public Const PROJECTPROPERTY_CUSTOMTOOL As String = "CustomTool"
Public Const PROJECTPROPERTY_CUSTOMTOOLNAMESPACE As String = "CustomToolNamespace"
@@ -33,7 +42,15 @@ Namespace Microsoft.VisualStudio.Editors.Common
''' The key to check for.
''' The ProjectItem for the given key, if found, else Nothing. Throws exceptions only in unexpected cases.
Public Shared Function QueryProjectItems(ProjectItems As ProjectItems, Name As String) As ProjectItem
- Return ResourceEditor.ResourcesFolderService.QueryProjectItems(ProjectItems, Name)
+ Try
+ Return ProjectItems.Item(Name)
+ Catch ex As ArgumentException
+ 'This is the expected exception if the key could not be found.
+ Catch ex As Exception When ReportWithoutCrash(ex, "Unexpected exception searching for an item in ProjectItems", NameOf(DTEUtils))
+ 'Any other error - shouldn't be the case, but it might depend on the project implementation
+ End Try
+
+ Return Nothing
End Function
'''
@@ -42,7 +59,80 @@ Namespace Microsoft.VisualStudio.Editors.Common
''' The ProjectItems collection to check. Must refer to a physical folder on disk.
''' The directory name of the collection on disk.
Public Shared Function GetFolderNameFromProjectItems(ProjectItems As ProjectItems) As String
- Return ResourceEditor.ResourcesFolderService.GetFolderNameFromProjectItems(ProjectItems)
+ If s_guid_vsProjectItemKindPhysicalFolder.Equals(New Guid(ProjectItems.Kind)) Then
+ If TypeOf ProjectItems.Parent Is Project Then
+ Return GetProjectDirectory(DirectCast(ProjectItems.Parent, Project))
+ ElseIf TypeOf ProjectItems.Parent Is ProjectItem Then
+ Return GetFileNameFromFolderProjectItem(DirectCast(ProjectItems.Parent, ProjectItem))
+ Else
+ Debug.Fail("Unexpected Parent type for ProjectItems")
+ Return Nothing
+ End If
+ Else
+ Debug.Fail("Shouldn't call GetFileNameFromProjectItems for a ProjectItems collection that is not a physical disk folder.")
+ Return ""
+ End If
+ End Function
+
+ '''
+ ''' Retrieves the file name on disk for a ProjectItem.
+ '''
+ ''' The project item to check.
+ ''' The filename and path of the project item.
+ Private Shared Function GetFileNameFromFolderProjectItem(ProjectItem As ProjectItem) As String
+ If s_guid_vsProjectItemKindPhysicalFolder.Equals(New Guid(ProjectItem.Kind)) Then
+ 'The FileNames property represents the actual full path of the directory if the folder
+ ' is an actual physical folder on disk.
+ Debug.Assert(ProjectItem.FileCount = 1, "Didn't expect multiple filenames for a folder ProjectItem")
+ Return ProjectItem.FileNames(1) 'this collection is 1-indexed
+ Else
+ Debug.Fail("Trying to get filename of a non-physical folder in the project")
+ Return ""
+ End If
+ End Function
+
+ '''
+ ''' Given a project, returns the project's directory on disk.
+ '''
+ ''' The project to query.
+ Private Shared Function GetProjectDirectory(Project As Project) As String
+ 'Some special cases. In particular, note that the Miscellaneous Files project
+ ' has a FullName value of the empty string.
+ If Project Is Nothing OrElse Project.FullName Is Nothing OrElse Project.FullName = "" OrElse IsMiscellaneousProject(Project) Then
+ Debug.Fail("Shouldn't be calling this with a null Project or with the Miscellaneous Files Project")
+ Return ""
+ End If
+
+ Dim ProjectDirectory As String
+ Try
+ ProjectDirectory = Path.GetFullPath(Path.GetDirectoryName(Project.FullName))
+ Catch ex As ArgumentException
+ 'In some scenarios Project.FullName does not give us an actual location on the local file
+ ' system (e.g. when working with ASP.NET projects created on a URL instead of the local file
+ ' system). ASP.NET projects have a FullPath property which gives us what we want. Let's try
+ ' that before giving up.
+ ProjectDirectory = Path.GetFullPath(Path.GetDirectoryName(CStr(Project.Properties.Item("FullPath").Value)))
+ End Try
+
+ Debug.Assert(Directory.Exists(ProjectDirectory), "Project's FullName property is not its path on disk?")
+ Return ProjectDirectory
+ End Function
+
+ '''
+ ''' Given a project, determine if it is the Miscellaneous Files project
+ '''
+ '''
+ Private Shared Function IsMiscellaneousProject(Project As Project) As Boolean
+ If vsMiscFilesProjectUniqueName.Equals(Project.UniqueName, StringComparison.OrdinalIgnoreCase) Then
+ Return True
+ End If
+
+ If Project.FullName = "" Then
+ Debug.Fail("This project is not the miscellaneous files project, but its FullName is empty!")
+ Return True 'defensive
+ End If
+
+ Return False
End Function
'''
@@ -67,27 +157,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return DirectCast(ExtensibilityObject, ProjectItem)
End Function
- '''
- ''' Finds all files within a given ProjectItem that contain the given extension
- '''
- ''' The ProjectItems node to search through
- ''' The extension to search for, including the period. E.g. ".resx"
- ''' If True, the search will continue to children.
- Public Shared Function FindAllFilesWithExtension(ProjectItems As ProjectItems, Extension As String, SearchChildren As Boolean) As List(Of ProjectItem)
- Dim ResXFiles As New List(Of ProjectItem)
- For Each Item As ProjectItem In ProjectItems
- If Path.GetExtension(Item.FileNames(1)).Equals(Extension, StringComparison.OrdinalIgnoreCase) Then
- ResXFiles.Add(Item)
- End If
-
- If SearchChildren AndAlso Item.ProjectItems.Count > 0 Then
- ResXFiles.AddRange(FindAllFilesWithExtension(Item.ProjectItems, Extension, SearchChildren))
- End If
- Next
-
- Return ResXFiles
- End Function
-
'''
''' Get the file name from a project item.
'''
@@ -209,7 +278,7 @@ Namespace Microsoft.VisualStudio.Editors.Common
Public Shared Function FindProjectItem(projectItems As ProjectItems, fileName As String) As ProjectItem
For Each projectItem As ProjectItem In projectItems
If projectItem.Kind.Equals(
- EnvDTE.Constants.vsProjectItemKindPhysicalFile, StringComparison.OrdinalIgnoreCase) AndAlso
+ vsProjectItemKindPhysicalFile, StringComparison.OrdinalIgnoreCase) AndAlso
projectItem.FileCount > 0 Then
Dim itemFileName As String = Path.GetFileName(projectItem.FileNames(1))
diff --git a/src/Microsoft.VisualStudio.Editors/Common/ShellUtil.vb b/src/Microsoft.VisualStudio.Editors/Common/ShellUtil.vb
index 909233f41f2..22740c4e4ab 100644
--- a/src/Microsoft.VisualStudio.Editors/Common/ShellUtil.vb
+++ b/src/Microsoft.VisualStudio.Editors/Common/ShellUtil.vb
@@ -55,20 +55,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return Color.FromArgb(CInt(abgrValue And &HFFUI), CInt((abgrValue And &HFF00UI) >> 8), CInt((abgrValue And &HFF0000UI) >> 16))
End Function
- '''
- ''' Retrieves the window that should be used as the owner of all dialogs and messageboxes.
- '''
- Friend Shared Function GetDialogOwnerWindow(serviceProvider As IServiceProvider) As IWin32Window
- Dim dialogOwner As IWin32Window = Nothing
- Dim UIService As IUIService = DirectCast(serviceProvider.GetService(GetType(IUIService)), IUIService)
- If UIService IsNot Nothing Then
- dialogOwner = UIService.GetDialogOwnerWindow()
- End If
-
- Debug.Assert(dialogOwner IsNot Nothing, "Couldn't get DialogOwnerWindow")
- Return dialogOwner
- End Function
-
'''
''' Given an IVsCfg, get its configuration and platform names.
'''
@@ -234,24 +220,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return TryCast(ConfigProvider, IVsCfgProvider2)
End Function
- '''
- ''' Given a hierarchy, determine if this is a devices project...
- '''
- '''
- Public Shared Function IsDeviceProject(hierarchy As IVsHierarchy) As Boolean
- If hierarchy Is Nothing Then
- Debug.Fail("I can't determine if this is a devices project from a NULL hierarchy!?")
- Return False
- End If
-
- Dim vsdProperty As Object = Nothing
- Dim hr As Integer = hierarchy.GetProperty(VSITEMID.ROOT, 8000, vsdProperty)
- If Interop.NativeMethods.Succeeded(hr) AndAlso vsdProperty IsNot Nothing AndAlso TryCast(vsdProperty, IVSDProjectProperties) IsNot Nothing Then
- Return True
- End If
- Return False
- End Function
-
'''
''' Is this a Venus project?
'''
@@ -444,13 +412,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
End Function
- '''
- ''' a fake IVSDProjectProperties definition. We only use this to check whether the project supports this interface, but don't pay attention to the detail.
- '''
-
- Private Interface IVSDProjectProperties
- End Interface
-
'''
''' Wrapper class for IVsShell.OnBroadcastMessage
'''
@@ -655,45 +616,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Public Shared Function GetServiceProvider(dte As DTE) As IServiceProvider
Return New Shell.ServiceProvider(DirectCast(dte, OLE.Interop.IServiceProvider))
End Function
- '''
- ''' VSHPROPID_IsDefaultNamespaceRefactorNotify only exists in C#. Other langs will not have this property
- '''
- ''' C# does not support default namespace rename. this flag will tell the caller if
- ''' this is a default renamespace rename or not.
- '''
- '''
- '''
- Public Shared Function IsDefaultNamespaceRename(pHier As IVsHierarchy, itemId As UInteger) As Boolean
- ' result <<== out
- Dim result As Object = Nothing
- Dim success As Boolean = VSErrorHandler.Succeeded(pHier.GetProperty(itemId, CType(__VSHPROPID3.VSHPROPID_IsDefaultNamespaceRefactorNotify, Integer), result))
-
- If Not success OrElse result Is Nothing Then
- Return False
- End If
-
- Return CType(result, Boolean)
- End Function
-
- '''
- ''' Create a Type Resolution Service.
- '''
- '''
- '''
- Friend Shared Function CreateTypeResolutionService(serviceProvider As IServiceProvider, hierarchy As IVsHierarchy) As System.ComponentModel.Design.ITypeResolutionService
- Dim dynamicTypeService As Shell.Design.DynamicTypeService =
- TryCast(serviceProvider.GetService(
- GetType(Shell.Design.DynamicTypeService)),
- Shell.Design.DynamicTypeService)
-
- Dim trs As System.ComponentModel.Design.ITypeResolutionService = Nothing
-
- If dynamicTypeService IsNot Nothing Then
- trs = dynamicTypeService.GetTypeResolutionService(hierarchy, VSITEMID.ROOT)
- End If
-
- Return trs
- End Function
'''
''' Gets VS color from the shell's color service. If for some reason this fails or is False, returns the supplied
diff --git a/src/Microsoft.VisualStudio.Editors/Common/Utils.vb b/src/Microsoft.VisualStudio.Editors/Common/Utils.vb
index c470fc71d7d..7a6c87b7eb6 100644
--- a/src/Microsoft.VisualStudio.Editors/Common/Utils.vb
+++ b/src/Microsoft.VisualStudio.Editors/Common/Utils.vb
@@ -24,47 +24,11 @@ Namespace Microsoft.VisualStudio.Editors.Common
Friend Module Utils
- 'The transparent color used for all bitmaps in the resource editor is lime (R=0, G=255, B=0).
- ' Any pixels of this color will be converted to transparent if StandardTransparentColor
- ' is passed to GetManifestBitmap
- Public ReadOnly StandardTransparentColor As Color = Color.Lime
-
' The maximal amount of files that can be added at one shot. (copied from other VS features)
Private Const VSDPLMAXFILES As Integer = 200
Private s_imageService As IVsImageService2
- 'Property page GUIDs. These are used only for sorting the tabs in the project designer, and for providing a
- ' unique ID for SQM. Both cases are optional (we handle getting property pages with GUIDs we don't recognize).
- 'PERF: NOTE: Initializing GUIDs from numeric values as below is a lot faster than initializing from strings.
- Friend Class KnownPropertyPageGuids
- Friend Shared ReadOnly GuidApplicationPage_VB As Guid = New Guid(&H8998E48EUI, &HB89AUS, &H4034US, &HB6, &H6E, &H35, &H3D, &H8C, &H1F, &HDC, &H2E)
- Friend Shared ReadOnly GuidApplicationPage_VB_WPF As Guid = New Guid(&HAA1F44UI, &H2BA3US, &H4EAAUS, &HB5, &H4A, &HCE, &H18, &H0, &HE, &H6C, &H5D)
- Friend Shared ReadOnly GuidApplicationPage_CS As Guid = New Guid(&H5E9A8AC2UI, &H4F34US, &H4521US, CByte(&H85), CByte(&H8F), CByte(&H4C), CByte(&H24), CByte(&H8B), CByte(&HA3), CByte(&H15), CByte(&H32))
- Friend Shared ReadOnly GuidApplicationPage_JS As Guid = GuidApplicationPage_CS
- Friend Shared ReadOnly GuidSigningPage As Guid = New Guid(&HF8D6553FUI, &HF752US, &H4DBFUS, CByte(&HAC), CByte(&HB6), CByte(&HF2), CByte(&H91), CByte(&HB7), CByte(&H44), CByte(&HA7), CByte(&H92))
- Friend Shared ReadOnly GuidReferencesPage_VB As Guid = New Guid(&H4E43F4ABUI, &H9F03US, &H4129US, CByte(&H95), CByte(&HBF), CByte(&HB8), CByte(&HFF), CByte(&H87), CByte(&HA), CByte(&HF6), CByte(&HAB))
- Friend Shared ReadOnly GuidServicesPropPage As Guid = New Guid(&H43E38D2EUI, &H4EB8US, &H4204US, CByte(&H82), CByte(&H25), CByte(&H93), CByte(&H57), CByte(&H31), CByte(&H61), CByte(&H37), CByte(&HA4))
- Friend Shared ReadOnly GuidSecurityPage As Guid = New Guid(&HDF8F7042UI, &HBB1US, &H47D1US, CByte(&H8E), CByte(&H6D), CByte(&HDE), CByte(&HB3), CByte(&HD0), CByte(&H76), CByte(&H98), CByte(&HBD))
- Friend Shared ReadOnly GuidSecurityPage_WPF As Guid = New Guid(&HA2C8FEUI, &H3844US, &H41BEUS, CByte(&H96), CByte(&H37), CByte(&H16), CByte(&H74), CByte(&H54), CByte(&HA7), CByte(&HF1), CByte(&HA7))
- Friend Shared ReadOnly GuidPublishPage As Guid = New Guid(&HCC4014F5UI, &HB18DUS, &H439CUS, CByte(&H93), CByte(&H52), CByte(&HF9), CByte(&H9D), CByte(&H98), CByte(&H4C), CByte(&HCA), CByte(&H85))
- Friend Shared ReadOnly GuidDebugPage As Guid = New Guid(&H6185191FUI, &H1008US, &H4FB2US, CByte(&HA7), CByte(&H15), CByte(&H3A), CByte(&H4E), CByte(&H4F), CByte(&H27), CByte(&HE6), CByte(&H10))
- Friend Shared ReadOnly GuidCompilePage_VB As Guid = New Guid(&HEDA661EAUI, &HDC61US, &H4750US, CByte(&HB3), CByte(&HA5), CByte(&HF6), CByte(&HE9), CByte(&HC7), CByte(&H40), CByte(&H60), CByte(&HF5))
- Friend Shared ReadOnly GuidBuildPage_CS As Guid = New Guid(&HA54AD834UI, &H9219US, &H4AA6US, CByte(&HB5), CByte(&H89), CByte(&H60), CByte(&H7A), CByte(&HF2), CByte(&H1C), CByte(&H3E), CByte(&H26))
- Friend Shared ReadOnly GuidBuildPage_JS As Guid = New Guid(&H8ADF8DB1UI, &HA8B8US, &H4E04US, CByte(&HA6), CByte(&H16), CByte(&H2E), CByte(&HFC), CByte(&H59), CByte(&H5F), CByte(&H27), CByte(&HF4))
- Friend Shared ReadOnly GuidReferencePathsPage As Guid = New Guid(&H31911C8UI, &H6148US, &H4E25US, CByte(&HB1), CByte(&HB1), CByte(&H44), CByte(&HBC), CByte(&HA9), CByte(&HA0), CByte(&HC4), CByte(&H5C))
- Friend Shared ReadOnly GuidBuildEventsPage As Guid = New Guid(&H1E78F8DBUI, &H6C07US, &H4D61US, CByte(&HA1), CByte(&H8F), CByte(&H75), CByte(&H14), CByte(&H1), CByte(&HA), CByte(&HBD), CByte(&H56))
- Friend Shared ReadOnly GuidDatabasePage_SQL As Guid = New Guid(&H87F6ADCEUI, &H9161US, &H489FUS, CByte(&H90), CByte(&H7E), CByte(&H39), CByte(&H30), CByte(&HA6), CByte(&H42), CByte(&H96), CByte(&H9))
- Friend Shared ReadOnly GuidFxCopPage As Guid = New Guid(&H984AE51AUI, &H4B21US, &H44E7US, CByte(&H82), CByte(&H2C), CByte(&HDD), CByte(&H5E), CByte(&H4), CByte(&H68), CByte(&H93), CByte(&HEF))
- Friend Shared ReadOnly GuidDeployPage As Guid = New Guid(&H29AB1D1BUI, &H10E8US, &H4511US, CByte(&HA3), CByte(&H62), CByte(&HEF), CByte(&H15), CByte(&H71), CByte(&HB8), CByte(&H44), CByte(&H3C))
- Friend Shared ReadOnly GuidDevicesPage_VSD As Guid = New Guid(&H7B74AADFUI, &HACA4US, &H410EUS, CByte(&H8D), CByte(&H4B), CByte(&HAF), CByte(&HE1), CByte(&H19), CByte(&H83), CByte(&H5B), CByte(&H99))
- Friend Shared ReadOnly GuidDebugPage_VSD As Guid = New Guid(&HAC5FAEC7UI, &HD452US, &H4AC1US, CByte(&HBC), CByte(&H44), CByte(&H2D), CByte(&H7E), CByte(&HCE), CByte(&H6D), CByte(&HF0), CByte(&H6C))
- Friend Shared ReadOnly GuidMyExtensionsPage As Guid = New Guid(&HF24459FCUI, &HE883US, &H4A8EUS, CByte(&H9D), CByte(&HA2), CByte(&HAE), CByte(&HF6), CByte(&H84), CByte(&HF0), CByte(&HE1), CByte(&HF4))
- Friend Shared ReadOnly GuidOfficePublishPage As Guid = New Guid(&HCC7369A8UI, &HB9B0US, &H439CUS, CByte(&HB1), CByte(&H36), CByte(&HBA), CByte(&H95), CByte(&H58), CByte(&H19), CByte(&HF7), CByte(&HF8))
- Friend Shared ReadOnly GuidServicesPage As Guid = New Guid(&H43E38D2EUI, &H43B8US, &H4204US, CByte(&H82), CByte(&H25), CByte(&H93), CByte(&H57), CByte(&H31), CByte(&H61), CByte(&H37), CByte(&HA4))
- Friend Shared ReadOnly GuidWAPWebPage As Guid = New Guid(&H909D16B3UI, &HC8E8US, &H43D1US, CByte(&HA2), CByte(&HB8), CByte(&H26), CByte(&HEA), CByte(&HD), CByte(&H4B), CByte(&H6B), CByte(&H57))
- End Class
-
'''
''' test if vs in build process BUGFIX: Dev11#45255
'''
@@ -89,115 +53,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return False
End Function
- '''
- ''' Convert a variant to integer value
- '''
- '''
- '''
- ''' return true if the variant is an integer type value
- Public Function TryConvertVariantToInt(obj As Object, ByRef value As Integer) As Boolean
- If obj Is Nothing Then
- Return False
- End If
-
- Dim objType As Type = obj.GetType()
- If objType Is GetType(UShort) OrElse
- objType Is GetType(Short) OrElse
- objType Is GetType(UInteger) OrElse
- objType Is GetType(Integer) OrElse
- objType Is GetType(ULong) OrElse
- objType Is GetType(Long) OrElse
- objType Is GetType(Byte) OrElse
- objType Is GetType(SByte) OrElse
- objType Is GetType(Single) OrElse
- objType Is GetType(Double) Then
-
- value = CInt(obj)
- Return True
- End If
- Return False
- End Function
-
- '''
- ''' Helper to convert ItemIds or other 32 bit ID values
- ''' where it is sometimes treated as an Int32 and sometimes UInt32
- ''' ItemId is sometimes marshaled as a VT_INT_PTR, and often declared
- ''' UInt in the interop assemblies. Otherwise we get overflow exceptions converting
- ''' negative numbers to UInt32. We just want raw bit translation.
- '''
- '''
- Public Function NoOverflowCUInt(obj As Object) As UInteger
- Return NoOverflowCUInt(CLng(obj))
- End Function
-
- '''
- ''' Masks the top 32 bits to get just the lower 32bit number
- '''
- '''
- Public Function NoOverflowCUInt(LongValue As Long) As UInteger
- Return CUInt(LongValue And UInteger.MaxValue)
- End Function
-
- '''
- ''' Retrieves a given bitmap from the manifest resources (unmodified)
- '''
- ''' Name of the bitmap resource (not including the assembly name, e.g. "Link.bmp")
- ''' The retrieved bitmap
- ''' Throws an internal exception if the bitmap cannot be found or loaded.
- Public Function GetManifestBitmap(BitmapID As String) As Bitmap
- Return DirectCast(GetManifestImage(BitmapID), Bitmap)
- End Function
-
- '''
- ''' Retrieves a transparent copy of a given bitmap from the manifest resources.
- '''
- ''' Name of the bitmap resource (not including the assembly name, e.g. "Link.bmp")
- ''' The color that represents transparent in the bitmap
- ''' The retrieved transparent bitmap
- ''' Throws an internal exception if the bitmap cannot be found or loaded.
- Public Function GetManifestBitmapTransparent(BitmapID As String, TransparentColor As Color) As Bitmap
- Dim Bitmap As Bitmap = GetManifestBitmap(BitmapID)
- If Bitmap IsNot Nothing Then
- Bitmap.MakeTransparent(TransparentColor)
- Return Bitmap
- Else
- Debug.Fail("Couldn't find internal resource")
- Throw New Package.InternalException(String.Format(My.Resources.Microsoft_VisualStudio_Editors_Designer.RSE_Err_Unexpected_NoResource_1Arg, BitmapID))
- End If
- End Function
-
- '''
- ''' Retrieves a transparent copy of a given bitmap from the manifest resources.
- '''
- ''' Name of the bitmap resource (not including the assembly name, e.g. "Link.bmp")
- ''' The retrieved transparent bitmap
- ''' Throws an internal exception if the bitmap cannot be found or loaded.
- Public Function GetManifestBitmapTransparent(BitmapID As String) As Bitmap
- Return GetManifestBitmapTransparent(BitmapID, StandardTransparentColor)
- End Function
-
- '''
- ''' Retrieves a given image from the manifest resources.
- '''
- ''' Name of the bitmap resource (not including the assembly name, e.g. "Link.bmp")
- ''' The retrieved bitmap
- ''' Throws an internal exception if the bitmap cannot be found or loaded.
- Public Function GetManifestImage(ImageID As String) As Image
- Dim BitmapStream As Stream = GetType(Utils).Assembly.GetManifestResourceStream(ImageID)
- If BitmapStream IsNot Nothing Then
- Dim Image As Image = Image.FromStream(BitmapStream)
- If Image IsNot Nothing Then
- Return Image
- Else
- Debug.Fail("Unable to find image resource from manifest: " & ImageID)
- End If
- Else
- Debug.Fail("Unable to find image resource from manifest: " & ImageID)
- End If
-
- Throw New Package.InternalException(String.Format(My.Resources.Microsoft_VisualStudio_Editors_Designer.RSE_Err_Unexpected_NoResource_1Arg, ImageID))
- End Function
-
Public Function GetImageFromImageService(imageMoniker As ImageMoniker, width As Integer, height As Integer, background As Color) As Image
If ImageService IsNot Nothing Then
Dim attributes As New Imaging.Interop.ImageAttributes With {
@@ -328,10 +183,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return True
End Function
- Public Function IsIOException(ex As Exception) As Boolean
- Return TypeOf ex Is IOException OrElse TypeOf ex Is UnauthorizedAccessException
- End Function
-
'''
''' Given an exception, returns True if it is a CheckOut exception.
'''
@@ -375,22 +226,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
End If
End Function
- '''
- ''' Does the same as System.IO.Path.GetFullPath(), except that if the filename
- ''' is malformed, it returns the original file path.
- '''
- ''' The path to get the full path from.
- Public Function GetFullPathTolerant(Path As String) As String
- Try
- Return IO.Path.GetFullPath(Path)
- Catch ex As ArgumentException
- Catch ex As NotSupportedException
- End Try
-
- 'If we hit an exception we want to be tolerant of, just return the original path
- Return Path
- End Function
-
'''
''' Given two namespace (either or both of which might be empty), combine them together into a single
''' namespace.
@@ -774,75 +609,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
Return Filter
End Function
- '''
- ''' Browses to save a File.
- '''
- ''' Service Provider
- ''' Window Handle of the parent window
- ''' The initial directory for the dialog. Can be Nothing or empty.
- ''' The dialog title.
- ''' The filter string to use.
- ''' The filter index to start out with.
- ''' The default file name.
- ''' If true, Windows will ask the user to overwrite the file if it already exists.
- ''' The selected file/path, or Nothing if the user canceled.
- Friend Function GetNewFileNameViaBrowse(ServiceProvider As IServiceProvider, ParentWindow As IntPtr,
- InitialDirectory As String, DialogTitle As String,
- Filter As String, FilterIndex As UInteger,
- Optional DefaultFileName As String = Nothing,
- Optional OverwritePrompt As Boolean = False) As String
-
- Dim uishell As IVsUIShell =
- CType(ServiceProvider.GetService(GetType(IVsUIShell)), IVsUIShell)
-
- InitialDirectory = NormalizeInitialDirectory(InitialDirectory)
- Filter = GetNativeFilter(Filter)
-
- Const MAX_PATH_NAME As Integer = 4096
-
- Dim defaultName(MAX_PATH_NAME) As Char
- If DefaultFileName IsNot Nothing Then
- DefaultFileName.CopyTo(0, defaultName, 0, DefaultFileName.Length)
- End If
-
- Dim vsSaveFileName As VSSAVEFILENAMEW()
- Dim stringMemPtr As IntPtr = Marshal.AllocHGlobal(MAX_PATH_NAME * 2 + 2)
- Marshal.Copy(defaultName, 0, stringMemPtr, defaultName.Length)
-
- Try
- vsSaveFileName = New VSSAVEFILENAMEW(0) {}
- vsSaveFileName(0).lStructSize = CUInt(Marshal.SizeOf(vsSaveFileName(0)))
- vsSaveFileName(0).hwndOwner = ParentWindow
- vsSaveFileName(0).pwzDlgTitle = DialogTitle
- vsSaveFileName(0).nMaxFileName = MAX_PATH_NAME
- vsSaveFileName(0).pwzFileName = stringMemPtr
- vsSaveFileName(0).pwzInitialDir = InitialDirectory
- vsSaveFileName(0).pwzFilter = Filter
- vsSaveFileName(0).nFilterIndex = FilterIndex
- vsSaveFileName(0).nFileOffset = 0
- vsSaveFileName(0).nFileExtension = FilterIndex
- vsSaveFileName(0).dwHelpTopic = 0
- vsSaveFileName(0).pSaveOpts = Nothing
-
- If OverwritePrompt Then
- vsSaveFileName(0).dwFlags = &H2 'OFN_OVERWRITEPROMPT
- Else
- vsSaveFileName(0).dwFlags = 0
- End If
-
- Dim hr As Integer = uishell.GetSaveFileNameViaDlg(vsSaveFileName)
- If VSErrorHandler.Succeeded(hr) Then
- Dim sFileName As String = Marshal.PtrToStringUni(stringMemPtr)
- Return sFileName
- End If
-
- Finally
- Marshal.FreeHGlobal(stringMemPtr)
- End Try
-
- Return Nothing
- End Function
-
'''
''' Returns a relative path from a given directory to another file or directory.
'''
@@ -958,22 +724,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
End If
End Function
- '''
- ''' Check whether the screen reader is running
- '''
- Friend Function IsScreenReaderRunning() As Boolean
- Dim pvParam As IntPtr = Marshal.AllocCoTaskMem(4)
- Try
- If NativeMethods.SystemParametersInfo(Win32Constant.SPI_GETSCREENREADER, 0, pvParam, 0) <> 0 Then
- Dim result As Integer = Marshal.ReadInt32(pvParam)
- Return result <> 0
- End If
- Finally
- Marshal.FreeCoTaskMem(pvParam)
- End Try
- Return False
- End Function
-
'''
''' We use this function to map one color in the image to another color
'''
@@ -1059,75 +809,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
End If
End Sub
- '''
- ''' Sets focus to the first (or last) control inside of a parent HWND.
- '''
- ''' The container HWND.
- ''' If True, sets focus to the first control, otherwise the last.
- Public Function FocusFirstOrLastTabItem(HwndParent As IntPtr, First As Boolean) As Boolean
- If HwndParent.Equals(IntPtr.Zero) Then
- Return False
- End If
-
- Dim c As Control = Control.FromChildHandle(HwndParent)
- If c IsNot Nothing Then
- 'WinForms controls don't set WS_TABSTOP so GetNextDlgTabItem doesn't work well for them.
-
- Dim TabStopOnly As Boolean = True
- Dim Nested As Boolean = True
- Dim Wrap As Boolean = True
- If c.SelectNextControl(Nothing, First, TabStopOnly, Nested, Wrap) Then
- Dim cc As ContainerControl = TryCast(c, ContainerControl)
- If cc IsNot Nothing AndAlso cc.ActiveControl IsNot Nothing Then
- cc.ActiveControl.Focus()
- End If
-
- Return True
- End If
-
- 'Perhaps all the controls are disabled
- Return False
- End If
-
- 'Use standard Win32 function for native dialog pages
- Dim FirstTabStop As IntPtr = NativeMethods.GetNextDlgTabItem(HwndParent, IntPtr.Zero, False)
- If FirstTabStop.Equals(IntPtr.Zero) Then
- Return False
- End If
-
- Dim NextTabStop As IntPtr
- If First Then
- NextTabStop = FirstTabStop
- Else
- NextTabStop = NativeMethods.GetNextDlgTabItem(HwndParent, FirstTabStop, True)
- End If
-
- If NextTabStop.Equals(IntPtr.Zero) Then
- Return False
- End If
-
- NativeMethods.SetFocus(NextTabStop)
- Return True
- End Function
-
- '''
- ''' Validates whether it is a high-surrogate character
- '''
- ''' a character to check
- ''' True if it is a high-surrogate character
- Public Function IsHighSurrogate(ch As Char) As Boolean
- Return AscW(ch) >= &HD800 AndAlso AscW(ch) <= &HDBFF
- End Function
-
- '''
- ''' Validates whether it is a low-surrogate character
- '''
- ''' a character to check
- ''' True if it is a low-surrogate character
- Public Function IsLowSurrogate(ch As Char) As Boolean
- Return AscW(ch) >= &HDC00 AndAlso AscW(ch) <= &HDFFF
- End Function
-
'''
''' Get the namespace for the generated file...
'''
@@ -1378,52 +1059,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
#End Region
- '''
- ''' Normalizes line endings. For instance, it will expand \r and \n to
- ''' \r\n and reverse \n\r to \r\n
- '''
- '''
- Public Function NormalizeLineEndings(text As String) As String
- If text = "" Then
- Return text
- End If
-
- Dim sb As New StringBuilder(text.Length)
-
- For i As Integer = 0 To text.Length - 1
- Select Case AscW(text.Chars(i))
- Case 13 '\r
- If i < text.Length - 1 AndAlso text.Chars(i + 1) = vbLf Then
- 'This one is okay, skip it
- sb.Append(vbCrLf)
- i += 1 'Skip next character
- Continue For
- Else
- 'This is an unmatched '\r', need to expand it
- sb.Append(vbCrLf)
- Continue For
- End If
-
- Case 10 '\n
- If i < text.Length - 1 AndAlso text.Chars(i + 1) = vbCr Then
- 'This is backwards (\n\r), need to reverse it
- sb.Append(vbCrLf)
- i += 1 'Skip next character
- Continue For
- Else
- 'This is an unmatched '\n', need to expand it
- sb.Append(vbCrLf)
- Continue For
- End If
-
- Case Else
- sb.Append(text.Chars(i))
- End Select
- Next
-
- Return sb.ToString()
- End Function
-
'''
''' Determines whether the project associated with the given hierarchy is targeting .NET 4.5 or above
'''
diff --git a/src/Microsoft.VisualStudio.Editors/Common/switches.vb b/src/Microsoft.VisualStudio.Editors/Common/switches.vb
index 24a0af763e0..b38ef4aea71 100644
--- a/src/Microsoft.VisualStudio.Editors/Common/switches.vb
+++ b/src/Microsoft.VisualStudio.Editors/Common/switches.vb
@@ -1,9 +1,5 @@
' Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
-#If DEBUG Then
-Imports Microsoft.VisualStudio.Editors.Interop
-#End If
-
Imports Microsoft.VisualStudio.Editors.PropertyPages
Namespace Microsoft.VisualStudio.Editors.Common
@@ -19,7 +15,7 @@ Namespace Microsoft.VisualStudio.Editors.Common
.
.
.
- Public Shared FileWatcher As New TraceSwitch("FileWatcher", "Trace the resource editor FileWatcher class.")
+ Public Shared FileWatcher As New TraceSwitch("FileWatcher", "Trace the property page editor FileWatcher class.")
.
.
.
@@ -143,48 +139,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
'''
Friend Class Switches
- '------------- Resource Editor -------------
-
- '''
- ''' Trace for the ResourceEditor.FileWatcher class
- '''
- Public Shared RSEFileWatcher As New TraceSwitch("RSEFileWatcher", "Trace the resource editor FileWatcher class.")
-
- '''
- ''' Tracing for the ResourceEditor.ResourceSerializationService class
- '''
- Public Shared RSEResourceSerializationService As New TraceSwitch("RSEResourceSerializationService", "Trace the resource editor ResourceSerializationService class.")
-
- '''
- ''' Track adding and removing resources in the resource editor
- '''
- Public Shared RSEAddRemoveResources As New TraceSwitch("RSEAddRemoveResources", "Trace adding/removing resources in the resource editor")
-
- '''
- ''' Trace virtual mode methods in the resource editor's string table
- '''
- Public Shared RSEVirtualStringTable As New TraceSwitch("RSEVirtualStringTable", "Trace virtual mode methods in the resource editor's string table")
-
- '''
- ''' Trace virtual mode methods in the resource editor's listview
- '''
- Public Shared RSEVirtualListView As New TraceSwitch("RSEVirtualListView", "Trace virtual mode methods in the resource editor's listview")
-
- '''
- ''' Trace the delayed checking of errors in resources
- '''
- Public Shared RSEDelayCheckErrors As New TraceSwitch("RSEDelayCheckErrors", "Trace the delayed checking of errors in resources")
-
- '''
- ''' Disable high-quality options on the Graphics object when creating thumbnails in the resource editor
- '''
- Public Shared RSEDisableHighQualityThumbnails As New BooleanSwitch("RSEDisableHighQualityThumbnails", "Disable high-quality options on the Graphics object when creating thumbnails in the resource editor")
-
- '''
- ''' Trace find/replace in the resource editor
- '''
- Public Shared RSEFindReplace As New TraceSwitch("RSEFindReplace", "Trace find/replace in the resource editor")
-
'------------- Designer Framework -------------
'''
@@ -319,48 +273,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
End Function
#End If
-#If DEBUG Then
- '''
- ''' Formats a Win32 message into a friendly form for debugging/tracing purposes
- '''
- '''
- Private Shared Function FormatWin32Message(msg As System.Windows.Forms.Message) As String
- Dim str As New System.Text.StringBuilder()
- Dim MsgType As String = Nothing
- Select Case msg.Msg
- Case Win32Constant.WM_KEYDOWN
- MsgType = "WM_KEYDOWN"
- Case AppDesInterop.Win32Constant.WM_KEYUP
- MsgType = "WM_KEYUP"
- Case Win32Constant.WM_SETFOCUS
- MsgType = "WM_SETFOCUS"
- Case Win32Constant.WM_CHAR
- MsgType = "WM_CHAR"
- Case Win32Constant.WM_SYSCHAR
- MsgType = "WM_SYSCHAR"
-
- Case Else
- If PDMessageRouting.Level >= TraceLevel.Verbose Then
- MsgType = "0x" & Hex(msg.Msg)
- Else
- Return Nothing
- End If
- End Select
- str.Append("MSG{" & MsgType & ", HWND=0x" & Hex(msg.HWnd.ToInt32))
-
- 'Get the HWND's text
- Dim WindowText As New String(" "c, 30)
- Dim CharsCopied As Integer = NativeMethods.GetWindowText(msg.HWnd, WindowText, WindowText.Length)
- If CharsCopied > 0 Then
- WindowText = WindowText.Substring(0, CharsCopied)
- str.Append(" """ & WindowText & """")
- End If
-
- str.Append("}"c)
- Return str.ToString()
- End Function
-#End If
-
#If DEBUG Then
Private Shared s_timeCodeStart As Date
Private Shared s_firstTimeCodeTaken As Boolean
@@ -460,18 +372,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
#End If
End Sub
- '''
- ''' Trace project designer focus-related events
- '''
- '''
- '''
-
- Public Shared Sub TracePDUndo(Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDUndo.TraceVerbose, "PDUndo: " & Format(Message, FormatArguments))
-#End If
- End Sub
-
'''
''' Trace project designer focus-related events
'''
@@ -484,37 +384,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
#End If
End Sub
- '''
- ''' Trace the functionality of extender properties
- '''
- '''
- '''
-
- Public Shared Sub TracePDExtenders(Level As TraceLevel, Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDExtenders.Level >= Level, "PDExtenders: " & Format(Message, FormatArguments))
-#End If
- End Sub
-
- '''
- ''' Trace configuration setup and changes tracking in the project designer
- '''
- '''
- '''
-
- Public Shared Sub TracePDConfigs(TraceLevel As TraceLevel, Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDConfigs.Level >= TraceLevel, "PDConfigs: " & Format(Message, FormatArguments))
-#End If
- End Sub
-
-
- Public Shared Sub TracePDConfigs(Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- TracePDConfigs(TraceLevel.Verbose, Message, FormatArguments)
-#End If
- End Sub
-
'''
''' Trace configuration setup and changes tracking in the project designer
'''
@@ -527,91 +396,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
#End If
End Sub
-
- Public Shared Sub TracePDPerfBegin(Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- If PDPerf.TraceInfo Then
- TracePDPerf("BEGIN: " & Message)
- Else
- TracePDPerf(Message)
- End If
-#End If
- End Sub
-
-
- Public Shared Sub TracePDPerfEnd(Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- If PDPerf.TraceInfo Then
- TracePDPerf(" END: " & Message)
- Else
- 'Don't bother with this message unless it's verbose
- End If
-#End If
- End Sub
-
-
- Public Shared Sub TracePDPerf(e As System.Windows.Forms.LayoutEventArgs, Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- TracePDPerf(Message, FormatArguments)
- TraceOnLayout(e)
-#End If
- End Sub
-
-#If DEBUG Then
- Private Shared Sub TraceOnLayout(e As System.Windows.Forms.LayoutEventArgs)
- If PDPerf.TraceInfo Then
- Trace.WriteLine(" AffectedControl=" & DebugToString(e.AffectedControl))
- Trace.WriteLine(" AffectedComponent=" & DebugToString(e.AffectedComponent))
- Trace.WriteLine(" AffectedProperty=" & DebugToString(e.AffectedProperty))
- If PDPerf.TraceVerbose Then
- Trace.WriteLine(New StackTrace().ToString)
- End If
- End If
- End Sub
-#End If
-
- '''
- ''' Trace configuration setup and changes tracking in the project designer
- '''
- '''
- '''
-
- Public Shared Sub TracePDCmdTarget(TraceLevel As TraceLevel, Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDCmdTarget.Level >= TraceLevel, "PDCmdTarget: " & Format(Message, FormatArguments))
-#End If
- End Sub
-
- '''
- ''' Trace Win32 message routing
- '''
- '''
- '''
- '''
-
- Public Shared Sub TracePDMessageRouting(TraceLevel As TraceLevel, Message As String, msg As System.Windows.Forms.Message)
-#If DEBUG Then
- If PDMessageRouting.Level >= TraceLevel Then
- Dim FormattedMessage As String = FormatWin32Message(msg)
- If FormattedMessage IsNot Nothing Then
- Trace.WriteLine("PDMessageRouting: " & Message & ": " & FormattedMessage)
- End If
- End If
-#End If
- End Sub
-
- '''
- ''' Trace Win32 message routing
- '''
- '''
- '''
-
- Public Shared Sub TracePDMessageRouting(TraceLevel As TraceLevel, Message As String)
-#If DEBUG Then
- Trace.WriteLineIf(PDMessageRouting.Level >= TraceLevel, "PDMessageRouting: " & Message)
-#End If
- End Sub
-
'''
''' Traces the access modifier combobox functionality
'''
@@ -647,44 +431,6 @@ Namespace Microsoft.VisualStudio.Editors.Common
#End If
End Sub
-
- Public Overloads Shared Sub TracePDLinqImports(tracelevel As TraceLevel, formatString As String, ParamArray parameters() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(PDLinqImports.Level >= tracelevel, Format(formatString, parameters))
-#End If
- End Sub
-
- '''
- ''' Trace changes to one of the monitored configuration files
- '''
- '''
-
- Public Overloads Shared Sub TraceWCFConfigFileChangeWatch(tracelevel As TraceLevel, formatString As String, ParamArray parameters() As Object)
-#If DEBUG Then
- Trace.WriteLineIf(WCF_Config_FileChangeWatch.Level >= tracelevel, String.Format(formatString, parameters))
-#End If
- End Sub
-
- '''
- ''' Trace changes to one of the monitored configuration files
- '''
- '''
- '''
-
- Public Overloads Shared Sub TraceWCFConfigFileChangeWatch(tracelevel As TraceLevel, message As String)
-#If DEBUG Then
- Trace.WriteLineIf(WCF_Config_FileChangeWatch.Level >= tracelevel, message)
-#End If
- End Sub
-
-
- Public Shared Sub TracePDPerfBegin(e As System.Windows.Forms.LayoutEventArgs, Message As String, ParamArray FormatArguments() As Object)
-#If DEBUG Then
- TracePDPerfBegin(Message, FormatArguments)
- TraceOnLayout(e)
-#End If
- End Sub
-
Public Shared Sub TraceMyExtensibility(traceLevel As TraceLevel, message As String)
#If DEBUG Then
diff --git a/src/Microsoft.VisualStudio.Editors/DesignerFramework/AccessModifierComboBox.vb b/src/Microsoft.VisualStudio.Editors/DesignerFramework/AccessModifierComboBox.vb
index b9a3ecad940..1eefd8b2cc1 100644
--- a/src/Microsoft.VisualStudio.Editors/DesignerFramework/AccessModifierComboBox.vb
+++ b/src/Microsoft.VisualStudio.Editors/DesignerFramework/AccessModifierComboBox.vb
@@ -4,11 +4,9 @@ Imports System.CodeDom
Imports System.CodeDom.Compiler
Imports System.ComponentModel
Imports System.ComponentModel.Design
-Imports System.Windows.Forms
Imports Microsoft.VisualStudio.Designer.Interfaces
Imports Microsoft.VisualStudio.Editors.Common
-Imports Microsoft.VisualStudio.Editors.ResourceEditor
Imports Microsoft.VisualStudio.Shell.Interop
Namespace Microsoft.VisualStudio.Editors.DesignerFramework
@@ -67,7 +65,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
Private _isDisposed As Boolean
Private ReadOnly _rootDesigner As BaseRootDesigner
- Private ReadOnly _resxFileProjectItem As EnvDTE.ProjectItem
+ Private ReadOnly _projectItem As EnvDTE.ProjectItem
Private ReadOnly _serviceProvider As IServiceProvider
Private ReadOnly _namespaceToOverrideIfCustomToolIsEmpty As String
Private ReadOnly _codeGeneratorEntries As New List(Of CodeGenerator)
@@ -83,7 +81,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
' checked the project system yet)
' This field should only be accessed through the CustomToolsRegistered property.
Private _customToolsRegistered As Boolean?
- Private _allowEdit As Boolean
+ 'Private _allowEdit As Boolean
#Region "Nested class CodeGenerator"
@@ -302,7 +300,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
Requires.NotNull(serviceProvider)
_rootDesigner = rootDesigner
- _resxFileProjectItem = projectItem
+ _projectItem = projectItem
_serviceProvider = serviceProvider
_namespaceToOverrideIfCustomToolIsEmpty = namespaceToOverrideIfCustomToolIsEmpty
End Sub
@@ -411,7 +409,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
Dim customToolProperty As EnvDTE.Property = Nothing
Try
- customToolProperty = DTEUtils.GetProjectItemProperty(_resxFileProjectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOL)
+ customToolProperty = DTEUtils.GetProjectItemProperty(_projectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOL)
Catch ex As KeyNotFoundException
' Possible limitation of Cps. In some cases Cps is not able to maintain the same item id for items,
' causing them to Not be found. In some scenarios (i.e., when the item Is moved), it ends up having
@@ -441,25 +439,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
For Each codeGenerator As CodeGenerator In _codeGeneratorEntries
If codeGenerator.DisplayName.Equals(value, StringComparison.CurrentCultureIgnoreCase) Then
- If TypeOf RootDesigner Is ResourceEditorRootDesigner Then
- Dim Designer = CType(RootDesigner, ResourceEditorRootDesigner)
- Dim ResourceView As ResourceEditorView = Designer.GetView()
- ' We let the base class handle the read only mode
- ' As mentioned in ResourceEditorDesignerLoader, "We actually don't want users to edit Form RESX file"
- ' so we just need to add the same warning as there for now until the new resource explorer is released
- If ResourceView IsNot Nothing AndAlso Not ResourceView.ReadOnlyMode Then
- If ResourceView.DsMsgBox(My.Resources.Microsoft_VisualStudio_Editors_Designer.RSE_Err_UpdateADependentFile, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, HelpIDs.Err_EditFormResx) = DialogResult.Yes Then
- _allowEdit = True
- End If
- End If
- If _allowEdit Then
- TrySetCustomToolValue(codeGenerator.CustomToolValue)
- End If
-
- _allowEdit = False
- Else
- TrySetCustomToolValue(codeGenerator.CustomToolValue)
- End If
+ TrySetCustomToolValue(codeGenerator.CustomToolValue)
Return
End If
Next
@@ -474,8 +454,8 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
'''
Private Sub TrySetCustomToolValue(value As String)
Try
- Dim customToolProperty As EnvDTE.Property = DTEUtils.GetProjectItemProperty(_resxFileProjectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOL)
- Dim customToolNamespaceProperty As EnvDTE.Property = DTEUtils.GetProjectItemProperty(_resxFileProjectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOLNAMESPACE)
+ Dim customToolProperty As EnvDTE.Property = DTEUtils.GetProjectItemProperty(_projectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOL)
+ Dim customToolNamespaceProperty As EnvDTE.Property = DTEUtils.GetProjectItemProperty(_projectItem, DTEUtils.PROJECTPROPERTY_CUSTOMTOOLNAMESPACE)
If customToolProperty IsNot Nothing Then
Dim previousCustomToolValue As String = TryCast(customToolProperty.Value, String)
@@ -588,7 +568,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
'''
Protected Overridable ReadOnly Property Hierarchy As IVsHierarchy
Get
- Return ShellUtil.VsHierarchyFromDTEProject(_serviceProvider, _resxFileProjectItem.ContainingProject)
+ Return ShellUtil.VsHierarchyFromDTEProject(_serviceProvider, _projectItem.ContainingProject)
End Get
End Property
diff --git a/src/Microsoft.VisualStudio.Editors/DesignerFramework/BaseRootDesigner.vb b/src/Microsoft.VisualStudio.Editors/DesignerFramework/BaseRootDesigner.vb
index c63f58b6bee..2fab54f891c 100644
--- a/src/Microsoft.VisualStudio.Editors/DesignerFramework/BaseRootDesigner.vb
+++ b/src/Microsoft.VisualStudio.Editors/DesignerFramework/BaseRootDesigner.vb
@@ -82,8 +82,7 @@ Namespace Microsoft.VisualStudio.Editors.DesignerFramework
''' TRUE to keep previously registered menu commands for this designer.
''' FALSE otherwise, the root designer will clear its menu commands list and add the new one.
'''
- ''' Child root designers call this method to register their own menu commands.
- ''' See ResourceEditorRootDesigner.
+ ''' Child root designers call this method to register their own menu commands.
Friend Sub RegisterMenuCommands(MenuCommands As ArrayList,
Optional KeepRegisteredMenuCommands As Boolean = True)
' Clear the list of menu commands if specified.
diff --git a/src/Microsoft.VisualStudio.Editors/DesignerFramework/UserCanceledException.vb b/src/Microsoft.VisualStudio.Editors/DesignerFramework/UserCanceledException.vb
deleted file mode 100644
index 76148c9fa25..00000000000
--- a/src/Microsoft.VisualStudio.Editors/DesignerFramework/UserCanceledException.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
-
-Option Strict On
-Option Explicit On
-
-Namespace Microsoft.VisualStudio.Editors.DesignerFramework
-
- '''
- ''' an exception is thrown when the customer cancel an operation.
- ''' We need specialize it, because we don't need pop an error message when this happens
- '''
- Friend NotInheritable Class UserCanceledException
- Inherits ApplicationException
-
- Public Sub New()
- MyBase.New(My.Resources.Microsoft_VisualStudio_Editors_Designer.RSE_Err_UserCancel)
- End Sub
-
- End Class
-
-End Namespace
-
diff --git a/src/Microsoft.VisualStudio.Editors/DesignerUI/VisualStudioEditorsID.vb b/src/Microsoft.VisualStudio.Editors/DesignerUI/VisualStudioEditorsID.vb
index b83ffabbdb2..b4c06d84153 100644
--- a/src/Microsoft.VisualStudio.Editors/DesignerUI/VisualStudioEditorsID.vb
+++ b/src/Microsoft.VisualStudio.Editors/DesignerUI/VisualStudioEditorsID.vb
@@ -22,52 +22,8 @@ Namespace Microsoft.VisualStudio.Editors
' Menu IDs (0x01??)
' *********************************************************************
- Private Const IDM_CTX_RESX_ContextMenu As Integer = &H100
Private Const IDM_CTX_SETTINGSDESIGNER_ContextMenu As Integer = &H110
Public Const IDM_VS_TOOLBAR_Settings As Integer = &H210
- Public Const IDM_VS_TOOLBAR_Resources As Integer = &H211
- Public Const IDM_VS_TOOLBAR_Resources_ResW As Integer = &H212
-
- ' *********************************************************************
- ' Command Group IDs (0x1???)
- ' *********************************************************************
-
- ' *********************************************************************
- ' Command IDs (0x2???)
- ' *********************************************************************
-
- Private Const CmdIdRESXImport As Integer = &H2003
- Private Const CmdIdRESXExport As Integer = &H2004
- Private Const CmdIdRESXPlay As Integer = &H2005
-
- Private Const CmdIdRESXAddFixedMenuCommand As Integer = &H2019
- Private Const CmdIdRESXAddExistingFile As Integer = &H2020
- Private Const CmdIdRESXAddNewString As Integer = &H2021
- Private Const CmdIdRESXAddNewImagePNG As Integer = &H2022
- Private Const CmdIdRESXAddNewImageBMP As Integer = &H2023
- Private Const CmdIdRESXAddNewImageGIF As Integer = &H2024
- Private Const CmdIdRESXAddNewImageJPEG As Integer = &H2025
- Private Const CmdIdRESXAddNewImageTIFF As Integer = &H2026
- Private Const CmdIdRESXAddNewIcon As Integer = &H2027
- Private Const CmdIdRESXAddNewTextFile As Integer = &H2028
- Private Const CmdIdRESXAddDefaultResource As Integer = &H2030
-
- Private Const CmdIdRESXResTypeStrings As Integer = &H2040
- Private Const CmdIdRESXResTypeImages As Integer = &H2041
- Private Const CmdIdRESXResTypeIcons As Integer = &H2042
- Private Const CmdIdRESXResTypeAudio As Integer = &H2043
- Private Const CmdIdRESXResTypeFiles As Integer = &H2044
- Private Const CmdIdRESXResTypeOther As Integer = &H2045
-
- Private Const CmdIdIDRESXViewsFixedMenuCommand As Integer = &H2018
- Private Const CmdIdRESXViewsList As Integer = &H2050
- Private Const CmdIdRESXViewsDetails As Integer = &H2051
- Private Const CmdIdRESXViewsThumbnails As Integer = &H2052
-
- Private Const CmdIdRESXGenericRemove As Integer = &H2060
-
- Private Const CmdIdRESXAccessModifierCombobox As Integer = &H2061
- Private Const CmdIdRESXGetAccessModifierOptions As Integer = &H2062
Private Const CmdIdSETTINGSDESIGNERViewCode As Integer = &H2104
Private Const CmdIdSETTINGSDESIGNERSynchronize As Integer = &H2105
@@ -119,14 +75,6 @@ Namespace Microsoft.VisualStudio.Editors
Public Shared ReadOnly CommandIDVSStd97cmdidViewCode As New CommandID(GuidVSStd97, CmdIdViewCode)
Public Shared ReadOnly CommandIDVSStd2kECMD_CANCEL As New CommandID(GuidVSStd2K, ECMD_CANCEL)
- ' GUID constants.
- Private Shared ReadOnly s_GUID_RESX_CommandID As New Guid("66BD4C1D-3401-4bcc-A942-E4990827E6F7")
- 'The Command GUID for the resource editor. It is required for us to correctly hook up key bindings,
- ' and must be returned from the editor factory.
- Public Shared ReadOnly GUID_RESXEditorCommandUI As New Guid("fea4dcc9-3645-44cd-92e7-84b55a16465c")
- Public Const GUID_RESXEditorCommandUIString As String = "fea4dcc9-3645-44cd-92e7-84b55a16465c"
-
- Public Shared ReadOnly GUID_RESX_MenuGroup As New Guid("54869924-25F5-4878-A9C9-1C7198D99A8A")
Public Shared ReadOnly GUID_SETTINGSDESIGNER_MenuGroup As New Guid("42b7a61f-81fd-4283-9678-6c448a827e56")
Private Shared ReadOnly s_GUID_SETTINGSDESIGNER_CommandID As New Guid("c2013470-51ac-4278-9ac5-389c72a1f926")
'The Command GUID for the settings designer. It is required for us to correctly hook up key bindings,
@@ -139,38 +87,7 @@ Namespace Microsoft.VisualStudio.Editors
' Command ID = GUID + cmdid.
Public Shared ReadOnly CommandIDVSStd97Open As New CommandID(GuidVSStd97, CmdIdOpen)
Public Shared ReadOnly CommandIDVSStd97OpenWith As New CommandID(GuidVSStd97, CmdIdOpenWith)
- Public Shared ReadOnly CommandIDResXImport As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXImport)
- Public Shared ReadOnly CommandIDResXExport As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXExport)
- Public Shared ReadOnly CommandIDResXPlay As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXPlay)
-
- Public Shared ReadOnly CommandIDRESXAddFixedMenuCommand As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddFixedMenuCommand)
- Public Shared ReadOnly CommandIDRESXAddExistingFile As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddExistingFile)
- Public Shared ReadOnly CommandIDRESXAddNewString As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewString)
- Public Shared ReadOnly CommandIDRESXAddNewImagePNG As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewImagePNG)
- Public Shared ReadOnly CommandIDRESXAddNewImageBMP As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewImageBMP)
- Public Shared ReadOnly CommandIDRESXAddNewImageGIF As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewImageGIF)
- Public Shared ReadOnly CommandIDRESXAddNewImageJPEG As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewImageJPEG)
- Public Shared ReadOnly CommandIDRESXAddNewImageTIFF As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewImageTIFF)
- Public Shared ReadOnly CommandIDRESXAddNewIcon As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewIcon)
- Public Shared ReadOnly CommandIDRESXAddNewTextFile As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddNewTextFile)
- Public Shared ReadOnly CommandIDRESXAddDefaultResource As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAddDefaultResource)
-
- Public Shared ReadOnly CommandIDRESXResTypeStrings As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeStrings)
- Public Shared ReadOnly CommandIDRESXResTypeImages As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeImages)
- Public Shared ReadOnly CommandIDRESXResTypeIcons As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeIcons)
- Public Shared ReadOnly CommandIDRESXResTypeAudio As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeAudio)
- Public Shared ReadOnly CommandIDRESXResTypeFiles As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeFiles)
- Public Shared ReadOnly CommandIDRESXResTypeOther As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXResTypeOther)
- Public Shared ReadOnly CommandIDRESXViewsFixedMenuCommand As New CommandID(s_GUID_RESX_CommandID, CmdIdIDRESXViewsFixedMenuCommand)
- Public Shared ReadOnly CommandIDRESXViewsList As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXViewsList)
- Public Shared ReadOnly CommandIDRESXViewsDetails As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXViewsDetails)
- Public Shared ReadOnly CommandIDRESXViewsThumbnails As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXViewsThumbnails)
-
- Public Shared ReadOnly CommandIDRESXGenericRemove As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXGenericRemove)
- Public Shared ReadOnly CommandIDRESXAccessModifierCombobox As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXAccessModifierCombobox)
- Public Shared ReadOnly CommandIDRESXGetAccessModifierOptions As New CommandID(s_GUID_RESX_CommandID, CmdIdRESXGetAccessModifierOptions)
-
- Public Shared ReadOnly ResXContextMenuID As New CommandID(GUID_RESX_MenuGroup, IDM_CTX_RESX_ContextMenu)
+
Public Shared ReadOnly SettingsDesignerContextMenuID As New CommandID(GUID_SETTINGSDESIGNER_MenuGroup, IDM_CTX_SETTINGSDESIGNER_ContextMenu)
Public Shared ReadOnly SettingsDesignerToolbar As New CommandID(GUID_SETTINGSDESIGNER_MenuGroup, IDM_VS_TOOLBAR_Settings)
diff --git a/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb b/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb
index b94689760a9..2524a3b3e36 100644
--- a/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb
+++ b/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb
@@ -9,7 +9,6 @@ Imports System.Diagnostics.CodeAnalysis
' Baselined, we should revisit these, see: https://github.com/dotnet/project-system/issues/121.
-
@@ -19,15 +18,9 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
@@ -37,17 +30,9 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
", Scope:="type", Target:="~T:Microsoft.VisualStudio.Editors.PropertyPages.ImportIdentity")>
-
-
-
@@ -61,14 +46,6 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
-
-
@@ -81,7 +58,6 @@ Imports System.Diagnostics.CodeAnalysis
-
@@ -90,21 +66,11 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
-
-
-
-
@@ -114,7 +80,6 @@ Imports System.Diagnostics.CodeAnalysis
-
@@ -136,13 +101,7 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
@@ -151,16 +110,9 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
-
@@ -171,7 +123,6 @@ Imports System.Diagnostics.CodeAnalysis
-
@@ -377,7 +328,6 @@ Imports System.Diagnostics.CodeAnalysis
-
@@ -390,393 +340,6 @@ Imports System.Diagnostics.CodeAnalysis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-