IMonitorSelection changes in Version 2.6

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

IMonitorSelection changes in Version 2.6

Post by roteague »

In previous versions I used the IMonitorSelection interface like thus:

Code: Select all

IMonitorSelection monitor = GetService<IMonitorSelection>();
ISelectionContainer[] selection = monitor.Selection;
In fact, the latest version of the SDK Help File shows this same code as an example as well. However, the SDK shows the interface as:

ISelectionContainer Selection { get; } - returning a single item

BTW, the sample project (CustomLookupTablePackage) that is supplied with the SDK fails to compile (as does my projects), reporting :

Code: Select all

Cannot implicitly convert type 'SoftPro.Select.Shell.ISelectionContainer' to 'SoftPro.Select.Shell.ISelectionContainer[]'
Does this now mean that the Monitor service only returns a single item at a time now?
Robert
Mark McKenna

Re: IMonitorSelection changes in Version 2.6

Post by Mark McKenna »

The interface did change such that only one selection container can be monitored, although within that container you will find that "many" selected objects are, indeed, supported (see ISelectionContainer.SelectedObjects). So, for example, multiple selected items within a single container such as a list box can be monitored, but multiple items across multiple list boxes could not.

The SDK sample code and sample project updates unfortunately did not occur, which was an oversight on our part. We now have it on our list to update. Thanks for bringing it to our attention.
Post Reply