Beispiel #1
0
 private void CodeTextBox_TextChanged(object sender, EventArgs e)
 {
     if (_enableTextChangeEvent)
     {
         ActiveCodeSectionManager.ReplaceCodeInsideSection(_activeSectionId, XCodeTextBox.Text);
         if ((bool)XAutoCompileButton.IsChecked)
         {
             TryToUpdateAndCompileFXSourceCode();
         }
     }
 }
Beispiel #2
0
 private void XCodeSectionTabControl_SectionChangedHandler(object o, CodeSectionTabControl.SectionChangedEventArgs e)
 {
     if (o is CodeSectionTabControl)
     {
         ActiveCodeSectionManager        = e.CodeSectionManager;
         _activeSectionId                = e.CodeSection.Id;
         XCodeTextBox.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition(ActiveCodeSectionManager.CodeDefinition.LangageAbbrev);
         _enableTextChangeEvent          = false;
         XCodeTextBox.Text               = ActiveCodeSectionManager.GetSectionCode(_activeSectionId);
         _errorHighlightRenderer.CurrentCodeSectionStartLine = ActiveCodeSectionManager.GetCodeSectionStartLine(_activeSectionId);
         _enableTextChangeEvent             = true;
         XUseExternalEditorButton.IsEnabled = ActiveCodeSectionManager.CodeDefinition.LangageAbbrev == "HLSL";
     }
 }
Beispiel #3
0
        public bool Compile()
        {
            if (_metaOperator == null)
            {
                return(false);
            }

            int keepCurrentLineNumer = XCodeTextBox.CaretOffset;

            TryToUpdateAndCompileFXSourceCode();
            UpdateAndCompileScriptSourceCode();

            App.Current.UpdateRequiredAfterUserInteraction = true;

            // Update text editor
            XCodeTextBox.Text        = ActiveCodeSectionManager.GetSectionCode(_activeSectionId);
            XCodeTextBox.CaretOffset = Math.Min(keepCurrentLineNumer, XCodeTextBox.Text.Count() - 1);
            return(true);
        }