示例#1
0
文件: Program.cs 项目: Makarova13/Uni
        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);
        }
示例#2
0
文件: Program.cs 项目: Makarova13/Uni
 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;
     }
 }
示例#3
0
文件: Program.cs 项目: Makarova13/Uni
 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);
     }
 }
示例#4
0
文件: Program.cs 项目: Makarova13/Uni
 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);
     }
 }
示例#5
0
文件: Program.cs 项目: Makarova13/Uni
 protected virtual void OnLecturerReferenceChanged(LecturerListHandlerEventArgs e)
 {
     LecturerReferenceChanged?.Invoke(this, e);
 }
示例#6
0
文件: Program.cs 项目: Makarova13/Uni
 protected virtual void OnLecturerChanges(LecturerListHandlerEventArgs e)
 {
     LecturersCountChanged?.Invoke(this, e);
 }