|
#region USING
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
#endregion
namespace NetMX.OpenMBean
{
/// <summary>
/// This runtime exception is thrown to indicate that the index of a row to be added to a tabular data
/// instance is already used to refer to another row in this tabular data instance.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), Serializable] //Other constructos do not make sense.
public sealed class KeyAlreadyExistsException : ArgumentException
{
private readonly IEnumerable<object> _key;
/// <summary>
/// Key which caused the problem.
/// </summary>
public IEnumerable<object> Key
{
get { return _key; }
}
/// <summary>
/// Creates new KeyAlreadyExistsException object.
/// </summary>
/// <param name="key">Key which caused the problem.</param>
public KeyAlreadyExistsException(IEnumerable<object> key)
: base()
{
_key = key;
}
private KeyAlreadyExistsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
_key = (IEnumerable<object>)info.GetValue("key", typeof(IEnumerable<object>));
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods"), System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("key", _key);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.