public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, Exception innerException, params RedirectionLocation[] locations) : base(message, innerException) { if (type == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("type"); } if (message == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); } else if (message.Length == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("message", SR.GetString(SR.ParameterCannotBeEmpty)); } if (type.InternalType == RedirectionType.InternalRedirectionType.UseIntermediary || type.InternalType == RedirectionType.InternalRedirectionType.Resource) { if (locations == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("locations", SR.GetString(SR.RedirectMustProvideLocation)); } else if (locations.Length == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("locations", SR.GetString(SR.RedirectMustProvideLocation)); } } if (type.InternalType == RedirectionType.InternalRedirectionType.Cache && locations != null && locations.Length > 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.RedirectCacheNoLocationAllowed)); } if (locations == null) { //if we got here, then the redirect type doesn't care if there are locations... locations = EmptyArray<RedirectionLocation>.Instance; } this.Locations = new ReadOnlyCollection<RedirectionLocation>(locations); this.Type = type; this.Scope = scope; this.Duration = duration; }
public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, Exception innerException, params RedirectionLocation[] locations) : base(message, innerException) { if (type == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("type"); } if (message == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); } else if (message.Length == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("message", SR.GetString(SR.ParameterCannotBeEmpty)); } if (type.InternalType == RedirectionType.InternalRedirectionType.UseIntermediary || type.InternalType == RedirectionType.InternalRedirectionType.Resource) { if (locations == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("locations", SR.GetString(SR.RedirectMustProvideLocation)); } else if (locations.Length == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("locations", SR.GetString(SR.RedirectMustProvideLocation)); } } if (type.InternalType == RedirectionType.InternalRedirectionType.Cache && locations != null && locations.Length > 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.RedirectCacheNoLocationAllowed)); } if (locations == null) { //if we got here, then the redirect type doesn't care if there are locations... locations = EmptyArray <RedirectionLocation> .Instance; } this.Locations = new ReadOnlyCollection <RedirectionLocation>(locations); this.Type = type; this.Scope = scope; this.Duration = duration; }
public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, Exception innerException, params RedirectionLocation[] locations) : base(message, innerException) { if (type == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("type"); } if (message == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); } if (message.Length == 0) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("message", System.ServiceModel.SR.GetString("ParameterCannotBeEmpty")); } if ((type.InternalType == RedirectionType.InternalRedirectionType.UseIntermediary) || (type.InternalType == RedirectionType.InternalRedirectionType.Resource)) { if (locations == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("locations", System.ServiceModel.SR.GetString("RedirectMustProvideLocation")); } if (locations.Length == 0) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("locations", System.ServiceModel.SR.GetString("RedirectMustProvideLocation")); } } if (((type.InternalType == RedirectionType.InternalRedirectionType.Cache) && (locations != null)) && (locations.Length > 0)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(System.ServiceModel.SR.GetString("RedirectCacheNoLocationAllowed")); } if (locations == null) { locations = EmptyArray<RedirectionLocation>.Instance; } this.Locations = new ReadOnlyCollection<RedirectionLocation>(locations); this.Type = type; this.Scope = scope; this.Duration = duration; }
public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, Exception innerException, params RedirectionLocation[] locations) : base(message, innerException) { if (type == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("type"); } if (message == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); } if (message.Length == 0) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("message", System.ServiceModel.SR.GetString("ParameterCannotBeEmpty")); } if ((type.InternalType == RedirectionType.InternalRedirectionType.UseIntermediary) || (type.InternalType == RedirectionType.InternalRedirectionType.Resource)) { if (locations == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("locations", System.ServiceModel.SR.GetString("RedirectMustProvideLocation")); } if (locations.Length == 0) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("locations", System.ServiceModel.SR.GetString("RedirectMustProvideLocation")); } } if (((type.InternalType == RedirectionType.InternalRedirectionType.Cache) && (locations != null)) && (locations.Length > 0)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(System.ServiceModel.SR.GetString("RedirectCacheNoLocationAllowed")); } if (locations == null) { locations = EmptyArray <RedirectionLocation> .Instance; } this.Locations = new ReadOnlyCollection <RedirectionLocation>(locations); this.Type = type; this.Scope = scope; this.Duration = duration; }
public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, params RedirectionLocation[] locations) : this(message, type, duration, scope, null, locations) { }
public RedirectionException(RedirectionType type, RedirectionDuration duration, RedirectionScope scope, Exception innerException, params RedirectionLocation[] locations) : this(GetDefaultMessage(type, locations), type, duration, scope, innerException, locations) { }
public RedirectionException(string message, RedirectionType type, RedirectionDuration duration, RedirectionScope scope, RedirectionLocation[] locations) { Contract.Requires(!String.IsNullOrEmpty(message)); }
public RedirectionException(RedirectionType type, RedirectionDuration duration, RedirectionScope scope, RedirectionLocation[] locations) { }