Code review

This commit is contained in:
JustArchi
2016-04-12 19:12:45 +02:00
parent e9d8f271a2
commit 4a36345635
16 changed files with 68 additions and 24 deletions

View File

@@ -26,6 +26,7 @@ using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace ConfigGenerator {
@@ -121,6 +122,9 @@ namespace ConfigGenerator {
return;
}
// Get rid of any potential whitespaces in bot name
input = Regex.Replace(input, @"\s+", "");
configPage.ASFConfig.Rename(input);
configPage.RefreshText();
} else if (e.TabPage == NewTab) {
@@ -144,6 +148,9 @@ namespace ConfigGenerator {
return;
}
// Get rid of any potential whitespaces in bot name
input = Regex.Replace(input, @"\s+", "");
foreach (ASFConfig config in ASFConfig.ASFConfigs) {
if (Path.GetFileNameWithoutExtension(config.FilePath).Equals(input)) {
Logging.LogGenericError("Bot with such name exists already!");