示例#1
0
 internal ArgumentUtilitiesHandle(T value, string name, bool isPropertyValue, ExceptionFactoryDelegate2 exceptionFactory)
 {
     Value            = value;
     Name             = string.IsNullOrEmpty(name) ? nameof(name) : name;
     IsProp           = isPropertyValue;
     ExceptionFactory = exceptionFactory;
 }
示例#2
0
 internal ArgumentUtilitiesHandle(T value, string name)
 {
     Value            = value;
     Name             = string.IsNullOrEmpty(name) ? nameof(name) : name;
     IsProp           = false;
     ExceptionFactory = null;
 }
示例#3
0
        // TODO: Put strings into the resources.
        //
        internal static Exception Internal_CreateNullValueException(bool isPropertyValue, string name, ExceptionFactoryDelegate2 exceptionFactory = default)
        {
            var exceptionMessage = isPropertyValue ? $"Не указано значение свойства '{name}'." : $"Значение не может быть '{FormatStringUtilitiesCoreL0.GetNullValueText()}'.";

            return
                (exceptionFactory?.Invoke(message: exceptionMessage)
                 ?? new ArgumentNullException(message: exceptionMessage, paramName: name));
        }
示例#4
0
 public static ArgumentUtilitiesHandle <T> PropArg <T>(this T value, string name, ExceptionFactoryDelegate2 exceptionFactory)
 => new ArgumentUtilitiesHandle <T>(value: value, name: name, isPropertyValue: true, exceptionFactory: exceptionFactory);