Exemple #1
0
        public override void Add(DailyItem item)
        {
            if (item != null && _items.Where(p => p.Name.Equals(item.Name)).Count() != 0)
            {
                throw new DuplicateDailyItemException(item.Name);
            }

            base.Add(item);
        }
Exemple #2
0
        public virtual bool AddDailyItem(DailyItem item)
        {
            bool isSuccess = false;

            if (_plan != null && _plan.Items != null)
            {
                _plan.Items.Add(item);
                isSuccess = true;
            }
            return(isSuccess);
        }
Exemple #3
0
        protected override void CheckItem(DailyItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (!(item is ScheduleItem))
            {
                throw new InvalidTypeException(typeof(ScheduleItem), item.GetType());
            }
        }