示例#1
0
        /// <summary>
        /// 树节点被鼠标单击时触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //|| 或者    && 并且
            if (e.Node.Name == "StudentsList" || e.Node.Name == "ClassList" || e.Node.Name == "HeadTeacherList" || e.Node.Name == "TeacherList")
            {
                TabPage tabPage;
                if (!tabPages.Exists(x => x.Text == e.Node.Text))
                {
                    tabPage      = new TabPage();
                    tabPage.Text = e.Node.Text;
                    this.tabCtrl_Content.TabPages.Add(tabPage);
                    tabPages.Add(tabPage);
                }
                else
                {
                    tabPage = tabPages.FirstOrDefault(x => x.Text == e.Node.Text);
                }

                if (e.Node.Name == "StudentsList")
                {
                    StudentList studentList = new StudentList();
                    studentList.Dock = DockStyle.Fill;
                    tabPage.Controls.Clear();
                    tabPage.Controls.Add(studentList);
                }
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            StudentList list = new StudentList();

            //list.ReadFromFile(ConfigurationManager.AppSettings["InputFile"].ToString());
            //list.Display();
            list.WriteToFile(ConfigurationManager.AppSettings["OutputFile"].ToString());
            Console.ReadLine();
        }