Skip to content

Commit d32ed71

Browse files
authored
Merge branch 'master' into patch-1
2 parents 41ac24c + 6db5001 commit d32ed71

File tree

3 files changed

+48
-28
lines changed

3 files changed

+48
-28
lines changed

samples/Exceptionless.SampleWindows/MainForm.Designer.cs

Lines changed: 20 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/Exceptionless.SampleWindows/MainForm.cs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
using System.IO;
44
using System.Windows.Forms;
55
using Exceptionless.Models.Collections;
6+
using Exceptionless.Plugins;
67
using Tester;
78

89
namespace Exceptionless.SampleWindows {
910
public partial class MainForm : Form {
1011
public MainForm() {
1112
InitializeComponent();
1213
ExceptionlessClient.Default.SubmittingEvent += OnSubmittingEvent;
14+
ExceptionlessClient.Default.SubmittedEvent += OnSubmittedEvent;
1315
ExceptionlessClient.Default.Configuration.Settings.Changed += SettingsOnChanged;
1416
}
1517

@@ -19,7 +21,7 @@ private void SettingsOnChanged(object sender, ChangedEventArgs<KeyValuePair<stri
1921
return;
2022
}
2123

22-
logTextBox.AppendText("Configuration Updated.");
24+
logTextBox.AppendText("\r\nConfiguration Updated.");
2325
}
2426

2527
private void OnSubmittingEvent(object sender, EventSubmittingEventArgs e) {
@@ -33,13 +35,17 @@ private void OnSubmittingEvent(object sender, EventSubmittingEventArgs e) {
3335
e.Event.Tags.Add("Important");
3436

3537
if (!String.IsNullOrEmpty(e.Event.ReferenceId))
36-
logTextBox.AppendText($"Submitting Event: {e.Event.ReferenceId}{Environment.NewLine}");
38+
logTextBox.AppendText($"\r\nSubmitting Event: {e.Event.ReferenceId}{Environment.NewLine}");
3739
else
38-
logTextBox.AppendText("Submitting Event");
40+
logTextBox.AppendText("\r\nSubmitting Event");
3941

4042
statusLabel.Text = "Submitting Message";
4143
}
4244

45+
private void OnSubmittedEvent(object sender, EventSubmittedEventArgs e) {
46+
statusLabel.Text = String.Empty;
47+
}
48+
4349
private void generateExceptionToolStripMenuItem_Click(object sender, EventArgs e) {
4450
//try to open a file
4551
string buffer = File.ReadAllText("somefile2.txt");
@@ -49,23 +55,29 @@ private void processQueueToolStripMenuItem_Click(object sender, EventArgs e) {
4955
ExceptionlessClient.Default.ProcessQueueAsync();
5056
}
5157

52-
private void randomExceptionToolStripMenuItem_Click(object sender, EventArgs e) {
53-
string path = Path.GetRandomFileName();
58+
private void OnRandomExceptionMenuItemClick(object sender, EventArgs e) {
59+
File.ReadAllText(Path.GetRandomFileName());
60+
}
5461

55-
//try to open a file
56-
//simulate filenotfound exception
57-
string buffer = File.ReadAllText(path);
62+
private void OnAttemptDeadlockMenuItemClick(object sender, EventArgs e) {
63+
for (int i = 0; i < 10; i++) {
64+
for (int i2 = 0; i2 < 5; i2++) {
65+
new Exception("test for deadlock").ToExceptionless().Submit();
66+
}
67+
68+
var contextData = new ContextData();
69+
contextData.MarkAsUnhandledError();
70+
contextData.SetSubmissionMethod("OnAttemptDeadlockMenuItemClick");
71+
72+
new ApplicationException("Attempt to deadlock:" + i).ToExceptionless(contextData).SetManualStackingInfo(new Dictionary<string, string> {{ "iteration", i.ToString() }}).Submit();
73+
}
5874
}
5975

6076
private void toolStripMenuItem1_Click(object sender, EventArgs e) {
6177
try {
62-
//try to open a file
63-
string buffer = File.ReadAllText("somefile.txt");
64-
//simulate filenotfound exception
65-
//throw new System.IO.FileNotFoundException("The file could not be found.", "SomeFile.txt");
78+
File.ReadAllText("somefile.txt");
6679
} catch (Exception ex) {
67-
throw new ApplicationException(
68-
"An ev has occurred and I have wrapped it inside of this ApplicationException.", ex);
80+
throw new ApplicationException("An ev has occurred and I have wrapped it inside of this ApplicationException.", ex);
6981
}
7082
}
7183

@@ -86,11 +98,8 @@ private void multipleExceptionsToolStripMenuItem_Click(object sender, EventArgs
8698

8799
decimal count = multiple.NumericUpDown.Value;
88100

89-
for (int i = 0; i < count; i++) {
101+
for (int i = 0; i < count; i++)
90102
new ApplicationException("Multiple Crash Test.").ToExceptionless().SetUserDescription("[email protected]", "Testing multiple crash reports. " + i).Submit();
91-
//r.Description = "Testing multiple crash reports.";
92-
//r.EmailAddress = "[email protected]";
93-
}
94103
}
95104

96105
private void showFilterFormToolStripMenuItem_Click(object sender, EventArgs e) {

src/Platforms/Exceptionless.Windows/ExceptionlessWindowsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static void Register(this ExceptionlessClient client, bool showDialog = t
2121
client.Startup();
2222

2323
client.RegisterApplicationThreadExceptionHandler();
24-
24+
2525
if (!showDialog)
2626
return;
2727

0 commit comments

Comments
 (0)