//----------------------------------------------------------------------- // // Copyright (c) 2009 Deltares. All rights reserved. // // B. Faassen // barry.faassen@deltares.nl // // n.a. //----------------------------------------------------------------------- using System; using System.Runtime.Serialization; namespace Deltares.Standard { [Serializable] public class CollectionRequirementsNotSatisfiedException : Exception { public CollectionRequirementsNotSatisfiedException() { } public CollectionRequirementsNotSatisfiedException(string collectionElementName, string itemElementName, object coll) : base(GetMessage(collectionElementName, itemElementName, coll)) { } protected CollectionRequirementsNotSatisfiedException( SerializationInfo info, StreamingContext context) : base(info, context) { } private static string GetMessage(string collectionElementName, string itemElementName, object coll) { string msg = "Cannot write the xml sequence '{0}' with the element '{1}', because it doesn't satisfy the requirements in the xsd schema. See the schema for min and max occurences"; return string.Format(msg, collectionElementName, itemElementName); } } }