Beispiel #1
0
        /// <summary>
        /// 执行上下文
        /// </summary>

        public void Commit()
        {
            while (_rEntityQueue.Count() > 0)
            {
                ReferenceEntity queue = _rEntityQueue.Dequeue();
                try
                {
                    Project       proj   = TemplateContainer.Resove <Project>(queue.ProjectId);
                    List <string> refers = queue.ReferenceCollection;
                    if (refers != null && refers.Count > 0)
                    {
                        refers.ForEach(t =>
                        {
                            proj.AddReferByKey(t);
                        });
                    }
                }
                catch (Exception ex)
                {
                    MsgBoxHelp.ShowError(string.Format(Properties.Resource.ReferError, PrjCmdId.FindProjectName(queue.ProjectId)), ex);
                }
                finally
                {
                    if (HandledOne != null)
                    {
                        HandledOne(this, new EventHandledArg(queue.ProjectId, Count));
                    }
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// 将引用注入上下文
 /// </summary>
 /// <param name="gEntity"></param>
 public void injection(ReferenceEntity gEntity)
 {
     _rEntityQueue.Enqueue(gEntity);
 }