in Configurator/Core/Server/MySqlServerSettings.cs [1089:1150]
private void ExecuteCheckAction(string actionName, string key, string value, PropertyInfo propertyInfo = null)
{
switch (actionName)
{
case "CheckInteger":
if (!uint.TryParse(value, out var integer))
{
throw new InvalidOperationException(string.Format(Resources.NotProperValueForUInt, value));
}
break;
case "CheckPort":
if (!uint.TryParse(value, out var port))
{
throw new InvalidOperationException(string.Format(Resources.NotProperValueForUInt, value));
}
if (!Utilities.PortIsAvailable(port))
{
throw new Exception(string.Format(Resources.PortNotAvailable, value));
}
break;
case "CheckPassword":
var errorMessage = MySqlServerInstance.ValidatePassword(value, true);
if (!string.IsNullOrEmpty(errorMessage))
{
throw new Exception(string.Format(errorMessage));
}
break;
case "CheckServiceName":
if (Service.ExistsServiceInstance(value))
{
throw new Exception(string.Format(Resources.InvalidServiceName, value));
}
break;
case "CheckXPort":
if (!uint.TryParse(value, out var xPort))
{
throw new InvalidOperationException(string.Format(Resources.NotProperValueForUInt, value));
}
if (!Utilities.PortIsAvailable(xPort))
{
throw new Exception(string.Format(Resources.PortNotAvailable, value));
}
break;
case "CheckAbsolutePath":
var message = Utilities.ValidateAbsoluteFilePath(value, true);
if (!string.IsNullOrEmpty(message))
{
throw new Exception(string.Format(message, value));
}
break;
default:
throw new NotSupportedException(string.Format(Resources.CheckMethodNotSupported, actionName));
}
}