From ab9af8915f15c2d6766eca4080489d6c341e3640 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Tue, 25 Nov 2025 22:15:42 -0800 Subject: [PATCH 01/11] Fixed binding redirect exception for when ValueTuple 4.0.3 is not in gac in w11. --- .../DotNETFramework4_8/DotNETFrameworkWorker/App.config | 4 ---- 1 file changed, 4 deletions(-) diff --git a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config index 5e849d8..29034d0 100644 --- a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config +++ b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config @@ -37,10 +37,6 @@ - - - - \ No newline at end of file From d50b814a91b576ef792db2f34487fba685170199 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Tue, 25 Nov 2025 22:17:35 -0800 Subject: [PATCH 02/11] More specific version error exception type to assist with ignoring --- .../DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs index 45751b1..f091926 100644 --- a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs +++ b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.Diagnostics; using System.IO; using System.Linq; @@ -102,7 +103,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string if( !ph.Start( cnc ) ) return null; - if( !string.IsNullOrWhiteSpace( ph.Error ) ) throw new Exception( ph.Error ); + if( !string.IsNullOrWhiteSpace( ph.Error ) ) throw new VersionNotFoundException( ph.Error ); VersionResponse response = JsonSerializer.Deserialize( ph.OutputStream )!; From 58e4271ee923bdc9dc3dae0952fb107dd5c0707e Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 00:03:15 -0800 Subject: [PATCH 03/11] Added editorconfig matching what the project seems to follow --- .editorconfig | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..620fcb3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,78 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_size = 2 + +[*.{cs,cpp,h,c,cc,cxx,hpp,hxx}] +indent_size = 4 + +[*.{cpp,h,c,cc,cxx,hpp,hxx}] +cpp_indent_braces = false +cpp_indent_multi_line_relative_to = statement_begin +cpp_new_line_before_open_brace_namespace = new_line +cpp_new_line_before_open_brace_type = new_line +cpp_new_line_before_open_brace_function = new_line +cpp_new_line_before_open_brace_block = new_line +cpp_new_line_before_catch = true +cpp_new_line_before_else = true +cpp_new_line_before_finally = true +cpp_space_before_function_open_parenthesis = false +cpp_space_within_parameter_list_parentheses = true +cpp_space_between_empty_parameter_list_parentheses = true +cpp_space_after_keywords_in_control_flow_statements = true +cpp_space_within_control_flow_statement_parentheses = true +cpp_space_before_semicolon_in_for_statement = false +cpp_space_after_semicolon_in_for_statement = true +cpp_space_around_binary_operator = insert +cpp_space_around_assignment_operator = insert + +[*.xaml] +charset = utf-8-bom + +[*.cs] +charset = utf-8-bom +# New line settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation settings +csharp_indent_case_contents = true +csharp_indent_switch_labels = false +csharp_indent_labels = one_less_than_current + +# Spacing settings +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_between_method_call_parameter_list_parentheses = true +csharp_space_between_method_declaration_parameter_list_parentheses = true +csharp_space_between_method_call_empty_parameter_list_parentheses = true +csharp_space_between_method_declaration_empty_parameter_list_parentheses = true +csharp_space_between_parentheses = control_flow_statements, expressions + +# Style settings +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = false:suggestion +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_prefer_braces = false:silent +csharp_preserve_single_line_blocks = true +csharp_using_directive_placement = outside_namespace:silent From e47bfe870bf4bd972b6b9d05464c290ad0505ee1 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 01:15:46 -0800 Subject: [PATCH 04/11] Added app.manifest for DPI control and defaults --- .../RegExpressWPFNET/RegExpressWPFNET.csproj | 1 + .../RegExpressWPFNET/app.manifest | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 RegExpressWPFNET/RegExpressWPFNET/app.manifest diff --git a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj index 63997f0..5eca725 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj +++ b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj @@ -6,6 +6,7 @@ enable true RegExpress.ico + app.manifest diff --git a/RegExpressWPFNET/RegExpressWPFNET/app.manifest b/RegExpressWPFNET/RegExpressWPFNET/app.manifest new file mode 100644 index 0000000..df92cb6 --- /dev/null +++ b/RegExpressWPFNET/RegExpressWPFNET/app.manifest @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + PerMonitorV2 + true + + + + + + + + + + + + + + + From 0fac73dab450a9b5a91d10412e3caf0f2eb5e4b6 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 01:21:59 -0800 Subject: [PATCH 05/11] Move to a central backend config class and added central exception/break handling --- .../RegExpressLibrary/InternalConfig.cs | 117 ++++++++++++++++++ .../RegExpressLibrary/PluginUtilities.cs | 16 ++- .../RegExpressLibrary/ProcessHelper.cs | 12 +- .../Adorners/UnderliningAdorner.cs | 3 +- RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs | 9 +- .../Code/ChangeEventHelper.cs | 4 +- .../RegExpressWPFNET/Code/ResumableLoop.cs | 4 +- .../RegExpressWPFNET/Code/RtbUtilities.cs | 4 +- .../RegExpressWPFNET/Code/UITaskHelper.cs | 7 +- .../RegExpressWPFNET/Code/Utilities.cs | 6 +- .../RegExpressWPFNET/MainWindow.xaml.cs | 12 +- .../RegExpressWPFNET/UCMain.xaml.cs | 4 +- .../RegExpressWPFNET/UCMatches.xaml.cs | 2 +- .../RegexEngines/Ada/AdaPlugin/Engine.cs | 8 +- .../RegexEngines/Boost/BoostPlugin/Engine.cs | 8 +- .../CompileTimeRegexPlugin/Engine.cs | 8 +- .../CppBuilder/CppBuilderPlugin/Engine.cs | 8 +- .../RegexEngines/D/DPlugin/Engine.cs | 8 +- .../DotNET9/DotNET9Plugin/Engine.cs | 8 +- .../DotNETFrameworkPlugin/Engine.cs | 8 +- .../Fortran/FortranPlugin/Engine.cs | 8 +- .../Fortran/FortranPlugin/MatcherForgex.cs | 2 +- .../FortranPlugin/MatcherRegexJeyemhex.cs | 2 +- .../FortranPlugin/MatcherRegexPerazz.cs | 2 +- .../HyperscanPlugin/ChimeraEngine.cs | 9 +- .../HyperscanPlugin/HyperscanEngine.cs | 8 +- .../RegexEngines/ICU/ICUPlugin/Engine.cs | 8 +- .../RegexEngines/Java/JavaPlugin/Engine.cs | 8 +- .../RegexEngines/Java/JavaPlugin/Matcher.cs | 8 +- .../JavaScript/JavaScriptPlugin/Engine.cs | 5 +- .../JavaScript/JavaScriptPlugin/MatcherBun.cs | 9 +- .../JavaScriptPlugin/MatcherNodeJs.cs | 9 +- .../JavaScriptPlugin/MatcherQuickJs.cs | 3 +- .../JavaScriptPlugin/MatcherRE2JS.cs | 3 +- .../JavaScriptPlugin/MatcherSpiderMonkey.cs | 9 +- .../JavaScriptPlugin/MatcherWebView2.cs | 3 +- .../Oniguruma/OnigurumaPlugin/Engine.cs | 11 +- .../RegexEngines/PCRE2/PCRE2Plugin/Engine.cs | 8 +- .../RegexEngines/Perl/PerlPlugin/Engine.cs | 8 +- .../RegexEngines/Perl/PerlPlugin/Matcher.cs | 2 +- .../Python/PythonPlugin/Engine.cs | 8 +- .../RegexEngines/Qt/QtPlugin/Engine.cs | 8 +- .../RegexEngines/RE2/RE2Plugin/Engine.cs | 8 +- .../RegexEngines/Rust/RustPlugin/Engine.cs | 8 +- .../RegexEngines/Std/StdPlugin/Engine.cs | 5 +- .../SubReg/SubRegPlugin/Engine.cs | 8 +- .../RegexEngines/TRE/TREPlugin/Engine.cs | 8 +- .../TinyRegexC/TinyRegexCPlugin/Engine.cs | 8 +- .../VBScript/VBScriptPlugin/Engine.cs | 8 +- 49 files changed, 321 insertions(+), 129 deletions(-) create mode 100644 RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs diff --git a/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs new file mode 100644 index 0000000..4808e7c --- /dev/null +++ b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using System.Diagnostics; +using System.Windows; + +namespace RegExpressLibrary +{ + public static class InternalConfig + { + public static bool SHOW_DEBUG_BUTTONS = false; + [Flags] + public enum ON_EXCEPTION_ACTION + { + None, + MessageBox = 1 << 0, + DebuggerBreak = 1 << 1, + Rethrow = 1 << 2, + IncludeStackTrace = 1 << 3, + IncludeTraceDetails = 1 << 4, + + } + public static ON_EXCEPTION_ACTION ON_EXCEPTION_DEBUGGER_ATTACHED = ON_EXCEPTION_ACTION.DebuggerBreak | ON_EXCEPTION_ACTION.IncludeTraceDetails | ON_EXCEPTION_ACTION.IncludeStackTrace; + public static ON_EXCEPTION_ACTION ON_EXCEPTION_STANDARD = ON_EXCEPTION_ACTION.MessageBox; + public static void HandleOtherCriticalError( String error, [System.Runtime.CompilerServices.CallerLineNumber] int source_line_number = 0, [System.Runtime.CompilerServices.CallerMemberName] string member_name = "", [System.Runtime.CompilerServices.CallerFilePath] string source_file_path = "" ) => + _CriticalError( new StringBuilder( error ), source_line_number, member_name, source_file_path ); + private static void _CriticalError( StringBuilder sb, [System.Runtime.CompilerServices.CallerLineNumber] int source_line_number = 0, [System.Runtime.CompilerServices.CallerMemberName] string member_name = "", [System.Runtime.CompilerServices.CallerFilePath] string source_file_path = "" ) + { + var ON_EXCEPTION = Debugger.IsAttached ? ON_EXCEPTION_DEBUGGER_ATTACHED : ON_EXCEPTION_STANDARD; + if( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.IncludeTraceDetails ) ) + { + sb.Append( "Member: " ).AppendLine( member_name ); + sb.Append( "File: " ).AppendLine( source_file_path ); + sb.Append( "Line: " ).AppendLine( source_line_number.ToString( ) ); + } + + string message = sb.ToString( ); + + // MessageBox (on UI thread if possible) + if( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.MessageBox ) ) + { + try + { + if( Application.Current?.Dispatcher != null && !Application.Current.Dispatcher.CheckAccess( ) ) + Application.Current.Dispatcher.Invoke( ( ) => MessageBox.Show( message, "Exception", MessageBoxButton.OK, MessageBoxImage.Error ) ); + else + MessageBox.Show( message, "Exception", MessageBoxButton.OK, MessageBoxImage.Error ); + + } + catch + { + // Fallback to Debug output if UI unavailable + Debug.WriteLine( message ); + } + } + + // Break into debugger if requested and a debugger is attached + if( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.DebuggerBreak ) && Debugger.IsAttached ) + Debugger.Break( ); + + + // Always log to debug output for visibility + Debug.WriteLine( message ); + + } + + public static bool HandleException( String msg, Exception exception, [System.Runtime.CompilerServices.CallerLineNumber] int source_line_number = 0, [System.Runtime.CompilerServices.CallerMemberName] string member_name = "", [System.Runtime.CompilerServices.CallerFilePath] string source_file_path = "", [CallerArgumentExpression( "exception" )] string exceptionName = "" ) + { + if( exception == null ) return false; + var ON_EXCEPTION = Debugger.IsAttached ? ON_EXCEPTION_DEBUGGER_ATTACHED : ON_EXCEPTION_STANDARD; + + // Build a diagnostic message + StringBuilder sb = new( ); + + sb.AppendLine( "Exception! " ); + if( !String.IsNullOrWhiteSpace( msg ) ) + sb.AppendLine( msg + " " ); + if( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.IncludeTraceDetails ) ) + { + sb.Append( "Member: " ).AppendLine( member_name ); + sb.Append( "File: " ).AppendLine( source_file_path ); + sb.Append( "Line: " ).AppendLine( source_line_number.ToString( ) ); + } + sb.Append( "Exception Var: " ).AppendLine( exceptionName ); + sb.Append( "Type: " ).AppendLine( exception.GetType( ).FullName ); + sb.Append( "Message: " ).AppendLine( exception.Message ); + + if( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.IncludeStackTrace ) ) + { + var st = exception.StackTrace; + if( !string.IsNullOrWhiteSpace( st ) ) + { + sb.AppendLine( "StackTrace:" ); + sb.AppendLine( st ); + } + } + _CriticalError( sb, source_line_number, member_name, source_file_path ); + + return ( ON_EXCEPTION.HasFlag( ON_EXCEPTION_ACTION.Rethrow ) ); + } + /// + /// Returns true if caller should rethrow the exception + /// + /// + /// + /// + /// + /// + /// + public static bool HandleException( Exception exception, [System.Runtime.CompilerServices.CallerLineNumber] int source_line_number = 0, [System.Runtime.CompilerServices.CallerMemberName] string member_name = "", [System.Runtime.CompilerServices.CallerFilePath] string source_file_path = "", [CallerArgumentExpression( "exception" )] string exceptionName = "" ) => + HandleException( string.Empty, exception, source_line_number, member_name, source_file_path, exceptionName ); + + } +} diff --git a/RegExpressWPFNET/RegExpressLibrary/PluginUtilities.cs b/RegExpressWPFNET/RegExpressLibrary/PluginUtilities.cs index 73cdd9e..ea1f16a 100644 --- a/RegExpressWPFNET/RegExpressLibrary/PluginUtilities.cs +++ b/RegExpressWPFNET/RegExpressLibrary/PluginUtilities.cs @@ -64,9 +64,8 @@ public static class PluginLoader } catch( Exception exc ) { - if( Debugger.IsAttached ) Debugger.Break( ); - - MessageBox.Show( ownerWindow, $"Failed to load plugins using '{enginesJsonPath}'.\r\n\r\n{exc.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation ); + if (InternalConfig.HandleException($"Failed to load plugins using '{enginesJsonPath}'", exc )) + throw; return (null, null); } @@ -106,18 +105,17 @@ public static class PluginLoader } catch( Exception exc ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( $"Failed to create plugin \"{engine_data.path}\"", exc )) + throw; - MessageBox.Show( ownerWindow, $"Failed to create plugin \"{engine_data.path}\".\r\n\r\n{exc.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation ); } } } } catch( Exception exc ) { - if( Debugger.IsAttached ) Debugger.Break( ); - - MessageBox.Show( $"Failed to load plugin \"{engine_data.path}\".\r\n\r\n{exc.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation ); + if (InternalConfig.HandleException( $"Failed to create plugin \"{engine_data.path}\"", exc )) + throw; } } } @@ -142,4 +140,4 @@ public static class PluginLoader return (plugins, no_fm_plugins); } -} \ No newline at end of file +} diff --git a/RegExpressWPFNET/RegExpressLibrary/ProcessHelper.cs b/RegExpressWPFNET/RegExpressLibrary/ProcessHelper.cs index 68a9aae..77ed1a3 100644 --- a/RegExpressWPFNET/RegExpressLibrary/ProcessHelper.cs +++ b/RegExpressWPFNET/RegExpressLibrary/ProcessHelper.cs @@ -129,7 +129,8 @@ public bool Start( ICancellable cnc ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; } } ) { @@ -155,7 +156,8 @@ public bool Start( ICancellable cnc ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; } } ) { @@ -174,7 +176,8 @@ public bool Start( ICancellable cnc ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; } } ) { @@ -222,7 +225,8 @@ public bool Start( ICancellable cnc ) if( unchecked((uint)exc.HResult) != 0x80004005 && // 'E_ACCESSDENIED' unchecked((uint)exc.HResult) != 0x80131509 ) // -2146233079, "Cannot process request because the process () has exited." { - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; } // ignore diff --git a/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs b/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs index 323bc3d..e243239 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs @@ -98,7 +98,8 @@ public void SetRangesToUnderline( IReadOnlyList<(TextPointer start, TextPointer // TODO: 'ExecutionEngineException' is now obsolete. _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( exc )) + throw; // ignore and accept the ranges } } diff --git a/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs index bdc3b42..be3b8b2 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs @@ -93,17 +93,20 @@ private void CurrentDomain_UnhandledException( object sender, UnhandledException private void TaskScheduler_UnobservedTaskException( object? sender, UnobservedTaskExceptionEventArgs e ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( e.Exception )) + throw e.Exception; } private void App_DispatcherUnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( e.Exception )) + throw e.Exception; } private void Dispatcher_UnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( e.Exception )) + throw e.Exception; } } } diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/ChangeEventHelper.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/ChangeEventHelper.cs index 5964f2b..a046f89 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/ChangeEventHelper.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/ChangeEventHelper.cs @@ -82,7 +82,7 @@ public void Invoke( CancellationToken ct, Action action ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + RegExpressLibrary.InternalConfig.HandleException( exc ); throw; } } @@ -106,7 +106,7 @@ public void Do( Action action ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + RegExpressLibrary.InternalConfig.HandleException( exc ); throw; } finally diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/ResumableLoop.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/ResumableLoop.cs index f54e774..d3a00d2 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/ResumableLoop.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/ResumableLoop.cs @@ -220,7 +220,7 @@ void ThreadProc( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleException( exc ); throw; // TODO: maybe restart the loop? } @@ -237,7 +237,7 @@ void ThreadProc( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleException(exc); throw; } } diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/RtbUtilities.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/RtbUtilities.cs index 134b0f7..2d0b0e3 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/RtbUtilities.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/RtbUtilities.cs @@ -477,7 +477,7 @@ public static void BringIntoViewInvoked( ICancellable cnc, RichTextBox rtb, Text if( rect_to_bring.IsEmpty ) { - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Rect is empty"); return; } @@ -490,7 +490,7 @@ public static void BringIntoViewInvoked( RichTextBox rtb, Rect rect, bool isRect { if( rect.IsEmpty ) { - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Rect is empty"); return; } diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/UITaskHelper.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/UITaskHelper.cs index 2ecba6f..e24eb38 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/UITaskHelper.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/UITaskHelper.cs @@ -47,7 +47,7 @@ public static void Invoke( DispatcherObject obj, CancellationToken ct, Action ac catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + RegExpressLibrary.InternalConfig.HandleException( exc ); throw; } } @@ -66,7 +66,8 @@ public static void Invoke( DispatcherObject obj, Action action ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached && !( exc is TaskCanceledException ) ) Debugger.Break( ); + if(!( exc is TaskCanceledException ) ) + RegExpressLibrary.InternalConfig.HandleException( exc ); throw; } } @@ -118,7 +119,7 @@ static void Execute( Action action ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + RegExpressLibrary.InternalConfig.HandleException( exc ); throw; } } diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs index 63ccdfe..ad9979d 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs @@ -69,7 +69,8 @@ public static void DbgSaveXAML( string filename, FlowDocument doc ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( exc )) + throw; } } @@ -88,7 +89,8 @@ public static void DbgLoadXAML( FlowDocument doc, string filename ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( exc )) + throw; } } } diff --git a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs index f4876b1..7d321c5 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs @@ -130,7 +130,8 @@ private async void Window_Loaded( object sender, RoutedEventArgs e ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (RegExpressLibrary.InternalConfig.HandleException( exc )) + throw; } #if DEBUG @@ -224,7 +225,7 @@ private void Window_Closing( object sender, System.ComponentModel.CancelEventArg } catch( Exception exc ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if( Debugger.IsAttached ) InternalConfig.HandleException( exc ); else Debug.Fail( exc.Message, exc.ToString( ) ); // ignore @@ -465,7 +466,8 @@ void SaveAllTabData( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; // ignore } @@ -518,7 +520,7 @@ void SaveWindowPlacement( ) } catch( Exception exc ) { - if( Debugger.IsAttached ) Debugger.Break( ); + if( Debugger.IsAttached ) InternalConfig.HandleException( exc ); else Debug.Fail( exc.Message, exc.ToString( ) ); // ignore @@ -588,7 +590,7 @@ void TryRestoreWindowPlacement( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if( Debugger.IsAttached ) InternalConfig.HandleException( exc ); // ignore } diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs index 527afc1..9f3e3a9 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs @@ -879,7 +879,7 @@ void IndeterminateProgressThreadProc( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if( Debugger.IsAttached ) InternalConfig.HandleException( exc ); // ignore } @@ -899,7 +899,7 @@ void HideIndeterminateProgress( Thread indeterminateProgressThread ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleException( exc ); // ignore } diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs index 1441939..43fa674 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs @@ -114,7 +114,7 @@ public UCMatches( ) ExternalUnderliningLoop = new ResumableLoop( "Matches External Underline", ExternalUnderliningThreadProc, 333, 555 ); - pnlDebug.Visibility = Visibility.Collapsed; + pnlDebug.Visibility = InternalConfig.SHOW_DEBUG_BUTTONS ? Visibility.Visible : Visibility.Collapsed; #if !DEBUG pnlDebug.Visibility = Visibility.Collapsed; #endif diff --git a/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/Engine.cs index c58c6bd..7391b66 100644 --- a/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -149,7 +150,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/Engine.cs index e317474..d2edda0 100644 --- a/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch(Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -169,7 +170,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs index d7d7795..950de89 100644 --- a/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -148,7 +149,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/Engine.cs index c585e64..2766d39 100644 --- a/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch (Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -152,7 +153,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/D/DPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/D/DPlugin/Engine.cs index 4c62e85..dc62261 100644 --- a/RegExpressWPFNET/RegexEngines/D/DPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/D/DPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch (Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -154,7 +155,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/Engine.cs b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/Engine.cs index 7d14b65..a64e4b9 100644 --- a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch (Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -151,7 +152,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs index eb8ea06..fa4efeb 100644 --- a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch (Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -151,7 +152,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs index e1ac9ef..0d0c95b 100644 --- a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch (Exception ex) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -163,7 +164,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherForgex.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherForgex.cs index 5fd6ae3..fcfafe3 100644 --- a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherForgex.cs +++ b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherForgex.cs @@ -89,7 +89,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string if( !string.IsNullOrWhiteSpace( line ) ) { // invalid line - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Invalid Line"); } #endif } diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexJeyemhex.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexJeyemhex.cs index 54bfae3..177fb32 100644 --- a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexJeyemhex.cs +++ b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexJeyemhex.cs @@ -90,7 +90,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string if( !string.IsNullOrWhiteSpace( line ) ) { // invalid line - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Invalid Line"); } #endif } diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexPerazz.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexPerazz.cs index 2a238e3..d74c70a 100644 --- a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexPerazz.cs +++ b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherRegexPerazz.cs @@ -90,7 +90,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string if( !string.IsNullOrWhiteSpace( line ) ) { // invalid line - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Invalid Line"); } #endif } diff --git a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/ChimeraEngine.cs b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/ChimeraEngine.cs index 61d5116..3daa10f 100644 --- a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/ChimeraEngine.cs +++ b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/ChimeraEngine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new ChimeraOptions( ); } @@ -153,7 +154,9 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; + return null; } diff --git a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanEngine.cs b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanEngine.cs index 792006b..16ac936 100644 --- a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanEngine.cs +++ b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanEngine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new HyperscanOptions( ); } @@ -156,7 +157,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/Engine.cs index 43e3558..a6e7c73 100644 --- a/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -157,7 +158,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Engine.cs index 9a71dac..a00a371 100644 --- a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Engine.cs @@ -100,10 +100,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -171,7 +172,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Matcher.cs index 94d97b4..bbe5c34 100644 --- a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Matcher.cs +++ b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Matcher.cs @@ -191,7 +191,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string if( !string.IsNullOrWhiteSpace( line ) ) { // invalid line - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("Invalid Line"); } #endif } @@ -293,7 +293,8 @@ static void DecompressJre( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; // ignore } @@ -304,7 +305,8 @@ static void DecompressJre( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; JrePath = null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/Engine.cs index 143cf14..f4a4b29 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/Engine.cs @@ -105,10 +105,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherBun.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherBun.cs index 91d9fef..da8cde6 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherBun.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherBun.cs @@ -159,7 +159,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } @@ -229,7 +230,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; // ignore } @@ -240,7 +242,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; TempFolder = null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherNodeJs.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherNodeJs.cs index a1d1693..9768141 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherNodeJs.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherNodeJs.cs @@ -169,7 +169,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } @@ -229,7 +230,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; // ignore } @@ -240,7 +242,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; TempFolder = null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherQuickJs.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherQuickJs.cs index b2d259b..9f5bce8 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherQuickJs.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherQuickJs.cs @@ -143,7 +143,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherRE2JS.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherRE2JS.cs index 7510037..db272f2 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherRE2JS.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherRE2JS.cs @@ -158,7 +158,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherSpiderMonkey.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherSpiderMonkey.cs index 504f72a..ae7e5b6 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherSpiderMonkey.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherSpiderMonkey.cs @@ -164,7 +164,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } @@ -234,7 +235,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; // ignore } @@ -245,7 +247,8 @@ static void Decompress( ) catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; TempFolder = null; } diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherWebView2.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherWebView2.cs index 91da4dc..659c641 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherWebView2.cs +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherWebView2.cs @@ -174,7 +174,8 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/Engine.cs index 770bc19..47e2493 100644 --- a/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -248,7 +249,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } @@ -267,7 +269,8 @@ private static FeatureMatrix MakeFeatureMatrix( Options options ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return default; } diff --git a/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/Engine.cs b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/Engine.cs index 143e03d..a5eb74f 100644 --- a/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -173,7 +174,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Engine.cs index 86333d6..f44a7cc 100644 --- a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -154,7 +155,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Matcher.cs index 8561f4b..6da1ba0 100644 --- a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Matcher.cs +++ b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Matcher.cs @@ -145,7 +145,7 @@ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string } else { - if( Debugger.IsAttached ) Debugger.Break( ); + InternalConfig.HandleOtherCriticalError("No Match"); // ignore } } diff --git a/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/Engine.cs index 220feb0..03768b1 100644 --- a/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/Engine.cs @@ -95,10 +95,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -165,7 +166,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/Engine.cs index f05370d..c293d1d 100644 --- a/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -152,7 +153,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/Engine.cs b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/Engine.cs index 6dde322..e6665e5 100644 --- a/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -153,7 +154,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/Engine.cs index e4ca13d..240e95c 100644 --- a/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -169,7 +170,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/Std/StdPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/Engine.cs index 0fe77b3..8b641d8 100644 --- a/RegExpressWPFNET/RegexEngines/Std/StdPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/Engine.cs @@ -90,10 +90,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } diff --git a/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/Engine.cs index 8e21759..e4f6661 100644 --- a/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -152,7 +153,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/Engine.cs index c40c565..32bf336 100644 --- a/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -159,7 +160,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/Engine.cs index f3e6e8f..0dd2d85 100644 --- a/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/Engine.cs @@ -92,10 +92,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -150,7 +151,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } diff --git a/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/Engine.cs index c33bd40..92f21c0 100644 --- a/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/Engine.cs +++ b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/Engine.cs @@ -91,10 +91,11 @@ public void ImportOptions( string? json ) { Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!; } - catch + catch( Exception ex ) { // ignore versioning errors, for example - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( ex )) + throw; Options = new Options( ); } @@ -151,7 +152,8 @@ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedAr catch( Exception exc ) { _ = exc; - if( Debugger.IsAttached ) Debugger.Break( ); + if (InternalConfig.HandleException( exc )) + throw; return null; } From 83fb49e5932bd84d0cea1ce5068e5f04cb036121 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 01:53:54 -0800 Subject: [PATCH 06/11] Moved to centralized Directory.Build.props for .net target --- RegExpressWPFNET/Directory.Build.props | 5 +++++ RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj | 1 - RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj | 1 - RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj | 1 - .../RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj | 1 - .../CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj | 1 - .../CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj | 1 - .../RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj | 1 - .../RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj | 1 - .../DotNETFrameworkPlugin/DotNETFrameworkPlugin.csproj | 1 - .../RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj | 1 - .../Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj | 1 - .../RegexEngines/Java/JavaPlugin/JavaPlugin.csproj | 1 - .../JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj | 1 - .../Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj | 1 - .../RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj | 1 - .../RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj | 1 - .../RegexEngines/Python/PythonPlugin/PythonPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj | 1 - .../RegexEngines/Rust/RustPlugin/RustPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj | 1 - .../RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj | 1 - RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj | 1 - .../TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj | 1 - .../VBScript/VBScriptPlugin/VBScriptPlugin.csproj | 1 - .../Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj | 1 - 29 files changed, 5 insertions(+), 28 deletions(-) create mode 100644 RegExpressWPFNET/Directory.Build.props diff --git a/RegExpressWPFNET/Directory.Build.props b/RegExpressWPFNET/Directory.Build.props new file mode 100644 index 0000000..fb3bb5b --- /dev/null +++ b/RegExpressWPFNET/Directory.Build.props @@ -0,0 +1,5 @@ + + + net9.0-windows7.0 + + diff --git a/RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj b/RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj index cbaade0..df6d8bb 100644 --- a/RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj +++ b/RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj index 5eca725..70d26ca 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj +++ b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj @@ -2,7 +2,6 @@ WinExe - net9.0-windows7.0 enable true RegExpress.ico diff --git a/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj b/RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj +++ b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj index 78ad5a2..068627b 100644 --- a/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj +++ b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj @@ -2,7 +2,6 @@ Exe - net9.0-windows7.0 enable enable diff --git a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/DotNETFrameworkPlugin.csproj b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/DotNETFrameworkPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/DotNETFrameworkPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/DotNETFrameworkPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/JavaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/JavaPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/JavaPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/JavaPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj +++ b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/PythonPlugin.csproj b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/PythonPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/PythonPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/PythonPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj +++ b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/RustPlugin.csproj b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/RustPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/RustPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/RustPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj index 8febfad..1fc6bb7 100644 --- a/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true diff --git a/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj index 9d7f22a..e538cd7 100644 --- a/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj +++ b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj @@ -1,7 +1,6 @@ - net9.0-windows7.0 enable true true diff --git a/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj b/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj index 43db82a..6ecd9b8 100644 --- a/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj +++ b/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj @@ -2,7 +2,6 @@ WinExe - net9.0-windows enable enable true From 302dd37fc9e9058ad64f096997eec27005d6332c Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 02:08:21 -0800 Subject: [PATCH 07/11] Added the .net 9 fluent theme for basic stylizing --- RegExpressWPFNET/RegExpressWPFNET/App.xaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RegExpressWPFNET/RegExpressWPFNET/App.xaml b/RegExpressWPFNET/RegExpressWPFNET/App.xaml index 2fc9d44..10dd6ff 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/App.xaml +++ b/RegExpressWPFNET/RegExpressWPFNET/App.xaml @@ -8,9 +8,14 @@ xmlns:sys="clr-namespace:System;assembly=mscorlib" StartupUri="MainWindow.xaml" Startup="App_Startup" + ThemeMode="System" > + + + + @@ -613,7 +618,7 @@ --> - + From 8eb2715e767c51fa8c63980ef79797607fd6b427 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Wed, 26 Nov 2025 03:11:02 -0800 Subject: [PATCH 08/11] Added load text from file button and basic CLI handling for doing the same --- .../RegExpressWPFNET/Code/Utilities.cs | 20 ++++++++++++ RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml | 15 +++++++-- .../RegExpressWPFNET/UCMain.xaml.cs | 31 +++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs index ad9979d..9068935 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs +++ b/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs @@ -47,6 +47,26 @@ public static double PointsFromInvariantString( string value ) return PixelsFromInvariantString( value ) * r; } + private static string[]? _commandLineArgs; + public static bool GetCommandLineArg( String arg, out String? NextVal ) + { + _commandLineArgs ??= Environment.GetCommandLineArgs( ); + var pos = Array.IndexOf( _commandLineArgs, "--" + arg ); + NextVal = null; + if( pos == -1 ) + return false; + if( pos + 1 < _commandLineArgs.Length ) + NextVal = _commandLineArgs[pos + 1]; + return true; + } + public static string? GetCommandLineArgStr( String arg ) + { + if (! GetCommandLineArg( arg, out String? NextVal )) + return null; + return NextVal; + } + public static bool GetCommandLineExists(String arg) => GetCommandLineArg( arg, out _ ); + [Conditional( "DEBUG" )] public static void DbgSimpleLog( Exception exc, [CallerFilePath] string? filePath = null, [CallerMemberName] string? memberName = null, [CallerLineNumber] int lineNumber = 0 ) diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml index b5097ad..834c167 100644 --- a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml +++ b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml @@ -12,8 +12,16 @@ IsVisibleChanged="UserControl_IsVisibleChanged" > - - + + + + + @@ -67,7 +75,8 @@ - +