コード例 #1
0
        private void GetQuestionsFromXmls()
        {
            try
            {
                Log.Write("GetQuestionsFromXmls() was Started");
                questionModelList = new List <QuestionModel>();
                var questList = new List <string>();
                questList = XmlManagerController.GetQuestions();
                questList.ForEach(e =>
                {
                    questionModelList.Add(new QuestionModel()
                    {
                        Question = e
                    });
                });

                impactModelList = new List <QuestionForExcel>();
                var excelQuestList = XmlManagerController.GetExcelQuestions();
                foreach (var excelQuest in excelQuestList)
                {
                    impactModelList.Add(new QuestionForExcel()
                    {
                        ExcelColumnNumber = excelQuest.Key, Question = excelQuest.Value
                    });
                }
                Log.Write("GetQuestionsFromXmls() was Done");
            }
            catch (Exception e)
            {
                Log.Write("Error was catched in MainWindow.GetQuestionsFromXmls(): " + e);
                Application.Current.Shutdown();
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Idanpor/CheckListTool
        private void InitUI()
        {
            var questList = XmlManagerController.GetQuestions();

            foreach (var quest in questList)
            {
                var quest1 = new Question()
                {
                    Parent = flowLayoutPanel1
                };
                quest1.SetQuestion(quest);
                flowLayoutPanel1.Controls.Add(quest1);
            }

            var excelQuestList = XmlManagerController.GetExcelQuestions();

            foreach (var excelQuest in excelQuestList)
            {
                var quest1 = new QuestionForExcel()
                {
                    Parent            = ExcelQuestfLPanel,
                    ExcelColumnNumber = excelQuest.Key
                };
                quest1.SetQuestion(excelQuest.Value);
                ExcelQuestfLPanel.Controls.Add(quest1);
            }
        }