I suppose I really have two questions. First, I am trying to implement a
VSIP feature where a user can click on a control in a ToolWindow and have
that event notify another toolwindow.
Is it possible to send event information AND arguments between toolwindows?
I've found that setting up a new CommandID and routing it through the
MenuCommandService will allow simple Commands to be sent, but not args.
As part of an attempted workaround, I've tried to get the Package from
within the toolwindow using:
Package pkg = (Package)this.GetService(typeof(Package)), but pkg is ALWAYS
null. I know that the toolwindow implements IServiceProvider.
So my second question is, how can I get the Package object from a toolwindow?
Is there a way to enumerate the services available on a component or
container?
Gaston Milano - 30 Dec 2004 02:57 GMT
The first toolwindow should register a new service and promote it (using
addservice).
So after that the second toolwindow do a request for this service (using
GetService). And use this service in order to comunicate with the other
toolwindow.
If both toolwindows are in the same package they can access to the package
by a static member of the package. For example
class MyPackage : Package
{
public static MyPackage Package;
public override void Initialize()
{
Package = this;
}
}
> I suppose I really have two questions. First, I am trying to implement a
> VSIP feature where a user can click on a control in a ToolWindow and have
[quoted text clipped - 14 lines]
> Is there a way to enumerate the services available on a component or
> container?