internal static void IfNullAndNullsAreIllegalThenThrow <T>(object value, System.ExceptionArgument argName) { if ((value == null) && (default(T) != null)) { ThrowArgumentNullException(argName); } }
internal static string GetArgumentName(System.ExceptionArgument argument) { switch (argument) { case System.ExceptionArgument.obj: return("obj"); case System.ExceptionArgument.dictionary: return("dictionary"); case System.ExceptionArgument.array: return("array"); case System.ExceptionArgument.info: return("info"); case System.ExceptionArgument.key: return("key"); case System.ExceptionArgument.collection: return("collection"); case System.ExceptionArgument.match: return("match"); case System.ExceptionArgument.converter: return("converter"); case System.ExceptionArgument.queue: return("queue"); case System.ExceptionArgument.stack: return("stack"); case System.ExceptionArgument.capacity: return("capacity"); case System.ExceptionArgument.index: return("index"); case System.ExceptionArgument.startIndex: return("startIndex"); case System.ExceptionArgument.value: return("value"); case System.ExceptionArgument.count: return("count"); case System.ExceptionArgument.arrayIndex: return("arrayIndex"); case System.ExceptionArgument.item: return("item"); } return(string.Empty); }
internal static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument, System.ExceptionResource resource) { throw new ArgumentOutOfRangeException(GetArgumentName(argument), SR.GetString(GetResourceName(resource))); }
internal static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument) { throw new ArgumentOutOfRangeException(GetArgumentName(argument)); }