/// <summary> /// 开始执行上下文中所有的内容 /// </summary> public void Commit() { while (_gEntityQueue.Count() > 0) { GenerateEntity queue = _gEntityQueue.Dequeue(); try { queue.GenerateEngin.Generate(queue.GenerateId, queue.GenerateArgment, queue.GenerateContainer); } catch (Exception ex) { MsgBoxHelp.ShowError(string.Format(Properties.Resource.GenerateError, PrjCmdId.FindProjectName(queue.GenerateId)), ex); } finally { if (GeneratedOne != null) { GeneratedOne(this, new EventGeneratedArg(queue.GenerateId, Count, KeywordContainer.Resove("$Entity$"))); } } } }
/// <summary> /// 将生成代码的参数注入到上下文中 /// </summary> /// <param name="gEntity">参数实体</param> public void injection(GenerateEntity gEntity) { _gEntityQueue.Enqueue(gEntity); }