private static string GetArgumentName(ExceptionArgument argument) { switch (argument) { case ExceptionArgument.dictionary: return("dictionary"); case ExceptionArgument.array: return("array"); case ExceptionArgument.key: return("key"); case ExceptionArgument.value: return("value"); case ExceptionArgument.startIndex: return("startIndex"); case ExceptionArgument.index: return("index"); case ExceptionArgument.capacity: return("capacity"); case ExceptionArgument.collection: return("collection"); case ExceptionArgument.item: return("item"); case ExceptionArgument.converter: return("converter"); case ExceptionArgument.match: return("match"); case ExceptionArgument.count: return("count"); case ExceptionArgument.action: return("action"); case ExceptionArgument.comparison: return("comparison"); case ExceptionArgument.source: return("source"); case ExceptionArgument.length: return("length"); case ExceptionArgument.destinationArray: return("destinationArray"); default: RoslynDebug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); return(""); } }
private static string GetResourceString(ExceptionResource resource) { switch (resource) { case ExceptionResource.ArgumentOutOfRange_Index: return(SR.ArgumentOutOfRange_Index); case ExceptionResource.ArgumentOutOfRange_Count: return(SR.ArgumentOutOfRange_Count); case ExceptionResource.Arg_ArrayPlusOffTooSmall: return(SR.Arg_ArrayPlusOffTooSmall); case ExceptionResource.Arg_RankMultiDimNotSupported: return(SR.Arg_RankMultiDimNotSupported); case ExceptionResource.Arg_NonZeroLowerBound: return(SR.Arg_NonZeroLowerBound); case ExceptionResource.ArgumentOutOfRange_ListInsert: return(SR.ArgumentOutOfRange_ListInsert); case ExceptionResource.ArgumentOutOfRange_NeedNonNegNum: return(SR.ArgumentOutOfRange_NeedNonNegNum); case ExceptionResource.ArgumentOutOfRange_SmallCapacity: return(SR.ArgumentOutOfRange_SmallCapacity); case ExceptionResource.Argument_InvalidOffLen: return(SR.Argument_InvalidOffLen); case ExceptionResource.ArgumentOutOfRange_BiggerThanCollection: return(SR.ArgumentOutOfRange_BiggerThanCollection); case ExceptionResource.NotSupported_KeyCollectionSet: return(SR.NotSupported_KeyCollectionSet); case ExceptionResource.NotSupported_ValueCollectionSet: return(SR.NotSupported_ValueCollectionSet); case ExceptionResource.InvalidOperation_IComparerFailed: return(SR.InvalidOperation_IComparerFailed); default: RoslynDebug.Fail("The enum value is not defined, please check the ExceptionResource Enum."); return(""); } }