Пример #1
0
 public bool RemoveAt(int index)
 {
     if ((index >= 0) && (index < items.Count))
     {
         Operation value = items[index];
         items.RemoveAt(index);
         NotifyRemoving?.Invoke(this, new OperationEventArgs(value, OperationAction.Remove));
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
        public bool Remove(DateTime date, decimal value)
        {
            int index = items.FindIndex(item => (item.Date == date) && (item.Value == value));

            if (index == -1)
            {
                return(false);
            }
            else
            {
                Operation removingItem = items[index];
                items.RemoveAt(index);
                NotifyRemoving?.Invoke(this, new OperationEventArgs(removingItem, OperationAction.Remove));
                return(true);
            }
        }