private static void ApplyLicense(IEyeTracker eyeTracker, string licensePath) { // Create a collection with the license. var licenseCollection = new LicenseCollection( new System.Collections.Generic.List <LicenseKey> { new LicenseKey(System.IO.File.ReadAllBytes(licensePath)) }); // See if we can apply the license. FailedLicenseCollection failedLicenses; if (eyeTracker.TryApplyLicenses(licenseCollection, out failedLicenses)) { //Console.WriteLine( System.Diagnostics.Debug.WriteLine("Successfully applied license from {0} on eye tracker with serial number {1}.", licensePath, eyeTracker.SerialNumber); } else { //Console.WriteLine( System.Diagnostics.Debug.WriteLine("Failed to apply license from {0} on eye tracker with serial number {1}.\n" + "The validation result is {2}.", licensePath, eyeTracker.SerialNumber, failedLicenses[0].ValidationResult); } }
public void PhotosLicensesGetInfoBasicTest() { LicenseCollection col = Instance.PhotosLicensesGetInfo(); foreach (License lic in col) { if (!Enum.IsDefined(typeof(LicenseType), lic.LicenseId)) { Assert.Fail("License with ID " + (int)lic.LicenseId + ", " + lic.LicenseName + " dooes not exist."); } } }
public LicenseCollection GetLicenses() { // Licenses won't change normally in a user session if (licenses == null) { try { licenses = flickr.PhotosLicensesGetInfo(); } catch (FlickrNet.FlickrApiException e) { Log.Error(e.Code + ": " + e.OriginalMessage); return(null); } } return(licenses); }
public LicenseCollection GetLicenses() { // Licenses won't change normally in a user session if (licenses == null) { try { licenses = flickr.PhotosLicensesGetInfo(); } catch (FlickrNet.FlickrApiException e ) { Log.Error (e.Code + ": " + e.OriginalMessage ); return null; } } return licenses; }