Esempio n. 1
0
        public bool Remove(int j)
        {
            if (j <= 0 && j >= LectList.Count)
            {
                return(false);
            }
            LectList.RemoveAt(j);
            LecturerListHandlerEventArgs e = new LecturerListHandlerEventArgs(CollectionName, "The lecturer was recently deleted.", LectList[j]);

            OnLecturerChanges(e);
            return(true);
        }
Esempio n. 2
0
 public Lecturer this[int index]
 {
     get
     {
         return(LectList.ElementAt(index));
     }
     set
     {
         LecturerListHandlerEventArgs e = new LecturerListHandlerEventArgs(CollectionName, "Item of collection was changed.", value);
         OnLecturerReferenceChanged(e);
         LectList[index] = value;
     }
 }
Esempio n. 3
0
 public void AddLecturers(params Lecturer[] l)
 {
     if (LectList == null)
     {
         LectList = new List <Lecturer>();
     }
     LectList.AddRange(l);
     foreach (var el in l)
     {
         LecturerListHandlerEventArgs e = new LecturerListHandlerEventArgs(CollectionName, "The lecturer was recently added.", el);
         OnLecturerChanges(e);
     }
 }
Esempio n. 4
0
 public void AddDefaults()
 {
     if (LectList == null)
     {
         LectList = new List <Lecturer>();
     }
     LectList.Add(new Lecturer());
     foreach (var el in LectList)
     {
         LecturerListHandlerEventArgs e = new LecturerListHandlerEventArgs(CollectionName, "The lecturer was recently deleted.", el);
         OnLecturerChanges(e);
     }
 }
Esempio n. 5
0
 protected virtual void OnLecturerReferenceChanged(LecturerListHandlerEventArgs e)
 {
     LecturerReferenceChanged?.Invoke(this, e);
 }
Esempio n. 6
0
 protected virtual void OnLecturerChanges(LecturerListHandlerEventArgs e)
 {
     LecturersCountChanged?.Invoke(this, e);
 }