C# VS Add-In: Modifying Solution Explorer Icons and/or Text

M

Max Khitrov

Hello everyone,

I'm working on a VS .NET add-in that will allow developers to use
Subversion software from within the IDE (much like Source Safe).
Ideally, I would like for my plug-in to be able to modify icons that are
displayed in Solution Explorer based on the file's status.

So far I've been able to retrieve data from Solution Explorer using the
UIHierarchy and related objects. Those give me access to the contents,
but not to the actual presentation. So basically, in my add-in I can
browse through the Solution Explorer and do things like save, delete,
etc... But when it comes to actually being able to modify what is
displayed on it, I can't seem to be able to do this.

Does anyone have any clue as to how I might be able to gain access to
the visual aspects of the solution explorer, and do things like putting
overlays over the current icons? If modifying the icons is too
difficult, then perhaps there is a way I could modify the text? So for
example, if I have a file in my Solution Explorer called Connect.cs, and
my version control plug-in is running, I could just change the actual
text of the file to read something like "Connect.cs [Conflict]" if that
file is in conflict state.

Any help on this would be greatly appreciated.

- Max
 
J

Jon Skeet [C# MVP]

Max Khitrov said:
I'm working on a VS .NET add-in that will allow developers to use
Subversion software from within the IDE (much like Source Safe).
Ideally, I would like for my plug-in to be able to modify icons that are
displayed in Solution Explorer based on the file's status.

So far I've been able to retrieve data from Solution Explorer using the
UIHierarchy and related objects. Those give me access to the contents,
but not to the actual presentation. So basically, in my add-in I can
browse through the Solution Explorer and do things like save, delete,
etc... But when it comes to actually being able to modify what is
displayed on it, I can't seem to be able to do this.

Does anyone have any clue as to how I might be able to gain access to
the visual aspects of the solution explorer, and do things like putting
overlays over the current icons? If modifying the icons is too
difficult, then perhaps there is a way I could modify the text? So for
example, if I have a file in my Solution Explorer called Connect.cs, and
my version control plug-in is running, I could just change the actual
text of the file to read something like "Connect.cs [Conflict]" if that
file is in conflict state.

Any help on this would be greatly appreciated.

I'd suggest having a look at an existing Subversion add-in such as
ankhsvn: http://ankhsvn.tigris.org/

(You might also consider either contributing to that project or a
similar one rather than re-inventing the wheel - but that depends on
your reasons for doing it. If it's for the investigation side of things
as much as anything else, it doesn't matter at all.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top