warnings fixed
This commit is contained in:
parent
d7a699f8d1
commit
148ad19fae
@ -261,7 +261,7 @@ public class DtsodV21 : Dictionary<string, dynamic>, IDtsod
|
||||
break;
|
||||
default:
|
||||
throw new Exception($"Dtsod.Parse.ReadValue() error: value= wrong type <u{stringValue[stringValue.Length - 1]}>");
|
||||
};
|
||||
}
|
||||
}
|
||||
// short; long; int
|
||||
else
|
||||
@ -278,7 +278,7 @@ public class DtsodV21 : Dictionary<string, dynamic>, IDtsod
|
||||
break;
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder defaultValueBuilder = new();
|
||||
@ -303,7 +303,8 @@ public class DtsodV21 : Dictionary<string, dynamic>, IDtsod
|
||||
case ValueType.Default:
|
||||
ParseValueToRightType(defaultValueBuilder.ToString());
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
return value;
|
||||
case '[':
|
||||
value = ReadList();
|
||||
|
||||
@ -202,10 +202,15 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
||||
: throw new Exception("can't parse value:" + value_str);
|
||||
default:
|
||||
if (value_str.Contains('.'))
|
||||
return (object)(value_str.ToDouble());
|
||||
// ReSharper disable once RedundantCast
|
||||
return (object)value_str.ToDouble();
|
||||
else
|
||||
{
|
||||
try { return (object)(value_str.ToInt()); }
|
||||
try
|
||||
{
|
||||
// ReSharper disable once RedundantCast
|
||||
return (object)value_str.ToInt();
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
Log("r", $"can't parse value: {value_str}");
|
||||
|
||||
@ -4,12 +4,10 @@ namespace DTLib.Logging.DependencyInjection;
|
||||
|
||||
public class LoggerService<TCaller> : ServiceDescriptor
|
||||
{
|
||||
DTLib.Logging.New.ILogger _logger;
|
||||
|
||||
// ReSharper disable once RedundantNameQualifier
|
||||
public LoggerService(DTLib.Logging.New.ILogger logger) : base(
|
||||
typeof(Microsoft.Extensions.Logging.ILogger<TCaller>),
|
||||
new MyLoggerWrapper<TCaller>(logger))
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
using DTLib.Logging.New;
|
||||
using Microsoft.Extensions.Logging;
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
|
||||
namespace DTLib.Logging.DependencyInjection;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ public class DefaultLogFormat : ILogFormat
|
||||
sb.Append('[').Append(severity.ToString()).Append(']');
|
||||
if (sb.Length != 0)
|
||||
sb.Append(": ");
|
||||
sb.Append(message.ToString());
|
||||
sb.Append(message);
|
||||
sb.Append('\n');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public static class StringConverter
|
||||
public static List<string> SplitToList(this string s, int length)
|
||||
{
|
||||
List<string> parts = new();
|
||||
int max = (int)(s.Length / length);
|
||||
int max = s.Length / length;
|
||||
for (int i = 0; i < max; i++)
|
||||
parts.Add(s.Substring(i * length, length));
|
||||
if (max * length != s.Length) parts.Add(s.Substring(max * length, s.Length - max * length));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user