Example #1
0
        public static string Initialize()
        {
            string       assemblyFile = ConfigurationManager.AppSettings["Assembly"];
            AssemblyInfo assemblyInfo = new AssemblyInfo(assemblyFile);

            s_singleton = new LicenseConsoleData(assemblyInfo);
            return(null);
        }
        public MainWindow()
        {
            LicenseConsoleData data = LicenseConsoleData.Singleton;

            DataContext = data;
            InitializeComponent();
            data.BeginCheckUpdate();
        }
Example #3
0
        public static void Show(Window ownerWindow, string assemblyPath, string assemblyData)
        {
            LicenseEntry        licenseEntry = LicenseConsoleData.Singleton.LicenseEntry;
            NameValueCollection parameters   = PrepareParameters(LicenseType.Distributable, licenseEntry.LicenseKey, licenseEntry.Name, licenseEntry.Company, assemblyData);

            parameters.Add("AssemblyPath", assemblyPath);
            parameters.Add("LicenseCategory", LicenseConsoleData.GetLicenseCategory(LicenseType.Distributable));
            Show(ownerWindow, parameters);
        }
        public ChangeProductLicenseWindow()
        {
            LicenseConsoleData data = LicenseConsoleData.Singleton;

            DataContext = data;
            InitializeComponent();
            UserName   = data.LicenseEntry.Name;
            Company    = data.LicenseEntry.Company;
            Email      = data.LicenseEntry.Email;
            LicenseKey = data.LicenseEntry.LicenseKey;
            Refresh();
        }
Example #5
0
        public static void Show(Window ownerWindow, LicenseType licenseType, LicenseKey licenseKey, string userName, string company)
        {
            NameValueCollection parameters   = PrepareParameters(licenseType, licenseKey, userName, company, MachineLicense.LocalMachineData);
            string designTimeLicenseCategory = LicenseConsoleData.GetLicenseCategory(licenseType, true);

            if (!string.IsNullOrEmpty(designTimeLicenseCategory))
            {
                parameters.Add("DesignTimeLicenseCategory", designTimeLicenseCategory);
            }
            parameters.Add("RuntimeLicenseCategory", LicenseConsoleData.GetLicenseCategory(licenseType, false));
            Show(ownerWindow, parameters);
        }
Example #6
0
        static int Main(string[] args)
        {
            string errorMessage = LicenseConsoleData.Initialize();

            if (errorMessage != null)
            {
                MessageBox.Show(errorMessage);
                return(0);
            }

            LicenseError licenseError = DevZest.Licensing.LicenseManager.Check(".Net Licensing", typeof(LicenseClient));

            if (licenseError != null)
            {
                MessageBox.Show(licenseError.ExceptionMessage);
                return(-1);
            }

            App.Main();
            return(0);
        }