dnauck / Portable.Licensing

Portable.Licensing is a cross platform software licensing framework which allows you to implement licensing into your application or library. It provides you all tools to create and validate licenses for your software.
http://dev.nauck-it.de/projects/portable-licensing
MIT License
592 stars 173 forks source link

Adding 'Company' to the Customer section of a license. #50

Open ritchritch opened 5 years ago

ritchritch commented 5 years ago

Would you be able to provide some sample code to include the Company name in the customer section of a license?

So rather than this:

Portable.Licensing.License lic = license.LicensedTo("Persons Name", "email@dot.com");

I would like to do something like this:

Portable.Licensing.License lic = license.LicensedTo("Persons Name", "email@dot.com", "Company Name");

But it doesn't seem to work that way.

Thanks

brysmi commented 5 years ago

The third argument isn’t a string, it is a delegated Customer. So you would have to customer.setCompany(“company”) or something like that. Kind of odd. I am not near a place to test it; sorry.

ritchritch commented 5 years ago

Thanks, that make sense, but I can’t make it work like that. I might be being stupid, if you could show me a code snippet when you get chance it would be hugley appreciated.

Thanks

lordrak007 commented 5 years ago

Hi, try it like this lic.LicensedTo(to => { to.Name = "Name"; to.Company = "Company\nAddress"; to.Email = "mail@earth.milkyway"; } );

ritchritch commented 5 years ago

Brilliant, thanks, that works perfectly.