如何在Visual Studio解决方案资源管理器(VSPackage)中更改风味项目的项目节点的顺序? [英] How to Change Order of a Flavored Project’s Item Nodes in Visual Studio Solution Explorer (VSPackage)?

查看:75
本文介绍了如何在Visual Studio解决方案资源管理器(VSPackage)中更改风味项目的项目节点的顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为Visual Studio 2010/2012(VSPackage)扩展的一部分,我需要在解决方案资源管理器中更改风味项目节点的顺序.具体来说,我有一个自定义项目子类型,该子类型继承自"Microsoft.VisualStudio.Shell.Flavor.FlavoredProjectBase". 我需要以非字母顺序显示几个文件夹,类似于在类库项目中排在首位的属性"和引用".因此,例如,我需要以编程方式排列文件夹,而不是显示"FolderA,FolderB,FolderC" 它们就像"FolderC,FolderA,B文件夹"之类.

在这种特定情况下,文件夹是真实的,但是我希望找到一种通用的方法,该方法可以使我最终需要完成扩展的任何类型的节点(例如虚拟文件夹)都可以更改节点顺序. br/>
我没有成功探索过的两种可能的方法是:

1.覆盖风味项目中的"GetProperty(uint itemId,int propId,out对象属性)",并为__VSHPROPID.VSHPROPID_FirstChild,_VSHPROPID.VSHPROPID_FirstVisibleChild,__ VSHPROPID.VSHPROPID_NextSibling和__VSHPROPID.First返回. 属性.

在这种情况下,如果我不重新排列ItemIds并以相同顺序返回节点,则一切正常.当我以其他顺序返回节点时,它失败了.

2.通过ToolWindows.SolutionExplorer的UIHierarchy更改节点的顺序. 2003 MSDN文档讨论了能够移动节点的问题.更高版本讨论了移动插入点.直接找到该项目的UIHierarchyItem 调味项目中的对象,但似乎没有办法更改节点顺序.

我肯定错过了什么.这应该很容易实现.

如何更改风味项目子类型中项目的项目节点的顺序?

As part of an extension for Visual Studio 2010/2012 (VSPackage) I need to change the order of a flavored project’s nodes in the solution explorer. Specifically, I have a custom project subtype that inherits from "Microsoft.VisualStudio.Shell.Flavor.FlavoredProjectBase". I need to display several folders in a non-alphabetic order similar to "Properties" and "Referenced" coming first in a class library project. So, for example instead of the folders being displayed "FolderA, FolderB, FolderC" I need to programmatically arrange them as something like "FolderC, FolderA, Folder B".

In this specific case, the folders are real, but I hoping to find a generic approach that would allow me to change the node order for whatever types of nodes (such as a virtual folder) that I end up needing to complete the extension.

Two possible approaches that I have explored without success are:

1. Override "GetProperty(uint itemId, int propId, out object property)" in the flavored project and return a rearranged ItemId for the __VSHPROPID.VSHPROPID_FirstChild, _VSHPROPID.VSHPROPID_FirstVisibleChild, __VSHPROPID.VSHPROPID_NextSibling, and __VSHPROPID.VSHPROPID_NextVisibleSibling properties.

In this case if I did not rearrange the ItemIds and returned the nodes in the same order, everything worked. As soon as I returned the nodes in a different order it failed.

2. Changing the order of nodes through ToolWindows.SolutionExplorer’s UIHierarchy. The 2003 MSDN documentation talks about being able to move nodes. Later versions talk about moving the insertion point. It is straight forward to find the project’s UIHierarchyItem object from the flavored project, but there does not appear to be a way to change the node order.

I must be missing something. This should be very simple to achieve.

How can I change the order of a project’s item nodes in a flavored project subtype?

推荐答案

谢谢您的提问.

我正在尝试让熟悉此主题的人进一步研究此问题.可能会有一些时间延迟.感谢您的耐心.
 
感谢您的理解和支持.

I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
 
Thank you for your understanding and support.

最好的问候


这篇关于如何在Visual Studio解决方案资源管理器(VSPackage)中更改风味项目的项目节点的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆