1
// -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.ComponentModel
.Composition
.Hosting
;
6 using System
.ComponentModel
.Composition
.Primitives
;
7 using System
.Runtime
.Serialization
;
9 namespace System
.ComponentModel
.Composition
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"/>.
17 public class ImportCardinalityMismatchException
: Exception
20 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class.
22 public ImportCardinalityMismatchException()
23 : this((string)null, (Exception
)null)
28 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class
29 /// with the specified error message.
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.
36 public ImportCardinalityMismatchException(string message
)
37 : this(message
, (Exception
)null)
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
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.
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"/>.
56 public ImportCardinalityMismatchException(string message
, Exception innerException
)
57 : base(message
, innerException
)
64 /// Initializes a new instance of the <see cref="ImportCardinalityMismatchException"/> class
65 /// with the specified serialization data.
67 /// <param name="info">
68 /// The <see cref="SerializationInfo"/> that holds the serialized object data about the
69 /// <see cref="ImportCardinalityMismatchException"/>.
71 /// <param name="context">
72 /// The <see cref="StreamingContext"/> that contains contextual information about the
73 /// source or destination.
75 /// <exception cref="ArgumentNullException">
76 /// <paramref name="info"/> is <see langword="null"/>.
78 /// <exception cref="SerializationException">
79 /// <paramref name="info"/> is missing a required value.
81 /// <exception cref="InvalidCastException">
82 /// <paramref name="info"/> contains a value that cannot be cast to the correct type.
84 [System
.Security
.SecuritySafeCritical
]
85 protected ImportCardinalityMismatchException(SerializationInfo info
, StreamingContext context
)