This repository was archived by the owner on May 8, 2020. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathDuplicateItemException.cs
More file actions
61 lines (53 loc) · 2.64 KB
/
Copy pathDuplicateItemException.cs
File metadata and controls
61 lines (53 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//------------------------------------------------------------------------------
// <copyright company="LeanKit Inc.">
// Copyright (c) LeanKit Inc. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Runtime.Serialization;
namespace LeanKit.API.Client.Library.Exceptions
{
[Serializable]
public class DuplicateItemException : Exception
{
#region Constructors
/// <overloads>Initializes a new instance of the <see cref="DuplicateItemException" /> class.</overloads>
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateItemException" /> class with the default error
/// message.
/// </summary>
public DuplicateItemException()
: this(null, null) { }
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateItemException" /> class with a specified error
/// message.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
public DuplicateItemException(string message)
: this(message, null) { }
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateItemException" /> class with the default error
/// message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="innerException">The exception that is the cause of the current exception.</param>
public DuplicateItemException(Exception innerException)
: this(null, innerException) { }
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateItemException" /> class with a specified error
/// message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception.</param>
public DuplicateItemException(string message, Exception innerException)
: base(
string.IsNullOrEmpty(message)
? (innerException != null ? innerException.Message : "This action would result in a duplicate item.")
: message, innerException) { }
/// <summary>Initializes a new instance of the <see cref="DuplicateItemException" /> class with serialized data.</summary>
/// <param name="info">The object that holds the serialized object data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
protected DuplicateItemException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
#endregion
}
}