/// <summary>
 /// 更新基础部件 有则更新无则增加
 /// </summary>
 /// <param name="item">基础部件</param>
 public void UpdateEventSchduleTaskItem(IIEventSchduleTask item)
 {
     if (_dicItems.ContainsKey(item.EventSchduleClassId))
     {
         _dicItems[item.EventSchduleClassId] = item;
         var args = new PublishEventArgs()
         {
             EventType = PublishEventType.Core,
             EventId   = Services.EventIdAssign.EventSchduleTaskComponentUpdate,
         };
         args.AddParams(item.EventSchduleClassId);
         EventPublish.PublishEvent(args);
     }
     else
     {
         _dicItems.Add(item.EventSchduleClassId, item);
         var args = new PublishEventArgs()
         {
             EventType = PublishEventType.Core,
             EventId   = Services.EventIdAssign.EventSchduleTaskComponentAdd,
         };
         args.AddParams(item.EventSchduleClassId);
         EventPublish.PublishEvent(args);
     }
 }
        //public EventSchduleTaskBase ()
        //{
        //    MaxAllowEvent = 0;
        //    EventSchduleDescription = "No Description";
        //    EventSchduleClassId = -1;
        //    EventSchduleName = "Not Set";
        //    EventSchduleViewId = -1;
        //}

        public EventSchduleTaskBase(IIEventSchduleTask info)
        {
            this.MaxAllowEvent           = info.MaxAllowEvent;
            this.EventSchduleDescription = info.EventSchduleDescription;
            this.EventSchduleClassId     = info.EventSchduleClassId;
            this.EventSchduleName        = info.EventSchduleName;
            this.EventSchduleViewId      = info.EventSchduleViewId;
        }
 /// <summary>
 /// 删除部件
 /// </summary>
 /// <param name="item">需要删除的部件</param>
 public void DeleteEventSchduleTaskItem(IIEventSchduleTask item)
 {
     if (_dicItems.ContainsKey(item.EventSchduleClassId))
     {
         _dicItems.Remove(item.EventSchduleClassId);
         var args = new PublishEventArgs()
         {
             EventType = PublishEventType.Core,
             EventId   = Services.EventIdAssign.EventSchduleTaskComponentDelete,
         };
         args.AddParams(item.EventSchduleClassId);
         EventPublish.PublishEvent(args);
     }
 }
 /// <summary>
 /// 有则更新无则增加
 /// </summary>
 /// <param name="item">基础部件</param>
 public void AdEventSchduleTaskItem(IIEventSchduleTask item)
 {
     UpdateEventSchduleTaskItem(item);
 }
 /// <summary>
 /// 获取是否已经包含该部件
 /// </summary>
 /// <param name="item">任务</param>
 /// <returns></returns>
 public static bool ContainsComponent(IIEventSchduleTask item)
 {
     return(_dicItems.ContainsKey(item.EventSchduleClassId));
 }