Skip to content

Commit

Permalink
[Debugging]Add toggle for FirstChance Exception #567
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Oct 17, 2020
1 parent 314b671 commit 70fdbee
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 201 deletions.
3 changes: 3 additions & 0 deletions Analogy/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@
<setting name="RibbonStyle" serializeAs="String">
<value>0</value>
</setting>
<setting name="EnableFirstChanceException" serializeAs="String">
<value>False</value>
</setting>
</Analogy.Properties.Settings>
</userSettings>
</configuration>
256 changes: 143 additions & 113 deletions Analogy/Forms/UserSettingsForm.Designer.cs

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions Analogy/Forms/UserSettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ public partial class UserSettingsForm : XtraForm
public UserSettingsForm()
{
InitializeComponent();



messageData = Utils.DataTableConstructor();
}



public UserSettingsForm(int tabIndex) : this()
{
InitialSelection = tabIndex;
Expand All @@ -53,7 +49,7 @@ private void UserSettingsForm_Load(object sender, EventArgs e)
{
gridControl.MainView.RestoreLayoutFromXml(Settings.LogGridFileName);
}
messageData = Utils.DataTableConstructor();

gridControl.DataSource = messageData.DefaultView;
SetupExampleMessage("Test 1");
SetupExampleMessage("Test 2");
Expand Down Expand Up @@ -258,6 +254,7 @@ private void LoadSettings()
}

tsRibbonCompactStyle.IsOn = Settings.RibbonStyle == CommandLayout.Simplified;
tsEnableFirstChanceException.IsOn = Settings.EnableFirstChanceException;
}

private void SaveSetting()
Expand Down Expand Up @@ -310,7 +307,7 @@ private void SaveSetting()
if (rbMenuFontSizeVeryLarge.Checked)
Settings.FontSettings.SetMenuFontSelectionType(FontSelectionType.VeryLarge);


Settings.EnableFirstChanceException= tsEnableFirstChanceException.IsOn;

Settings.Save();
}
Expand Down
204 changes: 126 additions & 78 deletions Analogy/Forms/UserSettingsForm.resx

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Analogy/Managers/UserSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class UserSettingsManager
public LogLevelSelectionType LogLevelSelection { get; set; }
public bool ShowWhatIsNewAtStartup { get; set; }
public FontSettings FontSettings { get; set; }

public bool EnableFirstChanceException { get; set; }
public CommandLayout RibbonStyle
{
get => _ribbonStyle;
Expand Down Expand Up @@ -226,6 +226,7 @@ public void Load()
ShowWhatIsNewAtStartup = Settings.Default.ShowWhatIsNewAtStartup;
FontSettings = ParseSettings<FontSettings>(Settings.Default.FontSettings);
RibbonStyle = (CommandLayout)Settings.Default.RibbonStyle;
EnableFirstChanceException = Settings.Default.EnableFirstChanceException;
}

private T ParseSettings<T>(string data) where T : new()
Expand Down Expand Up @@ -311,6 +312,7 @@ public void Save()
Settings.Default.ShowWhatIsNewAtStartup = ShowWhatIsNewAtStartup;
Settings.Default.FontSettings = JsonConvert.SerializeObject(FontSettings);
Settings.Default.RibbonStyle = (int)RibbonStyle;
Settings.Default.EnableFirstChanceException=EnableFirstChanceException;
Settings.Default.Save();

}
Expand Down
6 changes: 4 additions & 2 deletions Analogy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
Expand Down Expand Up @@ -38,7 +37,10 @@ static void Main()
WindowsFormsSettings.DefaultMenuFont = Settings.FontSettings.MenuFont;
Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
if (Settings.EnableFirstChanceException)
{
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
}
Application.SetCompatibleTextRenderingDefault(false);
Application.EnableVisualStyles();
#if NETCOREAPP3_1
Expand Down
12 changes: 12 additions & 0 deletions Analogy/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Analogy/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,8 @@
<Setting Name="RibbonStyle" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="EnableFirstChanceException" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 70fdbee

Please sign in to comment.