protected void OnModify(ListModificationArgs modifyInfo)
 {
     if (ListModified != null)
     {
         Console.WriteLine("This is called when event fires");
         ListModified(this, modifyInfo);
     }
 }
        public override void Clear()
        {
            var al  = new ArrayList(this);
            var lma = new ListModificationArgs(DateTime.Now, al);

            OnModify(lma);
            base.Clear();
        }
        public override int Add(object value)
        {
            var al = new ArrayList();

            al.Add(value);
            var lma = new ListModificationArgs(DateTime.Now, al);

            OnModify(lma);
            return(base.Add(value));
        }
 public override object this[int pos]
 {
     get
     {
         return(base[pos]);
     }
     set
     {
         var al = new ArrayList();
         al.Add(value);
         var lma = new ListModificationArgs(DateTime.Now, al);
         OnModify(lma);
         base[pos] = value;
     }
 }
 public void SaveToFile(object list, ListModificationArgs modifyInfo)
 {
     streamWriter.WriteLine(modifyInfo.ToString());
     streamWriter.WriteLine("-------------------------");
     streamWriter.Flush();
 }
Exemple #6
0
 public void DisplayOnConsole(object list, ListModificationArgs modifyInfo)
 {
     Console.WriteLine(modifyInfo.ToString());
     Console.WriteLine("-------------------------");
 }