Page 1 of 1

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

Posted: Wed Feb 03, 2016 10:11 am
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

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

Posted: Mon Feb 08, 2016 11:39 am
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();

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

Posted: Sat Feb 13, 2016 9:16 pm
by joe.mag
Thanks, Bob. I'll have to see what I was doing wrong!