forked from filoe/cscore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStoppedEventArgs.cs
48 lines (42 loc) · 1.41 KB
/
StoppedEventArgs.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
using System;
namespace CSCore
{
/// <summary>
/// Provides data for any stopped operations.
/// </summary>
public class StoppedEventArgs : EventArgs
{
private readonly Exception _exception;
/// <summary>
/// Initializes a new instance of the <see cref="StoppedEventArgs" /> class.
/// </summary>
public StoppedEventArgs()
: this(null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StoppedEventArgs" /> class.
/// </summary>
/// <param name="exception">The associated exception. Can be null.</param>
public StoppedEventArgs(Exception exception)
{
_exception = exception;
}
/// <summary>
/// Gets a value which indicates whether the operation stopped due to an error. True means that that the operation
/// stopped due to an error. False means that the operation did not stop due to an error.
/// </summary>
public virtual bool HasError
{
get { return _exception != null; }
}
/// <summary>
/// Gets the associated <see cref="Exception" /> which caused the operation to stop.
/// </summary>
/// <value>Can be null.</value>
public virtual Exception Exception
{
get { return _exception; }
}
}
}