From d5e89fabb8a1b3f95db71af211bec07f5bf139c3 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 27 May 2015 12:07:10 -0700 Subject: [PATCH 1/4] Updates SharedProject to require use of image monikers on VS 2015. --- .../Product/SharedProject/CommonConstants.cs | 23 ----- .../Product/SharedProject/CommonFileNode.cs | 38 ++++---- .../Product/SharedProject/CommonFolderNode.cs | 16 ++-- .../SharedProject/CommonProjectNode.cs | 51 +++++----- .../SharedProject/DependentFileNode.cs | 20 +--- Common/Product/SharedProject/FileNode.cs | 35 +++---- Common/Product/SharedProject/FolderNode.cs | 14 +-- Common/Product/SharedProject/HierarchyNode.cs | 92 ++++++++----------- .../Navigation/ProjectLibraryNode.cs | 6 ++ Common/Product/SharedProject/ProjectNode.cs | 17 ++++ .../SharedProject/ReferenceContainerNode.cs | 10 +- Common/Product/SharedProject/ReferenceNode.cs | 16 ++-- 12 files changed, 161 insertions(+), 177 deletions(-) diff --git a/Common/Product/SharedProject/CommonConstants.cs b/Common/Product/SharedProject/CommonConstants.cs index 8cc6c3a05b..6ea330553d 100644 --- a/Common/Product/SharedProject/CommonConstants.cs +++ b/Common/Product/SharedProject/CommonConstants.cs @@ -118,27 +118,4 @@ internal static class CommonConstants { /// public const string Visible = "Visible"; } - -#if DEV14_OR_LATER - // This enumeration is not defined in the managed assemblies. - public enum __VSHPROPID8 { - VSHPROPID_SupportsIconMonikers = -2159, - VSHPROPID_IconMonikerGuid = -2160, - VSHPROPID_IconMonikerId = -2161, - VSHPROPID_OpenFolderIconMonikerGuid = -2162, - VSHPROPID_OpenFolderIconMonikerId = -2163, - VSHPROPID_IconMonikerImageList = -2164, - VSHPROPID_SharedProjectReference = -2165, - VSHPROPID_DiagHubPlatform = -2166, - VSHPROPID_DiagHubPlatformVersion = -2167, - VSHPROPID_DiagHubLanguage = -2168, - VSHPROPID_DiagHubProjectTargetFactory = -2169, - VSHPROPID_DiagHubProjectTarget = -2170, - VSHPROPID_SolutionGuid = -2171, - VSHPROPID_ActiveIntellisenseProjectContext = -2172, - VSHPROPID_ProjectCapabilitiesChecker = -2173, - VSHPROPID_ContainsStartupTask = -2174, - VSHPROPID_FIRST8 = -2174 - }; -#endif } diff --git a/Common/Product/SharedProject/CommonFileNode.cs b/Common/Product/SharedProject/CommonFileNode.cs index 29be2442eb..272d2f7883 100644 --- a/Common/Product/SharedProject/CommonFileNode.cs +++ b/Common/Product/SharedProject/CommonFileNode.cs @@ -100,25 +100,6 @@ internal override object Object { #region overridden methods - public override int ImageIndex { - get { - if (ItemNode.IsExcluded) { - return (int)ProjectNode.ImageName.ExcludedFile; - } else if (!File.Exists(Url)) { - return (int)ProjectNode.ImageName.MissingFile; - } else if (IsFormSubType) { - return (int)ProjectNode.ImageName.WindowsForm; - } else if (this._project.IsCodeFile(FileName)) { - if (CommonUtils.IsSamePath(this.Url, _project.GetStartupFile())) { - return _project.ImageOffset + (int)CommonImageName.StartupFile; - } else { - return _project.ImageOffset + (int)CommonImageName.File; - } - } - return base.ImageIndex; - } - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -152,6 +133,25 @@ protected override ImageMoniker GetIconMoniker(bool open) { } return default(ImageMoniker); } +#else + public override int ImageIndex { + get { + if (ItemNode.IsExcluded) { + return (int)ProjectNode.ImageName.ExcludedFile; + } else if (!File.Exists(Url)) { + return (int)ProjectNode.ImageName.MissingFile; + } else if (IsFormSubType) { + return (int)ProjectNode.ImageName.WindowsForm; + } else if (this._project.IsCodeFile(FileName)) { + if (CommonUtils.IsSamePath(this.Url, _project.GetStartupFile())) { + return _project.ImageOffset + (int)CommonImageName.StartupFile; + } else { + return _project.ImageOffset + (int)CommonImageName.File; + } + } + return base.ImageIndex; + } + } #endif diff --git a/Common/Product/SharedProject/CommonFolderNode.cs b/Common/Product/SharedProject/CommonFolderNode.cs index 96223c0ec6..1c2c5afa2d 100644 --- a/Common/Product/SharedProject/CommonFolderNode.cs +++ b/Common/Product/SharedProject/CommonFolderNode.cs @@ -40,6 +40,14 @@ public override bool IsNonMemberItem { } } +#if DEV14_OR_LATER + protected override ImageMoniker GetIconMoniker(bool open) { + if (ItemNode.IsExcluded) { + return open ? KnownMonikers.HiddenFolderOpened : KnownMonikers.HiddenFolderClosed; + } + return base.GetIconMoniker(open); + } +#else public override object GetIconHandle(bool open) { if (ItemNode.IsExcluded) { return ProjectMgr.GetIconHandleByName(open ? @@ -49,14 +57,6 @@ public override object GetIconHandle(bool open) { } return base.GetIconHandle(open); } - -#if DEV14_OR_LATER - protected override ImageMoniker GetIconMoniker(bool open) { - if (ItemNode.IsExcluded) { - return open ? KnownMonikers.HiddenFolderOpened : KnownMonikers.HiddenFolderClosed; - } - return base.GetIconMoniker(open); - } #endif internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result) { diff --git a/Common/Product/SharedProject/CommonProjectNode.cs b/Common/Product/SharedProject/CommonProjectNode.cs index 91cf8b3a31..529907f070 100644 --- a/Common/Product/SharedProject/CommonProjectNode.cs +++ b/Common/Product/SharedProject/CommonProjectNode.cs @@ -73,18 +73,24 @@ internal abstract class CommonProjectNode : ProjectNode, IVsProjectSpecificEdito #endif private int _idleTriggered; - public CommonProjectNode(IServiceProvider serviceProvider, ImageList/*!*/ imageList) + public CommonProjectNode(IServiceProvider serviceProvider, ImageList imageList) : base(serviceProvider) { +#if !DEV14_OR_LATER Contract.Assert(imageList != null); +#endif CanFileNodesHaveChilds = true; SupportsProjectDesigner = true; - _imageList = imageList; - - //Store the number of images in ProjectNode so we know the offset of the language icons. - _imageOffset = ImageHandler.ImageList.Images.Count; - foreach (Image img in ImageList.Images) { - ImageHandler.AddImage(img); + if (imageList != null) { + _imageList = imageList; + + //Store the number of images in ProjectNode so we know the offset of the language icons. +#pragma warning disable 0618 + _imageOffset = ImageHandler.ImageList.Images.Count; + foreach (Image img in ImageList.Images) { + ImageHandler.AddImage(img); + } +#pragma warning restore 0618 } //Initialize a new object to track project document changes so that we can update the StartupFile Property accordingly @@ -108,7 +114,7 @@ public override int QueryService(ref Guid guidService, out object result) { return base.QueryService(ref guidService, out result); } - #region abstract methods +#region abstract methods public abstract Type GetProjectFactoryType(); public abstract Type GetEditorFactoryType(); @@ -124,9 +130,9 @@ public virtual CommonFileNode CreateNonCodeFileNode(ProjectElement item) { public abstract Type GetGeneralPropertyPageType(); public abstract Type GetLibraryManagerType(); - #endregion +#endregion - #region Properties +#region Properties public int ImageOffset { get { return _imageOffset; } @@ -192,9 +198,9 @@ protected bool IsUserProjectFileDirty { } } - #endregion +#endregion - #region overridden properties +#region overridden properties public override bool CanShowAllFiles { get { @@ -212,6 +218,9 @@ public override bool IsShowingAllFiles { /// Since we appended the language images to the base image list in the constructor, /// this should be the offset in the ImageList of the langauge project icon. /// +#if DEV14_OR_LATER + [Obsolete("Use GetIconMoniker() to specify the icon and GetIconHandle() for back-compat")] +#endif public override int ImageIndex { get { return _imageOffset + (int)CommonImageName.Project; @@ -233,9 +242,9 @@ internal override object Object { return VSProject; } } - #endregion +#endregion - #region overridden methods +#region overridden methods public override object GetAutomationObject() { if (_automationObject == null) { @@ -1514,9 +1523,9 @@ public override int GetFormatList(out string formatlist) { protected override ConfigProvider CreateConfigProvider() { return new CommonConfigProvider(this); } - #endregion +#endregion - #region Methods +#region Methods /// /// This method retrieves an instance of a service that @@ -1668,9 +1677,9 @@ public virtual string GetUserProjectProperty(string propertyName) { return _userBuildProject.GetPropertyValue(propertyName); } - #endregion +#endregion - #region IVsProjectSpecificEditorMap2 Members +#region IVsProjectSpecificEditorMap2 Members public int GetSpecificEditorProperty(string mkDocument, int propid, out object result) { // initialize output params @@ -1722,9 +1731,9 @@ public int SetSpecificEditorProperty(string mkDocument, int propid, object value return VSConstants.E_NOTIMPL; } - #endregion +#endregion - #region IVsDeferredSaveProject Members +#region IVsDeferredSaveProject Members /// /// Implements deferred save support. Enabled by unchecking Tools->Options->Solutions and Projects->Save New Projects Created. @@ -1820,7 +1829,7 @@ out cancelled } } - #endregion +#endregion internal void SuppressFileChangeNotifications() { _watcher.EnableRaisingEvents = false; diff --git a/Common/Product/SharedProject/DependentFileNode.cs b/Common/Product/SharedProject/DependentFileNode.cs index fb3ee3d099..6b4970905f 100644 --- a/Common/Product/SharedProject/DependentFileNode.cs +++ b/Common/Product/SharedProject/DependentFileNode.cs @@ -39,12 +39,6 @@ internal class DependentFileNode : FileNode { /// #endregion - #region Properties - public override int ImageIndex { - get { return (this.CanShowDefaultIcon() ? (int)ProjectNode.ImageName.DependentFile : (int)ProjectNode.ImageName.MissingFile); } - } - #endregion - #region ctor /// /// Constructor for the DependentFileNode @@ -69,15 +63,6 @@ public override string GetEditLabel() { throw new NotImplementedException(); } - /// - /// Gets a handle to the icon that should be set for this node - /// - /// Whether the folder is open, ignored here. - /// Handle to icon for the node - public override object GetIconHandle(bool open) { - return this.ProjectMgr.ImageHandler.GetIconHandle(this.ImageIndex); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -89,6 +74,11 @@ protected override ImageMoniker GetIconMoniker(bool open) { KnownMonikers.ReferencedElement : KnownMonikers.DocumentWarning; } +#else + public override int ImageIndex { + get { return (this.CanShowDefaultIcon() ? (int)ProjectNode.ImageName.DependentFile : (int)ProjectNode.ImageName.MissingFile); } + } + #endif /// diff --git a/Common/Product/SharedProject/FileNode.cs b/Common/Product/SharedProject/FileNode.cs index cbf2f86a3c..df40eabde5 100644 --- a/Common/Product/SharedProject/FileNode.cs +++ b/Common/Product/SharedProject/FileNode.cs @@ -36,7 +36,9 @@ internal class FileNode : HierarchyNode, IDiskBasedNode { private string _caption; #region static fields +#if !DEV14_OR_LATER private static Dictionary extensionIcons; +#endif #endregion #region overriden Properties @@ -109,6 +111,7 @@ public override string GetEditLabel() { return Caption; } +#if !DEV14_OR_LATER public override int ImageIndex { get { // Check if the file is there. @@ -128,6 +131,7 @@ public override int ImageIndex { return imageIndex; } } +#endif public uint DocCookie { get { @@ -171,9 +175,10 @@ public override string Url { } } - #endregion +#endregion - #region ctor +#region ctor +#if !DEV14_OR_LATER [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static FileNode() { // Build the dictionary with the mapping between some well known extensions @@ -216,7 +221,7 @@ static FileNode() { extensionIcons.Add(".pfx", (int)ProjectNode.ImageName.PFX); extensionIcons.Add(".snk", (int)ProjectNode.ImageName.SNK); } - +#endif /// /// Constructor for the FileNode /// @@ -239,16 +244,6 @@ protected override NodeProperties CreatePropertiesObject() { return new IncludedFileNodeProperties(this); } - public override object GetIconHandle(bool open) { - int index = this.ImageIndex; - if (NoImage == index) { - // There is no image for this file; let the base class handle this case. - return base.GetIconHandle(open); - } - // Return the handle for the image. - return this.ProjectMgr.ImageHandler.GetIconHandle(index); - } - /// /// Get an instance of the automation object for a FileNode /// @@ -602,9 +597,9 @@ protected override bool CanShowDefaultIcon() { return File.Exists(moniker); } - #endregion +#endregion - #region virtual methods +#region virtual methods public override object GetProperty(int propId) { switch ((__VSHPROPID)propId) { @@ -803,9 +798,9 @@ protected internal override void GetSccSpecialFiles(string sccFile, IList /// Gets called to rename the eventually running document this hierarchyitem points to /// @@ -918,9 +913,9 @@ private void RenameCaseOnlyChange(string oldName, string newName) { ExpandItem(EXPANDFLAGS.EXPF_SelectItem); } - #endregion +#endregion - #region helpers +#region helpers /// @@ -942,7 +937,7 @@ private List GetChildNodes() { } return childNodes; } - #endregion +#endregion void IDiskBasedNode.RenameForDeferredSave(string basePath, string baseNewPath) { string oldLoc = CommonUtils.GetAbsoluteFilePath(basePath, ItemNode.GetMetadata(ProjectFileConstants.Include)); diff --git a/Common/Product/SharedProject/FolderNode.cs b/Common/Product/SharedProject/FolderNode.cs index d0a1448364..6846480c26 100644 --- a/Common/Product/SharedProject/FolderNode.cs +++ b/Common/Product/SharedProject/FolderNode.cs @@ -100,13 +100,6 @@ public override object GetAutomationObject() { return new Automation.OAFolderItem(this.ProjectMgr.GetAutomationObject() as Automation.OAProject, this); } - public override object GetIconHandle(bool open) { - return ProjectMgr.GetIconHandleByName(open ? - ProjectNode.ImageName.OpenFolder : - ProjectNode.ImageName.Folder - ); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -115,6 +108,13 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return open ? KnownMonikers.FolderOpened : KnownMonikers.FolderClosed; } +#else + public override object GetIconHandle(bool open) { + return ProjectMgr.GetIconHandleByName(open ? + ProjectNode.ImageName.OpenFolder : + ProjectNode.ImageName.Folder + ); + } #endif /// diff --git a/Common/Product/SharedProject/HierarchyNode.cs b/Common/Product/SharedProject/HierarchyNode.cs index f8515e5e16..eeac8b89f8 100644 --- a/Common/Product/SharedProject/HierarchyNode.cs +++ b/Common/Product/SharedProject/HierarchyNode.cs @@ -154,6 +154,9 @@ public virtual Guid MenuGroupId { /// Return an imageindex /// /// +#if DEV14_OR_LATER + [Obsolete("Use GetIconMoniker() to specify the icon")] +#endif public virtual int ImageIndex { get { return NoImage; } } @@ -510,15 +513,6 @@ protected virtual NodeProperties CreatePropertiesObject() { return null; } - /// - /// Return an iconhandle - /// - /// - /// - public virtual object GetIconHandle(bool open) { - return null; - } - #if DEV14_OR_LATER protected virtual bool SupportsIconMonikers { get { return false; } @@ -530,6 +524,16 @@ protected virtual bool SupportsIconMonikers { protected virtual ImageMoniker GetIconMoniker(bool open) { return default(ImageMoniker); } +#else + /// + /// Return an icon handle + /// + /// + /// + public virtual object GetIconHandle(bool open) { + var index = ImageIndex; + return index == NoImage ? null : (object)ProjectMgr.ImageHandler.GetIconHandle(index); + } #endif /// @@ -592,53 +596,35 @@ public virtual object GetProperty(int propId) { result = false; break; +#if !DEV14_OR_LATER case __VSHPROPID.VSHPROPID_IconImgList: -#if DEV14_OR_LATER - if (SupportsIconMonikers) { - break; - } -#endif result = this.ProjectMgr.ImageHandler.ImageList.Handle; break; case __VSHPROPID.VSHPROPID_OpenFolderIconIndex: case __VSHPROPID.VSHPROPID_IconIndex: -#if DEV14_OR_LATER - if (SupportsIconMonikers) { - break; - } -#endif - int index = this.ImageIndex; + int index = ImageIndex; if (index != NoImage) { result = index; } break; - case __VSHPROPID.VSHPROPID_StateIconIndex: - result = (int)this.StateIconIndex; - break; - - case __VSHPROPID.VSHPROPID_OverlayIconIndex: - result = (int)this.OverlayIconIndex; - break; - case __VSHPROPID.VSHPROPID_IconHandle: -#if DEV14_OR_LATER - if (SupportsIconMonikers) { - break; - } -#endif result = GetIconHandle(false); break; case __VSHPROPID.VSHPROPID_OpenFolderIconHandle: -#if DEV14_OR_LATER - if (SupportsIconMonikers) { - break; - } -#endif result = GetIconHandle(true); break; +#endif + + case __VSHPROPID.VSHPROPID_StateIconIndex: + result = (int)this.StateIconIndex; + break; + + case __VSHPROPID.VSHPROPID_OverlayIconIndex: + result = (int)this.OverlayIconIndex; + break; case __VSHPROPID.VSHPROPID_NextVisibleSibling: var nextVisible = NextVisibleSibling; @@ -1398,7 +1384,7 @@ protected virtual int ShowContextMenu(int menuId, Guid menuGroup, POINTS points) return shell.ShowContextMenu(0, ref menuGroup, menuId, pnts, (Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget)ProjectMgr); } - #region initiation of command execution +#region initiation of command execution /// /// Handles command execution. /// @@ -1470,9 +1456,9 @@ internal virtual int ExecCommandOnNode(Guid cmdGroup, uint cmd, uint nCmdexecopt return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED; } - #endregion +#endregion - #region query command handling +#region query command handling /// @@ -1529,7 +1515,7 @@ internal virtual int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED; } - #endregion +#endregion internal virtual bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation) { return this.ProjectMgr.CanProjectDeleteItems; } @@ -1692,9 +1678,9 @@ protected internal virtual void ShowDeleteMessage(IList nodes, __ cancel = true; } - #endregion +#endregion - #region public methods +#region public methods /// /// Clears the cached node properties so that it will be recreated on the next request. @@ -1815,9 +1801,9 @@ public object GetService(Type type) { } - #endregion +#endregion - #region IDisposable +#region IDisposable /// /// The IDispose interface Dispose method for disposing the object determinastically. /// @@ -1826,7 +1812,7 @@ public void Dispose() { GC.SuppressFinalize(this); } - #endregion +#endregion public virtual void Close() { DocumentManager manager = this.GetDocumentManager(); @@ -1846,7 +1832,7 @@ internal uint HierarchyId { } } - #region helper methods +#region helper methods /// /// Searches the immediate children of this node for a node which matches the specified predicate. @@ -1913,13 +1899,13 @@ internal IEnumerable EnumNodesOfType() } } - #endregion +#endregion private bool InvalidProject() { return this.projectMgr == null || this.projectMgr.IsClosed; } - #region nested types +#region nested types /// /// DropEffect as defined in oleidl.h /// @@ -1929,9 +1915,9 @@ internal enum DropEffect { Move = 2, Link = 4 }; - #endregion +#endregion - #region IOleServiceProvider +#region IOleServiceProvider int IOleServiceProvider.QueryService(ref Guid guidService, ref Guid riid, out IntPtr ppvObject) { object obj; @@ -1977,6 +1963,6 @@ public virtual int QueryService(ref Guid guidService, out object result) { return VSConstants.E_FAIL; } - #endregion +#endregion } } diff --git a/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs b/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs index 0944ae3dde..f8758b0079 100644 --- a/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs +++ b/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs @@ -12,6 +12,7 @@ * * ***************************************************************************/ +using System; using Microsoft.VisualStudio.Language.Intellisense; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudioTools.Project; @@ -36,8 +37,13 @@ public override uint CategoryField(LIB_CATEGORY category) { public override VSTREEDISPLAYDATA DisplayData { get { var res = new VSTREEDISPLAYDATA(); +#if DEV14_OR_LATER + res.hImageList = IntPtr.Zero; + res.Image = res.SelectedImage = 192; +#else res.hImageList = _project.ImageHandler.ImageList.Handle; res.Image = res.SelectedImage = (ushort)_project.ImageIndex; +#endif return res; } } diff --git a/Common/Product/SharedProject/ProjectNode.cs b/Common/Product/SharedProject/ProjectNode.cs index ebafc9d6ed..844322e170 100644 --- a/Common/Product/SharedProject/ProjectNode.cs +++ b/Common/Product/SharedProject/ProjectNode.cs @@ -66,6 +66,9 @@ internal abstract partial class ProjectNode : HierarchyNode, IOleCommandTarget { #region nested types +#if DEV14_OR_LATER + [Obsolete("Use ImageMonikers instead")] +#endif public enum ImageName { OfflineWebApp = 0, WebReferencesFolder = 1, @@ -477,11 +480,16 @@ public override Guid ItemTypeGuid { } } +#pragma warning disable 0618, 0672 + // Project subclasses decide whether or not to support using image + // monikers, and so we need to keep the ImageIndex overrides in case + // they choose not to. public override int ImageIndex { get { return (int)ProjectNode.ImageName.Application; } } +#pragma warning restore 0618, 0672 #endregion @@ -596,6 +604,9 @@ public IServiceProvider Site { /// /// Gets an ImageHandler for the project node. /// +#if DEV14_OR_LATER + [Obsolete("Use ImageMonikers instead")] +#endif public ImageHandler ImageHandler { get { if (null == imageHandler) { @@ -3505,10 +3516,16 @@ protected void PersistXMLFragments() { } } +#if DEV14_OR_LATER + [Obsolete("Use ImageMonikers instead")] +#endif internal int GetIconIndex(ImageName name) { return (int)name; } +#if DEV14_OR_LATER + [Obsolete("Use ImageMonikers instead")] +#endif internal IntPtr GetIconHandleByName(ImageName name) { return ImageHandler.GetIconHandle(GetIconIndex(name)); } diff --git a/Common/Product/SharedProject/ReferenceContainerNode.cs b/Common/Product/SharedProject/ReferenceContainerNode.cs index 308390e682..ae3a68bd7f 100644 --- a/Common/Product/SharedProject/ReferenceContainerNode.cs +++ b/Common/Product/SharedProject/ReferenceContainerNode.cs @@ -120,10 +120,6 @@ public override string GetEditLabel() { } - public override object GetIconHandle(bool open) { - return this.ProjectMgr.GetIconHandleByName(ProjectNode.ImageName.ReferenceFolder); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -132,6 +128,12 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return KnownMonikers.Reference; } +#else + public override int ImageIndex { + get { + return ProjectMgr.GetIconIndex(ProjectNode.ImageName.ReferenceFolder); + } + } #endif /// diff --git a/Common/Product/SharedProject/ReferenceNode.cs b/Common/Product/SharedProject/ReferenceNode.cs index bc5b87bdda..d75df038bd 100644 --- a/Common/Product/SharedProject/ReferenceNode.cs +++ b/Common/Product/SharedProject/ReferenceNode.cs @@ -100,13 +100,6 @@ public override string GetEditLabel() { } - public override object GetIconHandle(bool open) { - return ProjectMgr.GetIconHandleByName(CanShowDefaultIcon() ? - ProjectNode.ImageName.Reference : - ProjectNode.ImageName.DanglingReference - ); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -115,6 +108,15 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return CanShowDefaultIcon() ? KnownMonikers.Reference : KnownMonikers.ReferenceWarning; } +#else + public override int ImageIndex { + get { + return ProjectMgr.GetIconIndex(CanShowDefaultIcon() ? + ProjectNode.ImageName.Reference : + ProjectNode.ImageName.DanglingReference + ); + } + } #endif /// From 9125759958ece0715d3a9d773f64a8a3376d81a3 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 27 May 2015 13:52:53 -0700 Subject: [PATCH 2/4] Updates project system to use image monikers everywhere. Reduces use of image lists where possible. --- Python/Product/Django/Django.csproj | 3 ++ Python/Product/Icons/Dev14.0/Images_32bit.png | Bin 511 -> 0 bytes .../Product/Icons/Dev14.0/InterpreterList.bmp | Bin 822 -> 822 bytes .../Product/Icons/Dev14.0/ProfilingCmdBar.bmp | Bin 3126 -> 0 bytes .../Icons/Dev14.0/PythonPackageIcons.png | Bin 464 -> 0 bytes .../Icons/Dev14.0/Refactoring_Commands.bmp | Bin 2358 -> 0 bytes .../Product/Icons/Dev14.0/completionset.bmp | Bin 166710 -> 0 bytes Python/Product/Profiling/Profiling.csproj | 20 ++++++++ Python/Product/Profiling/PythonProfiling.vsct | 6 +-- .../Profiling/PythonProfiling_iconmap.csv | 6 +++ Python/Product/PythonTools/PythonConstants.cs | 2 + Python/Product/PythonTools/PythonTools.csproj | 12 ++--- Python/Product/PythonTools/PythonTools.vsct | 8 +--- .../Commands/ExecuteInReplCommand.cs | 18 +++++-- .../InterpreterListToolWindow.cs | 6 +++ .../Navigation/CodeWindowManager.cs | 2 +- .../Navigation/DropDownBarClient.cs | 31 +++++++----- .../Navigation/PythonFileLibraryNode.cs | 7 +++ .../PythonTools/Options/OptionsTreeView.cs | 2 + .../PythonTools/Project/BaseSearchPathNode.cs | 26 +++++----- .../Project/CommonSearchPathContainerNode.cs | 10 ++-- .../Project/InterpretersContainerNode.cs | 10 ++-- .../PythonTools/Project/InterpretersNode.cs | 35 +++++++------- .../Project/InterpretersPackageNode.cs | 10 ++-- .../PythonTools/Project/PythonFolderNode.cs | 20 ++++---- .../PythonTools/Project/PythonProjectNode.cs | 45 +++++++++++------- .../PythonTools/Project/WebPiReferenceNode.cs | 10 ++-- .../images12.0}/PyFile.png | Bin .../PythonTools/images12.0/images.xaml | 3 +- 29 files changed, 188 insertions(+), 104 deletions(-) delete mode 100644 Python/Product/Icons/Dev14.0/Images_32bit.png delete mode 100644 Python/Product/Icons/Dev14.0/ProfilingCmdBar.bmp delete mode 100644 Python/Product/Icons/Dev14.0/PythonPackageIcons.png delete mode 100644 Python/Product/Icons/Dev14.0/Refactoring_Commands.bmp delete mode 100644 Python/Product/Icons/Dev14.0/completionset.bmp create mode 100644 Python/Product/Profiling/PythonProfiling_iconmap.csv rename Python/Product/{Icons/Dev14.0 => PythonTools/images12.0}/PyFile.png (100%) diff --git a/Python/Product/Django/Django.csproj b/Python/Product/Django/Django.csproj index c53240dd3f..b2fdb8b2c4 100644 --- a/Python/Product/Django/Django.csproj +++ b/Python/Product/Django/Django.csproj @@ -79,6 +79,9 @@ + + True + diff --git a/Python/Product/Icons/Dev14.0/Images_32bit.png b/Python/Product/Icons/Dev14.0/Images_32bit.png deleted file mode 100644 index 19e381b956cbb9d59a2b8cbb9f955eef52a927b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 511 zcmVAHIP00004XF*Lt006O% z3;baP00009a7bBm000iZ000iZ0XPLyBme*a7<5HgbW?9;ba!ELWdLwtX>N2bZe?^J zG%heMGW+4D#sB~TeMv+?R9Hvtm9a|0P#A^t0=|Y%AmV6(4dslc3I02b}wcZMC9Ieys+kmd`dg4|R z3l}i_jI?M{06vor>Ny>xpbG*f91Qm9@%4fZ`+>L_2WLAe;Bq% zlCqd?SO~De3CIMPl2@1qBifMHq>;XKn^=52?+1&n(!M?;FB$*<002ovPDHLkV1m+= B*gpUO diff --git a/Python/Product/Icons/Dev14.0/InterpreterList.bmp b/Python/Product/Icons/Dev14.0/InterpreterList.bmp index f379b45d0305b40f273539fbd57bf78575ae6bac..9bde1665ea1e93e1c8835eb7ef45dbec6d76055a 100644 GIT binary patch literal 822 rcmZ?rHDhJ~12Z700mK4O%*Y@C76%bW_#hZAkoBKo6pe?|RiHoZNSE-1|M}eBODta{0_q)UgbHk|)bE!ZQ$!;bo(PQPh6E>?8X4 zSL;2&!jK6`o^93f93*Uo`^HZxlZzRfaizQC&5D)DS)Fe6Zm)1m<@vdJR`cezP$&1mdeFXyX^DasJDfM0P+t4;Q zHt35Np6x4O)5}jvwNeF)7iS1uKY{>%8vXD1;nWO4rHi{b^6~@BC&Oc4>k@JsU49ZV zDzJ&{N4=&*iudxc$&owBcJ-JE!1YMnEb-vY>>}~s!1&2JzJA0b(`H!jwn)QodIIZ0 zBbVG@q;Zu7qhO^}(hu2EfFEBzJ-Teg`Ps1_zUhqzm>&75sj_Zy%F4tejn^ZP5_p1? z`o8ef>sveigh7+fZq00;?9{I=I;xN(h2hWcHN+p1cFxp7uRz?F`D?b6S8@E*+O*br zv(BGC8uNd6dXr4wB9P+FKaI@vnk}5VEjFt-Kl5L$tgE=2?v3sK^A&*SbLi*n75BIa plKA8I*`0q%a={=LFyt2Z$eENbew+NafKw9XlPdh}K5StF?-SpX=raHS diff --git a/Python/Product/Icons/Dev14.0/PythonPackageIcons.png b/Python/Product/Icons/Dev14.0/PythonPackageIcons.png deleted file mode 100644 index bdf4392c8d199da593b5593738fa5c23b41595f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 464 zcmV;>0WbcEP)N2bZe?^J zG%heZ==Es;00B@*L_t(YOYM|BPQySDg?$8$z**e;0KN*9MF$Nng(Z}V8>B!28j1)C z7jZ#>V#SIOBq$~laXaiAd7{n!*&!_}eOd2j-n{3P?Z`LUw#^jOLqJM&EJzUb;_{_=d?wp&L=0NRdU$co*rvtqhUSXkw28)+l`ffH(q(Ns`=vsjA zL-Z1W??_Jv)*rP~45UF9z|sz3F90@NMn0s$e}JO{sGn0@Y?c*mf40o$>m$vdt}XOu zLK=u(XYo9;%v_)r0h&C|DM=D4%aUiT*L7hD>dB2Oz+k|FQ6uP0t4VL=n?uN zcmn*6_Kc7ouV^2^6X-mGBcwOYTyO&)okwuEbb@JSL(wmeoA0W(HzQyG0000y$V>Oi!SV_5%avOg^en7C#LNJ9ZVj~Ml6NEsT z4T2FCL9p1$LAEil*y^`?vWM%Nab58-^Y+~H&b@QyzBii}E6=mZSYdw6{g!)?`&ssq zS>yMMEF0g`ag*J|>-z3sDH2gBTwSd))vWm$sx_OFCWw{bRA}yE#g)CF2qTh8b|JpNZR93_l39*<)ZJc^w_VmV5PJbx0KNw?#FI7lp*=GWipK6B=|f8MIM zzaGA-uS)OSIrq8eKKFS}-Kw{$-rM!P@#Y&o_(yNt+up!`f1dw7{Ks$H_>=tqkKFh( zl-mB(AG>km-hU6ayEpDmKL0zm3C&GGzXxrf0C$;i)MRFYNw1_CUm}0vYSiQ~1V*&9 zyGt6o*vtf7ri@85zC`}S)u_o~2#jcHcb7DFv6%_FOc|4Ae2M&tt5K7~5E#+Y?k;KU zVlxwTnKCBL_!9XOSED9}Auyt)-Cfey#bzexGG$Df@g?#nu0~A`LtsQpySt>Zi_J{X zWy+W|<4fdET#cF>hQNrHc6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`FH>5>;wA z!qAEbET8-G*V@-4+OoDw%P%8dR+WKBvrJA^vHNiu!-?5yg1x(`3r)8_^Nw7ym{^My z;fSoo@EU^0df2TZyU2A7hewS1vU1f^Hg?wm! z#bWp6igv54xn!CwRup+Tb02(5v;-gy6UqCr0L`)Vvvq#vvK*6j{%W>xy<&F3!(_Ot z=6@3Eq=_ti3!{H~rDJo{W$XM=UL!mCE_@TCJZzmm(xJ7Jsb8_k%$ZLcx^JD|DloE; zX*nlnmDbX6>->_=!YWy7(^DfBk^vsrszms7(?&Z@?HC~!AXD$mdf~5CU&yvYU_M*A%)SFnHob*S&XrplVI!o%;h8|Ssxt< zCgLQ`cq{yqf)v8mC&SwKOZxLF&b4jydCr6IPyaoUxeoJIM)6@{fN|7oi+n5D1#PC# zx+@2;w`43^=XaAjX(a38{(Yhn`e?g8=O5+EFE#qHhU!S4t6z9mEIVRpKf0S2iPc@8Nnl0ueaBB;aX57+jF(-jrTaYy4mUf24-bSGK z9MNpQ;`|ccs;YA|n0GhLU|alowDVS{oM6%=X~rAkk3w}W0!edI*SJxB=CTl5hc@M| zhpqFwNzIL0PkC+pb2YlHYlql6zbnGTxb=M3#y^oFn~K|Rbx-`vWg$*Y)TOngtG2bZ zTxEX7b`oc5U0ghLIcdD&{1V=(YNlyC@nBAZ4e=+Tx+zneV|AHxvh`~6o%mXiskONE z)^gHv_4#dtCoP#^!QH-vlhsY|yFreOnO(u%E`^iTP4K%xPK=pg!QEbklhsY|yFt#4 znWON&`Sa}B)>fanN?Yf*3bd9{j@Vl=maX%Ac#WL@{u(kMfwRE?A30T#)kk6}5qUt(a%kMf_Vk`rl?6Q!bwASbU E1Lbe76aWAK diff --git a/Python/Product/Profiling/Profiling.csproj b/Python/Product/Profiling/Profiling.csproj index f1a02a121b..36b12506aa 100644 --- a/Python/Product/Profiling/Profiling.csproj +++ b/Python/Product/Profiling/Profiling.csproj @@ -77,6 +77,22 @@ + + + + + + + True + + + True + + + + + + {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} @@ -195,6 +211,10 @@ + + PreserveNewest + true + Designer diff --git a/Python/Product/Profiling/PythonProfiling.vsct b/Python/Product/Profiling/PythonProfiling.vsct index 9824437659..169711b6fc 100644 --- a/Python/Product/Profiling/PythonProfiling.vsct +++ b/Python/Product/Profiling/PythonProfiling.vsct @@ -178,10 +178,8 @@ - - - - + + diff --git a/Python/Product/Profiling/PythonProfiling_iconmap.csv b/Python/Product/Profiling/PythonProfiling_iconmap.csv new file mode 100644 index 0000000000..9aa1543414 --- /dev/null +++ b/Python/Product/Profiling/PythonProfiling_iconmap.csv @@ -0,0 +1,6 @@ +Icon guid, Icon id, Moniker guid, Moniker id +D0023B39-E866-4995-9C8A-50BB0D72E074,1,ae27a6b0-e345-4288-96df-5eaf394ee369,2652 +D0023B39-E866-4995-9C8A-50BB0D72E074,2,ae27a6b0-e345-4288-96df-5eaf394ee369,2032 +D0023B39-E866-4995-9C8A-50BB0D72E074,3,ae27a6b0-e345-4288-96df-5eaf394ee369,2967 +D0023B39-E866-4995-9C8A-50BB0D72E074,4,ae27a6b0-e345-4288-96df-5eaf394ee369,2299 + diff --git a/Python/Product/PythonTools/PythonConstants.cs b/Python/Product/PythonTools/PythonConstants.cs index 825508593e..e02c56eb31 100644 --- a/Python/Product/PythonTools/PythonConstants.cs +++ b/Python/Product/PythonTools/PythonConstants.cs @@ -62,7 +62,9 @@ public static class PythonConstants { // IDs of the icons for product registration (see Resources.resx) internal const int IconIfForSplashScreen = 300; internal const int IconIdForAboutBox = 400; +#if !DEV14_OR_LATER internal const int ResourceIdForReplImages = 407; +#endif // Command IDs internal const int AddEnvironment = 0x4006; diff --git a/Python/Product/PythonTools/PythonTools.csproj b/Python/Product/PythonTools/PythonTools.csproj index 9b1ad8379a..75c1cf7293 100644 --- a/Python/Product/PythonTools/PythonTools.csproj +++ b/Python/Product/PythonTools/PythonTools.csproj @@ -253,6 +253,9 @@ True + + True + @@ -1192,7 +1195,6 @@ - Microsoft.VisualStudioTools.SharedProject @@ -1227,7 +1229,7 @@ PythonDebugPropertyPageControl.cs - + PythonTools\Project\Resources\imagelis.bmp @@ -1248,13 +1250,10 @@ PythonGeneralPropertyPageControl.cs - - Resources\completionset.bmp - Resources\PythonPackageIcons.bmp - + Resources\PythonPackageIcons.png @@ -1304,6 +1303,7 @@ Designer + MSBuild:Compile Designer diff --git a/Python/Product/PythonTools/PythonTools.vsct b/Python/Product/PythonTools/PythonTools.vsct index ba708d5999..bc49f2999e 100644 --- a/Python/Product/PythonTools/PythonTools.vsct +++ b/Python/Product/PythonTools/PythonTools.vsct @@ -875,12 +875,8 @@ - - - - - - + + diff --git a/Python/Product/PythonTools/PythonTools/Commands/ExecuteInReplCommand.cs b/Python/Product/PythonTools/PythonTools/Commands/ExecuteInReplCommand.cs index 8a746503d5..e2d7d1d781 100644 --- a/Python/Product/PythonTools/PythonTools/Commands/ExecuteInReplCommand.cs +++ b/Python/Product/PythonTools/PythonTools/Commands/ExecuteInReplCommand.cs @@ -21,16 +21,17 @@ using Microsoft.PythonTools.Project; using Microsoft.PythonTools.Repl; using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudioTools; #if DEV14_OR_LATER +using Microsoft.VisualStudio.Imaging; using Microsoft.VisualStudio.InteractiveWindow; using Microsoft.VisualStudio.InteractiveWindow.Shell; #else using Microsoft.VisualStudio.Repl; #endif -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Text.Editor; -using Microsoft.VisualStudioTools; namespace Microsoft.PythonTools.Commands { #if DEV14_OR_LATER @@ -69,6 +70,15 @@ public ExecuteInReplCommand(IServiceProvider serviceProvider) { replId ); + var toolWindow = window as ToolWindowPane; + if (toolWindow != null) { +#if DEV14_OR_LATER + toolWindow.BitmapImageMoniker = KnownMonikers.PYInteractiveWindow; +#else + // TODO: Add image here for VS 2013 +#endif + } + var pyService = serviceProvider.GetPythonToolsService(); window.SetSmartUpDown(pyService.GetInteractiveOptions(factory).ReplSmartHistory); } diff --git a/Python/Product/PythonTools/PythonTools/InterpreterList/InterpreterListToolWindow.cs b/Python/Product/PythonTools/PythonTools/InterpreterList/InterpreterListToolWindow.cs index e5fec76b1c..e2f368c93a 100644 --- a/Python/Product/PythonTools/PythonTools/InterpreterList/InterpreterListToolWindow.cs +++ b/Python/Product/PythonTools/PythonTools/InterpreterList/InterpreterListToolWindow.cs @@ -33,6 +33,7 @@ using SR = Microsoft.PythonTools.Project.SR; using Microsoft.PythonTools.Repl; #if DEV14_OR_LATER +using Microsoft.VisualStudio.Imaging; using Microsoft.VisualStudio.InteractiveWindow.Shell; #else using Microsoft.VisualStudio.Repl; @@ -56,8 +57,13 @@ protected override void OnCreate() { _pyService = _site.GetPythonToolsService(); +#if DEV14_OR_LATER + // TODO: Get PYEnvironment added to image list + BitmapImageMoniker = KnownMonikers.DockPanel; +#else BitmapResourceID = PythonConstants.ResourceIdForReplImages; BitmapIndex = 0; +#endif Caption = SR.GetString(SR.Environments); _service = _site.GetComponentModel().GetService(); diff --git a/Python/Product/PythonTools/PythonTools/Navigation/CodeWindowManager.cs b/Python/Product/PythonTools/PythonTools/Navigation/CodeWindowManager.cs index b711268527..02b057a918 100644 --- a/Python/Product/PythonTools/PythonTools/Navigation/CodeWindowManager.cs +++ b/Python/Product/PythonTools/PythonTools/Navigation/CodeWindowManager.cs @@ -95,7 +95,7 @@ private int AddDropDownBar() { return VSConstants.E_FAIL; } - _client = new DropDownBarClient(wpfTextView, pythonProjectEntry); + _client = new DropDownBarClient(_serviceProvider, wpfTextView, pythonProjectEntry); IVsDropdownBarManager manager = (IVsDropdownBarManager)_window; diff --git a/Python/Product/PythonTools/PythonTools/Navigation/DropDownBarClient.cs b/Python/Product/PythonTools/PythonTools/Navigation/DropDownBarClient.cs index b9091c2ec6..4142c8b8b6 100644 --- a/Python/Product/PythonTools/PythonTools/Navigation/DropDownBarClient.cs +++ b/Python/Product/PythonTools/PythonTools/Navigation/DropDownBarClient.cs @@ -25,6 +25,7 @@ using Microsoft.PythonTools.Parsing; using Microsoft.PythonTools.Parsing.Ast; using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.TextManager.Interop; @@ -61,17 +62,20 @@ class DropDownBarClient : IVsDropdownBarClient { private IWpfTextView _textView; // text view we're drop downs for private IVsDropdownBar _dropDownBar; // drop down bar - used to refresh when changes occur private int _curTopLevelIndex = -1, _curNestedIndex = -1; // currently selected indices for each oar - - private static readonly ImageList _imageList = GetImageList(); + private readonly IServiceProvider _serviceProvider; + private IntPtr _imageList; + private static readonly ReadOnlyCollection EmptyEntries = new ReadOnlyCollection(new DropDownEntryInfo[0]); private const int TopLevelComboBoxId = 0; private const int NestedComboBoxId = 1; - public DropDownBarClient(IWpfTextView textView, IPythonProjectEntry pythonProjectEntry) { + public DropDownBarClient(IServiceProvider serviceProvider, IWpfTextView textView, IPythonProjectEntry pythonProjectEntry) { + Utilities.ArgumentNotNull("serviceProvider", serviceProvider); Utilities.ArgumentNotNull("textView", textView); Utilities.ArgumentNotNull("pythonProjectEntry", pythonProjectEntry); + _serviceProvider = serviceProvider; _projectEntry = pythonProjectEntry; _projectEntry.OnNewParseTree += ParserOnNewParseTree; _textView = textView; @@ -120,7 +124,7 @@ public int GetComboAttributes(int iCombo, out uint pcEntries, out uint puEntryTy pcEntries = count; puEntryType = (uint)(DROPDOWNENTRYTYPE.ENTRY_TEXT | DROPDOWNENTRYTYPE.ENTRY_IMAGE | DROPDOWNENTRYTYPE.ENTRY_ATTR); - phImageList = _imageList.Handle; + phImageList = GetImageList(); return VSConstants.S_OK; } @@ -571,13 +575,18 @@ private static int GetImageListIndex(ImageListKind kind, ImageListOverlay overla /// /// Reads our image list from our DLLs resource stream. /// - private static ImageList GetImageList() { - ImageList list = new ImageList(); - list.ImageSize = new Size(0x10, 0x10); - list.TransparentColor = Color.FromArgb(0xff, 0, 0xff); - Stream manifestResourceStream = typeof(DropDownBarClient).Assembly.GetManifestResourceStream("Microsoft.Resources.completionset.bmp"); - list.Images.AddStrip(new Bitmap(manifestResourceStream)); - return list; + private IntPtr GetImageList() { + if (_imageList == IntPtr.Zero) { + var shell = _serviceProvider.GetService(typeof(SVsShell)) as IVsShell; + if (shell != null) { + object obj; + var hr = shell.GetProperty((int)__VSSPROPID.VSSPROPID_ObjectMgrTypesImgList, out obj); + if (ErrorHandler.Succeeded(hr) && obj != null) { + _imageList = (IntPtr)(int)obj; + } + } + } + return _imageList; } /// diff --git a/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs b/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs index e5da3554e9..b21fd74d99 100644 --- a/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs +++ b/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs @@ -12,6 +12,7 @@ * * ***************************************************************************/ +using System; using System.Text; using Microsoft.PythonTools.Analysis; using Microsoft.PythonTools.Intellisense; @@ -32,8 +33,14 @@ public PythonFileLibraryNode(LibraryNode parent, HierarchyNode hierarchy, string public override VSTREEDISPLAYDATA DisplayData { get { var res = new VSTREEDISPLAYDATA(); + +#if DEV14_OR_LATER + res.hImageList = IntPtr.Zero; + res.Image = res.SelectedImage = 90; +#else res.hImageList = _hierarchy.ProjectMgr.ImageHandler.ImageList.Handle; res.Image = res.SelectedImage = (ushort)_hierarchy.ImageIndex; +#endif return res; } } diff --git a/Python/Product/PythonTools/PythonTools/Options/OptionsTreeView.cs b/Python/Product/PythonTools/PythonTools/Options/OptionsTreeView.cs index 38ab6fca37..ba89daf4ce 100644 --- a/Python/Product/PythonTools/PythonTools/Options/OptionsTreeView.cs +++ b/Python/Product/PythonTools/PythonTools/Options/OptionsTreeView.cs @@ -43,8 +43,10 @@ protected override void OnGotFocus(EventArgs e) { private void InitializeImageList() { if (_imageList == null) { using (var imgHandler = new ImageHandler(typeof(OptionsTreeView).Assembly.GetManifestResourceStream("Microsoft.PythonTools.Project.Resources.imagelis.bmp"))) { +#pragma warning disable 0618 var openFolder = imgHandler.ImageList.Images[(int)ProjectNode.ImageName.OpenFolder]; var closedFolder = imgHandler.ImageList.Images[(int)ProjectNode.ImageName.Folder]; +#pragma warning restore 0618 _imageList = new ImageList(); diff --git a/Python/Product/PythonTools/PythonTools/Project/BaseSearchPathNode.cs b/Python/Product/PythonTools/PythonTools/Project/BaseSearchPathNode.cs index db1a3123ff..ac0c85e93c 100644 --- a/Python/Product/PythonTools/PythonTools/Project/BaseSearchPathNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/BaseSearchPathNode.cs @@ -83,18 +83,6 @@ public override bool IsSearchable { get { return false; } } - public override object GetIconHandle(bool open) { - return _project.GetIconHandleByName( -#if DEV11_OR_LATER && !DEV14_OR_LATER - PythonProjectImageName.SearchPath -#else - (Directory.Exists(Url) || File.Exists(Url)) ? - PythonProjectImageName.SearchPath : - PythonProjectImageName.MissingSearchPath -#endif - ); - } - #if DEV11_OR_LATER && !DEV14_OR_LATER protected override VSOVERLAYICON OverlayIconIndex { get { @@ -115,6 +103,20 @@ protected override ImageMoniker GetIconMoniker(bool open) { KnownMonikers.Reference : KnownMonikers.ReferenceWarning; } +#else + public override int ImageIndex { + get { + return _project.GetIconIndex( +#if DEV11_OR_LATER + PythonProjectImageName.SearchPath +#else + (Directory.Exists(Url) || File.Exists(Url)) ? + PythonProjectImageName.SearchPath : + PythonProjectImageName.MissingSearchPath +#endif + ); + } + } #endif diff --git a/Python/Product/PythonTools/PythonTools/Project/CommonSearchPathContainerNode.cs b/Python/Product/PythonTools/PythonTools/Project/CommonSearchPathContainerNode.cs index 4157997784..cb48b0f681 100644 --- a/Python/Product/PythonTools/PythonTools/Project/CommonSearchPathContainerNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/CommonSearchPathContainerNode.cs @@ -90,10 +90,6 @@ public override string GetEditLabel() { return null; } - public override object GetIconHandle(bool open) { - return _projectNode.GetIconHandleByName(PythonProjectImageName.SearchPathContainer); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -102,6 +98,12 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return KnownMonikers.Reference; } +#else + public override int ImageIndex { + get { + return _projectNode.GetIconIndex(PythonProjectImageName.SearchPathContainer); + } + } #endif /// diff --git a/Python/Product/PythonTools/PythonTools/Project/InterpretersContainerNode.cs b/Python/Product/PythonTools/PythonTools/Project/InterpretersContainerNode.cs index 46380ebce5..50d6cf6ea5 100644 --- a/Python/Product/PythonTools/PythonTools/Project/InterpretersContainerNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/InterpretersContainerNode.cs @@ -98,10 +98,6 @@ public override string GetEditLabel() { return null; } - public override object GetIconHandle(bool open) { - return _projectNode.GetIconHandleByName(PythonProjectImageName.InterpretersContainer); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -111,6 +107,12 @@ protected override ImageMoniker GetIconMoniker(bool open) { // TODO: Update to PYEnvironment return KnownMonikers.DockPanel; } +#else + public override int ImageIndex { + get { + return _projectNode.GetIconIndex(PythonProjectImageName.InterpretersContainer); + } + } #endif /// diff --git a/Python/Product/PythonTools/PythonTools/Project/InterpretersNode.cs b/Python/Product/PythonTools/PythonTools/Project/InterpretersNode.cs index b52609b107..70bb3d4b3b 100644 --- a/Python/Product/PythonTools/PythonTools/Project/InterpretersNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/InterpretersNode.cs @@ -387,22 +387,6 @@ public override string GetEditLabel() { return null; } - public override object GetIconHandle(bool open) { - if (ProjectMgr == null) { - return null; - } - - int index; - if (!_interpreters.IsAvailable(_factory)) { - index = ProjectMgr.GetIconIndex(PythonProjectImageName.MissingInterpreter); - } else if (_interpreters.ActiveInterpreter == _factory) { - index = ProjectMgr.GetIconIndex(PythonProjectImageName.ActiveInterpreter); - } else { - index = ProjectMgr.GetIconIndex(PythonProjectImageName.Interpreter); - } - return this.ProjectMgr.ImageHandler.GetIconHandle(index); - } - protected override VSOVERLAYICON OverlayIconIndex { get { if (!Directory.Exists(Url)) { @@ -430,6 +414,25 @@ protected override ImageMoniker GetIconMoniker(bool open) { // TODO: Change to PYEnvironment return KnownMonikers.DockPanel; } +#else + public override int ImageIndex { + get { + if (ProjectMgr == null) { + return NoImage; + } + + int index; + if (!_interpreters.IsAvailable(_factory)) { + index = ProjectMgr.GetIconIndex(PythonProjectImageName.MissingInterpreter); + } else if (_interpreters.ActiveInterpreter == _factory) { + index = ProjectMgr.GetIconIndex(PythonProjectImageName.ActiveInterpreter); + } else { + index = ProjectMgr.GetIconIndex(PythonProjectImageName.Interpreter); + } + return index; + } + } + #endif /// diff --git a/Python/Product/PythonTools/PythonTools/Project/InterpretersPackageNode.cs b/Python/Product/PythonTools/PythonTools/Project/InterpretersPackageNode.cs index 8e69a94051..3c2e01c2d2 100644 --- a/Python/Product/PythonTools/PythonTools/Project/InterpretersPackageNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/InterpretersPackageNode.cs @@ -152,10 +152,6 @@ public override string GetEditLabel() { return null; } - public override object GetIconHandle(bool open) { - return ProjectMgr.GetIconHandleByName(PythonProjectImageName.InterpretersPackage); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -164,6 +160,12 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return KnownMonikers.PythonPackage; } +#else + public override int ImageIndex { + get { + return ProjectMgr.GetIconIndex(PythonProjectImageName.InterpretersPackage); + } + } #endif /// diff --git a/Python/Product/PythonTools/PythonTools/Project/PythonFolderNode.cs b/Python/Product/PythonTools/PythonTools/Project/PythonFolderNode.cs index fa9edfd838..c8897726f6 100644 --- a/Python/Product/PythonTools/PythonTools/Project/PythonFolderNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/PythonFolderNode.cs @@ -35,12 +35,23 @@ namespace Microsoft.PythonTools.Project { /// Currently we just provide a specialized icon for the different folder. /// class PythonFolderNode : CommonFolderNode { +#if !DEV14_OR_LATER private ImageList _imageList; +#endif public PythonFolderNode(CommonProjectNode root, ProjectElement element) : base(root, element) { } +#if DEV14_OR_LATER + protected override ImageMoniker GetIconMoniker(bool open) { + if (!ItemNode.IsExcluded && AllChildren.Any(n => ModulePath.IsInitPyFile(n.Url))) { + return open ? KnownMonikers.PackageFolderOpened : KnownMonikers.PackageFolderClosed; + } + + return base.GetIconMoniker(open); + } +#else public override object GetIconHandle(bool open) { if (ItemNode.IsExcluded) { return base.GetIconHandle(open); @@ -64,15 +75,6 @@ public override object GetIconHandle(bool open) { return base.GetIconHandle(open); } - -#if DEV14_OR_LATER - protected override ImageMoniker GetIconMoniker(bool open) { - if (!ItemNode.IsExcluded && AllChildren.Any(n => ModulePath.IsInitPyFile(n.Url))) { - return open ? KnownMonikers.PackageFolderOpened : KnownMonikers.PackageFolderClosed; - } - - return base.GetIconMoniker(open); - } #endif diff --git a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs index 9d12280d70..77f05fdf9c 100644 --- a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs @@ -78,7 +78,14 @@ internal class PythonProjectNode : private readonly CommentTaskProvider _commentTaskProvider; public PythonProjectNode(IServiceProvider serviceProvider) - : base(serviceProvider, Utilities.GetImageList(typeof(PythonProjectNode).Assembly.GetManifestResourceStream(PythonConstants.ProjectImageList))) { + : base( + serviceProvider, +#if DEV14_OR_LATER + null +#else + Utilities.GetImageList(typeof(PythonProjectNode).Assembly.GetManifestResourceStream(PythonConstants.ProjectImageList)) +#endif + ) { Type projectNodePropsType = typeof(PythonProjectNodeProperties); AddCATIDMapping(projectNodePropsType, projectNodePropsType.GUID); @@ -168,7 +175,11 @@ internal MSBuildProjectInterpreterFactoryProvider Interpreters { protected override Stream ProjectIconsImageStripStream { get { +#if DEV14_OR_LATER + throw new NotSupportedException("Python Tools does not support project image strip"); +#else return typeof(ProjectNode).Assembly.GetManifestResourceStream("Microsoft.PythonTools.Project.Resources.imagelis.bmp"); +#endif } } @@ -185,14 +196,6 @@ protected internal override void SetCurrentConfiguration() { } } - internal int GetIconIndex(PythonProjectImageName name) { - return ImageOffset + (int)name; - } - - internal IntPtr GetIconHandleByName(PythonProjectImageName name) { - return ImageHandler.GetIconHandle(GetIconIndex(name)); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -201,6 +204,14 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return KnownMonikers.PYProjectNode; } +#else + internal int GetIconIndex(PythonProjectImageName name) { + return ImageOffset + (int)name; + } + + internal IntPtr GetIconHandleByName(PythonProjectImageName name) { + return ImageHandler.GetIconHandle(GetIconIndex(name)); + } #endif internal override string IssueTrackerUrl { @@ -1481,7 +1492,7 @@ private int ExecOpenInteractiveForEnvironment(Dictionary args, I } - #region IPythonProject Members +#region IPythonProject Members string IPythonProject.ProjectName { get { @@ -1554,9 +1565,9 @@ string IPythonProject.GetUnevaluatedProperty(string name) { return base.GetUnevaluatedProperty(name); } - #endregion +#endregion - #region Search Path support +#region Search Path support internal int AddSearchPathZip() { var fileName = Site.BrowseForFileOpen( @@ -1590,9 +1601,9 @@ internal int AddPythonPathToSearchPath() { return VSConstants.S_OK; } - #endregion +#endregion - #region Package Installation support +#region Package Installation support private int ExecInstallPythonPackage(Dictionary args, IList selectedNodes) { InterpretersNode selectedInterpreter; @@ -2032,9 +2043,9 @@ bool addNew } } - #endregion +#endregion - #region Virtual Env support +#region Virtual Env support private void ShowAddInterpreter() { var service = Site.GetComponentModel().GetService(); @@ -2160,7 +2171,7 @@ internal async void RemoveInterpreter(IPythonInterpreterFactory factory, bool re } } - #endregion +#endregion public override Guid SharedCommandGuid { get { diff --git a/Python/Product/PythonTools/PythonTools/Project/WebPiReferenceNode.cs b/Python/Product/PythonTools/PythonTools/Project/WebPiReferenceNode.cs index 075426dd02..6331467d03 100644 --- a/Python/Product/PythonTools/PythonTools/Project/WebPiReferenceNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/WebPiReferenceNode.cs @@ -67,10 +67,6 @@ internal override object Object { } } - public override object GetIconHandle(bool open) { - return ProjectMgr.GetIconHandleByName(ProjectNode.ImageName.XWorld); - } - #if DEV14_OR_LATER protected override bool SupportsIconMonikers { get { return true; } @@ -79,6 +75,12 @@ protected override bool SupportsIconMonikers { protected override ImageMoniker GetIconMoniker(bool open) { return KnownMonikers.XWorldFile; } +#else + public override int ImageIndex { + get { + return ProjectMgr.GetIconIndex(ProjectNode.ImageName.XWorld); + } + } #endif protected override NodeProperties CreatePropertiesObject() { diff --git a/Python/Product/Icons/Dev14.0/PyFile.png b/Python/Product/PythonTools/images12.0/PyFile.png similarity index 100% rename from Python/Product/Icons/Dev14.0/PyFile.png rename to Python/Product/PythonTools/images12.0/PyFile.png diff --git a/Python/Product/PythonTools/images12.0/images.xaml b/Python/Product/PythonTools/images12.0/images.xaml index f3aa343ac2..c0efb92757 100644 --- a/Python/Product/PythonTools/images12.0/images.xaml +++ b/Python/Product/PythonTools/images12.0/images.xaml @@ -15,8 +15,7 @@ - - + From d5e78b3a0435956200c8b75d2e512ad7637f5a01 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 28 May 2015 09:01:58 -0700 Subject: [PATCH 3/4] Clarifies image indexes --- Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs | 1 + .../PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs b/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs index f8758b0079..5b63c395a3 100644 --- a/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs +++ b/Common/Product/SharedProject/Navigation/ProjectLibraryNode.cs @@ -38,6 +38,7 @@ public override VSTREEDISPLAYDATA DisplayData { get { var res = new VSTREEDISPLAYDATA(); #if DEV14_OR_LATER + // Use the default Reference icon for projects res.hImageList = IntPtr.Zero; res.Image = res.SelectedImage = 192; #else diff --git a/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs b/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs index b21fd74d99..f88709e8b6 100644 --- a/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs +++ b/Python/Product/PythonTools/PythonTools/Navigation/PythonFileLibraryNode.cs @@ -35,6 +35,7 @@ public override VSTREEDISPLAYDATA DisplayData { var res = new VSTREEDISPLAYDATA(); #if DEV14_OR_LATER + // Use the default Module icon for modules res.hImageList = IntPtr.Zero; res.Image = res.SelectedImage = 90; #else From 1a09e24d0b4941c9323690066a66197e305a6c9b Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 28 May 2015 09:03:50 -0700 Subject: [PATCH 4/4] Moves PTVS-specific build settings out of common settings Removes Dev14OrLater property and uses VSMajorVersion comparisons instead Fixes some conditional references --- Build/Common.Build.CSharp.settings | 8 ---- Build/Common.Build.settings | 6 --- Python/Product/Django/Django.csproj | 12 +++-- Python/Product/ProjectBefore.settings | 4 ++ Python/Product/PythonTools/PythonTools.csproj | 46 +++++++++---------- Python/Product/ReplWindow/ReplWindow.csproj | 2 +- Python/products.settings | 9 +++- 7 files changed, 43 insertions(+), 44 deletions(-) diff --git a/Build/Common.Build.CSharp.settings b/Build/Common.Build.CSharp.settings index 6dc9becaa4..431ce44f2d 100644 --- a/Build/Common.Build.CSharp.settings +++ b/Build/Common.Build.CSharp.settings @@ -30,16 +30,11 @@ TRACE;$(DefineConstants) - - $(DefineConstants);FEATURE_AZURE_REMOTE_DEBUG - - $(DefineConstants);DEV14;DEV14_OR_LATER;DEV12_OR_LATER;DEV11_OR_LATER DEV14;DEV14_OR_LATER;DEV12_OR_LATER;DEV11_OR_LATER 14.0.0.0 Core - True @@ -47,7 +42,6 @@ DEV12;DEV12_OR_LATER;DEV11_OR_LATER 12.0.0.0 v12.0 - False @@ -55,7 +49,6 @@ DEV11;DEV11_OR_LATER 4.0.0.0 v4.0 - False @@ -63,7 +56,6 @@ DEV10 4.0.0.0 v4.0 - False diff --git a/Build/Common.Build.settings b/Build/Common.Build.settings index a64b7647dd..38f1ed3008 100644 --- a/Build/Common.Build.settings +++ b/Build/Common.Build.settings @@ -115,12 +115,6 @@ <_VSUpdateVersion Condition="$(VSUpdateVersion)=='' and $(VisualStudioVersion)!='10.0'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\vs\Servicing\$(VSTarget)\devenv', 'UpdateVersion', null, RegistryView.Registry32)) $([System.Int32]::Parse($(_VSUpdateVersion.Substring(0, $(_VSUpdateVersion.IndexOf(`.`)))))) $([System.Int32]::Parse($(_VSUpdateVersion.Substring($([MSBuild]::Add(1, $(_VSUpdateVersion.LastIndexOf(`.`)))))))) - - - $(ReleaseBuild) - - - true diff --git a/Python/Product/Django/Django.csproj b/Python/Product/Django/Django.csproj index b2fdb8b2c4..4c9ab1a5d4 100644 --- a/Python/Product/Django/Django.csproj +++ b/Python/Product/Django/Django.csproj @@ -79,9 +79,6 @@ - - True - @@ -140,6 +137,15 @@ $(DevEnvDir)Microsoft.VisualStudio.Web.Html.dll + + + + + True + + + + {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} diff --git a/Python/Product/ProjectBefore.settings b/Python/Product/ProjectBefore.settings index 2834e4203f..b357935717 100644 --- a/Python/Product/ProjectBefore.settings +++ b/Python/Product/ProjectBefore.settings @@ -6,4 +6,8 @@ + + + $(DefineConstants);FEATURE_AZURE_REMOTE_DEBUG + diff --git a/Python/Product/PythonTools/PythonTools.csproj b/Python/Product/PythonTools/PythonTools.csproj index 75c1cf7293..efe7eb2b0d 100644 --- a/Python/Product/PythonTools/PythonTools.csproj +++ b/Python/Product/PythonTools/PythonTools.csproj @@ -91,13 +91,6 @@ - - {20BB6FAC-44D2-4D76-ABFE-0C1E163A1A4F} - false - true - Microsoft.VisualStudio.ReplWindow - Microsoft.VisualStudio.InteractiveWindow - @@ -246,8 +239,16 @@ - + + + $(DevEnvDir)PrivateAssemblies\Microsoft.VisualStudio.InteractiveWindow.dll + false + + + $(DevEnvDir)PrivateAssemblies\Microsoft.VisualStudio.VsInteractiveWindow.dll + false + @@ -260,6 +261,17 @@ + + + + {20BB6FAC-44D2-4D76-ABFE-0C1E163A1A4F} + false + true + Microsoft.VisualStudio.ReplWindow + Microsoft.VisualStudio.InteractiveWindow + + + @@ -277,20 +289,6 @@ - - - - - $(DevEnvDir)PrivateAssemblies\Microsoft.VisualStudio.InteractiveWindow.dll - false - - - $(DevEnvDir)PrivateAssemblies\Microsoft.VisualStudio.VsInteractiveWindow.dll - false - - - - IEnumerableExtensions.cs @@ -1181,10 +1179,10 @@ Designer - + Designer - + Designer diff --git a/Python/Product/ReplWindow/ReplWindow.csproj b/Python/Product/ReplWindow/ReplWindow.csproj index a5639ffca9..69e99c33cc 100644 --- a/Python/Product/ReplWindow/ReplWindow.csproj +++ b/Python/Product/ReplWindow/ReplWindow.csproj @@ -48,7 +48,7 @@ $(DevEnvDir)devenv.exe /rootsuffix Exp true - false + false AnyCPU diff --git a/Python/products.settings b/Python/products.settings index 5ffc66a868..12f7aaf6b4 100644 --- a/Python/products.settings +++ b/Python/products.settings @@ -1,11 +1,11 @@ - true + true false - false + false true $(ReleaseBuild) @@ -22,5 +22,10 @@ --> true false + + + $(ReleaseBuild) + true + false