To get information about a product key/license, you can use the LicensingHelper class. Here is a code example and I attached a visual aid. If anyone knows how to use the ILicensingService or a simple way to get LicenseInfo object, please share.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.Composition;
using Caliburn.Micro;
using VisualComponents.Create3D;
using VisualComponents.UX.Shared;
using VisualComponents.Licensor;
namespace Example001
{
[Export(typeof(IPlugin))]
public class MyScene : IPlugin
{
//[Import]
private IApplication app = null;
[ImportingConstructor]
public MyScene([Import(typeof(IApplication))] IApplication app)
{
this.app = app;
}
void IPlugin.Exit()
{
}
void IPlugin.Initialize()
{
IMessageService ms = IoC.Get<IMessageService>();
String key = LicensingHelper.ProductKeyFromLauncherConfig;
IProductKey pk = LicensingHelper.GetActiveStandaloneProductKey(key);
String msg = "";
msg += "Activation Ends: " + pk.CurrentActivationEnd + "\n";
msg += "Evaluation Time Left: " + pk.EvaluationTimeLeft + "\n";
msg += "Expiration Date: " + pk.ExpirationDate + "\n";
msg += "Maintenance End Date: " + pk.MaintenanceEndDate + "\n";
msg += "Activation Time Left: " + (pk.CurrentActivationEnd.Value - DateTime.Now).Days;
ms.AppendMessage(msg, MessageLevel.Warning);
}
}
}