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"; } }
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); }