diff --git a/Examples/CLI/Monitor/CliTaskMonitor.cs b/Examples/CLI/Monitor/CliTaskMonitor.cs index 200167a..59c6edd 100644 --- a/Examples/CLI/Monitor/CliTaskMonitor.cs +++ b/Examples/CLI/Monitor/CliTaskMonitor.cs @@ -1,6 +1,6 @@ using System.Text; -namespace CLI.Monitor; +namespace Ocr.Cli.Monitor; public class CliTaskMonitor : TaskMonitor { diff --git a/Examples/CLI/Monitor/CompactCliTaskMonitor.cs b/Examples/CLI/Monitor/CompactCliTaskMonitor.cs index 3c79a3e..644d314 100644 --- a/Examples/CLI/Monitor/CompactCliTaskMonitor.cs +++ b/Examples/CLI/Monitor/CompactCliTaskMonitor.cs @@ -1,6 +1,6 @@ using System.Text; -namespace CLI.Monitor; +namespace Ocr.Cli.Monitor; public class CompactCliTaskMonitor : TaskMonitor { diff --git a/Examples/CLI/Monitor/ITaskMonitor.cs b/Examples/CLI/Monitor/ITaskMonitor.cs index 86a64ed..dca250d 100644 --- a/Examples/CLI/Monitor/ITaskMonitor.cs +++ b/Examples/CLI/Monitor/ITaskMonitor.cs @@ -1,4 +1,4 @@ -namespace CLI.Monitor; +namespace Ocr.Cli.Monitor; public interface ITaskMonitor { diff --git a/Examples/CLI/Monitor/TaskMonitor.cs b/Examples/CLI/Monitor/TaskMonitor.cs index 8229a2e..00da61f 100644 --- a/Examples/CLI/Monitor/TaskMonitor.cs +++ b/Examples/CLI/Monitor/TaskMonitor.cs @@ -1,4 +1,4 @@ -namespace CLI.Monitor; +namespace Ocr.Cli.Monitor; public abstract class TaskMonitor : ITaskMonitor { diff --git a/Examples/CLI/CLI.csproj b/Examples/CLI/Ocr.Cli.csproj similarity index 100% rename from Examples/CLI/CLI.csproj rename to Examples/CLI/Ocr.Cli.csproj diff --git a/Examples/CLI/Processor/EvaluationProcessor.cs b/Examples/CLI/Processor/EvaluationProcessor.cs index 7f57225..c6444b5 100644 --- a/Examples/CLI/Processor/EvaluationProcessor.cs +++ b/Examples/CLI/Processor/EvaluationProcessor.cs @@ -10,7 +10,7 @@ using Process.Interface; using System.Text.Json; using System.Text.RegularExpressions; -namespace CLI.Processor; +namespace Ocr.Cli.Processor; internal class EvaluationProcessor { diff --git a/Examples/CLI/Processor/StopwatchProcessor.cs b/Examples/CLI/Processor/StopwatchProcessor.cs index d9f0e65..66db4ec 100644 --- a/Examples/CLI/Processor/StopwatchProcessor.cs +++ b/Examples/CLI/Processor/StopwatchProcessor.cs @@ -2,7 +2,7 @@ using Process.Interface; using System.Diagnostics; -namespace CLI.Processor; +namespace Ocr.Cli.Processor; public class StopwatchProcessor : Processor { diff --git a/Examples/CLI/Program.cs b/Examples/CLI/Program.cs index 133fd62..f38ac0a 100644 --- a/Examples/CLI/Program.cs +++ b/Examples/CLI/Program.cs @@ -1,11 +1,11 @@ -using CLI.Monitor; -using CLI.Processor; -using Common.Extensions; +using Common.Extensions; using ImageMagick; +using Ocr.Cli.Monitor; +using Ocr.Cli.Processor; using Ocr.Tesseract.Screenshots.Threshold; using System.Diagnostics.CodeAnalysis; -namespace CLI; +namespace Ocr.Cli; public class Program { diff --git a/Examples/Examples.sln b/Examples/Examples.sln index 60f4d5d..459c01c 100644 --- a/Examples/Examples.sln +++ b/Examples/Examples.sln @@ -23,9 +23,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lookup.Database", "..\Looku EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lookup.Abstract", "..\Lookup\Lookup.Abstract\Lookup.Abstract.csproj", "{D14DA0B8-5EAE-4C77-992E-3527DC84CE6D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CLI", "CLI\CLI.csproj", "{2856493F-EF1C-42A1-8EE5-6C0387D08F95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocr.Cli", "CLI\Ocr.Cli.csproj", "{2856493F-EF1C-42A1-8EE5-6C0387D08F95}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GUI", "GUI\GUI.csproj", "{DA447F14-1B1D-4733-99F3-6EF8225DCBAB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocr.Gui", "GUI\Ocr.Gui.csproj", "{DA447F14-1B1D-4733-99F3-6EF8225DCBAB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "Common\Common.csproj", "{A6C738AC-DCD7-4024-A92D-3FC3CDCD7229}" EndProject @@ -35,7 +35,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocr.Tesseract", "..\Ocr\Ocr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocr.Tesseract.Screenshots", "..\Ocr\Ocr.Tesseract.Screenshots\Ocr.Tesseract.Screenshots.csproj", "{251F9AC9-3765-498C-83FD-DB3539A19CB3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGenerator", "ReportGenerator\ReportGenerator.csproj", "{729CB7AA-AB0D-4C39-AA17-7435E61FA0A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocr.Report", "ReportGenerator\Ocr.Report.csproj", "{729CB7AA-AB0D-4C39-AA17-7435E61FA0A6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReportGeneration", "ReportGeneration", "{8E08DA62-584B-4E26-AEB7-2B35742EF7A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportGeneration.Interface", "..\ReportGeneration\ReportGeneration.Interface\ReportGeneration.Interface.csproj", "{A0760AFE-5CB7-4603-8861-285F62BE510F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportGeneration.Generators", "..\ReportGeneration\ReportGeneration.Generators\ReportGeneration.Generators.csproj", "{F291F2D4-5BC5-4576-A210-BE8D447276FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportGeneration.Abstract", "..\ReportGeneration\ReportGeneration.Abstract\ReportGeneration.Abstract.csproj", "{80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -95,6 +103,18 @@ Global {729CB7AA-AB0D-4C39-AA17-7435E61FA0A6}.Debug|Any CPU.Build.0 = Debug|Any CPU {729CB7AA-AB0D-4C39-AA17-7435E61FA0A6}.Release|Any CPU.ActiveCfg = Release|Any CPU {729CB7AA-AB0D-4C39-AA17-7435E61FA0A6}.Release|Any CPU.Build.0 = Release|Any CPU + {A0760AFE-5CB7-4603-8861-285F62BE510F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0760AFE-5CB7-4603-8861-285F62BE510F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0760AFE-5CB7-4603-8861-285F62BE510F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0760AFE-5CB7-4603-8861-285F62BE510F}.Release|Any CPU.Build.0 = Release|Any CPU + {F291F2D4-5BC5-4576-A210-BE8D447276FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F291F2D4-5BC5-4576-A210-BE8D447276FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F291F2D4-5BC5-4576-A210-BE8D447276FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F291F2D4-5BC5-4576-A210-BE8D447276FC}.Release|Any CPU.Build.0 = Release|Any CPU + {80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -112,6 +132,10 @@ Global {E55F78E4-09F1-4D79-A9A2-460562C96DAB} = {CF65AA6A-2F25-4FEE-BDC1-AD96E1FFFA49} {D9B70035-0159-4D75-8ED6-2461F060F683} = {E55F78E4-09F1-4D79-A9A2-460562C96DAB} {251F9AC9-3765-498C-83FD-DB3539A19CB3} = {E55F78E4-09F1-4D79-A9A2-460562C96DAB} + {8E08DA62-584B-4E26-AEB7-2B35742EF7A5} = {CF65AA6A-2F25-4FEE-BDC1-AD96E1FFFA49} + {A0760AFE-5CB7-4603-8861-285F62BE510F} = {8E08DA62-584B-4E26-AEB7-2B35742EF7A5} + {F291F2D4-5BC5-4576-A210-BE8D447276FC} = {8E08DA62-584B-4E26-AEB7-2B35742EF7A5} + {80BF15A5-78EB-4B87-8C1B-7F90D6D8BC74} = {8E08DA62-584B-4E26-AEB7-2B35742EF7A5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DFA659EE-FE78-4BD9-888B-78984354093E} diff --git a/Examples/GUI/App.xaml b/Examples/GUI/App.xaml index 68946c8..bf2d2e7 100644 --- a/Examples/GUI/App.xaml +++ b/Examples/GUI/App.xaml @@ -1,4 +1,4 @@ - diff --git a/Examples/GUI/App.xaml.cs b/Examples/GUI/App.xaml.cs index 1957540..c2151b7 100644 --- a/Examples/GUI/App.xaml.cs +++ b/Examples/GUI/App.xaml.cs @@ -1,9 +1,7 @@ -using GUI.ViewModels; -using GUI.Views; -using Serilog; +using Ocr.Gui.Views; using System.Windows; -namespace GUI; +namespace Ocr.Gui; /// /// Interaction logic for App.xaml @@ -14,13 +12,6 @@ public partial class App : Application protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - - var loggingCollection = new LoggingCollection(100); - Log.Logger = new LoggerConfiguration() - .WriteTo.Sink(loggingCollection) - .CreateLogger(); - - new LogView(loggingCollection).Show(); new ImageView().Show(); } } \ No newline at end of file diff --git a/Examples/GUI/Controls/ImageControl.xaml b/Examples/GUI/Controls/ImageControl.xaml index 9a72c3e..44852f3 100644 --- a/Examples/GUI/Controls/ImageControl.xaml +++ b/Examples/GUI/Controls/ImageControl.xaml @@ -1,11 +1,11 @@  /// Interaction logic for ImageControl.xaml diff --git a/Examples/GUI/Converters/ImageConverter.cs b/Examples/GUI/Converters/ImageConverter.cs index bc07c41..5af2b93 100644 --- a/Examples/GUI/Converters/ImageConverter.cs +++ b/Examples/GUI/Converters/ImageConverter.cs @@ -6,12 +6,10 @@ using System.IO; using System.Windows.Data; using System.Windows.Media.Imaging; -namespace GUI.Converters; +namespace Ocr.Gui.Converters; internal class ImageConverter : IValueConverter { - #region Implementation of IValueConverter - /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { @@ -48,6 +46,4 @@ internal class ImageConverter : IValueConverter { throw new NotImplementedException(); } - - #endregion } \ No newline at end of file diff --git a/Examples/GUI/Model/Command.cs b/Examples/GUI/Model/Command.cs index d5608cc..6934ef2 100644 --- a/Examples/GUI/Model/Command.cs +++ b/Examples/GUI/Model/Command.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Input; -namespace GUI.Model; +namespace Ocr.Gui.Model; public class Command : ICommand { diff --git a/Examples/GUI/GUI.csproj b/Examples/GUI/Ocr.Gui.csproj similarity index 84% rename from Examples/GUI/GUI.csproj rename to Examples/GUI/Ocr.Gui.csproj index 9d7d3e7..88c4de9 100644 --- a/Examples/GUI/GUI.csproj +++ b/Examples/GUI/Ocr.Gui.csproj @@ -8,6 +8,7 @@ + diff --git a/Examples/GUI/ViewModels/LogMessage.cs b/Examples/GUI/ViewModels/LogMessage.cs deleted file mode 100644 index ff7cb0b..0000000 --- a/Examples/GUI/ViewModels/LogMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace GUI.ViewModels; - -public class LogMessage -{ - public DateTime Timestamp { get; set; } - - public string Message { get; set; } -} diff --git a/Examples/GUI/ViewModels/LogViewModel.cs b/Examples/GUI/ViewModels/LogViewModel.cs deleted file mode 100644 index cc86b88..0000000 --- a/Examples/GUI/ViewModels/LogViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace GUI.ViewModels; - -public class LogViewModel -{ - public LoggingCollection LoggingCollection { get; } - - public LogViewModel(LoggingCollection loggingCollection) - { - LoggingCollection = loggingCollection; - } -} \ No newline at end of file diff --git a/Examples/GUI/ViewModels/LoggingCollection.cs b/Examples/GUI/ViewModels/LoggingCollection.cs deleted file mode 100644 index ab78a01..0000000 --- a/Examples/GUI/ViewModels/LoggingCollection.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Serilog.Core; -using Serilog.Events; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace GUI.ViewModels; - -public class LoggingCollection : ILogEventSink -{ - public int Capacity { get; } - - public ObservableCollection Items { get; } - - public LoggingCollection(int capacity) - { - Capacity = capacity; - Items = new ObservableCollection(new List(capacity)); - } - - public void Trim(int offset = 0) - { - for (int i = Items.Count - Capacity - offset; i >= 0; i--) - { - Items.RemoveAt(0); - } - } - - #region Implementation of ILogEventSink - - /// - public void Emit(LogEvent logEvent) - { - Trim(1); - - Items.Add(new LogMessage - { - Timestamp = logEvent.Timestamp.DateTime, - Message = logEvent.RenderMessage() - }); - } - - #endregion -} \ No newline at end of file diff --git a/Examples/GUI/Views/ImageView.xaml b/Examples/GUI/Views/ImageView.xaml index e9dd67e..6fe2454 100644 --- a/Examples/GUI/Views/ImageView.xaml +++ b/Examples/GUI/Views/ImageView.xaml @@ -1,16 +1,16 @@  /// Interaction logic for MainWindow.xaml diff --git a/Examples/GUI/ViewModels/ImageViewModel.cs b/Examples/GUI/Views/ImageViewModel.cs similarity index 99% rename from Examples/GUI/ViewModels/ImageViewModel.cs rename to Examples/GUI/Views/ImageViewModel.cs index 50f7cdb..e2909d1 100644 --- a/Examples/GUI/ViewModels/ImageViewModel.cs +++ b/Examples/GUI/Views/ImageViewModel.cs @@ -1,7 +1,7 @@ using Common; -using GUI.Model; using ImageMagick; using Microsoft.Win32; +using Ocr.Gui.Model; using Ocr.Tesseract; using Ocr.Tesseract.Configuration; using Ocr.Tesseract.Models; @@ -23,7 +23,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Input; -namespace GUI.ViewModels; +namespace Ocr.Gui.Views; internal class ImageViewModel : INotifyPropertyChanged { diff --git a/Examples/GUI/Views/LogView.xaml b/Examples/GUI/Views/LogView.xaml deleted file mode 100644 index fa04cbe..0000000 --- a/Examples/GUI/Views/LogView.xaml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Examples/GUI/Views/LogView.xaml.cs b/Examples/GUI/Views/LogView.xaml.cs deleted file mode 100644 index 0769f21..0000000 --- a/Examples/GUI/Views/LogView.xaml.cs +++ /dev/null @@ -1,16 +0,0 @@ -using GUI.ViewModels; -using System.Windows; - -namespace GUI.Views; - -/// -/// Interaction logic for LogView.xaml -/// -public partial class LogView : Window -{ - public LogView(LoggingCollection loggingCollection) - { - InitializeComponent(); - DataContext = new LogViewModel(loggingCollection); - } -} \ No newline at end of file diff --git a/Examples/ReportGenerator/Generator/Interface/IBounds.cs b/Examples/ReportGenerator/Generator/Interface/IBounds.cs deleted file mode 100644 index e4a8680..0000000 --- a/Examples/ReportGenerator/Generator/Interface/IBounds.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace ReportGenerator.Generator.Interface; - -public interface IBounds -{ - public string Unit { get; } - public int? MinWidth { get; } - public int? MinHeight { get; } - public int? MaxWidth { get; } - public int? MaxHeight { get; } - public int? Width { get; } - public int? Height { get; } -} \ No newline at end of file diff --git a/Examples/ReportGenerator/Models/ImageStats.cs b/Examples/ReportGenerator/Models/ImageStats.cs index cc53e86..8d21086 100644 --- a/Examples/ReportGenerator/Models/ImageStats.cs +++ b/Examples/ReportGenerator/Models/ImageStats.cs @@ -1,4 +1,4 @@ -namespace ReportGenerator.Models; +namespace Ocr.Report.Models; public readonly struct ImageStats { diff --git a/Examples/ReportGenerator/Models/ProcessorStat.cs b/Examples/ReportGenerator/Models/ProcessorStat.cs index 0bdfe7b..a1c87c0 100644 --- a/Examples/ReportGenerator/Models/ProcessorStat.cs +++ b/Examples/ReportGenerator/Models/ProcessorStat.cs @@ -1,6 +1,6 @@ using Common.Distance; -namespace ReportGenerator.Models; +namespace Ocr.Report.Models; public readonly struct ProcessorStat : IDistanceComparer> { diff --git a/Examples/ReportGenerator/Models/ScanFileInfo.cs b/Examples/ReportGenerator/Models/ScanFileInfo.cs index e7c5703..97f8b23 100644 --- a/Examples/ReportGenerator/Models/ScanFileInfo.cs +++ b/Examples/ReportGenerator/Models/ScanFileInfo.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.RegularExpressions; -namespace ReportGenerator.Models; +namespace Ocr.Report.Models; public struct ScanFileInfo { diff --git a/Examples/ReportGenerator/Models/TagFileInfo.cs b/Examples/ReportGenerator/Models/TagFileInfo.cs index 390842f..8f72b14 100644 --- a/Examples/ReportGenerator/Models/TagFileInfo.cs +++ b/Examples/ReportGenerator/Models/TagFileInfo.cs @@ -1,31 +1,31 @@ using System.Text.Json; -namespace ReportGenerator.Models; +namespace Ocr.Report.Models; internal struct TagFileInfo { - public string Path { get; private init; } + public string Path { get; private init; } - public string ImageName { get; set; } + public string ImageName { get; set; } - public ICollection GetWords() - { - using var file = File.OpenRead(Path); - return JsonDocument - .Parse(file) - .RootElement - .GetProperty("words") - .EnumerateArray() - .Select(w => w.GetString() ?? throw new Exception("Cannot parse null words")) - .ToArray(); - } + public ICollection GetWords() + { + using var file = File.OpenRead(Path); + return JsonDocument + .Parse(file) + .RootElement + .GetProperty("words") + .EnumerateArray() + .Select(w => w.GetString() ?? throw new Exception("Cannot parse null words")) + .ToArray(); + } - public static TagFileInfo FromPath(string path) => new() - { - Path = path, - ImageName = System.IO.Path.GetFileNameWithoutExtension(path), - }; + public static TagFileInfo FromPath(string path) => new() + { + Path = path, + ImageName = System.IO.Path.GetFileNameWithoutExtension(path), + }; - /// - public override string ToString() => ImageName; + /// + public override string ToString() => ImageName; } diff --git a/Examples/ReportGenerator/ReportGenerator.csproj b/Examples/ReportGenerator/Ocr.Report.csproj similarity index 68% rename from Examples/ReportGenerator/ReportGenerator.csproj rename to Examples/ReportGenerator/Ocr.Report.csproj index 4512025..bfff13a 100644 --- a/Examples/ReportGenerator/ReportGenerator.csproj +++ b/Examples/ReportGenerator/Ocr.Report.csproj @@ -11,15 +11,13 @@ - - - - + + diff --git a/Examples/ReportGenerator/Program.cs b/Examples/ReportGenerator/Program.cs index 390aa7e..3f6975c 100644 --- a/Examples/ReportGenerator/Program.cs +++ b/Examples/ReportGenerator/Program.cs @@ -1,8 +1,8 @@ using Common.Extensions; -using ReportGenerator.Generator.Generator; -using ReportGenerator.Models; +using Ocr.Report.Models; +using ReportGeneration.Generators; -namespace ReportGenerator; +namespace Ocr.Report; internal static class Program { diff --git a/Examples/ReportGenerator/ReportGenerator.cs b/Examples/ReportGenerator/ReportGenerator.cs index 1c88133..fb91238 100644 --- a/Examples/ReportGenerator/ReportGenerator.cs +++ b/Examples/ReportGenerator/ReportGenerator.cs @@ -1,8 +1,8 @@ -using ReportGenerator.Generator.Interface; -using ReportGenerator.Generator.Model; -using ReportGenerator.Models; +using Ocr.Report.Models; +using ReportGeneration.Abstract.Model; +using ReportGeneration.Interface; -namespace ReportGenerator; +namespace Ocr.Report; public class ReportGenerator : IDisposable { diff --git a/Examples/ReportGenerator/Generator/Abstract/DocumentGeneratorBase.cs b/ReportGeneration/ReportGeneration.Abstract/DocumentGeneratorBase.cs similarity index 93% rename from Examples/ReportGenerator/Generator/Abstract/DocumentGeneratorBase.cs rename to ReportGeneration/ReportGeneration.Abstract/DocumentGeneratorBase.cs index 6358c6f..6cd2e20 100644 --- a/Examples/ReportGenerator/Generator/Abstract/DocumentGeneratorBase.cs +++ b/ReportGeneration/ReportGeneration.Abstract/DocumentGeneratorBase.cs @@ -1,7 +1,9 @@ -using ReportGenerator.Generator.Interface; +using ReportGeneration.Interface; +using System; +using System.IO; using System.Text; -namespace ReportGenerator.Generator.Abstract; +namespace ReportGeneration.Abstract; public abstract class DocumentGeneratorBase : StreamWriterBase, IDocumentGenerator { diff --git a/Examples/ReportGenerator/Generator/Model/Bounds.cs b/ReportGeneration/ReportGeneration.Abstract/Model/Bounds.cs similarity index 89% rename from Examples/ReportGenerator/Generator/Model/Bounds.cs rename to ReportGeneration/ReportGeneration.Abstract/Model/Bounds.cs index d94f6df..41dd56c 100644 --- a/Examples/ReportGenerator/Generator/Model/Bounds.cs +++ b/ReportGeneration/ReportGeneration.Abstract/Model/Bounds.cs @@ -1,6 +1,6 @@ -using ReportGenerator.Generator.Interface; +using ReportGeneration.Interface; -namespace ReportGenerator.Generator.Model; +namespace ReportGeneration.Abstract.Model; public struct Bounds : IBounds { diff --git a/ReportGeneration/ReportGeneration.Abstract/ReportGeneration.Abstract.csproj b/ReportGeneration/ReportGeneration.Abstract/ReportGeneration.Abstract.csproj new file mode 100644 index 0000000..6f77fc4 --- /dev/null +++ b/ReportGeneration/ReportGeneration.Abstract/ReportGeneration.Abstract.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + True + True + True + + + + + + + diff --git a/Examples/ReportGenerator/Generator/Abstract/StreamWriterBase.cs b/ReportGeneration/ReportGeneration.Abstract/StreamWriterBase.cs similarity index 97% rename from Examples/ReportGenerator/Generator/Abstract/StreamWriterBase.cs rename to ReportGeneration/ReportGeneration.Abstract/StreamWriterBase.cs index b880dfd..cf8b94d 100644 --- a/Examples/ReportGenerator/Generator/Abstract/StreamWriterBase.cs +++ b/ReportGeneration/ReportGeneration.Abstract/StreamWriterBase.cs @@ -1,7 +1,9 @@ -using ReportGenerator.Generator.Interface; +using ReportGeneration.Interface; +using System; +using System.IO; using System.Text; -namespace ReportGenerator.Generator.Abstract; +namespace ReportGeneration.Abstract; public abstract class StreamWriterBase : IStreamWriter { diff --git a/Examples/ReportGenerator/Generator/Abstract/TableGeneratorBase.cs b/ReportGeneration/ReportGeneration.Abstract/TableGeneratorBase.cs similarity index 91% rename from Examples/ReportGenerator/Generator/Abstract/TableGeneratorBase.cs rename to ReportGeneration/ReportGeneration.Abstract/TableGeneratorBase.cs index e5ab18d..fbb0b22 100644 --- a/Examples/ReportGenerator/Generator/Abstract/TableGeneratorBase.cs +++ b/ReportGeneration/ReportGeneration.Abstract/TableGeneratorBase.cs @@ -1,7 +1,10 @@ -using ReportGenerator.Generator.Interface; +using ReportGeneration.Interface; +using System.Collections.Generic; +using System.IO; +using System.Linq; using System.Text; -namespace ReportGenerator.Generator.Abstract; +namespace ReportGeneration.Abstract; public abstract class TableGeneratorBase : StreamWriterBase, ITableGenerator { diff --git a/ReportGeneration/ReportGeneration.Generators/CollapsibleHtmlTableGenerator.cs b/ReportGeneration/ReportGeneration.Generators/CollapsibleHtmlTableGenerator.cs new file mode 100644 index 0000000..ea91921 --- /dev/null +++ b/ReportGeneration/ReportGeneration.Generators/CollapsibleHtmlTableGenerator.cs @@ -0,0 +1,42 @@ +using ReportGeneration.Abstract; +using System.IO; +using System.Text; + +namespace ReportGeneration.Generators; + +internal class CollapsibleHtmlTableGenerator : HtmlTableGenerator +{ + public string DetailsClass { get; init; } + public string Summary { get; init; } = "Show table"; + + /// + public CollapsibleHtmlTableGenerator(int columns) + : base(columns) { } + + /// + public CollapsibleHtmlTableGenerator(int columns, Stream stream) + : base(columns, stream) { } + + /// + public CollapsibleHtmlTableGenerator(int columns, Stream stream, Encoding encoding) + : base(columns, stream, encoding) { } + + #region Overrides of HtmlTableGenerator + + /// + protected override void OnOpen() + { + Writer.Write($"
"); + Writer.Write(HtmlTools.Wrap("summary", Summary)); + base.OnOpen(); + } + + /// + protected override void OnClose() + { + base.OnClose(); + Writer.Write($"
"); + } + + #endregion +} diff --git a/Examples/ReportGenerator/Generator/Generator/HtmlDocumentGenerator.cs b/ReportGeneration/ReportGeneration.Generators/HtmlDocumentGenerator.cs similarity index 95% rename from Examples/ReportGenerator/Generator/Generator/HtmlDocumentGenerator.cs rename to ReportGeneration/ReportGeneration.Generators/HtmlDocumentGenerator.cs index ae67e82..9b8dc6f 100644 --- a/Examples/ReportGenerator/Generator/Generator/HtmlDocumentGenerator.cs +++ b/ReportGeneration/ReportGeneration.Generators/HtmlDocumentGenerator.cs @@ -1,9 +1,10 @@ -using ReportGenerator.Generator.Abstract; -using ReportGenerator.Generator.Interface; +using ReportGeneration.Abstract; +using ReportGeneration.Interface; +using System.IO; using System.Reflection; using System.Text; -namespace ReportGenerator.Generator.Generator; +namespace ReportGeneration.Generators; public class HtmlDocumentGenerator : DocumentGeneratorBase { diff --git a/Examples/ReportGenerator/Generator/Generator/HtmlTableGenerator.cs b/ReportGeneration/ReportGeneration.Generators/HtmlTableGenerator.cs similarity index 61% rename from Examples/ReportGenerator/Generator/Generator/HtmlTableGenerator.cs rename to ReportGeneration/ReportGeneration.Generators/HtmlTableGenerator.cs index 8fbef99..461fa95 100644 --- a/Examples/ReportGenerator/Generator/Generator/HtmlTableGenerator.cs +++ b/ReportGeneration/ReportGeneration.Generators/HtmlTableGenerator.cs @@ -1,45 +1,11 @@ -using ReportGenerator.Generator.Abstract; -using ReportGenerator.Generator.Interface; +using ReportGeneration.Abstract; +using ReportGeneration.Interface; +using System.Collections.Generic; +using System.IO; using System.Text; -namespace ReportGenerator.Generator.Generator; +namespace ReportGeneration.Generators; -internal class CollapsibleHtmlTableGenerator : HtmlTableGenerator -{ - public string DetailsClass { get; init; } - public string Summary { get; init; } = "Show table"; - - /// - public CollapsibleHtmlTableGenerator(int columns) - : base(columns) { } - - /// - public CollapsibleHtmlTableGenerator(int columns, Stream stream) - : base(columns, stream) { } - - /// - public CollapsibleHtmlTableGenerator(int columns, Stream stream, Encoding encoding) - : base(columns, stream, encoding) { } - - #region Overrides of HtmlTableGenerator - - /// - protected override void OnOpen() - { - Writer.Write($"
"); - Writer.Write(HtmlTools.Wrap("summary", Summary)); - base.OnOpen(); - } - - /// - protected override void OnClose() - { - base.OnClose(); - Writer.Write($"
"); - } - - #endregion -} internal class HtmlTableGenerator : TableGeneratorBase { @@ -108,4 +74,4 @@ internal class HtmlTableGenerator : TableGeneratorBase } #endregion -} +} \ No newline at end of file diff --git a/Examples/ReportGenerator/Generator/HtmlTools.cs b/ReportGeneration/ReportGeneration.Generators/HtmlTools.cs similarity index 93% rename from Examples/ReportGenerator/Generator/HtmlTools.cs rename to ReportGeneration/ReportGeneration.Generators/HtmlTools.cs index b3f1b95..fb6cd82 100644 --- a/Examples/ReportGenerator/Generator/HtmlTools.cs +++ b/ReportGeneration/ReportGeneration.Generators/HtmlTools.cs @@ -1,6 +1,6 @@ -using ReportGenerator.Generator.Interface; +using ReportGeneration.Interface; -namespace ReportGenerator.Generator; +namespace ReportGeneration.Generators; internal static class HtmlTools { diff --git a/Examples/ReportGenerator/Generator/Generator/MarkdownDocumentGenerator.cs b/ReportGeneration/ReportGeneration.Generators/MarkdownDocumentGenerator.cs similarity index 89% rename from Examples/ReportGenerator/Generator/Generator/MarkdownDocumentGenerator.cs rename to ReportGeneration/ReportGeneration.Generators/MarkdownDocumentGenerator.cs index 332df35..f326bf7 100644 --- a/Examples/ReportGenerator/Generator/Generator/MarkdownDocumentGenerator.cs +++ b/ReportGeneration/ReportGeneration.Generators/MarkdownDocumentGenerator.cs @@ -1,8 +1,9 @@ -using ReportGenerator.Generator.Abstract; -using ReportGenerator.Generator.Interface; +using ReportGeneration.Abstract; +using ReportGeneration.Interface; +using System.IO; using System.Text; -namespace ReportGenerator.Generator.Generator; +namespace ReportGeneration.Generators; public class MarkdownDocumentGenerator : DocumentGeneratorBase { diff --git a/Examples/ReportGenerator/Generator/Generator/MarkdownTableGenerator.cs b/ReportGeneration/ReportGeneration.Generators/MarkdownTableGenerator.cs similarity index 83% rename from Examples/ReportGenerator/Generator/Generator/MarkdownTableGenerator.cs rename to ReportGeneration/ReportGeneration.Generators/MarkdownTableGenerator.cs index 3ff3f46..911fc62 100644 --- a/Examples/ReportGenerator/Generator/Generator/MarkdownTableGenerator.cs +++ b/ReportGeneration/ReportGeneration.Generators/MarkdownTableGenerator.cs @@ -1,8 +1,10 @@ -using ReportGenerator.Generator.Abstract; -using ReportGenerator.Generator.Interface; +using ReportGeneration.Abstract; +using ReportGeneration.Interface; +using System.Collections.Generic; +using System.IO; using System.Text; -namespace ReportGenerator.Generator.Generator; +namespace ReportGeneration.Generators; internal class MarkdownTableGenerator : TableGeneratorBase { diff --git a/ReportGeneration/ReportGeneration.Generators/ReportGeneration.Generators.csproj b/ReportGeneration/ReportGeneration.Generators/ReportGeneration.Generators.csproj new file mode 100644 index 0000000..736beb2 --- /dev/null +++ b/ReportGeneration/ReportGeneration.Generators/ReportGeneration.Generators.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + True + True + True + + + + + + + diff --git a/Examples/ReportGenerator/Generator/Generator/Resources/Style.css b/ReportGeneration/ReportGeneration.Generators/Resources/Style.css similarity index 100% rename from Examples/ReportGenerator/Generator/Generator/Resources/Style.css rename to ReportGeneration/ReportGeneration.Generators/Resources/Style.css diff --git a/ReportGeneration/ReportGeneration.Interface/IBounds.cs b/ReportGeneration/ReportGeneration.Interface/IBounds.cs new file mode 100644 index 0000000..707c5e3 --- /dev/null +++ b/ReportGeneration/ReportGeneration.Interface/IBounds.cs @@ -0,0 +1,12 @@ +namespace ReportGeneration.Interface; + +public interface IBounds +{ + public string Unit { get; } + public int? MinWidth { get; } + public int? MinHeight { get; } + public int? MaxWidth { get; } + public int? MaxHeight { get; } + public int? Width { get; } + public int? Height { get; } +} \ No newline at end of file diff --git a/Examples/ReportGenerator/Generator/Interface/IDocumentGenerator.cs b/ReportGeneration/ReportGeneration.Interface/IDocumentGenerator.cs similarity index 88% rename from Examples/ReportGenerator/Generator/Interface/IDocumentGenerator.cs rename to ReportGeneration/ReportGeneration.Interface/IDocumentGenerator.cs index abe8b6e..ba1c9ce 100644 --- a/Examples/ReportGenerator/Generator/Interface/IDocumentGenerator.cs +++ b/ReportGeneration/ReportGeneration.Interface/IDocumentGenerator.cs @@ -1,4 +1,6 @@ -namespace ReportGenerator.Generator.Interface; +using System; + +namespace ReportGeneration.Interface; public interface IDocumentGenerator : IStreamWriter { diff --git a/Examples/ReportGenerator/Generator/Interface/IStreamWriter.cs b/ReportGeneration/ReportGeneration.Interface/IStreamWriter.cs similarity index 92% rename from Examples/ReportGenerator/Generator/Interface/IStreamWriter.cs rename to ReportGeneration/ReportGeneration.Interface/IStreamWriter.cs index 4a97fa0..b918fbc 100644 --- a/Examples/ReportGenerator/Generator/Interface/IStreamWriter.cs +++ b/ReportGeneration/ReportGeneration.Interface/IStreamWriter.cs @@ -1,4 +1,7 @@ -namespace ReportGenerator.Generator.Interface; +using System; +using System.IO; + +namespace ReportGeneration.Interface; public interface IStreamWriter : IDisposable { diff --git a/Examples/ReportGenerator/Generator/Interface/ITableGenerator.cs b/ReportGeneration/ReportGeneration.Interface/ITableGenerator.cs similarity index 84% rename from Examples/ReportGenerator/Generator/Interface/ITableGenerator.cs rename to ReportGeneration/ReportGeneration.Interface/ITableGenerator.cs index 2461eec..f109f4c 100644 --- a/Examples/ReportGenerator/Generator/Interface/ITableGenerator.cs +++ b/ReportGeneration/ReportGeneration.Interface/ITableGenerator.cs @@ -1,4 +1,6 @@ -namespace ReportGenerator.Generator.Interface; +using System.Collections.Generic; + +namespace ReportGeneration.Interface; public interface ITableGenerator : IStreamWriter { diff --git a/ReportGeneration/ReportGeneration.Interface/ReportGeneration.Interface.csproj b/ReportGeneration/ReportGeneration.Interface/ReportGeneration.Interface.csproj new file mode 100644 index 0000000..d2a7548 --- /dev/null +++ b/ReportGeneration/ReportGeneration.Interface/ReportGeneration.Interface.csproj @@ -0,0 +1,11 @@ + + + + net6.0 + enable + True + True + True + + + diff --git a/ReportGeneration/ReportGeneration.sln b/ReportGeneration/ReportGeneration.sln new file mode 100644 index 0000000..c5041f5 --- /dev/null +++ b/ReportGeneration/ReportGeneration.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGeneration.Abstract", "ReportGeneration.Abstract\ReportGeneration.Abstract.csproj", "{CE8FC7DA-E4DB-4A28-99CC-82D9EE72A290}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGeneration.Generators", "ReportGeneration.Generators\ReportGeneration.Generators.csproj", "{82729833-58A0-4694-AD41-EE41A659B413}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGeneration.Interface", "ReportGeneration.Interface\ReportGeneration.Interface.csproj", "{2C6CA0F6-0656-4C0A-8B3D-039C37EE5021}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE8FC7DA-E4DB-4A28-99CC-82D9EE72A290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE8FC7DA-E4DB-4A28-99CC-82D9EE72A290}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE8FC7DA-E4DB-4A28-99CC-82D9EE72A290}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE8FC7DA-E4DB-4A28-99CC-82D9EE72A290}.Release|Any CPU.Build.0 = Release|Any CPU + {82729833-58A0-4694-AD41-EE41A659B413}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82729833-58A0-4694-AD41-EE41A659B413}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82729833-58A0-4694-AD41-EE41A659B413}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82729833-58A0-4694-AD41-EE41A659B413}.Release|Any CPU.Build.0 = Release|Any CPU + {2C6CA0F6-0656-4C0A-8B3D-039C37EE5021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C6CA0F6-0656-4C0A-8B3D-039C37EE5021}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C6CA0F6-0656-4C0A-8B3D-039C37EE5021}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C6CA0F6-0656-4C0A-8B3D-039C37EE5021}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal