コード例 #1
0
ファイル: Store.cs プロジェクト: Megapop/EtceteraWindows
 static Store()
 {
     var information = CurrentApp.LicenseInformation;
     if (information != null)
     {
         information.LicenseChanged += OnLicenseChanged;
         licenseInformation = new LicenseInformation();
         licenseInformation.ExpirationDate = information.ExpirationDate;
         licenseInformation.IsActive = information.IsActive;
         licenseInformation.IsTrial = information.IsTrial;
         licenseInformation.ProductLicenses = new Dictionary<string, ProductLicense>();
         var dict = information.ProductLicenses;
         foreach (var keyValuePair in dict)
         {
             var value = keyValuePair.Value;
             var productLicense = new ProductLicense();
             productLicense.ExpirationDate = value.ExpirationDate;
             productLicense.IsActive = value.IsActive;
             productLicense.ProductId = productLicense.ProductId;
             licenseInformation.ProductLicenses.Add(keyValuePair.Key, productLicense);
         }
     }
 }
コード例 #2
0
        static Store()
        {
            var information = CurrentApp.LicenseInformation;

            if (information != null)
            {
                information.LicenseChanged        += OnLicenseChanged;
                licenseInformation                 = new LicenseInformation();
                licenseInformation.ExpirationDate  = information.ExpirationDate;
                licenseInformation.IsActive        = information.IsActive;
                licenseInformation.IsTrial         = information.IsTrial;
                licenseInformation.ProductLicenses = new Dictionary <string, ProductLicense>();
                var dict = information.ProductLicenses;
                foreach (var keyValuePair in dict)
                {
                    var value          = keyValuePair.Value;
                    var productLicense = new ProductLicense();
                    productLicense.ExpirationDate = value.ExpirationDate;
                    productLicense.IsActive       = value.IsActive;
                    productLicense.ProductId      = productLicense.ProductId;
                    licenseInformation.ProductLicenses.Add(keyValuePair.Key, productLicense);
                }
            }
        }