void UpdateWindowContents(QuestTemplate quest) { txtIndexNumber.Text = quest.IndexNumber.ToString(); lstMessages.Items.Clear(); lstQuests.Items.Clear(); foreach (TalkData msg in quest.Messages) { lstMessages.Items.Add(msg); } foreach (QuestData qst in quest.Quests) { lstQuests.Items.Add(qst); } }
private void btnNew_Click(object sender, EventArgs e) { ApplyWindowContents(); QuestTemplate quest = new QuestTemplate(); _area.Quests.Add( quest ); UpdateQuestList(); SetControlAvailability(); questList.SelectedIndex = questList.Items.Count - 1; UpdateWindowContents(quest); _parent.UpdateStatusBar(); }