How to work with SoftPro.Select.Client.Runtime namespace

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

How to work with SoftPro.Select.Client.Runtime namespace

Post by joe.mag »

I want to get the ILicensing interface so I can keep track of who has what licenses in our system programmatically. I can't seem to find any documentation on how to go about getting a collection of ILicenseLease objects to achieve this goal. I've tried every method I have in my existing shell package code I've used to get interfaces and none seem to work (I either get a cast exception or end up with a null reference).

A code sample showing how to enumerate across all the actively held licenses would be great. Obviously I could go straight to the database and query the ILicenseLease table but I'm trying to be good and use the API as much as possible.

TIA
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How to work with SoftPro.Select.Client.Runtime namespace

Post by BobRichards »

The ILicensing service has all that you need to get the total number of license your enterprise owns and who currently has them in use.

Code: Select all

SelectServer ss = GetService<SelectServer>();
ILicensing lic = ss.GetService<ILicensing>();

// Maximum number of seats available for each product.
List<ILicenseKey> keys = lic.Keys.ToList();

// Current licensed seats in use by machine name and user name.
List<ILicenseLease> leasesInUse = lic.Leases.ToList();
Bob Richards, Senior Software Developer, SoftPro
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: How to work with SoftPro.Select.Client.Runtime namespace

Post by joe.mag »

Thanks, Bob. I'll have to see what I was doing wrong!
Post Reply