From 0ed3a4750449f2ac2c9c46d048bc92f389913b77 Mon Sep 17 00:00:00 2001 From: d0rj Date: Tue, 2 Feb 2021 19:48:59 +0300 Subject: [PATCH] Added new variable name change. --- MeerkatUI/Windows/MainWindow.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MeerkatUI/Windows/MainWindow.xaml.cs b/MeerkatUI/Windows/MainWindow.xaml.cs index 7e95fe9..273047a 100644 --- a/MeerkatUI/Windows/MainWindow.xaml.cs +++ b/MeerkatUI/Windows/MainWindow.xaml.cs @@ -20,6 +20,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged { private readonly TemplateEngine engine; private string openedTemplatePath = string.Empty; + private char NewVariableName = 'A'; private Settings settings = new Settings(); public Settings Settings @@ -81,6 +82,13 @@ private void HighlightString(string str) } + private void IncrementVariableName() + { + if (NewVariableName < 'Z') + ++NewVariableName; + } + + private void ProcessButton_Click(object sender, RoutedEventArgs e) { RefreshVariables(); @@ -135,7 +143,8 @@ private void IgnoreUnknown_Unchecked(object sender, RoutedEventArgs e) private void AddVariable(object sender, RoutedEventArgs e) { - Variables.Add(new Variable("A", "яблоко")); + Variables.Add(new Variable(NewVariableName.ToString(), "яблоко")); + IncrementVariableName(); }