Ejemplo n.º 1
0
        protected virtual Boolean FillPipes()
        {
            bool result = true;

            Dictionary <Guid, ModuleConfig> .Enumerator modInstEnum = moduleInstances.GetEnumerator();
            Dictionary <Guid, ModuleConfig> .Enumerator modRefEnum  = moduleReferences.GetEnumerator();
            ModuleConfig module = null;

            while (modInstEnum.MoveNext())
            {
                module = modInstEnum.Current.Value;
                if (module.IsBasePipe())
                {
                    IBasePipe   bucket          = module.Instance as IBasePipe;
                    IEnumerator pipeContentEnum = module.ModuleConfigCollection.GetEnumerator();
                    while (pipeContentEnum.MoveNext())
                    {
                        ModuleConfig pipeContent = pipeContentEnum.Current as ModuleConfig;
                        if ((pipeContent != null) && (!pipeContent.HasProperty("Property", false)))
                        {
                            bucket.PushObject(pipeContent.Instance);
                        }
                    }
                }
            }

            while (modRefEnum.MoveNext())
            {
                module = modRefEnum.Current.Value;
                if (module.IsBasePipe())
                {
                    IBasePipe   bucket          = module.Instance as IBasePipe;
                    IEnumerator pipeContentEnum = module.ModuleConfigCollection.GetEnumerator();
                    while (pipeContentEnum.MoveNext())
                    {
                        ModuleConfig pipeContent = pipeContentEnum.Current as ModuleConfig;
                        if ((pipeContent != null) && (!pipeContent.HasProperty("Property", false)))
                        {
                            bucket.PushObject(pipeContent.Instance);
                        }
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
 protected virtual Boolean FindInstance(ModuleConfig config)
 {
     if (modules != null)
     {
         IEnumerator enumerator = modules.GetEnumerator();
         if (enumerator != null)
         {
             while (enumerator.MoveNext())
             {
                 ModuleConfig instance = enumerator.Current as ModuleConfig;
                 if (instance != null && instance.IsInstance())
                 {
                     if (instance.HasProperty("Key") && instance.GetConfigurationProperty("Key") == config.GetConfigurationProperty("Key"))
                     {
                         config.Instance = instance.Instance;
                         return(config.Instance != null);
                     }
                 }
             }
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
        protected Boolean FillAttributes(ModuleConfig module)
        {
            bool         result         = true;
            IEnumerator  modInstEnum    = module.ModuleConfigCollection.GetEnumerator();
            ModuleConfig propertyModule = null;

            while (modInstEnum.MoveNext())
            {
                propertyModule = modInstEnum.Current as ModuleConfig;
                if (propertyModule != null)
                {
                    result = result && FillAttributes(propertyModule);
                    if (propertyModule.HasProperty("Property", false))
                    {
                        result = result && module.SetInstanceProperty(propertyModule);
                    }
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }