/// <summary> /// /// </summary> /// <param name="items"></param> public TypeCollection(TypeCollection items) { this.AddRange(items); }
/// <summary> /// /// </summary> /// <param name="items"></param> public void AddRange(TypeCollection items) { this.InnerList.AddRange(items); }
/// <summary> /// /// </summary> /// <param name="items"></param> public TypeCollection(TypeCollection items) { this.AddRange(items); }
/// <summary> /// /// </summary> /// <param name="items"></param> public void AddRange(TypeCollection items) { this.InnerList.AddRange(items); }
/// <summary> /// /// </summary> /// <param name="errorCodes"></param> /// <param name="exceptions"></param> /// <param name="httpStatusCodes"></param> public ExceptionFilter(string errorCodes, string exceptions, string httpStatusCodes) { mTriggerErrorCodes = ParseTriggerErrorCodes(errorCodes); mTriggerHttpStatusCodes = ParseTriggerHttpStatusCodes(httpStatusCodes); mTriggerExceptions = ParseTriggerExceptions(exceptions); }
/// <summary> /// Converts comma-separated list of exception type names into the appropriate TypeCollection ready to set into the filter. /// </summary> /// <param name="configString"></param> /// <returns></returns> public static TypeCollection ParseTriggerExceptions(string configString) { if (configString == null || configString.Length == 0) return null; TypeCollection outCollection = new TypeCollection(); string[] tokens = configString.Split(SEPS); for (int i = 0; i < tokens.Length; i++) { string typename = tokens[i]; Type t = null; // Normally you must fully-qualify the name, e.g. eBay.Service.Core.Sdk.ApiException. // We allow shorthand for the 3 obvious ones. if (tokens[i].ToLower(System.Globalization.CultureInfo.InvariantCulture).Equals("apiexception")) t = typeof(ApiException); else if (tokens[i].ToLower(System.Globalization.CultureInfo.InvariantCulture).Equals("httpexception")) t = typeof(HttpException); else if (tokens[i].ToLower(System.Globalization.CultureInfo.InvariantCulture).Equals("sdkexception")) t = typeof(SdkException); else t = Type.GetType(tokens[i]); outCollection.Add(t); } return outCollection; }