| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 | using System.Collections.Generic;using System.Linq;using Comal.Classes;using InABox.Core;using InABox.DynamicGrid;using netDxf.Collections;using Org.BouncyCastle.Asn1.X509.Qualified;using PRSServer;namespace PRSLicensing;public class LicenseTimeDiscount : BaseObject{    [EditorSequence(1)]    [IntegerEditor(Width = 0, Alignment = Alignment.MiddleCenter)]    public int Months { get; set; }        [EditorSequence(2)]    [DoubleEditor(Alignment = Alignment.MiddleCenter)]    public double Discount { get; set; }}public class LicenseUserDiscount : BaseObject{    [EditorSequence(1)]    [IntegerEditor(Width = 0, Alignment = Alignment.MiddleCenter)]    public int Users { get; set; }        [EditorSequence(2)]    [DoubleEditor(Alignment = Alignment.MiddleCenter)]    public double Discount { get; set; }}public class LicenseProductMapping : BaseObject{    [ComboLookupEditor(typeof(LicenseSectionGenerator), Visible = Visible.Default, Editable = Editable.Enabled)]    [EditorSequence(1)]    public string License { get; set; }    public class LicenseSectionGenerator : LookupGenerator<object>    {        public LicenseSectionGenerator(object[] items) : base(items)        {            var tokens = CoreUtils.TypeList(x =>x.IsSubclassOf(typeof(LicenseToken)))                .OrderBy(x => x.EntityName().Split('.').Last())                .ToArray();            foreach (var token in tokens)                AddValue(token.EntityName(), token.GetCaption());        }    }    [EditorSequence(2)]    public ProductLink Product { get; set; }}public class LicensingEngineProperties : ServerProperties{        [IntegerEditor]    [EditorSequence(1)]    public int ListenPort { get; set; }        [ComboLookupEditor(typeof(LicensingDatabaseServerLookupGenerator))]    [EditorSequence(2)]    public string? Server { get; set; }        [ListEditor(ListWidth = 350, ListHeight = 600, DirectEdit = true)]    [EditorSequence(4)]    [Caption("Products")]    public List<LicenseProductMapping> Mappings { get; set; } = new();    [ListEditor(ListWidth = 250, ListHeight = 300, DirectEdit = true)]    [EditorSequence(5)]    public List<LicenseTimeDiscount> TimeDiscounts { get; set; } = new();        [ListEditor(ListWidth = 250, ListHeight = 400, DirectEdit = true)]    [EditorSequence(5)]    public List<LicenseUserDiscount> UserDiscounts { get; set; } = new();        [EditorSequence("Advanced", 1)]    [FileNameEditor("Certificate Files (*.pfx)|*.pfx")]    public string? CertificateFile { get; set; }        public override ServerType Type()    {        return ServerType.Other;    }}
 |