Example #1
0
        public InventoryManager(int engineID)
        {
            this.engineID = engineID;
            Dictionary <string, object> plugins1 = new Dictionary <string, object>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
            IEnumerable <IBackgroundInventoryPlugin> plugins2 = (IEnumerable <IBackgroundInventoryPlugin>) new PluginsFactory <IBackgroundInventoryPlugin>().Plugins;

            if (plugins2 != null)
            {
                using (IEnumerator <IBackgroundInventoryPlugin> enumerator = plugins2.GetEnumerator())
                {
                    while (((IEnumerator)enumerator).MoveNext())
                    {
                        IBackgroundInventoryPlugin current = enumerator.Current;
                        if (plugins1.ContainsKey(current.get_FlagName()))
                        {
                            InventoryManager.log.ErrorFormat("Plugin with FlagName {0} already loaded", (object)current.get_FlagName());
                        }
                        plugins1.Add(current.get_FlagName(), (object)current);
                    }
                }
            }
            IEnumerable <IBackgroundInventoryPlugin2> plugins3 = (IEnumerable <IBackgroundInventoryPlugin2>) new PluginsFactory <IBackgroundInventoryPlugin2>().Plugins;

            if (plugins3 != null)
            {
                using (IEnumerator <IBackgroundInventoryPlugin2> enumerator = plugins3.GetEnumerator())
                {
                    while (((IEnumerator)enumerator).MoveNext())
                    {
                        IBackgroundInventoryPlugin2 current = enumerator.Current;
                        if (plugins1.ContainsKey(current.get_FlagName()))
                        {
                            InventoryManager.log.ErrorFormat("Plugin with FlagName {0} already loaded", (object)current.get_FlagName());
                        }
                        plugins1.Add(current.get_FlagName(), (object)current);
                    }
                }
            }
            if (plugins2 == null && plugins3 == null)
            {
                InventoryManager.log.ErrorFormat("No Inventory plugins found", Array.Empty <object>());
            }
            this.backgroundInventory = new SolarWinds.Orion.Core.BusinessLayer.BackgroundInventory.BackgroundInventory(BusinessLayerSettings.Instance.BackgroundInventoryParallelTasksCount, plugins1);
        }