private void CheckLicenseFile() { // Make sure a license for DotImage and Advanced DocClean exist. try { var img = new AtalaImage(); img.Dispose(); } catch (AtalasoftLicenseException ex1) { LicenseCheckFailure("This demo requires an Atalasoft DotImage license.", ex1.Message); return; } if (AtalaImage.Edition != LicenseEdition.Document) { LicenseCheckFailure("This demo requires an Atalasoft DotImage Document Imaging License.", string.Format("Your current license is for '{0}'.", AtalaImage.Edition)); return; } try { // ReSharper disable once ObjectCreationAsStatement // We need this line to check the license. new TranslatorCollection(); } catch (AtalasoftLicenseException ex2) { LicenseCheckFailure("Licensing exception.", ex2.Message); return; } _validLicense = true; }
private void CheckLicenseFile() { // Make sure a license for DotImage and Advanced DocClean exist. try { AtalaImage img = new AtalaImage(); img.Dispose(); } catch (Atalasoft.Imaging.AtalasoftLicenseException ex1) { LicenseCheckFailure("This demo requires an Atalasoft DotImage license.", ex1.Message); return; } if (AtalaImage.Edition != LicenseEdition.Document) { LicenseCheckFailure("This demo requires an Atalasoft DotImage Document Imaging License.", "Your current license is for '" + AtalaImage.Edition.ToString() + "'."); return; } try { TranslatorCollection t = new TranslatorCollection(); } catch (AtalasoftLicenseException ex2) { LicenseCheckFailure("Licensing exception.", ex2.Message); return; } this._validLicense = true; }