Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            StudentCollection FirstCollect  = new StudentCollection(); //Liste d'eleve Numero 1
            StudentCollection SecondCollect = new StudentCollection(); //Liste d'eleve Numero 2

            FirstCollect.CollectionName  = "Collection numero 1";      //ChangeToRussian
            SecondCollect.CollectionName = "collection numero 2";      //ChangeToRussian
            StudentCollection[] FirstArray    = { FirstCollect };
            StudentCollection[] SecondArray   = { FirstCollect, SecondCollect };
            Journal             FirstJournal  = new Journal(FirstArray);  //Journal Numero 1
            Journal             SecondJournal = new Journal(SecondArray); //Journal Numero 2

            Console.WriteLine("-------------------------------------------Etape1");
            FirstCollect.AddDefaults();                                                                                                                                                                                                                                                                                                                                                                                                                                        //premiere modification sur une liste
            SecondCollect.AddDefaults();
            Student[] StudentToAdd = { new Student("Developpeur c#", 8977, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)), new Student("Developpeur c++", 8077, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)), new Student("Developpeur c", 18977, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)), new Student("Developpeur Javascript", 89770, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)) }; //ChangeToRussian
            FirstCollect.AddStudent(StudentToAdd);
            FirstCollect.Remove(1);
            FirstCollect.Remove(50);
            SecondCollect[0] = new Student("Developpeur Python", 2145, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5));                         //La reference A ete changer //ChangeToRussian
            SecondCollect.AddStudent(new Student[] { new Student("Developpeur Ruby", 77544, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)) }); //ChangeToRussian
            Console.WriteLine("--------------------------------------------Etape2");                                                                              //ChangeToRussian
            Console.WriteLine(FirstJournal.ToString());
            Console.WriteLine(SecondJournal.ToString());
            Console.WriteLine("-----------------------------------Etape 3");               //ChangeToRussian
            Console.WriteLine("Verifions le resume" + FirstCollect.ToString());            //ChangeToRussian
            Console.WriteLine("Verifions le court Resume" + FirstCollect.ToShortString()); //ChangeToRussian
        }
Ejemplo n.º 2
0
    public void AddDefaults()
    {
        Student StudentToAdd = new Student("Programmeur", 102201, GetVariables.getIntArrayList(5), GetVariables.getIntArrayList(5)); //ChangeToRussian

        StudentList.Add(StudentToAdd);
        if (StudentCountChanged != null)
        {
            StudentCountChanged(this, new StudentListHandlerEventArgs {
                CollectionName = this.CollectionName, ChangementType = "Un nouveau eleve ajouter", StudentWhoChange = StudentToAdd
            });                                                                                                                                                                                //ChangeToRussian
        }
    }