void Modify() { //Объекты string Object = ""; //Сортировка по возрастанию var sortedObjects = Objects.OrderByDescending(o => o.pCurrent); foreach (Object Obj in sortedObjects) { if (Obj.pCurrent == 0) { Object += "//" + Obj.Name + "[" + Obj.pCurrent + "]" + "\n"; } else { Object += Obj.Name + "[" + Obj.pCurrent + "]" + "\n"; } } ObjectsText.Text = Object; //Вопрос string[] Quest = Questions.Split('\r'); QuestionText.Text = Quest[1 + NubmerQuestion]; //Вопросы QuestionsText.Clear(); for (int i = 2 + NubmerQuestion; i < Quest.Length; i++) { QuestionsText.Text += Quest[i] + "\n"; } }
private void OpenFileButton_Click(object sender, EventArgs e) { //Очистка RichTextBox и открытие файла AutorText.Clear(); QuestionsText.Clear(); QuestionText.Clear(); ObjectsText.Clear(); openFile.ShowDialog(); string path = openFile.FileName; parser.ParseFile(path); Questions = parser.Questions; Autor = parser.Autor; Objects = parser.Objects; NubmerQuestion = 0; Reload(); GoButton.Enabled = true; }