コード例 #1
0
        private void SetEnvironmentForTeacher()
        {
            Button[] operationsButton =
            {
                new Button {
                    Height = 32, Width = 80, Content = "个人信息"
                },
                new Button {
                    Height = 32, Width = 80, Content = "题目管理"
                },
                new Button {
                    Height = 32, Width = 80, Content = "比赛管理"
                },
                new Button {
                    Height = 32, Width = 80, Content = "评测日志"
                },
                new Button {
                    Height = 32, Width = 80, Content = "发送消息"
                },
                new Button {
                    Height = 32, Width = 80, Content = "选手管理"
                },
                new Button {
                    Height = 32, Width = 80, Content = "离线评测"
                },
                new Button {
                    Height = 32, Width = 80, Content = "注销登录"
                }
            };
            operationsButton[0].Click += (o, args) => new ProfileManagement().ShowDialog();
            operationsButton[1].Click += (o, args) => new ProblemManagement().ShowDialog();
            operationsButton[2].Click += (o, args) => new CompetitionManagement().ShowDialog();
            operationsButton[3].Click += (o, args) =>
            {
                if (_judgeLogsForm == null)
                {
                    _judgeLogsForm         = new JudgeLogs();
                    _judgeLogsForm.Closed += (sender, eventArgs) => { _judgeLogsForm = null; };
                    _judgeLogsForm.Show();
                }
                else
                {
                    _judgeLogsForm.Activate();
                }
            };
            operationsButton[4].Click += (o, args) => new SendMessaging().ShowDialog();
            operationsButton[5].Click += (o, args) => new MembersManagement().ShowDialog();
            operationsButton[6].Click += (o, args) => new OfflineJudge().Show();
            operationsButton[7].Click += async(o, args) => await Logout();

            foreach (var t in operationsButton)
            {
                Operations.Items.Add(t);
            }
        }
コード例 #2
0
        private void SetEnvironmentForStudent()
        {
            Button[] operationsButton =
            {
                new Button {
                    Height = 32, Width = 80, Content = "个人信息"
                },
                new Button {
                    Height = 32, Width = 80, Content = "评测日志"
                },
                new Button {
                    Height = 32, Width = 80, Content = "离线评测"
                },
                new Button {
                    Height = 32, Width = 80, Content = "注销登录"
                }
            };
            operationsButton[0].Click += (o, args) => new ProfileManagement().ShowDialog();
            operationsButton[1].Click += (o, args) =>
            {
                if (_judgeLogsForm == null)
                {
                    _judgeLogsForm         = new JudgeLogs();
                    _judgeLogsForm.Closed += (sender, eventArgs) => { _judgeLogsForm = null; };
                    _judgeLogsForm.Show();
                }
                else
                {
                    _judgeLogsForm.Activate();
                }
            };
            operationsButton[2].Click += (o, args) => new OfflineJudge().Show();
            operationsButton[3].Click += async(o, args) => await Logout();

            foreach (var t in operationsButton)
            {
                Operations.Items.Add(t);
            }
        }