diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..620fcb3e
--- /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
diff --git a/RegExpressWPFNET/Directory.Build.props b/RegExpressWPFNET/Directory.Build.props
new file mode 100644
index 00000000..fb3bb5b6
--- /dev/null
+++ b/RegExpressWPFNET/Directory.Build.props
@@ -0,0 +1,5 @@
+
+
+ net9.0-windows7.0
+
+
diff --git a/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs
new file mode 100644
index 00000000..3b691cc0
--- /dev/null
+++ b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs
@@ -0,0 +1,118 @@
+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;
+ public static string[]? limited_engine_dlls;
+ [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 73cdd9e9..4b978bc1 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);
}
@@ -81,6 +80,11 @@ public static class PluginLoader
{
foreach( EngineData engine_data in engines_data.engines )
{
+ if ( InternalConfig.limited_engine_dlls?.Length > 0 && !InternalConfig.limited_engine_dlls.Any( dll => engine_data.path.Contains(dll, StringComparison.CurrentCultureIgnoreCase) ) )
+ {
+ Debug.WriteLine( $"Skipping plugin due to limited_engine_dlls \"{engine_data.path}\"..." );
+ continue;
+ }
string plugin_absolute_path = Path.Combine( plugin_root_folder, engine_data.path! );
try
@@ -106,18 +110,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 +145,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 68a9aae8..77ed1a3c 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/RegExpressLibrary/RegExpressLibrary.csproj b/RegExpressWPFNET/RegExpressLibrary/RegExpressLibrary.csproj
index cbaade07..df6d8bb0 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/RegExpressLibrary/UI/CheckboxWithNote.xaml b/RegExpressWPFNET/RegExpressLibrary/UI/CheckboxWithNote.xaml
index 8af92aba..2181e3ae 100644
--- a/RegExpressWPFNET/RegExpressLibrary/UI/CheckboxWithNote.xaml
+++ b/RegExpressWPFNET/RegExpressLibrary/UI/CheckboxWithNote.xaml
@@ -9,7 +9,7 @@
x:Name="userControl" DataContextChanged="userControl_DataContextChanged"
>
-
+
diff --git a/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs b/RegExpressWPFNET/RegExpressWPFNET/Adorners/UnderliningAdorner.cs
index 323bc3d5..e2432394 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 b/RegExpressWPFNET/RegExpressWPFNET/App.xaml
index 2fc9d44e..aed9901a 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/App.xaml
+++ b/RegExpressWPFNET/RegExpressWPFNET/App.xaml
@@ -8,11 +8,16 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
StartupUri="MainWindow.xaml"
Startup="App_Startup"
+ ThemeMode="System"
>
-
-
+
+
+
+
+
+
+
+
-
-
+
-
@@ -613,7 +625,7 @@
-->
-
+
diff --git a/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs
index bdc3b420..0e9ea8a1 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/App.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using RegExpressWPFNET.Code;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
@@ -61,6 +62,11 @@ private void App_Startup( object sender, StartupEventArgs e )
return;
}
+ var onlyEngine = Utilities.GetCommandLineArgStr( "only-engine-dll" );
+ if( !String.IsNullOrWhiteSpace( onlyEngine ) )
+ {
+ RegExpressLibrary.InternalConfig.limited_engine_dlls = new[] { onlyEngine! };
+ }
}
@@ -93,17 +99,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 5964f2bf..a046f89a 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 f54e774d..d3a00d27 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 134b0f7f..2d0b0e3e 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 2ecba6fd..e24eb384 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 63ccdfeb..90689355 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 )
@@ -69,7 +89,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 +109,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/Controls/BaseBoolNullConverter.cs b/RegExpressWPFNET/RegExpressWPFNET/Controls/BaseBoolNullConverter.cs
new file mode 100644
index 00000000..fc68d8fd
--- /dev/null
+++ b/RegExpressWPFNET/RegExpressWPFNET/Controls/BaseBoolNullConverter.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace RegExpressWPFNET.Controls
+{
+
+ public class BoolNullVisibilityCollapsedConverter( ) : BaseBoolNullConverter( Visibility.Visible, Visibility.Collapsed ), IValueConverter
+ {
+ }
+ public abstract class BaseBoolNullConverter( object true_val, object false_val )
+ {
+
+ public object Convert( object value, Type targetType, object parameter, CultureInfo? culture )
+ {
+ var res = GetConvertResult( value, parameter );
+ if( targetType == typeof( Boolean ) )
+ return res;
+ return res ? true_val : false_val;
+ }
+ //uwp
+ public object Convert( object value, Type targetType, object parameter, string language ) => Convert( value, targetType, parameter, default( CultureInfo ) );
+ public static bool GetConvertResult( object value, object parameter )
+ {
+ bool res = true;
+ if( value == null )
+ res = false;
+ else if( value is string sv )
+ res = !String.IsNullOrWhiteSpace( sv );
+ else if( value is bool bv )
+ res = bv;
+ if( parameter != null && ( ( parameter.GetType( ) == typeof( bool ) && ( (bool)parameter ) ) || ( parameter.GetType( ) == typeof( string ) && new string[] { "true", "1" }.Contains( parameter as string ) ) ) )
+ res = !res;
+ return res;
+ }
+ public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture ) => throw new NotImplementedException( );
+ public object ConvertBack( object value, Type targetType, object parameter, string language ) => throw new NotImplementedException( );
+ }
+}
diff --git a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs
index f4876b14..7d321c5f 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/RegExpressWPFNET.csproj b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
index 63997f06..70d26ca0 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
+++ b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
@@ -2,10 +2,10 @@
WinExe
- net9.0-windows7.0
enable
true
RegExpress.ico
+ app.manifest
diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
index b5097ad8..834c167c 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
+++ b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
@@ -12,8 +12,16 @@
IsVisibleChanged="UserControl_IsVisibleChanged"
>
-
-
+
+
+
+
+
@@ -67,7 +75,8 @@
-
+
+
diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs
index 527afc11..0de9d1e9 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml.cs
@@ -257,6 +257,16 @@ private void UserControl_Loaded( object sender, RoutedEventArgs e )
StopAll( );
RestartAll( );
}
+ var loadFile = Utilities.GetCommandLineArgStr( "text-load-file" );
+ if( !String.IsNullOrWhiteSpace( loadFile ) )
+ {
+ ucText.SetText( File.ReadAllText( loadFile ) );
+ }
+ loadFile = Utilities.GetCommandLineArgStr( "pattern-load-file" );
+ if( !String.IsNullOrWhiteSpace( loadFile ) )
+ {
+ ucPattern.SetText( File.ReadAllText( loadFile ) );
+ }
}
}
@@ -879,7 +889,7 @@ void IndeterminateProgressThreadProc( )
catch( Exception exc )
{
_ = exc;
- if( Debugger.IsAttached ) Debugger.Break( );
+ if( Debugger.IsAttached ) InternalConfig.HandleException( exc );
// ignore
}
@@ -899,7 +909,7 @@ void HideIndeterminateProgress( Thread indeterminateProgressThread )
catch( Exception exc )
{
_ = exc;
- if( Debugger.IsAttached ) Debugger.Break( );
+ InternalConfig.HandleException( exc );
// ignore
}
@@ -1154,5 +1164,26 @@ public void Dispose( )
[GeneratedRegex( @"\t|([ ](\r|\n|$))|((\r|\n)$)", RegexOptions.ExplicitCapture )]
private static partial Regex HasWhitespaceRegex( );
+ private void LoadFile_Click( object sender, RoutedEventArgs e )
+ {
+ var openFileDialog = new Microsoft.Win32.OpenFileDialog
+ {
+ Filter = "All files (*.*)|*.*|Text files (*.txt)|*.txt",
+ FilterIndex = 1
+ };
+
+ if( openFileDialog.ShowDialog( ) == true )
+ {
+ try
+ {
+ string fileContent = File.ReadAllText( openFileDialog.FileName );
+ ucText.SetText( fileContent );
+ }
+ catch( Exception ex )
+ {
+ MessageBox.Show( $"Error reading file: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error );
+ }
+ }
+ }
}
}
diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/UCMatches.xaml.cs
index 1441939c..43fa674c 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/RegExpressWPFNET/app.manifest b/RegExpressWPFNET/RegExpressWPFNET/app.manifest
new file mode 100644
index 00000000..df92cb6a
--- /dev/null
+++ b/RegExpressWPFNET/RegExpressWPFNET/app.manifest
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ PerMonitorV2
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/AdaPlugin.csproj
index 8febfad3..1fc6bb7c 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/Ada/AdaPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Ada/AdaPlugin/Engine.cs
index c58c6bde..7391b662 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/BoostPlugin.csproj b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/BoostPlugin.csproj
index 8febfad3..1fc6bb7c 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/Boost/BoostPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Boost/BoostPlugin/Engine.cs
index e317474a..d2edda03 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/CompileTimeRegexPlugin.csproj b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/CompileTimeRegexPlugin.csproj
index 8febfad3..1fc6bb7c 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/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/CompileTimeRegex/CompileTimeRegexPlugin/Engine.cs
index d7d77958..950de894 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/CppBuilderPlugin.csproj b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/CppBuilderPlugin.csproj
index 9d7f22a9..e538cd78 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/CppBuilder/CppBuilderPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/CppBuilder/CppBuilderPlugin/Engine.cs
index c585e648..2766d390 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/DPlugin.csproj b/RegExpressWPFNET/RegexEngines/D/DPlugin/DPlugin.csproj
index 8febfad3..1fc6bb7c 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/D/DPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/D/DPlugin/Engine.cs
index 4c62e857..dc62261a 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/DotNET9Plugin.csproj b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/DotNET9Plugin.csproj
index 9d7f22a9..e538cd78 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/DotNET9Plugin/Engine.cs b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Plugin/Engine.cs
index 7d14b65f..a64e4b96 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/DotNET9/DotNET9Worker/DotNET9Worker.csproj b/RegExpressWPFNET/RegexEngines/DotNET9/DotNET9Worker/DotNET9Worker.csproj
index 78ad5a28..068627b0 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 9d7f22a9..e538cd78 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/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Engine.cs
index eb8ea063..fa4efeb8 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/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkPlugin/Matcher.cs
index 45751b10..f0919264 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 )!;
diff --git a/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config b/RegExpressWPFNET/RegexEngines/DotNETFramework4_8/DotNETFrameworkWorker/App.config
index 5e849d86..29034d0c 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
diff --git a/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/Engine.cs
index e1ac9ef5..0d0c95b0 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/FortranPlugin.csproj b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/FortranPlugin.csproj
index 8febfad3..1fc6bb7c 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/Fortran/FortranPlugin/MatcherForgex.cs b/RegExpressWPFNET/RegexEngines/Fortran/FortranPlugin/MatcherForgex.cs
index 5fd6ae3b..fcfafe3c 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 54bfae32..177fb32f 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 2a238e3e..d74c70ab 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 61d5116c..3daa10f8 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 792006b0..16ac936b 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/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj b/RegExpressWPFNET/RegexEngines/Hyperscan/HyperscanPlugin/HyperscanPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/Engine.cs
index 43e35581..a6e7c73a 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/ICU/ICUPlugin/ICUPlugin.csproj b/RegExpressWPFNET/RegexEngines/ICU/ICUPlugin/ICUPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Engine.cs
index 9a71dac9..a00a3717 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/JavaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/JavaPlugin.csproj
index 8febfad3..1fc6bb7c 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/Java/JavaPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/Java/JavaPlugin/Matcher.cs
index 94d97b49..bbe5c34a 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 143cf146..f4a4b295 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/JavaScriptPlugin.csproj b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/JavaScriptPlugin.csproj
index 9d7f22a9..e538cd78 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/JavaScript/JavaScriptPlugin/MatcherBun.cs b/RegExpressWPFNET/RegexEngines/JavaScript/JavaScriptPlugin/MatcherBun.cs
index 91d9fef5..da8cde6e 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 a1d16935..9768141d 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 b2d259b1..9f5bce86 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 75100377..db272f22 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 504f72a6..ae7e5b69 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 91da4dc9..659c6413 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 770bc198..47e24939 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/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj b/RegExpressWPFNET/RegexEngines/Oniguruma/OnigurumaPlugin/OnigurumaPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/Engine.cs
index 143e03de..a5eb74f8 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/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj b/RegExpressWPFNET/RegexEngines/PCRE2/PCRE2Plugin/PCRE2Plugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/Engine.cs
index 86333d64..f44a7cc2 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 8561f4b2..6da1ba0a 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/Perl/PerlPlugin/PerlPlugin.csproj b/RegExpressWPFNET/RegexEngines/Perl/PerlPlugin/PerlPlugin.csproj
index 9d7f22a9..e538cd78 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/Engine.cs
index 220feb0c..03768b12 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/Python/PythonPlugin/PythonPlugin.csproj b/RegExpressWPFNET/RegexEngines/Python/PythonPlugin/PythonPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/Engine.cs
index f05370d7..c293d1d5 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/Qt/QtPlugin/QtPlugin.csproj b/RegExpressWPFNET/RegexEngines/Qt/QtPlugin/QtPlugin.csproj
index 9d7f22a9..e538cd78 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/Engine.cs b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/Engine.cs
index 6dde3226..e6665e53 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/RE2/RE2Plugin/RE2Plugin.csproj b/RegExpressWPFNET/RegexEngines/RE2/RE2Plugin/RE2Plugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/Engine.cs
index e4ca13d5..240e95ce 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/Rust/RustPlugin/RustPlugin.csproj b/RegExpressWPFNET/RegexEngines/Rust/RustPlugin/RustPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/Engine.cs
index 0fe77b35..8b641d88 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/Std/StdPlugin/StdPlugin.csproj b/RegExpressWPFNET/RegexEngines/Std/StdPlugin/StdPlugin.csproj
index 9d7f22a9..e538cd78 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/Engine.cs b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/Engine.cs
index 8e217594..e4f66613 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/SubReg/SubRegPlugin/SubRegPlugin.csproj b/RegExpressWPFNET/RegexEngines/SubReg/SubRegPlugin/SubRegPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/Engine.cs
index c40c565d..32bf3363 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/TRE/TREPlugin/TREPlugin.csproj b/RegExpressWPFNET/RegexEngines/TRE/TREPlugin/TREPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/Engine.cs
index f3e6e8f1..0dd2d851 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/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj b/RegExpressWPFNET/RegexEngines/TinyRegexC/TinyRegexCPlugin/TinyRegexCPlugin.csproj
index 8febfad3..1fc6bb7c 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/Engine.cs b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/Engine.cs
index c33bd408..92f21c01 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;
}
diff --git a/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj b/RegExpressWPFNET/RegexEngines/VBScript/VBScriptPlugin/VBScriptPlugin.csproj
index 9d7f22a9..e538cd78 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 43db82a2..6ecd9b8c 100644
--- a/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj
+++ b/RegExpressWPFNET/Tools/ExportFeatureMatrix/ExportFeatureMatrix.csproj
@@ -2,7 +2,6 @@
WinExe
- net9.0-windows
enable
enable
true