예제 #1
0
        public override void Add(CompBase child)
        {
            CompBase compRead = ReadXmlFile(child.GetType(), child.Name);

            if (compRead != null)
            {
                RecurseConstructChild(child, compRead);
                child = compRead;
            }
            base.Add(child);
            child.Initialize();
        }
예제 #2
0
        public void Add(CompBase child, eCleanUpMode cleanUpMode = eCleanUpMode.None)
        {
            CompBase compRead = ReadXmlFile(child.GetType(), child.Name);

            if (compRead != null)
            {
                RecurseConstructChild(child, compRead);
                RecurseCleanUpChild(child, compRead, cleanUpMode);
                child = compRead;
            }
            base.Add(child);
            child.Initialize();
        }
예제 #3
0
        public void Add(ComponentDefinition compDef, eCleanUpMode cleanUpMode = eCleanUpMode.None)
        {
            foreach (Type tyLoaded in s_loadedCompTypes)
            {
                compDef.ConfirmNotPluginType(tyLoaded);
            }
            foreach (Type tyPlugIn in s_pluginCompTypes)
            {
                compDef.AssignPlugInType(tyPlugIn);
            }

            List <ComponentDefinition> unresolvedPlugins = new List <ComponentDefinition>();

            compDef.GetUnloadedPlugins(unresolvedPlugins);
            // Assigns Sims, adds overrides to Serializer
            CreateSimClasses(compDef, unresolvedPlugins);

            AppStatus(string.Format("Reading {0}", compDef.Name));

            //
            CompBase compRead = ReadXmlFile(compDef.CompType, compDef.Name);

            if (compRead == null)
            {
                compRead = Activator.CreateInstance(compDef.CompType, compDef.Name) as CompBase;
            }
            else
            {
                CompBase child = Activator.CreateInstance(compDef.CompType, compDef.Name) as CompBase;
                compDef.CreateComponents(child);
                RecurseCleanUpChild(child, compRead, cleanUpMode);
            }
            compDef.CreateComponents(compRead);
            base.Add(compRead);
            compRead.Initialize();
        }