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/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..0e330d98
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "PilotAIAssistantControl"]
+ path = PilotAIAssistantControl
+ url = https://github.com/mitchcapper/PilotAIAssistantControl
diff --git a/PilotAIAssistantControl b/PilotAIAssistantControl
new file mode 160000
index 00000000..1daf03c3
--- /dev/null
+++ b/PilotAIAssistantControl
@@ -0,0 +1 @@
+Subproject commit 1daf03c3c068af9486c5880813ce53f16ab4041a
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/IRegexEngine.cs b/RegExpressWPFNET/RegExpressLibrary/IRegexEngine.cs
index 78cd4595..36f11dfe 100644
--- a/RegExpressWPFNET/RegExpressLibrary/IRegexEngine.cs
+++ b/RegExpressWPFNET/RegExpressLibrary/IRegexEngine.cs
@@ -14,8 +14,27 @@ namespace RegExpressLibrary
public delegate void RegexEngineOptionsChanged( IRegexEngine sender, RegexEngineOptionsChangedArgs args );
+ public interface IBaseEngine
+ {
+ string Name { get; }
+ string? ExportOptions( ); // (JSON)
+ }
+ public interface IAIBase : IBaseEngine
+ {
+ string AIPatternType => "Regex";
+ string AIPatternCodeblockType => "regex";
+ string AIAdditionalSystemPrompt => "If the language supports named capture groups, use these by default. " +
+ "If the user has ignoring patterned whitespace enabled in the options, use multi-lines and minimal in-regex comments for complex regexes with nice whitespace formatting to make it more readable. ";
+
+ string ReferenceTextHeader => "Users current target text";
+ string GetSystemPrompt( ) => $"You are a {Name} {AIPatternType} expert assistant. The user has questions about their {AIPatternType} patterns and target text. " +
+ $"Provide {AIPatternType} patterns inside Markdown code blocks (```{AIPatternCodeblockType} ... ```). " +
+ "Explain how the pattern works briefly. " +
+ AIAdditionalSystemPrompt +
+ $"They currently have these engine options enabled:\n```json\n{ExportOptions( )}\n```";
+ }
- public interface IRegexEngine
+ public interface IRegexEngine : IAIBase
{
event RegexEngineOptionsChanged? OptionsChanged;
event EventHandler? FeatureMatrixReady;
@@ -26,8 +45,6 @@ public interface IRegexEngine
(string Kind, string? Version) CombinedId => (Kind, Version);
- string Name { get; }
-
string Subtitle { get; }
RegexEngineCapabilityEnum Capabilities { get; }
@@ -36,8 +53,6 @@ public interface IRegexEngine
Control GetOptionsControl( );
- string? ExportOptions( ); // (JSON)
-
void ImportOptions( string? json );
RegexMatches GetMatches( ICancellable cnc, [StringSyntax( StringSyntaxAttribute.Regex )] string pattern, string text );
diff --git a/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs
new file mode 100644
index 00000000..a3907c10
--- /dev/null
+++ b/RegExpressWPFNET/RegExpressLibrary/InternalConfig.cs
@@ -0,0 +1,124 @@
+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 bool DEBUG_LOG_AI_MESSAGES = true;
+
+ ///
+ /// as the target text can be long lets not keep the old versions around two options are update the target text with the new text, or remove the old one add a note and add the new one
+ ///
+ public static bool DONT_UPDATE_OLD_AI_TEXT_MARK_REMOVED = true;
+ 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.slnx b/RegExpressWPFNET/RegExpressWPFNET.slnx
index bfd60797..3a2f8093 100644
--- a/RegExpressWPFNET/RegExpressWPFNET.slnx
+++ b/RegExpressWPFNET/RegExpressWPFNET.slnx
@@ -3,6 +3,10 @@
+
+
+
+
@@ -37,6 +41,9 @@
+
+
+
@@ -142,6 +149,7 @@
+
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..168ffcc8 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;
@@ -48,7 +49,7 @@ private void App_Startup( object sender, StartupEventArgs e )
SetForegroundWindow( other_process.MainWindowHandle );
- Shutdown( );
+ Environment.Exit(0); // Calling shutdown still constructs MainWindow.xaml which in turn attempts to save the session before it loads erasing the session data
return;
}
@@ -57,10 +58,15 @@ private void App_Startup( object sender, StartupEventArgs e )
if( other_process != null )
{
- Shutdown( );
+ Environment.Exit(0); // Calling shutdown still constructs MainWindow.xaml which in turn attempts to save the session before it loads erasing the session data
return;
}
+ var onlyEngine = Utilities.GetCommandLineArgArr( "only-engine-dll" );
+ if( onlyEngine.Length > 0 )
+ {
+ RegExpressLibrary.InternalConfig.limited_engine_dlls = 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/OutputBuilder.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/OutputBuilder.cs
index 229dbbc3..0c124666 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/Code/OutputBuilder.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/Code/OutputBuilder.cs
@@ -63,12 +63,13 @@ public OutputBuilder( StyleInfo? specialStyleInfo )
sb.Clear( );
runs.Clear( );
isPreviousSpecial = false;
+ int realLength = 0;
for( int i = 0; i < text.Length; i++ )
{
- if( i >= maxLength )
+ if( realLength >= maxLength )
{
- AppendSpecial( @"…" );
+ realLength += AppendSpecial( @"…" );
break;
}
@@ -78,13 +79,13 @@ public OutputBuilder( StyleInfo? specialStyleInfo )
switch( c )
{
case '\r':
- AppendSpecial( @"\r" );
+ realLength += AppendSpecial( @"\r" );
continue;
case '\n':
- AppendSpecial( @"\n" );
+ realLength += AppendSpecial( @"\n" );
continue;
case '\t':
- AppendSpecial( @"\t" );
+ realLength += AppendSpecial( @"\t" );
continue;
}
@@ -100,7 +101,7 @@ public OutputBuilder( StyleInfo? specialStyleInfo )
( c >= UnicodeRanges.Hebrew.FirstCodePoint && c < UnicodeRanges.Hebrew.FirstCodePoint + UnicodeRanges.Hebrew.Length && char.GetUnicodeCategory( c ) == UnicodeCategory.OtherLetter )
)
{
- AppendNormal( c );
+ realLength += AppendNormal( c );
continue;
}
@@ -138,13 +139,13 @@ public OutputBuilder( StyleInfo? specialStyleInfo )
case UnicodeCategory.OtherSymbol:
//case UnicodeCategory.OtherNotAssigned:
*/
- AppendNormal( c );
+ realLength += AppendNormal( c );
break;
default:
- AppendCode( c );
+ realLength += AppendCode( c );
break;
}
@@ -209,7 +210,7 @@ public OutputBuilder( StyleInfo? specialStyleInfo )
}
- private void AppendSpecial( string s )
+ private int AppendSpecial( string s )
{
if( isPreviousSpecial || specialStyleInfo == null )
{
@@ -226,16 +227,17 @@ private void AppendSpecial( string s )
sb.Clear( ).Append( s );
isPreviousSpecial = true;
}
+ return s.Length;
}
- private void AppendCode( char c )
+ private int AppendCode( char c )
{
- AppendSpecial( $@"\u{(int)c:X4}" );
+ return AppendSpecial( $@"\u{(int)c:X4}" );
}
- private void AppendNormal( char c )
+ private int AppendNormal( char c )
{
if( !isPreviousSpecial )
{
@@ -252,6 +254,7 @@ private void AppendNormal( char c )
sb.Clear( ).Append( c );
isPreviousSpecial = false;
}
+ return 1;
}
}
}
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/TabData.cs b/RegExpressWPFNET/RegExpressWPFNET/Code/TabData.cs
index dab38671..35419af3 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/Code/TabData.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/Code/TabData.cs
@@ -38,6 +38,8 @@ public sealed class TabData
class AllTabData
{
public List Tabs { get; set; } = new( );
+ public PilotAIAssistantControl.AIUserConfig AIConfig { get; set; } = new( );
+ public bool AITabOpen { get; set; } = false;
}
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..03b4b442 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/Code/Utilities.cs
@@ -47,6 +47,52 @@ public static double PointsFromInvariantString( string value )
return PixelsFromInvariantString( value ) * r;
}
+ private static string[]? _commandLineArgs;
+ public static bool GetCommandLineArg( String arg, out String? NextVal ) {
+ NextVal=null;
+ var arr = GetCommandLineArgArr( arg, 1 );
+ if (arr.Length == 0)
+ return false;
+ NextVal = arr[0];
+ return true;
+ }
+ ///
+ /// return an array with each occurrence of the arg, allows --ignore a --ignore b
+ ///
+ ///
+ ///
+ public static string[] GetCommandLineArgArr( string arg, int max = 0 )
+ {
+ _commandLineArgs ??= Environment.GetCommandLineArgs( );
+ List ret = new();
+ bool addNext = false;
+ string targetArg = "--" + arg;
+
+ foreach( var cmdArg in _commandLineArgs )
+ {
+ if( cmdArg.Equals( targetArg, StringComparison.CurrentCultureIgnoreCase) )
+ {
+ addNext = true;
+ }
+ else if( addNext )
+ {
+ ret.Add( cmdArg );
+ if (ret.Count == max)
+ break;
+ addNext = false;
+ }
+ }
+
+ return ret.ToArray( );
+ }
+ 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 +115,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 +135,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/Engines.json b/RegExpressWPFNET/RegExpressWPFNET/Engines.json
index ec34da9f..11fa10d2 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/Engines.json
+++ b/RegExpressWPFNET/RegExpressWPFNET/Engines.json
@@ -3,6 +3,10 @@
{
"path": "Engines\\DotNET9\\DotNET9Plugin.dll"
},
+ {
+ "path": "Engines\\HtmlAgilityPack\\HtmlAgilityPackPlugin.dll",
+ "no_fm": true
+ },
{
"path": "Engines\\DotNETFramework4_8\\DotNETFrameworkPlugin.dll",
"no_fm": true
diff --git a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml
index 397814f2..450c2ef0 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml
+++ b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml
@@ -3,6 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:pia="clr-namespace:PilotAIAssistantControl;assembly=PilotAIAssistantControlWPF"
+
xmlns:local="clr-namespace:RegExpressWPFNET"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
@@ -33,8 +35,27 @@
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
@@ -187,5 +208,5 @@
-
+
diff --git a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs
index f4876b14..eac24a14 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs
+++ b/RegExpressWPFNET/RegExpressWPFNET/MainWindow.xaml.cs
@@ -27,6 +27,8 @@
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Xml;
+
+using PilotAIAssistantControl;
using RegExpressLibrary;
using RegExpressWPFNET.Code;
using Path = System.IO.Path;
@@ -130,7 +132,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
@@ -176,6 +179,13 @@ private async void Window_Loaded( object sender, RoutedEventArgs e )
{
taskBarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
}
+
+ // Import AI settings
+ //all_tab_data.AIConfig = new();
+ ucAi.ImportData( all_tab_data.AIConfig );
+ if( all_tab_data.AITabOpen )
+ ucAi.IsExpanded = true;
+
}
// --- Delay effect
@@ -209,7 +219,14 @@ private void tabControlMain_SelectionChanged( object sender, SelectionChangedEve
var old_metrics = old_uc_main.GetMetrics( );
new_uc_main.ApplyMetrics( old_metrics, full: false );
}
+ if( new_uc_main != null )
+ {
+ AiOptions.CurrentTab = new_uc_main;
+ ucAi.Configure( AiOptions );
+ }
+
}
+ OurIAIUIOptions AiOptions = new( );
private void Window_Closing( object sender, System.ComponentModel.CancelEventArgs e )
@@ -224,7 +241,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
@@ -399,6 +416,30 @@ void UCMain_Changed( object? sender, EventArgs e )
AutoSaveLoop.SignalWaitAndExecute( );
}
+ void UCMain_ScopeToNewTabRequested( object? sender, ScopeToMatchEventArgs e )
+ {
+ if( !IsFullyLoaded ) return;
+ if( sender is not UCMain sourceUcMain ) return;
+
+ var tab_data = new TabData( );
+ sourceUcMain.ExportTabData( tab_data );
+
+ var fullText = sourceUcMain.ucText.GetTextData(tab_data.Eol).Text ?? ""; //we need to manually get the text data with the proper EOL as the offsets are based on the EOL the user has selected.
+
+ int start = Math.Max( 0, e.Segment.Index );
+ int length = Math.Min( e.Segment.Length, fullText.Length - start );
+ tab_data.Text = fullText.Substring( start, length );
+ tab_data.Pattern="";
+ var title = "Scoped Tab";
+ if (tabControl.SelectedItem is TabItem ti && ti.Header != null){
+ var curTitle = ti.Header.ToString();
+ var lastSpace = curTitle.LastIndexOf(' ');
+ if (lastSpace != -1)
+ title += " of" + curTitle.Substring(lastSpace);
+ }
+ AddNewTab( tab_data,tabControl.SelectedIndex+1, title );
+ }
+
void AutoSaveThreadProc( ICancellable cnc )
{
Dispatcher.InvokeAsync( SaveAllTabData, DispatcherPriority.ApplicationIdle );
@@ -428,6 +469,10 @@ void SaveAllTabData( )
all_data.Tabs.Add( tab_data );
}
+
+ all_data.AIConfig = ucAi.ExportData( );
+ all_data.AITabOpen = ucAi.IsExpanded;
+
string json = JsonSerializer.Serialize( all_data, PluginLoader.JsonOptions );
string my_file = GetMyDataFile( );
@@ -465,7 +510,8 @@ void SaveAllTabData( )
catch( Exception exc )
{
_ = exc;
- if( Debugger.IsAttached ) Debugger.Break( );
+ if( InternalConfig.HandleException( exc ) )
+ throw;
// ignore
}
@@ -518,7 +564,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 +634,7 @@ void TryRestoreWindowPlacement( )
catch( Exception exc )
{
_ = exc;
- if( Debugger.IsAttached ) Debugger.Break( );
+ if( Debugger.IsAttached ) InternalConfig.HandleException( exc );
// ignore
}
@@ -609,7 +655,7 @@ void RestoreMaximisedState( )
#region Tabs
- TabItem AddNewTab( TabData? tabData )
+ TabItem AddNewTab( TabData? tabData, int insertAt=-1, String? forceTitle=null )
{
int max =
GetMainTabs( )
@@ -632,7 +678,7 @@ TabItem AddNewTab( TabData? tabData )
var new_tab_item = new TabItem
{
//Header = string.IsNullOrWhiteSpace( tab_data?.Name ) ? $"Tab {max + 1}" : tab_data.Name;
- Header = $"Regex {max + 1}",
+ Header = forceTitle ?? $"Regex {max + 1}",
HeaderTemplate = (DataTemplate)tabControl.Resources["TabTemplate"]
};
@@ -643,12 +689,14 @@ TabItem AddNewTab( TabData? tabData )
};
new_tab_item.Content = uc_main;
-
- tabControl.Items.Insert( tabControl.Items.IndexOf( tabItemNew ), new_tab_item );
+ if (insertAt == -1)
+ insertAt = tabControl.Items.IndexOf( tabItemNew );
+ tabControl.Items.Insert( insertAt, new_tab_item );
if( tabData != null ) uc_main.ApplyTabData( tabData );
uc_main.Changed += UCMain_Changed;
+ uc_main.ScopeToNewTabRequested += UCMain_ScopeToNewTabRequested;
tabControl.SelectedItem = new_tab_item; //?
@@ -774,10 +822,54 @@ void GoToOptions( )
}
+ private void AiExpander_Expanded( object sender, RoutedEventArgs e )
+ {
+ // Connect the AI panel to the current tab when expanded
+ var uc_main = GetActiveUCMain( );
+ if( uc_main != null )
+ {
+ AiOptions.CurrentTab = uc_main;
+ ucAi.Configure( AiOptions );
+ }
+ }
+
+
[GeneratedRegex( @"^Regex\s*(\d+)$" )]
private static partial Regex HeaderParserRegex( );
#endregion
+
+
+ public class OurIAIUIOptions : AIOptions
+ {
+ public override string HintForUserInput => "Ask about a regex or matching...";
+ public override string ReferenceTextDisplayName => "Target Text";
+ public override string FormatUserQuestion( string userQuestion ) => $"Current pattern:\n```{CurrentTab.CurrentRegexEngine?.AIPatternCodeblockType}\n{CurrentTab.ucPattern.GetTextData( "\n" ).Text}\n```\n\nMy question: {userQuestion}";
+ public UCMain? CurrentTab;
+
+ public override string GetCurrentReferenceText( ) => CurrentTab?.ucText.GetTextData( "\n" ).Text;
+ public override IEnumerable CodeblockActions => [ GenericCodeblockAction.ClipboardAction,
+ new GenericCodeblockAction("📝 Use as Pattern", async ( block ) =>
+ {
+
+ if( CurrentTab == null ) return false;
+ CurrentTab.ucPattern.SetText( block.Code );
+ return true;
+ } )
+ {
+ Tooltip="Use this code block as the regex pattern",
+ FeedbackOnAction="✓ Applied!"
+ }
+ ];
+
+ public override void HandleDebugMessage( string msg )
+ {
+ if( InternalConfig.DEBUG_LOG_AI_MESSAGES )
+ System.Diagnostics.Debug.WriteLine( msg );
+ }
+
+ public override string GetSystemPrompt( ) => CurrentTab?.CurrentRegexEngine?.GetSystemPrompt( ) ?? null;
+ }
}
}
diff --git a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
index 63997f06..fe2bd14b 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
+++ b/RegExpressWPFNET/RegExpressWPFNET/RegExpressWPFNET.csproj
@@ -2,10 +2,11 @@
WinExe
- net9.0-windows7.0
enable
true
+ preview
RegExpress.ico
+ app.manifest
@@ -19,6 +20,12 @@
+
+
+
+
+
+
diff --git a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
index b5097ad8..924f418d 100644
--- a/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
+++ b/RegExpressWPFNET/RegExpressWPFNET/UCMain.xaml
@@ -5,15 +5,23 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RegExpressWPFNET"
mc:Ignorable="d"
- Width="800"
- Height="450"
- Loaded="UserControl_Loaded"
+ Width="800"
+ Height="450"
+ Loaded="UserControl_Loaded"
Unloaded="UserControl_Unloaded"
- IsVisibleChanged="UserControl_IsVisibleChanged"
+ IsVisibleChanged="UserControl_IsVisibleChanged"
>
-
-
+
+
+
+
+
@@ -67,7 +75,8 @@
-
+
+
@@ -107,7 +116,7 @@
-
+
@@ -173,7 +182,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/HtmlAgilityPack/HtmlAgilityPackPlugin/Engine.cs b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Engine.cs
new file mode 100644
index 00000000..90d728b3
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Engine.cs
@@ -0,0 +1,145 @@
+using RegExpressLibrary;
+using RegExpressLibrary.Matches;
+using RegExpressLibrary.SyntaxColouring;
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using System.Windows.Controls;
+
+
+namespace HtmlAgilityPackPlugin
+{
+ class Engine : IRegexEngine, IAIBase
+
+
+ {
+ string IAIBase.AIPatternType => Options.SelectorMode == SelectorMode.XPath ? "html xpath" : "html css query selector";
+ string IAIBase.AIPatternCodeblockType => Options.SelectorMode == SelectorMode.XPath ? "xpath" : "css";
+ string IAIBase.AIAdditionalSystemPrompt => "";
+ static readonly Lazy LazyVersion = new( Matcher.GetVersion );
+
+ Options mOptions = new( );
+ readonly Lazy mOptionsControl;
+
+ public Engine( )
+ {
+ mOptionsControl = new Lazy( ( ) =>
+ {
+ UCOptions oc = new( );
+ oc.SetOptions( Options );
+ oc.Changed += OptionsControl_Changed;
+
+ return oc;
+ } );
+ }
+
+ public Options Options
+ {
+ get
+ {
+ return mOptions;
+ }
+ set
+ {
+ mOptions = value;
+
+ if( mOptionsControl.IsValueCreated ) mOptionsControl.Value.SetOptions( mOptions );
+ }
+ }
+
+ #region IRegexEngine
+
+ public string Kind => "HtmlAgilityPack";
+
+ public string? Version => LazyVersion.Value;
+
+ public string Name => "HtmlAgilityPack";
+
+ public string Subtitle => mOptions.SelectorMode == SelectorMode.XPath ? "XPath" : "CSS";
+
+ public RegexEngineCapabilityEnum Capabilities => RegexEngineCapabilityEnum.Default;// | RegexEngineCapabilityEnum.NoCaptures;
+
+ public string? NoteForCaptures => "This engine uses XPath or CSS selectors to select HTML nodes, not regex patterns.";
+
+ public event RegexEngineOptionsChanged? OptionsChanged;
+#pragma warning disable 0067
+ public event EventHandler? FeatureMatrixReady;
+#pragma warning restore 0067
+
+ public Control GetOptionsControl( )
+ {
+ return mOptionsControl.Value;
+ }
+
+ public string? ExportOptions( )
+ {
+ string json = JsonSerializer.Serialize( Options, JsonUtilities.JsonOptions );
+
+ return json;
+ }
+
+ public void ImportOptions( string? json )
+ {
+ if( string.IsNullOrWhiteSpace( json ) )
+ {
+ Options = new Options( );
+ }
+ else
+ {
+ try
+ {
+ Options = JsonSerializer.Deserialize( json, JsonUtilities.JsonOptions )!;
+ }
+ catch( Exception ex )
+ {
+ // ignore versioning errors, for example
+ if( InternalConfig.HandleException( ex ) )
+ throw;
+
+ Options = new Options( );
+ }
+ }
+ }
+
+ public RegexMatches GetMatches( ICancellable cnc, string pattern, string text )
+ {
+ return Matcher.GetMatches( cnc, pattern, text, Options );
+ }
+
+ public SyntaxOptions GetSyntaxOptions( )
+ {
+ // XPath and CSS selectors have their own syntax, not regex syntax
+ // Return Literal mode so no regex syntax highlighting is applied
+ return new SyntaxOptions
+ {
+ Literal = true,
+ XLevel = XLevelEnum.none,
+ FeatureMatrix = new FeatureMatrix( )
+ };
+ }
+
+ public IReadOnlyList GetFeatureMatrices( )
+ {
+ // This engine doesn't use regex, so return empty feature matrix
+ return [];
+ }
+
+ public void SetIgnoreCase( bool yes )
+ {
+ // XPath/CSS selectors don't have a direct ignore case option
+ // but we could potentially add this in the future
+ }
+
+ public void SetIgnorePatternWhitespace( bool yes )
+ {
+ // Not applicable for XPath/CSS selectors
+ }
+
+ #endregion
+
+ private void OptionsControl_Changed( object? sender, RegexEngineOptionsChangedArgs args )
+ {
+ OptionsChanged?.Invoke( this, args );
+ }
+ }
+}
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/HtmlAgilityPackPlugin.csproj b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/HtmlAgilityPackPlugin.csproj
new file mode 100644
index 00000000..78888ec8
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/HtmlAgilityPackPlugin.csproj
@@ -0,0 +1,23 @@
+
+
+
+ enable
+ true
+ true
+ OnOutputUpdated
+
+
+
+
+ All
+
+
+
+
+
+ false
+ runtime
+
+
+
+
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Matcher.cs b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Matcher.cs
new file mode 100644
index 00000000..6dd4d5c1
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Matcher.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using HtmlAgilityPack;
+using RegExpressLibrary;
+using RegExpressLibrary.Matches;
+using RegExpressLibrary.Matches.Simple;
+using Universal.HtmlAgilityPack;
+
+
+namespace HtmlAgilityPackPlugin
+{
+ static class Matcher
+ {
+ // Cache the FieldInfo for the private _outerlength field
+ // HtmlAgilityPack's OuterHtml property returns reconstructed/normalized HTML which may differ
+ // in length from the original text (e.g., due to CRLF normalization). The private _outerlength
+ // field contains the actual length in the original source text.
+ private static readonly FieldInfo? OuterLengthField = typeof( HtmlNode ).GetField( "_outerlength", BindingFlags.NonPublic | BindingFlags.Instance );
+
+ public static RegexMatches GetMatches( ICancellable cnc, string pattern, string text, Options options )
+ {
+ if( string.IsNullOrWhiteSpace( pattern ) )
+ {
+ return RegexMatches.Empty;
+ }
+
+ if( string.IsNullOrEmpty( text ) )
+ {
+ return RegexMatches.Empty;
+ }
+
+ try
+ {
+ var doc = new HtmlDocument( );
+ doc.LoadHtml( text );
+
+ IEnumerable nodes;
+
+ if( options.SelectorMode == SelectorMode.XPath )
+ {
+ nodes = doc.DocumentNode.SelectNodes( pattern );
+ }
+ else // CssSelector
+ {
+ // CSS selectors are case-insensitive for tag names in HTML
+ // HtmlAgilityPack normalizes tag names to lowercase, so convert selector to lowercase
+ nodes = doc.DocumentNode.QuerySelectorAll( pattern.ToLowerInvariant( ) );
+ }
+
+ if( nodes == null || !nodes.Any( ) )
+ {
+ return RegexMatches.Empty;
+ }
+
+ if( cnc.IsCancellationRequested ) return RegexMatches.Empty;
+
+ var matches = new List( );
+ var sourceTextGetter = new SimpleTextGetter( text );
+
+ foreach( var node in nodes )
+ {
+ if( cnc.IsCancellationRequested ) return RegexMatches.Empty;
+
+ // Get the position of the node in the original text (for highlighting)
+ int index = node.StreamPosition;
+
+ // Use the private _outerlength field to get the actual length in the original text.
+ // OuterHtml.Length can differ due to HTML normalization (e.g., CRLF → LF conversion).
+ int length;
+ if( OuterLengthField != null )
+ {
+ length = (int)( OuterLengthField.GetValue( node ) ?? node.OuterHtml.Length );
+ }
+ else
+ {
+ // Fallback if reflection fails (shouldn't happen, but be safe)
+ length = node.OuterHtml.Length;
+ }
+
+ // Validate and clamp the index/length to avoid out-of-bounds
+ if( index < 0 ) index = 0;
+ if( index > text.Length ) continue;
+ if( index + length > text.Length ) length = text.Length - index;
+ if( length <= 0 ) continue;
+
+ // Match is always the full element (OuterHtml)
+ var match = SimpleMatch.Create( index, length, sourceTextGetter );
+
+ // Add default group (group 0 - the full match) - this is skipped in display but needed for structure
+ match.AddGroup( index, length, true, "" );
+
+ // Add named "Value" group based on output mode
+ if( options.OutputMode == OutputMode.InnerHtml )
+ {
+ string innerHtml = node.InnerHtml;
+ // Use SimpleTextGetterWithOffset to return the innerHtml as the group's Value
+ // The index/length point to the element in source for highlighting
+ var valueTextGetter = new SimpleTextGetterWithOffset( index, innerHtml );
+ match.AddGroup( index, innerHtml.Length, true, "Value", valueTextGetter );
+ }
+ else if( options.OutputMode == OutputMode.InnerText )
+ {
+ string innerText = node.InnerText;
+ // Use SimpleTextGetterWithOffset to return the innerText as the group's Value
+ var valueTextGetter = new SimpleTextGetterWithOffset( index, innerText );
+ match.AddGroup( index, innerText.Length, true, "Value", valueTextGetter );
+ }
+
+ matches.Add( match );
+ }
+
+ return new RegexMatches( matches.Count, matches );
+ }
+ catch( Exception ex )
+ {
+ throw new Exception( $"Error processing selector: {ex.Message}", ex );
+ }
+ }
+
+ public static string? GetVersion( )
+ {
+ try
+ {
+ var assembly = typeof( HtmlDocument ).Assembly;
+ var version = assembly.GetName( ).Version;
+ return version?.ToString( );
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Options.cs b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Options.cs
new file mode 100644
index 00000000..86fbeef8
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Options.cs
@@ -0,0 +1,26 @@
+namespace HtmlAgilityPackPlugin
+{
+ public enum SelectorMode
+ {
+ XPath,
+ CssSelector
+ }
+
+ public enum OutputMode
+ {
+ OuterHtml,
+ InnerHtml,
+ InnerText
+ }
+
+ sealed class Options
+ {
+ public SelectorMode SelectorMode { get; set; } = SelectorMode.XPath;
+ public OutputMode OutputMode { get; set; } = OutputMode.OuterHtml;
+
+ public Options Clone( )
+ {
+ return (Options)MemberwiseClone( );
+ }
+ }
+}
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Plugin.cs b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Plugin.cs
new file mode 100644
index 00000000..6772cd46
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/Plugin.cs
@@ -0,0 +1,18 @@
+using RegExpressLibrary;
+using System.Collections.Generic;
+
+
+namespace HtmlAgilityPackPlugin
+{
+ public class Plugin : RegexPlugin
+ {
+ #region RegexPlugin
+
+ public override IReadOnlyList GetEngines( )
+ {
+ return new[] { new Engine( ) };
+ }
+
+ #endregion
+ }
+}
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml
new file mode 100644
index 00000000..63710f83
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml.cs b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml.cs
new file mode 100644
index 00000000..f19cc9ec
--- /dev/null
+++ b/RegExpressWPFNET/RegexEngines/HtmlAgilityPack/HtmlAgilityPackPlugin/UCOptions.xaml.cs
@@ -0,0 +1,83 @@
+using RegExpressLibrary;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+
+namespace HtmlAgilityPackPlugin
+{
+ ///
+ /// Interaction logic for UCOptions.xaml
+ ///
+ public partial class UCOptions : UserControl
+ {
+ internal event EventHandler? Changed;
+
+ bool IsFullyLoaded = false;
+ int ChangeCounter = 0;
+ Options Options = new( );
+
+ public UCOptions( )
+ {
+ InitializeComponent( );
+ }
+
+ private void UserControl_Loaded( object sender, RoutedEventArgs e )
+ {
+ if( IsFullyLoaded ) return;
+
+ IsFullyLoaded = true;
+ }
+
+ private void SelectorMode_Changed( object sender, RoutedEventArgs e )
+ {
+ if( !IsFullyLoaded ) return;
+ if( ChangeCounter != 0 ) return;
+
+ if( rbXPath.IsChecked == true )
+ Options.SelectorMode = SelectorMode.XPath;
+ else if( rbCssSelector.IsChecked == true )
+ Options.SelectorMode = SelectorMode.CssSelector;
+
+ Changed?.Invoke( this, new RegexEngineOptionsChangedArgs { PreferImmediateReaction = false } );
+ }
+
+ private void OutputMode_Changed( object sender, RoutedEventArgs e )
+ {
+ if( !IsFullyLoaded ) return;
+ if( ChangeCounter != 0 ) return;
+
+ if( rbOuterHtml.IsChecked == true )
+ Options.OutputMode = OutputMode.OuterHtml;
+ else if( rbInnerHtml.IsChecked == true )
+ Options.OutputMode = OutputMode.InnerHtml;
+ else if( rbInnerText.IsChecked == true )
+ Options.OutputMode = OutputMode.InnerText;
+
+ Changed?.Invoke( this, new RegexEngineOptionsChangedArgs { PreferImmediateReaction = false } );
+ }
+
+ internal void SetOptions( Options options )
+ {
+ try
+ {
+ ++ChangeCounter;
+
+ Options = options;
+
+ // Update selector mode radio buttons
+ rbXPath.IsChecked = options.SelectorMode == SelectorMode.XPath;
+ rbCssSelector.IsChecked = options.SelectorMode == SelectorMode.CssSelector;
+
+ // Update output mode radio buttons
+ rbOuterHtml.IsChecked = options.OutputMode == OutputMode.OuterHtml;
+ rbInnerHtml.IsChecked = options.OutputMode == OutputMode.InnerHtml;
+ rbInnerText.IsChecked = options.OutputMode == OutputMode.InnerText;
+ }
+ finally
+ {
+ --ChangeCounter;
+ }
+ }
+ }
+}
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/SolutionEvents/CopyFiles.cmd b/RegExpressWPFNET/SolutionEvents/CopyFiles.cmd
index ba45bb91..46838aba 100644
--- a/RegExpressWPFNET/SolutionEvents/CopyFiles.cmd
+++ b/RegExpressWPFNET/SolutionEvents/CopyFiles.cmd
@@ -118,6 +118,14 @@ xcopy /D /R /Y "%BasePath%\HyperscanPlugin\bin\%Configuration%\%TargetDir%\Hyper
xcopy /D /R /Y "%BasePath%\HyperscanWorker\bin\%Configuration%\%Platform%\HyperscanWorker.exe" "%EnginesTargetPath%\Hyperscan\*.bin"
+rem -- HtmlAgilityPack --
+
+set BasePath=%SolutionDir%\RegexEngines\HtmlAgilityPack
+xcopy /D /R /Y "%BasePath%\HtmlAgilityPackPlugin\bin\%Configuration%\%TargetDir%\HtmlAgilityPackPlugin.dll" "%EnginesTargetPath%\HtmlAgilityPack\*"
+xcopy /D /R /Y "%BasePath%\HtmlAgilityPackPlugin\bin\%Configuration%\%TargetDir%\HtmlAgilityPack.dll" "%EnginesTargetPath%\HtmlAgilityPack\*"
+xcopy /D /R /Y "%BasePath%\HtmlAgilityPackPlugin\bin\%Configuration%\%TargetDir%\Universal.*.dll" "%EnginesTargetPath%\HtmlAgilityPack\*"
+
+
rem -- ICU --
set BasePath=%SolutionDir%\RegexEngines\ICU
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