コード例 #1
0
ファイル: StudentPanel.cs プロジェクト: adampy/Trackr
        async public override void RefreshList()
        {
            /// <summary>
            /// Executed after opening the manage student tab.
            /// </summary>

            // Data
            Student[] students = await APIHandler.GetAllStudents();

            // List
            if (list != null)
            {
                list.Dispose();
            }
            list          = new ListPanel(this.parent.Width, students, typeof(StudentListItem));
            list.Location = new Point(0, 35);
            list.Width    = this.parent.Width;
            list.Height   = this.parent.Height - 35;
            this.Controls.Add(list);
        }
コード例 #2
0
        async private void GetAllNonGroupStudents()
        {
            Student[] students = await APIHandler.GetAllStudents();

            for (int i = 0; i < students.Length; i++)
            {
                Student student = students[i];

                // If student isnt in the group, then add them to the non group
                bool found = false;
                foreach (Student groupStudent in this.groupStudents)
                {
                    found = found || groupStudent.id == student.id;
                }

                if (!found)    // Student is not already in the group
                {
                    this.allNonGroupStudents.Add(student);
                }
            }
        }