PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism/Modularity/ModuleTypeLoadingException.cs

#
C# | 80 lines | 29 code | 5 blank | 46 comment | 0 complexity | caccdac2245d86579c960ff0db8e84cf MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 4//===================================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===================================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===================================================================================
17using System;
18using System.Globalization;
19using Microsoft.Practices.Prism.Properties;
20
21namespace Microsoft.Practices.Prism.Modularity
22{
23    /// <summary>
24    /// Exception thrown by <see cref="IModuleManager"/> implementations whenever 
25    /// a module fails to retrieve.
26    /// </summary>
27    public partial class ModuleTypeLoadingException : ModularityException
28    {
29        /// <summary>
30        /// Initializes a new instance.
31        /// </summary>
32        public ModuleTypeLoadingException()
33            : base()
34        {
35        }
36
37        /// <summary>
38        /// Initializes a new instance with a specified error message.
39        /// </summary>
40        /// <param name="message">The message that describes the error.</param>
41        public ModuleTypeLoadingException(string message)
42            : base(message)
43        {
44        }
45
46        /// <summary>
47        /// Initializes a new instance with a specified error message 
48        /// and a reference to the inner exception that is the cause of this exception.
49        /// </summary>
50        /// <param name="message">The error message that explains the reason for the exception.</param>
51        /// <param name="exception">The exception that is the cause of the current exception, 
52        /// or a <see langword="null"/> reference if no inner exception is specified.</param>
53        public ModuleTypeLoadingException(string message, Exception exception)
54            : base(message, exception)
55        {
56        }
57
58        /// <summary>
59        /// Initializes the exception with a particular module and error message.
60        /// </summary>
61        /// <param name="moduleName">The name of the module.</param>
62        /// <param name="message">The error message that explains the reason for the exception.</param>
63        public ModuleTypeLoadingException(string moduleName, string message)
64            : this(moduleName, message, null)
65        {
66        }
67
68        /// <summary>
69        /// Initializes the exception with a particular module, error message and inner exception that happened.
70        /// </summary>
71        /// <param name="moduleName">The name of the module.</param>
72        /// <param name="message">The error message that explains the reason for the exception.</param>
73        /// <param name="innerException">The exception that is the cause of the current exception, 
74        /// or a <see langword="null"/> reference if no inner exception is specified.</param>
75        public ModuleTypeLoadingException(string moduleName, string message, Exception innerException)
76            : base(moduleName, String.Format(CultureInfo.CurrentCulture, Resources.FailedToRetrieveModule, moduleName, message), innerException)
77        {
78        }
79    }
80}