1 // -----------------------------------------------------------------------
\r
2 // Copyright (c) Microsoft Corporation. All rights reserved.
\r
3 // -----------------------------------------------------------------------
\r
5 using System.Collections.Generic;
\r
6 using System.Globalization;
\r
7 using System.Security.Permissions;
\r
8 using Microsoft.Internal;
\r
10 namespace System.ComponentModel.Composition
\r
13 /// The exception that is thrown when one or more recoverable errors occur during
\r
14 /// composition which results in those changes being rejected.
\r
17 public class ChangeRejectedException : CompositionException
\r
20 /// Initializes a new instance of the <see cref="ChangeRejectedException"/> class.
\r
22 public ChangeRejectedException()
\r
23 : this((string)null, (Exception)null)
\r
28 /// Initializes a new instance of the <see cref="ChangeRejectedException"/> class.
\r
30 public ChangeRejectedException(string message)
\r
31 : this(message, (Exception)null)
\r
36 /// Initializes a new instance of the <see cref="ChangeRejectedException"/> class.
\r
38 public ChangeRejectedException(string message, Exception innerException)
\r
39 : base(message, innerException, (IEnumerable<CompositionError>)null)
\r
44 /// Initializes a new instance of the <see cref="ChangeRejectedException"/> class.
\r
46 /// <param name="errors">List of errors that occured while applying the changes.</param>
\r
47 public ChangeRejectedException(IEnumerable<CompositionError> errors)
\r
48 : base((string)null, (Exception)null, errors)
\r
53 /// Gets a message that describes the exception.
\r
56 /// A <see cref="String"/> containing a message that describes the
\r
57 /// <see cref="ChangeRejectedException"/>.
\r
59 public override string Message
\r
63 return string.Format(CultureInfo.CurrentCulture,
\r
64 Strings.CompositionException_ChangesRejected,
\r