aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2017-12-09 00:31:12 +0200
committerRoy <roy.mail.net@gmail.com>2017-12-09 00:31:12 +0200
commitcf7af2bc991e99b9dc82f4f54784d0eaa9a043b0 (patch)
treeb87a44c720b745294eb021b4393a43d480da3961 /Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
parentdb4db5d05b42cbc795b3a38bba3e6c87f30d583f (diff)
downloadTango-cf7af2bc991e99b9dc82f4f54784d0eaa9a043b0.tar.gz
Tango-cf7af2bc991e99b9dc82f4f54784d0eaa9a043b0.zip
Stubs execution utility almost done.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
index 0551de699..97ac4f497 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
@@ -260,6 +260,28 @@ namespace Tango.SharedUI.Controls
public static readonly DependencyProperty SaveCommandProperty =
DependencyProperty.Register("SaveCommand", typeof(RelayCommand), typeof(ScriptEditorControl), new PropertyMetadata(null));
+
+
+ public RelayCommand<String> InsertSnippetCommand
+ {
+ get { return (RelayCommand<String>)GetValue(InsertSnippetCommandProperty); }
+ set { SetValue(InsertSnippetCommandProperty, value); }
+ }
+ public static readonly DependencyProperty InsertSnippetCommandProperty =
+ DependencyProperty.Register("InsertSnippetCommand", typeof(RelayCommand<String>), typeof(ScriptEditorControl), new PropertyMetadata(null,(d,e) => (d as ScriptEditorControl).OnInsertScriptCommandChanged()));
+
+ private void OnInsertScriptCommandChanged()
+ {
+ if (InsertSnippetCommand != null)
+ {
+ InsertSnippetCommand.Executed += (x, snippet) =>
+ {
+ textEditor.Document.Insert(textEditor.TextArea.Caret.Offset, snippet);
+ };
+ }
+ }
+
+
#endregion
private void textEditor_TextChanged(object sender, EventArgs e)