Skip to content

Commit 8e706ab

Browse files
Randall FlaggRandall Flagg
authored andcommitted
Moved all the UI controls from LogExpert to LogExpert.UI.
Fixed a logic bug where taking the first element in an array but the array might be empty. Removed some warnings. Licenses moved to a more central place Removed the auto generated .resx files from the LogExpert.UI project in order to prevent an error of duplication in resources. This might happen when opening the files in design mode inside VS.
1 parent ff889ad commit 8e706ab

148 files changed

Lines changed: 27623 additions & 27676 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
Copyright (c) 2004-2017 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen
2-
3-
All rights reserved.
4-
5-
Redistribution and use in source and binary forms, with or without
6-
modification, are permitted provided that the following conditions
7-
are met:
8-
9-
* Redistributions of source code must retain the above copyright notice,
10-
this list of conditions and the following disclaimer.
11-
12-
* Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
16-
* Neither the name of Jaroslaw Kowalski nor the names of its
17-
contributors may be used to endorse or promote products derived from this
18-
software without specific prior written permission.
19-
20-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30-
THE POSSIBILITY OF SUCH DAMAGE.
1+
Copyright (c) 2004-2017 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions
7+
are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of Jaroslaw Kowalski nor the names of its
17+
contributors may be used to endorse or promote products derived from this
18+
software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30+
THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
The MIT License
2-
3-
Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com)
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6-
7-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8-
9-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1+
The MIT License
2+
3+
Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/LogExpert.Tests/BufferShiftTest.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
using LogExpert.Classes.Log;
2-
using LogExpert.Core.Classes.Log;
1+
using LogExpert.Core.Classes.Log;
32
using LogExpert.Core.Entities;
43
using LogExpert.PluginRegistry.FileSystem;
5-
64
using NUnit.Framework;
7-
85
using System.Collections.Generic;
96
using System.Linq;
107
using System.Text;
@@ -43,7 +40,7 @@ public void TestShiftBuffers1()
4340
};
4441

4542
PluginRegistry.PluginRegistry.Instance.Create(testDirectory.FullName, 500);
46-
LogfileReader reader = new(files.Last.Value, encodingOptions, true, 40, 50, options);
43+
LogfileReader reader = new(files.Last.Value, encodingOptions, true, 40, 50, options, PluginRegistry.PluginRegistry.Instance);
4744
reader.ReadFiles();
4845

4946
IList<ILogFileInfo> lil = reader.GetLogFileInfoList();

src/LogExpert.Tests/CSVColumnizerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LogExpert.Classes.Log;
1+
using LogExpert.Core.Classes.Log;
22
using LogExpert.Core.Entities;
33

44
using NUnit.Framework;
@@ -18,7 +18,7 @@ public void Instantiat_CSVFile_BuildCorrectColumnizer(string filename, string[]
1818
{
1919
CsvColumnizer.CsvColumnizer csvColumnizer = new();
2020
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename);
21-
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions());
21+
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), PluginRegistry.PluginRegistry.Instance);
2222
reader.ReadFiles();
2323
ILogLine line = reader.GetLogLine(0);
2424
IColumnizedLogLine logline = new ColumnizedLogLine();

src/LogExpert.Tests/ColumnizerPickerTest.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
using JsonColumnizer;
2-
3-
using LogExpert.Classes.Log;
42
using LogExpert.Core.Classes.Columnizer;
3+
using LogExpert.Core.Classes.Log;
54
using LogExpert.Core.Entities;
6-
75
using Moq;
8-
96
using NUnit.Framework;
10-
117
using System;
128
using System.IO;
139

@@ -70,7 +66,7 @@ public void FindReplacementForAutoColumnizer_ValidTextFile_ReturnCorrectColumniz
7066
string fileName, Type columnizerType)
7167
{
7268
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
73-
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions());
69+
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), PluginRegistry.PluginRegistry.Instance);
7470
reader.ReadFiles();
7571

7672
Mock<ILogLineColumnizer> autoColumnizer = new();

src/LogExpert.Tests/JSONSaveTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public class JSONSaveTest
1515
[Test(Author = "Hirogen", Description = "Save Options as JSON and Check if the written file can be cast again into the settings object")]
1616
public void SaveOptionsAsJSON()
1717
{
18-
ConfigManager.Settings.alwaysOnTop = true;
19-
ConfigManager.Save(SettingsFlags.All);
20-
string configDir = ConfigManager.ConfigDir;
18+
ConfigManager.Instance.Settings.alwaysOnTop = true;
19+
ConfigManager.Instance.Save(SettingsFlags.All);
20+
string configDir = ConfigManager.Instance.ConfigDir;
2121
string settingsFile = configDir + "\\settings.json";
2222

2323
Settings settings = null;
@@ -26,8 +26,8 @@ public void SaveOptionsAsJSON()
2626
Assert.That(settings, Is.Not.Null);
2727
Assert.That(settings.alwaysOnTop, Is.True);
2828

29-
ConfigManager.Settings.alwaysOnTop = false;
30-
ConfigManager.Save(SettingsFlags.All);
29+
ConfigManager.Instance.Settings.alwaysOnTop = false;
30+
ConfigManager.Instance.Save(SettingsFlags.All);
3131

3232
settings = null;
3333
Assert.DoesNotThrow(CastSettings);

src/LogExpert.Tests/JsonColumnizerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LogExpert.Classes.Log;
1+
using LogExpert.Core.Classes.Log;
22
using LogExpert.Core.Entities;
33

44
using NUnit.Framework;
@@ -16,7 +16,7 @@ public void GetColumnNames_HappyFile_ColumnNameMatches(string fileName, string e
1616
{
1717
var jsonColumnizer = new JsonColumnizer.JsonColumnizer();
1818
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
19-
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions());
19+
LogfileReader reader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), PluginRegistry.PluginRegistry.Instance);
2020
reader.ReadFiles();
2121

2222
ILogLine line = reader.GetLogLine(0);

src/LogExpert.Tests/JsonCompactColumnizerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LogExpert.Classes.Log;
1+
using LogExpert.Core.Classes.Log;
22
using LogExpert.Core.Entities;
33

44
using NUnit.Framework;
@@ -20,7 +20,7 @@ public void GetPriority_HappyFile_PriorityMatches(string fileName, Priority prio
2020
{
2121
var jsonCompactColumnizer = new JsonColumnizer.JsonCompactColumnizer();
2222
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
23-
LogfileReader logFileReader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions());
23+
LogfileReader logFileReader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), PluginRegistry.PluginRegistry.Instance);
2424
logFileReader.ReadFiles();
2525
List<ILogLine> loglines = new()
2626
{

src/LogExpert.Tests/LocalFileSystemTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using LogExpert.Classes.Log;
2-
using LogExpert.PluginRegistry.FileSystem;
1+
using LogExpert.PluginRegistry.FileSystem;
32

43
using NUnit.Framework;
54

src/LogExpert.Tests/RolloverHandlerTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LogExpert.Classes.Log;
1+
using LogExpert.Core.Classes.Log;
22
using LogExpert.Core.Entities;
33
using LogExpert.PluginRegistry.FileSystem;
44

@@ -26,7 +26,7 @@ public void TestFilenameListWithAppendedIndex(string format, int retries)
2626

2727
ILogFileInfo info = new LogFileInfo(new Uri(firstFile));
2828
RolloverFilenameHandler handler = new(info, options);
29-
LinkedList<string> fileList = handler.GetNameList();
29+
LinkedList<string> fileList = handler.GetNameList(PluginRegistry.PluginRegistry.Instance);
3030

3131
Assert.That(fileList, Is.EqualTo(files));
3232

@@ -47,7 +47,7 @@ public void TestFilenameListWithDate(string format, int retries)
4747

4848
ILogFileInfo info = new LogFileInfo(new Uri(firstFile));
4949
RolloverFilenameHandler handler = new(info, options);
50-
LinkedList<string> fileList = handler.GetNameList();
50+
LinkedList<string> fileList = handler.GetNameList(PluginRegistry.PluginRegistry.Instance);
5151

5252
Assert.That(fileList, Is.EqualTo(files));
5353

0 commit comments

Comments
 (0)