コード例 #1
0
ファイル: CViewManage.cs プロジェクト: wpmyj/Zhuangkao
 public void UpdateStudentlist(int devnum, CStuDevlist stulist)
 {
     foreach (CDevListview tmp in ControlList)
     {
         if (tmp.IntDevnum == devnum)
         {
             tmp.UpdateStudent(stulist);
             return;
         }
     }
 }
コード例 #2
0
 public CModel()
 {
     settings   = ModuleConfig.GetSettings();
     devmanager = new CDevManager();
     string[] tmpstr = settings.DevOrder.ToString().Split(',');
     DevNumber  = tmpstr.Length;
     studevlist = new CStuDevlist[DevNumber];
     for (int i = 0; i < DevNumber; i++)
     {
         studevlist[i]        = new CStuDevlist();
         studevlist[i].DevNum = Int16.Parse(tmpstr[i]);
         devmanager.Add(studevlist[i]);
     }
 }
コード例 #3
0
ファイル: CCtrl.cs プロジェクト: wpmyj/Zhuangkao
        private void Server_Event_Devlogout(int devnum)
        {
            CStuDevlist tmpDevList = (CStuDevlist)(model.devmanager.DevList[devnum]);

            if (tmpDevList == null)
            {
                return;
            }
            for (int i = 0; i < ((CStuDevlist)(model.devmanager.DevList[devnum])).Stumum; i++)
            {
                CStudent stu = model.devmanager.GetStudent(devnum, i);
                if (stu != null)
                {
                    DisplayStrings.DeleteString(stu.DisplayString(devnum));
                }
            }
            //displaycomm.ShowText(DisplayStrings.GetAllStrings());
            mainform.ReUpdateStuColor(devnum);
            mainform.ChangeDevStatus(devnum, DevStatus.未连接);
        }
コード例 #4
0
 public void UpdateStudentlist(int devnum, CStuDevlist stulist)
 {
     ViewManage.UpdateStudentlist(devnum, stulist);
 }
コード例 #5
0
 public void Remove(CStuDevlist dev)
 {
     DevList.Remove(dev.DevNum);
 }
コード例 #6
0
 public void Add(CStuDevlist dev)
 {
     DevList.Add(dev.DevNum, dev);
 }
コード例 #7
0
        public void UpdateStudent(CStuDevlist student)
        {
            if (devlistViewEx.InvokeRequired)
            {
                devlistViewEx.BeginInvoke(new ViewUpdatelinvoke(UpdateStudent), student);
            }
            else
            {
                devlistViewEx.Items.Clear();
                if (student.StudentList.Count > 0)
                {
                    ListViewItem Item0 = new ListViewItem();
                    Item0.SubItems.Clear();
                    Item0.SubItems[0].Text = "0";
                    Item0.SubItems.Add(((CStudent)student.StudentList[0]).xm);
                    Item0.SubItems.Add(((CStudent)student.StudentList[0]).zkzmbh);
                    if (Status == DevStatus.身份验证 || Status == DevStatus.正在考试)
                    {
                        Item0.ForeColor = Color.SeaShell;
                        Item0.SubItems[1].ForeColor = Color.SeaShell;
                        Item0.SubItems[2].ForeColor = Color.SeaShell;

                        Item0.BackColor = Color.Tan;
                        Item0.SubItems[1].BackColor = Color.Tan;
                        Item0.SubItems[2].BackColor = Color.Tan;
                    }
                    else
                    {
                        Item0.BackColor = Color.White;
                    }
                    Item0.ForeColor = Color.FromArgb(255, 69, 98, 135);
                    Item0.SubItems[1].ForeColor = Color.FromArgb(255, 69, 98, 135);
                    Item0.SubItems[2].ForeColor = Color.FromArgb(255, 69, 98, 135);
                    devlistViewEx.Items.Add(Item0);

                    for (int i = 1; i < student.StudentList.Count; i++)
                    {
                        ListViewItem Item = new ListViewItem();
                        Item.SubItems.Clear();
                        Item.SubItems[0].Text = i.ToString();
                        Item.SubItems.Add(((CStudent)student.StudentList[i]).xm);
                        Item.SubItems.Add(((CStudent)student.StudentList[i]).zkzmbh);
                        if ((i % 2) == 0)
                        {
                            Item.BackColor = Color.White;
                        }
                        else
                        {
                            Item.BackColor = Color.FromArgb(255, 214, 224, 236);
                            Item.SubItems[1].BackColor = Color.FromArgb(255, 214, 224, 236);
                            Item.SubItems[2].BackColor = Color.FromArgb(255, 214, 224, 236);

                        }
                        Item.ForeColor = Color.FromArgb(255, 69, 98, 135);
                        Item.SubItems[1].ForeColor = Color.FromArgb(255, 69, 98, 135);
                        Item.SubItems[2].ForeColor = Color.FromArgb(255, 69, 98, 135);
                        devlistViewEx.Items.Add(Item);
                    }
                }
            }
        }