junian / Standard.Licensing

Easy-to-use licensing library for .NET Framework, Mono, .NET Core, and MAUI / Xamarin products
https://junian.dev/Standard.Licensing/
MIT License
554 stars 127 forks source link

What are valid options for ProductFeatures #26

Open emilaz opened 1 year ago

emilaz commented 1 year ago

I was wondering where I can see what the .WithProductFeatures(Dictionary<string, string> productFeatures) function actually does and where I could see which options I could set there?

AntiGuideAkquinet commented 1 year ago

The function works with any string as it is only used to build up an XML file.

When using a setup like the one provided in the README:

var license = License.New()  
    .WithProductFeatures(new Dictionary<string, string>  
    {  
        {"Sales Module", "yes"},  
        {"Purchase Module", "yes"},  
        {"Maximum Transactions", "10000"}  
    })  
    .CreateAndSignWithPrivateKey(privateKey, passPhrase);

The output will look like this:

<License>
  <ProductFeatures>
    <Feature name="Sales Module">yes</Feature>
    <Feature name="Purchase Module">yes</Feature>
    <Feature name="Maximum Transactions">10000</Feature>
  </ProductFeatures>
  <Signature>MEYCIQCjUXX6ZS4fEItOIS1rmaeex9/INfKQnvpDLmmdRiOR3AIhALkmUK8p9y7BxqElmIMDrznBZOcp+e3ypNRBF9g3xyif</Signature>
</License>