/// <summary> /// Obtains the <see cref="String"/> name associated to the /// <paramref name="argument"/> provided. /// </summary> /// <param name="argument">The <see cref="ArgumentWithException"/> enumeration value /// which determines which name to retrieve.</param> /// <returns>A <see cref="String"/> associated to the /// name of the <paramref name="argument"/> provided.</returns> internal static string GetArgumentName(ArgumentWithException argument) { switch (argument) { case ArgumentWithException.argument: return("argument"); case ArgumentWithException.ctor: return("ctor"); case ArgumentWithException.message: return("message"); case ArgumentWithException.parameter: return("parameter"); default: throw ObtainArgumentException(ArgumentWithException.argument, ExceptionMessageId.UnknownArgument); } }
/// <summary> /// Obtains the <see cref="String"/> name associated to the /// <paramref name="argument"/> provided. /// </summary> /// <param name="argument">The <see cref="ArgumentWithException"/> enumeration value /// which determines which name to retrieve.</param> /// <returns>A <see cref="String"/> associated to the /// name of the <paramref name="argument"/> provided.</returns> internal static string GetArgumentName(ArgumentWithException argument) { switch (argument) { case ArgumentWithException.argument: return("argument"); case ArgumentWithException.genericLocalType: return("structuralTypeInfo"); case ArgumentWithException.globalMemberType: return("globalMemberType"); case ArgumentWithException.message: return("message"); default: throw ObtainArgumentException(ArgumentWithException.argument, ExceptionMessageId.UnknownArgument); } }
public static ArgumentException ObtainArgumentException(ArgumentWithException argument, ExceptionMessageId message, params string[] replacements) { return(new ArgumentException(GetExceptionMessage(message, replacements ?? emptyReplacements), GetArgumentName(argument))); }
public static ArgumentException ObtainArgumentException(ArgumentWithException argument, ExceptionMessageId message, string replacement1, string replacement2, string replacement3) { return(ObtainArgumentException(argument, message, new[] { replacement1, replacement2, replacement3 })); }
public static ArgumentException ObtainArgumentException(ArgumentWithException argument, ExceptionMessageId message) { return(ObtainArgumentException(argument, message, emptyReplacements)); }
public static ArgumentOutOfRangeException ObtainArgumentOutOfRangeException(ArgumentWithException argument) { return(new ArgumentOutOfRangeException(GetArgumentName(argument))); }
/// <summary> /// Obtains the <see cref="String"/> name associated to the /// <paramref name="argument"/> provided. /// </summary> /// <param name="argument">The <see cref="ArgumentWithException"/> enumeration value /// which determines which name to retrieve.</param> /// <returns>A <see cref="String"/> associated to the /// name of the <paramref name="argument"/> provided.</returns> internal static string GetArgumentName(ArgumentWithException argument) { switch (argument) { case ArgumentWithException.argument: return("argument"); case ArgumentWithException.array: return("array"); case ArgumentWithException.collections: return("collections"); case ArgumentWithException.ctor: return("ctor"); case ArgumentWithException.data: return("data"); case ArgumentWithException.decl: return("decl"); case ArgumentWithException.deviant: return("deviant"); case ArgumentWithException.direction: return("direction"); case ArgumentWithException.e: return("e"); case ArgumentWithException.elementType: return("elementType"); case ArgumentWithException.genericLocalType: return("structuralTypeInfo"); case ArgumentWithException.genericParameters: return("genericParameters"); case ArgumentWithException.genericType: return("genericType"); case ArgumentWithException.globalMemberType: return("globalMemberType"); case ArgumentWithException.identifier: return("identifier"); case ArgumentWithException.index: return("index"); case ArgumentWithException.item: return("item"); case ArgumentWithException.items: return("items"); case ArgumentWithException.key: return("key"); case ArgumentWithException.leftSide: return("leftSide"); case ArgumentWithException.length: return("length"); case ArgumentWithException.member: return("member"); case ArgumentWithException.message: return("message"); case ArgumentWithException.methodReplacements: return("methodReplacements"); case ArgumentWithException.name: return("name"); case ArgumentWithException.nameAndDelegateType: return("nameAndDelegateType"); case ArgumentWithException.nameAndType: return("nameAndType"); case ArgumentWithException.@namespace: return("namespace"); case ArgumentWithException.operation: return("operation"); case ArgumentWithException.owner: return("owner"); case ArgumentWithException.parameter: return("parameter"); case ArgumentWithException.part: return("part"); case ArgumentWithException.path: return("path"); case ArgumentWithException.rank: return("rank"); case ArgumentWithException.requirement: return("requirement"); case ArgumentWithException.rightSide: return("rightSide"); case ArgumentWithException.searchCriteria: return("searchCriteria"); case ArgumentWithException.series: return("series"); case ArgumentWithException.service: return("service"); case ArgumentWithException.signature: return("signature"); case ArgumentWithException.sizes: return("sizes"); case ArgumentWithException.source: return("source"); case ArgumentWithException.sourceElement: return("sourceElement"); case ArgumentWithException.subordinate: return("subordinate"); case ArgumentWithException.target: return("target"); case ArgumentWithException.TAssembly: return("TAssembly"); case ArgumentWithException.type: return("type"); case ArgumentWithException.typedName: return("typedName"); case ArgumentWithException.typeParameters: return("typeParameters"); case ArgumentWithException.typeReplacements: return("typeReplacements"); case ArgumentWithException.typeSymbol: return("typeSymbol"); case ArgumentWithException.underlyingSystemType: return("underlyingSystemType"); case ArgumentWithException.uniqueId: return("uniqueId"); case ArgumentWithException.value: return("value"); case ArgumentWithException.word: return("word"); default: throw ObtainArgumentException(ArgumentWithException.argument, ExceptionMessageId.UnknownArgument); } }