Skip to content

Commit 618d871

Browse files
committed
fixes that the config could not be loaded and an oversight in ColumnizerPicker
1 parent b5caaab commit 618d871

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/LogExpert.Core/Classes/Columnizer/ColumnizerPicker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static ILogLineMemoryColumnizer DecideMemoryColumnizerByName (string name
6363
/// Creates a new instance of the specified columnizer type and loads its configuration from the given directory.
6464
/// </summary>
6565
/// <remarks>The method requires that the columnizer type has a public parameterless constructor. If the
66-
/// type implements IColumnizerConfigurator, its configuration is loaded from the specified directory. If these
66+
/// type implements IColumnizerConfiguratorMemory, its configuration is loaded from the specified directory. If these
6767
/// conditions are not met, the method returns null.</remarks>
6868
/// <param name="columnizer">The columnizer instance whose type will be cloned. If null, the method returns null.</param>
6969
/// <param name="directory">The directory path from which to load the configuration for the new columnizer instance.</param>
@@ -82,7 +82,7 @@ public static ILogLineMemoryColumnizer CloneMemoryColumnizer (ILogLineMemoryColu
8282
{
8383
var o = cti.Invoke([]);
8484

85-
if (o is IColumnizerConfigurator configurator)
85+
if (o is IColumnizerConfiguratorMemory configurator)
8686
{
8787
configurator.LoadConfig(directory);
8888
}

src/RegexColumnizer/RegexColumnizer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ public void Configure (ILogLineMemoryColumnizerCallback callback, string configD
429429

430430
string filePath = Path.Join(configDir, $"{name}Columnizer.json");
431431

432+
_config ??= new RegexColumnizerConfig
433+
{
434+
Name = GetName()
435+
};
436+
432437
RegexColumnizerConfigDialog dlg = new(_config);
433438
if (dlg.ShowDialog() == DialogResult.OK)
434439
{

0 commit comments

Comments
 (0)