2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.ComponentModel.Composition / src / ComponentModel / System / ComponentModel / Composition / ImportCardinalityMismatchException.cs
blob9048f5c6362371ddc09259cb3b0cf6f8985b23f6
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
5 using System.ComponentModel.Composition.Hosting;
6 using System.ComponentModel.Composition.Primitives;
7 using System.Runtime.Serialization;
9 namespace System.ComponentModel.Composition
11 /// <summary>
12 /// The exception that is thrown when the cardinality of a <see cref="ImportDefinition"/>
13 /// does not match the cardinality of the <see cref="Export"/> objects available in an
14 /// <see cref="ExportProvider"/>.
15 /// </summary>
16 [Serializable]
17 public class ImportCardinalityMismatchException : Exception
19 /// <summary>
20 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class.
21 /// </summary>
22 public ImportCardinalityMismatchException()
23 : this((string)null, (Exception)null)
27 /// <summary>
28 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class
29 /// with the specified error message.
30 /// </summary>
31 /// <param name="message">
32 /// A <see cref="String"/> containing a message that describes the
33 /// <see cref="ImportCardinalityMismatchException"/>; or <see langword="null"/> to set
34 /// the <see cref="Exception.Message"/> property to its default value.
35 /// </param>
36 public ImportCardinalityMismatchException(string message)
37 : this(message, (Exception)null)
41 /// <summary>
42 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class
43 /// with the specified error message and exception that is the cause of the
44 /// exception.
45 /// </summary>
46 /// <param name="message">
47 /// A <see cref="String"/> containing a message that describes the
48 /// <see cref="ImportCardinalityMismatchException"/>; or <see langword="null"/> to set
49 /// the <see cref="Exception.Message"/> property to its default value.
50 /// </param>
51 /// <param name="innerException">
52 /// The <see cref="Exception"/> that is the underlying cause of the
53 /// <see cref="ImportCardinalityMismatchException"/>; or <see langword="null"/> to set
54 /// the <see cref="Exception.InnerException"/> property to <see langword="null"/>.
55 /// </param>
56 public ImportCardinalityMismatchException(string message, Exception innerException)
57 : base(message, innerException)
61 #if !SILVERLIGHT
63 /// <summary>
64 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class
65 /// with the specified serialization data.
66 /// </summary>
67 /// <param name="info">
68 /// The <see cref="SerializationInfo"/> that holds the serialized object data about the
69 /// <see cref="ImportCardinalityMismatchException"/>.
70 /// </param>
71 /// <param name="context">
72 /// The <see cref="StreamingContext"/> that contains contextual information about the
73 /// source or destination.
74 /// </param>
75 /// <exception cref="ArgumentNullException">
76 /// <paramref name="info"/> is <see langword="null"/>.
77 /// </exception>
78 /// <exception cref="SerializationException">
79 /// <paramref name="info"/> is missing a required value.
80 /// </exception>
81 /// <exception cref="InvalidCastException">
82 /// <paramref name="info"/> contains a value that cannot be cast to the correct type.
83 /// </exception>
84 [System.Security.SecuritySafeCritical]
85 protected ImportCardinalityMismatchException(SerializationInfo info, StreamingContext context)
86 : base(info, context)
89 #endif //!SILVERLIGHT