Skip to content

Commit

Permalink
Merge pull request #266 from zooba/vs2015-images
Browse files Browse the repository at this point in the history
VS2015 images
  • Loading branch information
zooba committed May 28, 2015
2 parents 865c1cd + 1a09e24 commit 635737b
Show file tree
Hide file tree
Showing 46 changed files with 391 additions and 322 deletions.
8 changes: 0 additions & 8 deletions Build/Common.Build.CSharp.settings
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,32 @@
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<DefineConstants Condition="$(FeatureAzureRemoteDebug)">$(DefineConstants);FEATURE_AZURE_REMOTE_DEBUG</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(VSTarget)' == '14.0' ">
<DefineConstants>$(DefineConstants);DEV14;DEV14_OR_LATER;DEV12_OR_LATER;DEV11_OR_LATER</DefineConstants>
<VSCTDefinitions>DEV14;DEV14_OR_LATER;DEV12_OR_LATER;DEV11_OR_LATER</VSCTDefinitions>
<MicrosoftBuildAssemblyVersion>14.0.0.0</MicrosoftBuildAssemblyVersion>
<MicrosoftBuildAssemblyVersionSuffix>Core</MicrosoftBuildAssemblyVersionSuffix>
<Dev14OrLater>True</Dev14OrLater>
</PropertyGroup>

<PropertyGroup Condition=" '$(VSTarget)' == '12.0' ">
<DefineConstants>$(DefineConstants);DEV12;DEV12_OR_LATER;DEV11_OR_LATER</DefineConstants>
<VSCTDefinitions>DEV12;DEV12_OR_LATER;DEV11_OR_LATER</VSCTDefinitions>
<MicrosoftBuildAssemblyVersion>12.0.0.0</MicrosoftBuildAssemblyVersion>
<MicrosoftBuildAssemblyVersionSuffix>v12.0</MicrosoftBuildAssemblyVersionSuffix>
<Dev14OrLater>False</Dev14OrLater>
</PropertyGroup>

<PropertyGroup Condition=" '$(VSTarget)' == '11.0' ">
<DefineConstants>$(DefineConstants);DEV11;DEV11_OR_LATER</DefineConstants>
<VSCTDefinitions>DEV11;DEV11_OR_LATER</VSCTDefinitions>
<MicrosoftBuildAssemblyVersion>4.0.0.0</MicrosoftBuildAssemblyVersion>
<MicrosoftBuildAssemblyVersionSuffix>v4.0</MicrosoftBuildAssemblyVersionSuffix>
<Dev14OrLater>False</Dev14OrLater>
</PropertyGroup>

<PropertyGroup Condition=" '$(VSTarget)' == '10.0' ">
<DefineConstants>$(DefineConstants);DEV10</DefineConstants>
<VSCTDefinitions>DEV10</VSCTDefinitions>
<MicrosoftBuildAssemblyVersion>4.0.0.0</MicrosoftBuildAssemblyVersion>
<MicrosoftBuildAssemblyVersionSuffix>v4.0</MicrosoftBuildAssemblyVersionSuffix>
<Dev14OrLater>False</Dev14OrLater>
</PropertyGroup>

<PropertyGroup>
Expand Down
6 changes: 0 additions & 6 deletions Build/Common.Build.settings
Original file line number Diff line number Diff line change
Expand Up @@ -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))</_VSUpdateVersion>
<VSMajorVersion Condition="$(VSMajorVersion)=='' and $(_VSUpdateVersion)!=''">$([System.Int32]::Parse($(_VSUpdateVersion.Substring(0, $(_VSUpdateVersion.IndexOf(`.`))))))</VSMajorVersion>
<VSUpdateVersion Condition="$(VSUpdateVersion)=='' and $(_VSUpdateVersion)!=''">$([System.Int32]::Parse($(_VSUpdateVersion.Substring($([MSBuild]::Add(1, $(_VSUpdateVersion.LastIndexOf(`.`))))))))</VSUpdateVersion>

<!-- Features default to true for release builds -->
<FeatureAzureRemoteDebug>$(ReleaseBuild)</FeatureAzureRemoteDebug>

<!-- Enable features based on VS versions -->
<FeatureAzureRemoteDebug Condition="$(VSMajorVersion) > 12 or ($(VSMajorVersion) == 12 and $(VSUpdateVersion) >= 30723)">true</FeatureAzureRemoteDebug>
</PropertyGroup>

<ItemDefinitionGroup>
Expand Down
23 changes: 0 additions & 23 deletions Common/Product/SharedProject/CommonConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,4 @@ internal static class CommonConstants {
/// </summary>
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
}
38 changes: 19 additions & 19 deletions Common/Product/SharedProject/CommonFileNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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


Expand Down
16 changes: 8 additions & 8 deletions Common/Product/SharedProject/CommonFolderNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand All @@ -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) {
Expand Down
51 changes: 30 additions & 21 deletions Common/Product/SharedProject/CommonProjectNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand All @@ -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; }
Expand Down Expand Up @@ -192,9 +198,9 @@ protected bool IsUserProjectFileDirty {
}
}

#endregion
#endregion

#region overridden properties
#region overridden properties

public override bool CanShowAllFiles {
get {
Expand All @@ -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.
/// </summary>
#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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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

/// <summary>
/// This method retrieves an instance of a service that
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

/// <summary>
/// Implements deferred save support. Enabled by unchecking Tools->Options->Solutions and Projects->Save New Projects Created.
Expand Down Expand Up @@ -1820,7 +1829,7 @@ out cancelled
}
}

#endregion
#endregion

internal void SuppressFileChangeNotifications() {
_watcher.EnableRaisingEvents = false;
Expand Down
20 changes: 5 additions & 15 deletions Common/Product/SharedProject/DependentFileNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ internal class DependentFileNode : FileNode {
/// </summary>
#endregion

#region Properties
public override int ImageIndex {
get { return (this.CanShowDefaultIcon() ? (int)ProjectNode.ImageName.DependentFile : (int)ProjectNode.ImageName.MissingFile); }
}
#endregion

#region ctor
/// <summary>
/// Constructor for the DependentFileNode
Expand All @@ -69,15 +63,6 @@ public override string GetEditLabel() {
throw new NotImplementedException();
}

/// <summary>
/// Gets a handle to the icon that should be set for this node
/// </summary>
/// <param name="open">Whether the folder is open, ignored here.</param>
/// <returns>Handle to icon for the node</returns>
public override object GetIconHandle(bool open) {
return this.ProjectMgr.ImageHandler.GetIconHandle(this.ImageIndex);
}

#if DEV14_OR_LATER
protected override bool SupportsIconMonikers {
get { return true; }
Expand All @@ -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

/// <summary>
Expand Down
Loading

0 comments on commit 635737b

Please sign in to comment.