PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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. //===================================================================================
  17. using System;
  18. using System.Globalization;
  19. using Microsoft.Practices.Prism.Properties;
  20. namespace Microsoft.Practices.Prism.Modularity
  21. {
  22. /// <summary>
  23. /// Exception thrown by <see cref="IModuleManager"/> implementations whenever
  24. /// a module fails to retrieve.
  25. /// </summary>
  26. public partial class ModuleTypeLoadingException : ModularityException
  27. {
  28. /// <summary>
  29. /// Initializes a new instance.
  30. /// </summary>
  31. public ModuleTypeLoadingException()
  32. : base()
  33. {
  34. }
  35. /// <summary>
  36. /// Initializes a new instance with a specified error message.
  37. /// </summary>
  38. /// <param name="message">The message that describes the error.</param>
  39. public ModuleTypeLoadingException(string message)
  40. : base(message)
  41. {
  42. }
  43. /// <summary>
  44. /// Initializes a new instance with a specified error message
  45. /// and a reference to the inner exception that is the cause of this exception.
  46. /// </summary>
  47. /// <param name="message">The error message that explains the reason for the exception.</param>
  48. /// <param name="exception">The exception that is the cause of the current exception,
  49. /// or a <see langword="null"/> reference if no inner exception is specified.</param>
  50. public ModuleTypeLoadingException(string message, Exception exception)
  51. : base(message, exception)
  52. {
  53. }
  54. /// <summary>
  55. /// Initializes the exception with a particular module and error message.
  56. /// </summary>
  57. /// <param name="moduleName">The name of the module.</param>
  58. /// <param name="message">The error message that explains the reason for the exception.</param>
  59. public ModuleTypeLoadingException(string moduleName, string message)
  60. : this(moduleName, message, null)
  61. {
  62. }
  63. /// <summary>
  64. /// Initializes the exception with a particular module, error message and inner exception that happened.
  65. /// </summary>
  66. /// <param name="moduleName">The name of the module.</param>
  67. /// <param name="message">The error message that explains the reason for the exception.</param>
  68. /// <param name="innerException">The exception that is the cause of the current exception,
  69. /// or a <see langword="null"/> reference if no inner exception is specified.</param>
  70. public ModuleTypeLoadingException(string moduleName, string message, Exception innerException)
  71. : base(moduleName, String.Format(CultureInfo.CurrentCulture, Resources.FailedToRetrieveModule, moduleName, message), innerException)
  72. {
  73. }
  74. }
  75. }