-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBackgroundCopyException.cs
93 lines (75 loc) · 3.38 KB
/
BackgroundCopyException.cs
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// @(#) BackgroundCopyException.cs
//
// Project: usis.Net.Bits
// System: Microsoft Visual Studio 2017
// Author: Udo Schäfer
//
// Copyright (c) 2017,2018 usis GmbH. All rights reserved.
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace usis.Net.Bits
{
// -----------------------------
// BackgroundCopyException class
// -----------------------------
/// <summary>
/// The exception that is thrown when a BITS operation fails.
/// </summary>
[Serializable]
public class BackgroundCopyException : Exception
{
#region construction
// ------------
// construction
// ------------
/// <summary>
/// Initializes a new instance of the <see cref="BackgroundCopyException" /> class.
/// </summary>
public BackgroundCopyException() { }
/// <summary>
/// Initializes a new instance of the <see cref="BackgroundCopyException"/> class
/// with the specified error message.
/// </summary>
/// <param name="message">
/// The message that describes the error.
/// </param>
public BackgroundCopyException(string message) : base(message) { }
/// <summary>
/// Initializes a new instance of the <see cref="BackgroundCopyException"/> class,
/// with the 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="inner">
/// The exception that is the cause of the current exception.
/// </param>
public BackgroundCopyException(string message, Exception inner) : base(message, inner) { }
/// <summary>
/// Initializes a new instance of the <see cref="BackgroundCopyException"/> class.
/// </summary>
/// <param name="info">
/// The <see cref="SerializationInfo"></see>
/// that holds the serialized object data about the exception being thrown.
/// </param>
/// <param name="context">
/// The <see cref="StreamingContext"></see>
/// that contains contextual information about the source or destination.
/// </param>
/// <exception cref="SerializationException">
/// The class name is a <c>null</c> reference or <see cref="Exception.HResult"></see> is zero (0).
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="info"/> is a <c>null</c> reference.
/// </exception>
protected BackgroundCopyException(SerializationInfo info, StreamingContext context) : base(info, context) { }
internal BackgroundCopyException(BackgroundCopyManager manager, COMException inner) : base(manager.GetErrorDescription(inner), inner) { }
internal BackgroundCopyException(BackgroundCopyManager manager, uint hResult) : base(manager.GetErrorDescription(hResult)) => HResult = (int)hResult;
internal BackgroundCopyException(string message, uint hResult) : base(message) => HResult = (int)hResult;
#endregion construction
}
}
// eof "BackgroundCopyJobException.cs"