Ejemplo n.º 1
0
        public static List <ElementLicenseInfo> GetLicensedStatus(
            DiscoveryResultBase discoveryResult)
        {
            if (discoveryResult == null)
            {
                throw new ArgumentNullException(nameof(discoveryResult));
            }
            List <ElementLicenseInfo> elementLicenseInfoList1 = new List <ElementLicenseInfo>();
            IFeatureManager           ifeatureManager         = (IFeatureManager) new FeatureManager();
            Dictionary <string, int>  dictionary           = new Dictionary <string, int>();
            Dictionary <string, int>  elementsManagedCount = LicenseSaturationLogic.GetElementsManagedCount();

            foreach (string key in elementsManagedCount.Keys)
            {
                dictionary[key] = ifeatureManager.GetMaxElementCount(key);
            }
            using (IEnumerator <DiscoveryPluginResultBase> enumerator = discoveryResult.get_PluginResults().GetEnumerator())
            {
                while (((IEnumerator)enumerator).MoveNext())
                {
                    List <ElementLicenseInfo> elementLicenseInfoList2;
                    if (!enumerator.Current.CheckLicensingStatusForImport(elementsManagedCount, dictionary, ref elementLicenseInfoList2))
                    {
                        elementLicenseInfoList1.AddRange((IEnumerable <ElementLicenseInfo>)elementLicenseInfoList2);
                    }
                }
            }
            return(elementLicenseInfoList1);
        }
        // Token: 0x060002AF RID: 687 RVA: 0x00010BD4 File Offset: 0x0000EDD4
        public static List <ElementLicenseInfo> GetLicensedStatus(DiscoveryResultBase discoveryResult)
        {
            if (discoveryResult == null)
            {
                throw new ArgumentNullException("discoveryResult");
            }
            List <ElementLicenseInfo> list                 = new List <ElementLicenseInfo>();
            IFeatureManager           featureManager       = new FeatureManager();
            Dictionary <string, int>  dictionary           = new Dictionary <string, int>();
            Dictionary <string, int>  elementsManagedCount = LicenseSaturationLogic.GetElementsManagedCount();

            foreach (string text in elementsManagedCount.Keys)
            {
                dictionary[text] = featureManager.GetMaxElementCount(text);
            }
            using (IEnumerator <DiscoveryPluginResultBase> enumerator2 = discoveryResult.PluginResults.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    List <ElementLicenseInfo> collection;
                    if (!enumerator2.Current.CheckLicensingStatusForImport(elementsManagedCount, dictionary, ref collection))
                    {
                        list.AddRange(collection);
                    }
                }
            }
            return(list);
        }