Example #1
0
        private static esriLicenseProductCode[] GetLicenseProductCodes(
            EsriProduct licenseProduct,
            EsriProductFallback fallback)
        {
            var productCodes = new List <esriLicenseProductCode>
            {
                GetLicenseProductCode(licenseProduct)
            };

            if (fallback == EsriProductFallback.TryHigherProduct)
            {
                switch (licenseProduct)
                {
                case EsriProduct.ArcView:
                    productCodes.Add(GetLicenseProductCode(EsriProduct.ArcEditor));
                    productCodes.Add(GetLicenseProductCode(EsriProduct.ArcInfo));
                    break;

                case EsriProduct.ArcEditor:
                    productCodes.Add(GetLicenseProductCode(EsriProduct.ArcInfo));
                    break;
                }
            }

            return(productCodes.ToArray());
        }
Example #2
0
        private void Checkout(EsriProduct product, EsriProductFallback fallback,
                              params esriLicenseExtensionCode[] esriExtensionCodes)
        {
            esriLicenseProductCode[] productCodesArray =
                GetLicenseProductCodes(product, fallback);

            if (!_initializer.InitializeApplication(productCodesArray,
                                                    esriExtensionCodes))
            {
                throw new InvalidOperationException(
                          $"Cannot check out license ({product}, {StringUtils.Concatenate(esriExtensionCodes, ", ")})");
            }
        }
Example #3
0
 public void Checkout(EsriProduct product, EsriProductFallback fallback,
                      params EsriExtension[] extensions)
 {
     Checkout(product, fallback, GetExtensionCodes(extensions));
 }