Get instance of IMonitorSelectionService for Visual Studio Sequence Diagram
I'm trying to create a Visual Studio extension that works alongside the Sequence Diagram Designer, and I'd like to be able to register for an event that will notify me whenever the selection changes on the diagram. The IMonitorSelectionService interface appears to offer such an event, but I don't know how to get an instance of this service from a VSPackage.
What do I need to do in order to get an instance of this service, or is there some other more easily accessib开发者_C百科le event that I could use instead?
You should be able to do the following:
IMonitorSelectionService monitorSelectionService = ((IServiceProvider)store).GetService(typeof(IMonitorSelectionService)) as IMonitorSelectionService;
Where store is the Store of the diagram you're interested in.
精彩评论