public static void Execute() { foreach (string tmpName in dicInject.Keys) { IInjector owner = dicInject[tmpName]; List <ITemplate> tmpList = dicTemplates[tmpName]; IInputValue inputVO = dicInput[tmpName]; IInitValue initVO = dicInit[tmpName]; FileSettingText setting = dicSetting[tmpName]; owner.Init(initVO); owner.Inject(inputVO, tmpList); foreach (ITemplate iTemp in tmpList) { string FileName = iTemp.GetType().ToString(); string writeContent = iTemp.TransformText(); string directoryPath = setting.SaveTo; string filePath = directoryPath + FileName; if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } File.WriteAllText(filePath, writeContent); } } }
protected virtual void Startup() { Injector.Init(); EventDispatcher.DispatchEvent(new FramewerkStartEvent()); }