-
Notifications
You must be signed in to change notification settings - Fork 78
/
Custom.cs
52 lines (44 loc) · 1.51 KB
/
Custom.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
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CustomFactory.cs" company="NBug Project">
// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace NBug.Core.Submission.Custom
{
using System.IO;
using NBug.Core.Reporting.Info;
using NBug.Core.Util.Serialization;
using NBug.Events;
public class CustomFactory : IProtocolFactory
{
public string SupportedType
{
get
{
return "Custom";
}
}
public IProtocol FromConnectionString(string connectionString)
{
return new Custom(connectionString);
}
}
public class Custom : ProtocolBase
{
public Custom(string connectionString)
: base(connectionString)
{
}
public Custom()
{
}
public override bool Send(string fileName, Stream file, Report report, SerializableException exception)
{
if (Settings.CustomSubmissionHandle == null)
return false;
var e = new CustomSubmissionEventArgs(fileName, file, report, exception);
Settings.CustomSubmissionHandle.DynamicInvoke(this, e);
return e.Result;
}
}
}