コード例 #1
0
        public EntryEditor(Editor editor, Content.Section section, Content.Topic topic, Content.Entry entry)
        {
            InitializeComponent();
            this.editor  = editor;
            this.section = section;
            this.topic   = topic;
            this.entry   = entry;

            textBox.Text           = entry.GetText();
            isOpenCheckbox.Checked = entry.IsOpen();

            if (entry is Content.Challenge)
            {
                typeBox.SelectedIndex = (int)(entry as Content.Challenge).GetChallengeType();
                foreach (string str in (entry as Content.Challenge).GetAnswers())
                {
                    answersBox.Text += str + "\n";
                }
                practiceButton.Checked = true;
            }

            int selection = 0;

            foreach (Content.Topic item in section.GetTopics())
            {
                topicBox.Items.Add(item.GetTitle());
                if (item == topic)
                {
                    selection = topicBox.Items.Count - 1;
                }
            }
            topicBox.SelectedIndex = selection;

            displayControls();
        }
コード例 #2
0
 public EntryEditor(Editor editor, Content.Section section, Content.Topic topic)
 {
     InitializeComponent();
     this.editor           = editor;
     this.section          = section;
     this.topic            = topic;
     typeBox.SelectedIndex = 0;
     displayControls();
 }