//--------------------------------------------------------------------- private PlugIn[] LoadAndInitPlugIns(PlugInAndInitFile[] plugIns) { PlugIn[] loadedPlugIns = new PlugIn[plugIns.Length]; foreach (int i in Indexes.Of(plugIns)) { PlugInAndInitFile plugInAndInitFile = plugIns[i]; UI.WriteLine("Loading {0} plug-in ...", plugInAndInitFile.Info.Name); PlugIn loadedPlugIn = Loader.Load <PlugIn>(plugInAndInitFile.Info); loadedPlugIn.Initialize(plugInAndInitFile.InitFile, this); loadedPlugIns[i] = loadedPlugIn; if (loadedPlugIn is PlugIns.I2PhaseInitialization) { plugInsWith2PhaseInit.Add((PlugIns.I2PhaseInitialization)loadedPlugIn); } if (loadedPlugIn is PlugIns.ICleanUp) { plugInsWithCleanUp.Add((PlugIns.ICleanUp)loadedPlugIn); } } return(loadedPlugIns); }
//--------------------------------------------------------------------- private void Run(PlugIn plugIn) { UI.WriteLine("Running {0} ...", plugIn.Name); plugIn.Run(); }
//--------------------------------------------------------------------- private bool IsPlugInTimestep(PlugIn plugIn) { return((plugIn.Timestep > 0) && (timeSinceStart % plugIn.Timestep == 0)); }