diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-22 16:21:16 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-22 16:21:16 +0200 |
| commit | 3de0d44f88b713e7b018f470c7bd318a775345b7 (patch) | |
| tree | 7b5b2a1b50e4a9ab9e2f55269dd666133fd97e5e /Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs | |
| parent | e4498de8bf54d586d5af7d119b7c33ad4c0031b5 (diff) | |
| download | Tango-3de0d44f88b713e7b018f470c7bd318a775345b7.tar.gz Tango-3de0d44f88b713e7b018f470c7bd318a775345b7.zip | |
Implemented video recording on Data Capture Module!
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs index 6327196bc..a74e649c0 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs @@ -244,29 +244,34 @@ namespace Tango.SharedUI.Controls private void ScriptEditorControl_Loaded(object sender, RoutedEventArgs e) { - Stream xshd_stream = typeof(ScriptEditorControl).Assembly.GetManifestResourceStream("Tango.SharedUI.CSharp-Mode.xshd"); + if (HighlightTypes != null) + { + Stream xshd_stream = typeof(ScriptEditorControl).Assembly.GetManifestResourceStream("Tango.SharedUI.CSharp-Mode.xshd"); - String text = String.Empty; + String text = String.Empty; - using (StreamReader reader = new StreamReader(xshd_stream)) - { - text = reader.ReadToEnd(); - } + using (StreamReader reader = new StreamReader(xshd_stream)) + { + text = reader.ReadToEnd(); + } - String code = String.Empty; + String code = String.Empty; - foreach (var name in HighlightTypes.Select(x => x.Value).Select(x => x.Name)) - { - code += String.Format("<Word>{0}</Word>", name) + Environment.NewLine; - } - text = text.Replace("@CUSTOM_TYPES@", code); - using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(text))) - { - XmlTextReader xshd_reader = new XmlTextReader(ms); - textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(xshd_reader, ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance); - xshd_reader.Close(); + foreach (var name in HighlightTypes.Select(x => x.Value).Select(x => x.Name)) + { + code += String.Format("<Word>{0}</Word>", name) + Environment.NewLine; + } + + text = text.Replace("@CUSTOM_TYPES@", code); + + using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(text))) + { + XmlTextReader xshd_reader = new XmlTextReader(ms); + textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(xshd_reader, ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance); + xshd_reader.Close(); + } } } |
