diff --git a/EpsonPrintService/PrinterDiscoveryBackgroundTask.cs b/EpsonPrintService/PrinterDiscoveryBackgroundTask.cs index 18af6a1..a3daa5a 100644 --- a/EpsonPrintService/PrinterDiscoveryBackgroundTask.cs +++ b/EpsonPrintService/PrinterDiscoveryBackgroundTask.cs @@ -1,5 +1,6 @@ using Inspectron.Epson; using Inspectron.Epson.PrintServer.ConfigurationSources; +using Inspectron.Epson.Queue; using Microsoft.Extensions.Logging; namespace EpsonPrintService; diff --git a/EpsonPrintService/Program.cs b/EpsonPrintService/Program.cs index 87e8eac..535ef9c 100644 --- a/EpsonPrintService/Program.cs +++ b/EpsonPrintService/Program.cs @@ -11,6 +11,7 @@ using Inspectron.Epson.PrintServer.Printers; using Inspectron.Epson.PrintServer.Printers.Utils; using Inspectron.Epson.PrintServer.PrintServices; using EpsonPrintService; +using Inspectron.Epson.Queue; StandardKernel kernel = new StandardKernel(); diff --git a/Inspectron.Epson/PrintServer/IPrintJobSource.cs b/Inspectron.Epson/PrintServer/IPrintJobSource.cs index 805b2e5..82ecf44 100644 --- a/Inspectron.Epson/PrintServer/IPrintJobSource.cs +++ b/Inspectron.Epson/PrintServer/IPrintJobSource.cs @@ -1,4 +1,6 @@ -namespace Inspectron.Epson.PrintServer; +using Inspectron.Epson.Queue; + +namespace Inspectron.Epson.PrintServer; public interface IPrintJobSource { diff --git a/Inspectron.Epson/PrintServer/JobSources/SignalRPrintJobSource.cs b/Inspectron.Epson/PrintServer/JobSources/SignalRPrintJobSource.cs index 7a701c3..75eda1e 100644 --- a/Inspectron.Epson/PrintServer/JobSources/SignalRPrintJobSource.cs +++ b/Inspectron.Epson/PrintServer/JobSources/SignalRPrintJobSource.cs @@ -2,6 +2,7 @@ using System.Text.Json.Serialization; using System.Threading.Channels; using Inspectron.Epson.PrintServer.ConfigurationSources; +using Inspectron.Epson.Queue; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.Extensions.Logging; diff --git a/Inspectron.Epson/PrintServer/JobSources/SingleJobSource.cs b/Inspectron.Epson/PrintServer/JobSources/SingleJobSource.cs index 5ba677c..fbba865 100644 --- a/Inspectron.Epson/PrintServer/JobSources/SingleJobSource.cs +++ b/Inspectron.Epson/PrintServer/JobSources/SingleJobSource.cs @@ -1,4 +1,5 @@ using System.Threading.Channels; +using Inspectron.Epson.Queue; namespace Inspectron.Epson.PrintServer.JobSources; diff --git a/Inspectron.Epson/PrintServer/PrintLoop.cs b/Inspectron.Epson/PrintServer/PrintLoop.cs index 38f7f05..7bf5074 100644 --- a/Inspectron.Epson/PrintServer/PrintLoop.cs +++ b/Inspectron.Epson/PrintServer/PrintLoop.cs @@ -1,11 +1,12 @@ using Inspectron.Epson.PrintServer.PrintServices; +using Inspectron.Epson.Queue; using Microsoft.Extensions.Logging; namespace Inspectron.Epson.PrintServer; public class PrintLoop { - private readonly global::PrintServer _printServer; + private readonly global::Inspectron.Epson.Queue.PrintServer _printServer; private readonly IPrintService _printService; private readonly IPrintJobSource _jobSource; @@ -13,7 +14,7 @@ public class PrintLoop private CancellationTokenSource? _cancellationSource; private CancellationToken _cancellationToken; - public PrintLoop(global::PrintServer printServer,IPrintService printService, IPrintJobSource jobSource, ILogger logger) + public PrintLoop(global::Inspectron.Epson.Queue.PrintServer printServer,IPrintService printService, IPrintJobSource jobSource, ILogger logger) { _printServer = printServer; _printService = printService; diff --git a/Inspectron.Epson/PrintServer/PrintServices/EpsonPrintService.cs b/Inspectron.Epson/PrintServer/PrintServices/EpsonPrintService.cs index b8699fd..894a8ca 100644 --- a/Inspectron.Epson/PrintServer/PrintServices/EpsonPrintService.cs +++ b/Inspectron.Epson/PrintServer/PrintServices/EpsonPrintService.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Logging; using Inspectron.Epson.PrintServer.Printers; using Inspectron.Epson.PrintServer.Printers.Utils; +using Inspectron.Epson.Queue; namespace Inspectron.Epson.PrintServer.PrintServices; diff --git a/Inspectron.Epson/Queue/IJobStatusReporter.cs b/Inspectron.Epson/Queue/IJobStatusReporter.cs index cb44269..d45c4a1 100644 --- a/Inspectron.Epson/Queue/IJobStatusReporter.cs +++ b/Inspectron.Epson/Queue/IJobStatusReporter.cs @@ -1,6 +1,6 @@ -using System.Threading.Tasks; +namespace Inspectron.Epson.Queue; public interface IJobStatusReporter { Task ReportStatusAsync(PrintJob job, PrintJobStatus status); -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/IPrintService.cs b/Inspectron.Epson/Queue/IPrintService.cs index a4a4125..d2ffaae 100644 --- a/Inspectron.Epson/Queue/IPrintService.cs +++ b/Inspectron.Epson/Queue/IPrintService.cs @@ -1,6 +1,6 @@ -using System.Threading.Tasks; +namespace Inspectron.Epson.Queue; public interface IPrintService { Task PrintAsync(string printerIp, PrintJob job); -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/NullJobStatusReporter.cs b/Inspectron.Epson/Queue/NullJobStatusReporter.cs index 625b4f9..3d20a42 100644 --- a/Inspectron.Epson/Queue/NullJobStatusReporter.cs +++ b/Inspectron.Epson/Queue/NullJobStatusReporter.cs @@ -1,6 +1,6 @@ -using System.Threading.Tasks; +namespace Inspectron.Epson.Queue; public class NullJobStatusReporter : IJobStatusReporter { public Task ReportStatusAsync(PrintJob job, PrintJobStatus status) => Task.CompletedTask; -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/PrintErrorType.cs b/Inspectron.Epson/Queue/PrintErrorType.cs index 036e318..cc255c3 100644 --- a/Inspectron.Epson/Queue/PrintErrorType.cs +++ b/Inspectron.Epson/Queue/PrintErrorType.cs @@ -1,6 +1,8 @@ +namespace Inspectron.Epson.Queue; + public enum PrintErrorType { None, ConversionError, Other -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/PrintJob.cs b/Inspectron.Epson/Queue/PrintJob.cs index 3c09b4e..9c5a99b 100644 --- a/Inspectron.Epson/Queue/PrintJob.cs +++ b/Inspectron.Epson/Queue/PrintJob.cs @@ -1,5 +1,7 @@ using static Inspectron.Epson.PrintServer.JobSources.SignalRPrintJobSource; +namespace Inspectron.Epson.Queue; + public class PrintJob { // todo: change to ip address diff --git a/Inspectron.Epson/Queue/PrintJobStatus.cs b/Inspectron.Epson/Queue/PrintJobStatus.cs index ee4fa6b..8458613 100644 --- a/Inspectron.Epson/Queue/PrintJobStatus.cs +++ b/Inspectron.Epson/Queue/PrintJobStatus.cs @@ -1,6 +1,8 @@ +namespace Inspectron.Epson.Queue; + public enum PrintJobStatus { Received, Completed, Failed -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/PrintResult.cs b/Inspectron.Epson/Queue/PrintResult.cs index fb12e5f..91da4e2 100644 --- a/Inspectron.Epson/Queue/PrintResult.cs +++ b/Inspectron.Epson/Queue/PrintResult.cs @@ -1,3 +1,5 @@ +namespace Inspectron.Epson.Queue; + public class PrintResult { public bool Success { get; } @@ -11,4 +13,4 @@ public class PrintResult public static PrintResult Ok() => new(true, PrintErrorType.None); public static PrintResult Fail(PrintErrorType errorType) => new(false, errorType); -} +} \ No newline at end of file diff --git a/Inspectron.Epson/Queue/PrintServer.cs b/Inspectron.Epson/Queue/PrintServer.cs index 83e61a2..4f6b2ef 100644 --- a/Inspectron.Epson/Queue/PrintServer.cs +++ b/Inspectron.Epson/Queue/PrintServer.cs @@ -1,6 +1,8 @@ using System.Collections.Concurrent; using Microsoft.Extensions.Logging; +namespace Inspectron.Epson.Queue; + public class PrintServer { private readonly IPrintService _printService; diff --git a/Inspectron.Epson/Queue/PrinterQueue.cs b/Inspectron.Epson/Queue/PrinterQueue.cs index aa96653..a5d6fcc 100644 --- a/Inspectron.Epson/Queue/PrinterQueue.cs +++ b/Inspectron.Epson/Queue/PrinterQueue.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +using System.Collections.Concurrent; using Microsoft.Extensions.Logging; +namespace Inspectron.Epson.Queue; + public class PrinterQueue { public string PrinterIp { get; } @@ -139,5 +137,4 @@ public class PrinterQueue { return new List(_queue); } -} - +} \ No newline at end of file