123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using InABox.Configuration;
- using InABox.Core;
- using PRSServer;
- using PRSServices;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PRSLicensing;
- internal class PRSLicensingService : PRSService
- {
- public PRSLicensingService(string serviceName) : base(serviceName)
- {
- }
- protected override ServerSettings GetSettings(string serviceName)
- {
- var configuration = GetConfiguration().Load();
- return new ServerSettings
- {
- Type = ServerType.Other,
- Properties = configuration.Properties
- };
- }
-
- public static IConfiguration<LicensingConfiguration> GetConfiguration()
- {
- return new LocalConfiguration<LicensingConfiguration>(CoreUtils.GetCommonAppData(), "");
- }
- protected override Server CreateServer(ServerSettings settings, string serviceName)
- {
- var result = new Server();
- result.Key = serviceName;
- result.Type = ServerType.Other;
- //result.Sequence = Sequence == 0 ? DateTime.Now.Ticks : Sequence;
- var properties = Serialization.Deserialize<LicensingEngineProperties>(settings.Properties);
- if (properties != null)
- {
- result.Properties = properties;
- result.Name = result.Properties.Name;
- }
- result.CommitChanges();
- return result;
- }
- protected override IEngine? CreateEngine(ServerSettings settings)
- {
- return new LicensingEngine();
- }
- }
|