1 /* ****************************************************************************
\r
3 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5 * This software is subject to the Microsoft Public License (Ms-PL).
\r
6 * A copy of the license can be found in the license.htm file included
\r
7 * in this distribution.
\r
9 * You must not remove this notice, or any other, from this software.
\r
11 * ***************************************************************************/
\r
13 namespace System.Web.Mvc {
\r
15 using System.Globalization;
\r
16 using System.Web.Mvc.Async;
\r
17 using System.Web.Mvc.Resources;
\r
19 internal static class Error {
\r
21 public static InvalidOperationException AsyncActionMethodSelector_CouldNotFindMethod(string methodName, Type controllerType) {
\r
22 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.AsyncActionMethodSelector_CouldNotFindMethod,
\r
23 methodName, controllerType);
\r
24 return new InvalidOperationException(message);
\r
27 public static InvalidOperationException AsyncCommon_AsyncResultAlreadyConsumed() {
\r
28 return new InvalidOperationException(MvcResources.AsyncCommon_AsyncResultAlreadyConsumed);
\r
31 public static InvalidOperationException AsyncCommon_ControllerMustImplementIAsyncManagerContainer(Type actualControllerType) {
\r
32 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.AsyncCommon_ControllerMustImplementIAsyncManagerContainer,
\r
33 actualControllerType);
\r
34 return new InvalidOperationException(message);
\r
37 public static ArgumentException AsyncCommon_InvalidAsyncResult(string parameterName) {
\r
38 return new ArgumentException(MvcResources.AsyncCommon_InvalidAsyncResult, parameterName);
\r
41 public static ArgumentOutOfRangeException AsyncCommon_InvalidTimeout(string parameterName) {
\r
42 return new ArgumentOutOfRangeException(parameterName, MvcResources.AsyncCommon_InvalidTimeout);
\r
45 public static InvalidOperationException ReflectedAsyncActionDescriptor_CannotExecuteSynchronously(string actionName) {
\r
46 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.ReflectedAsyncActionDescriptor_CannotExecuteSynchronously,
\r
48 return new InvalidOperationException(message);
\r
51 public static InvalidOperationException ChildActionOnlyAttribute_MustBeInChildRequest(ActionDescriptor actionDescriptor) {
\r
52 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.ChildActionOnlyAttribute_MustBeInChildRequest,
\r
53 actionDescriptor.ActionName);
\r
54 return new InvalidOperationException(message);
\r
57 public static ArgumentException ParameterCannotBeNullOrEmpty(string parameterName) {
\r
58 return new ArgumentException(MvcResources.Common_NullOrEmpty, parameterName);
\r
61 public static InvalidOperationException PropertyCannotBeNullOrEmpty(string propertyName) {
\r
62 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.Common_PropertyCannotBeNullOrEmpty,
\r
64 return new InvalidOperationException(message);
\r
67 public static SynchronousOperationException SynchronizationContextUtil_ExceptionThrown(Exception innerException) {
\r
68 return new SynchronousOperationException(MvcResources.SynchronizationContextUtil_ExceptionThrown, innerException);
\r
71 public static InvalidOperationException ViewDataDictionary_WrongTModelType(Type valueType, Type modelType) {
\r
72 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.ViewDataDictionary_WrongTModelType,
\r
73 valueType, modelType);
\r
74 return new InvalidOperationException(message);
\r
77 public static InvalidOperationException ViewDataDictionary_ModelCannotBeNull(Type modelType) {
\r
78 string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.ViewDataDictionary_ModelCannotBeNull,
\r
80 return new InvalidOperationException(message);
\r