-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
79 lines (66 loc) · 2.19 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using ICSharpCode.AvalonEdit.CodeCompletion;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using KD.SDK2;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
namespace KD.Plugins.MobiscriptEditor
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
public SyntaxMode SyntaxMode {
get => _syntaxMode_private;
set
{
_syntaxMode_private = value;
if(value == SyntaxMode.AppliCatRuleScript)
{
textEditor.SyntaxHighlighting =
new ApplicatRuleScriptHighlightingDefinition();
}
else
{
textEditor.SyntaxHighlighting =
new BlockScriptHighlightingDefinition();
}
}
}
private SyntaxMode _syntaxMode_private;
public string Text { get => textEditor.Text; set => textEditor.Text = value; }
public double EditorFontSize { get => textEditor.FontSize; set => textEditor.FontSize = value; }
private void Save_Executed(object sender, ExecutedRoutedEventArgs e)
{
DialogResult = true;
}
private void Close_Executed(object sender, ExecutedRoutedEventArgs e)
{
DialogResult = false;
}
private void mainWindow_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
{
EditorFontSize += Math.Sign(e.Delta);
e.Handled = true;
}
}
private void mainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
{
}
private void mainWindow_LocationChanged(object sender, EventArgs e)
{
}
}
}