mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Added new section to handle the PreventTransferForClassNames settings.
This commit is contained in:
parent
afa461f956
commit
a54f1e5381
17 changed files with 484 additions and 35 deletions
|
|
@ -10,14 +10,19 @@ namespace ServerManagerTool.Common.Utils
|
|||
{
|
||||
public const string DEFAULT_CULTURE_CODE = "en-US";
|
||||
|
||||
public static string GetPropertyValue(object value, PropertyInfo property)
|
||||
public static string GetPropertyValue(object value, PropertyInfo property, bool quotedString = true)
|
||||
{
|
||||
string convertedVal;
|
||||
|
||||
if (property.PropertyType == typeof(float))
|
||||
convertedVal = ((float)value).ToString("0.000000####", CultureInfo.GetCultureInfo(DEFAULT_CULTURE_CODE));
|
||||
else if (property.PropertyType == typeof(string))
|
||||
convertedVal = $"\"{value}\"";
|
||||
{
|
||||
if (quotedString)
|
||||
convertedVal = $"\"{value}\"";
|
||||
else
|
||||
convertedVal = $"{value}";
|
||||
}
|
||||
else
|
||||
convertedVal = Convert.ToString(value, CultureInfo.GetCultureInfo(DEFAULT_CULTURE_CODE));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue