예제 #1
0
        public TheoryRedactor(Theory control)
        {
            TheoryControl = control;
            InitializeComponent();

            if (TheoryControl.TheoryLessonSet != null)
            {
                if (TheoryControl.TheoryLessonSet.TheoryText.Length != 0)
                {
                    TextBox prtb = new TextBox()
                    {
                        Name = "TheoryLabel" /*+ labelId*/, Width = 410, Multiline = true, Text = TheoryControl.TheoryLessonSet.TheoryText
                    };
                    labelId++;

                    VisibleTheory.Controls.Add(prtb);
                    prtb.TextChanged += new EventHandler(prtb_TextChanged);
                }

                if (TheoryControl.TheoryLessonSet.CodeId != -1)
                {
                    Scintilla Scintilla = new Scintilla()
                    {
                        Name = "CodeLabel" /*+ codeId*/, Width = 410
                    };
                    codeId++;

                    using (ForumContainer container = new ForumContainer())
                    {
                        var code = container.CodeSet.First(x => x.CodeId == TheoryControl.TheoryLessonSet.CodeId);
                        updateCodeId   = code.CodeId;
                        Scintilla.Text = Encoding.UTF8.GetString(code.BinaryFileData);
                    }

                    VisibleTheory.Controls.Add(Scintilla);

                    Scintilla.Click       += Scintilla_Click;
                    Scintilla.TextChanged += Scintilla_TextChanged;

                    TextArea = Scintilla;
                    LoadScintilla();
                }

                UpdateState = true;
            }
        }
예제 #2
0
 public List <Theory> Theories = new List <Theory>(); public void AddTheory(Theory theory)
 {
     Theories.Add(theory); theory.Position = TheoryQuestPosition; TheoryQuestPosition++;
 }