Ejemplo n.º 1
0
        public void Run(DtoInventoryModule module)
        {
            Logger.Info("Running Inventory Module");
            var collection = new EntityInventoryCollection();
            var instances  = from t in Assembly.GetExecutingAssembly().GetTypes()
                             where t.GetInterfaces().Contains(typeof(IInventorySearcher)) &&
                             t.GetConstructor(Type.EmptyTypes) != null
                             select Activator.CreateInstance(t) as IInventorySearcher;


            foreach (var instance in instances)
            {
                instance.Search(collection);
                //Thread thread = new Thread(() => instance.Search(collection));
                //thread.Start();
            }
        }
Ejemplo n.º 2
0
        private List <Policy> Seed()
        {
            var policyList = new List <Policy>();
            var policy     = new Policy();

            policy.Guid            = "Guid-1";
            policy.Hash            = "Hash-1";
            policy.Frequeny        = (int)EnumPolicyInterval.Frequency.Ongoing;
            policy.Trigger         = (int)EnumPolicyInterval.Trigger.Startup;
            policy.Scope           = "Computer";
            policy.Weight          = 100;
            policy.CompletedAction = "Nothing";
            var inventorymodule = new DtoInventoryModule();

            inventorymodule.DisplayName = "Test";
            inventorymodule.Order       = 1;
            policy.InventoryModules.Add(inventorymodule);
            policyList.Add(policy);
            return(policyList);
        }