Implemented VirtualPrinterDriver project
This commit is contained in:
parent
f29c84821b
commit
5c87967c3f
125 changed files with 8191 additions and 0 deletions
15
Common/VirtualPrinter.Agent.Core/Model/JobInfo.cs
Normal file
15
Common/VirtualPrinter.Agent.Core/Model/JobInfo.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using System.Printing;
|
||||
|
||||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public struct JobInfo : IJobInfo
|
||||
{
|
||||
public int JobId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DomainName { get; set; }
|
||||
public string MachineName { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public PrintJobStatus Status { get; set; }
|
||||
public string DeviceName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
|
||||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public class PostScriptConversionException : Exception
|
||||
{
|
||||
public PostScriptConversionException()
|
||||
{
|
||||
}
|
||||
|
||||
public PostScriptConversionException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public PostScriptConversionException(string message, Exception inner) : base(message, inner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public struct PostScriptRenderOptions
|
||||
{
|
||||
public double? UserRenderDpi { get; set; }
|
||||
public PostScriptRenderPdfOptions PdfOptions { get; set; }
|
||||
public PostScriptRenderTiffOptions TiffOptions { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public struct PostScriptRenderPdfOptions
|
||||
{
|
||||
public bool Enabled { set; get; }
|
||||
public bool Archivable { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public struct PostScriptRenderTiffOptions
|
||||
{
|
||||
public bool Enabled { set; get; }
|
||||
}
|
||||
}
|
||||
13
Common/VirtualPrinter.Agent.Core/Model/PrintExts.cs
Normal file
13
Common/VirtualPrinter.Agent.Core/Model/PrintExts.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using JetBrains.Annotations;
|
||||
|
||||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public static class PrintExts
|
||||
{
|
||||
[NotNull]
|
||||
public static string ToIni(this PrintStatus status)
|
||||
{
|
||||
return status.ToString().ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Common/VirtualPrinter.Agent.Core/Model/PrintStatus.cs
Normal file
15
Common/VirtualPrinter.Agent.Core/Model/PrintStatus.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public enum PrintStatus
|
||||
{
|
||||
Undefined = 0,
|
||||
|
||||
Paused,
|
||||
|
||||
Resumed,
|
||||
|
||||
Complete,
|
||||
|
||||
Canceled
|
||||
}
|
||||
}
|
||||
22
Common/VirtualPrinter.Agent.Core/Model/ProgressUpdateArgs.cs
Normal file
22
Common/VirtualPrinter.Agent.Core/Model/ProgressUpdateArgs.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
|
||||
using JetBrains.Annotations;
|
||||
|
||||
using VirtualPrinter.Agent.Core;
|
||||
|
||||
namespace VirtualPrinter.Agent.Lib.Model
|
||||
{
|
||||
public class ProgressUpdateArgs : EventArgs
|
||||
{
|
||||
public ProgressUpdateArgs([NotNull] IJob job, uint val)
|
||||
{
|
||||
Job = job;
|
||||
Value = val;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public IJob Job { get; }
|
||||
|
||||
public uint Value { get; }
|
||||
}
|
||||
}
|
||||
49
Common/VirtualPrinter.Agent.Core/Model/RegistryConfig.cs
Normal file
49
Common/VirtualPrinter.Agent.Core/Model/RegistryConfig.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using JetBrains.Annotations;
|
||||
|
||||
using VirtualPrinter.Agent.Core.Enums;
|
||||
|
||||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public class RegistryConfig : IExConfig
|
||||
{
|
||||
public string Postconverter { get; set; }
|
||||
|
||||
public string Preconverter { get; set; }
|
||||
|
||||
public string OutputDirectory { get; set; }
|
||||
|
||||
public string FileNameMask { get; set; }
|
||||
|
||||
public short PrinterPort { get; set; }
|
||||
|
||||
public Tuple<string, string> ResolvedPreconverter
|
||||
{
|
||||
get { return GetResolvedArgs(Preconverter); }
|
||||
}
|
||||
|
||||
public Tuple<string, string> ResolvedPostconverter
|
||||
{
|
||||
get { return GetResolvedArgs(Postconverter); }
|
||||
}
|
||||
|
||||
public string ResolvedOutputDirectory
|
||||
{
|
||||
get { return string.IsNullOrWhiteSpace(OutputDirectory) ? "" : Path.GetFullPath(OutputDirectory); }
|
||||
}
|
||||
|
||||
public IntermediateFormat IntermediateFormat { get; set; }
|
||||
|
||||
[NotNull]
|
||||
private static Tuple<string, string> GetResolvedArgs([NotNull]string text)
|
||||
{
|
||||
const string ending = ".exe";
|
||||
var parts = text.Split(new[] { ending }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
return Tuple.Create(Path.GetFullPath(parts.First() + ending), parts.Last().Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Common/VirtualPrinter.Agent.Core/Model/SessionInfo.cs
Normal file
11
Common/VirtualPrinter.Agent.Core/Model/SessionInfo.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public struct SessionInfo : ISessionInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Desktop { get; set; }
|
||||
|
||||
public string Sid { get; set; }
|
||||
}
|
||||
}
|
||||
13
Common/VirtualPrinter.Agent.Core/Model/UserRegistryConfig.cs
Normal file
13
Common/VirtualPrinter.Agent.Core/Model/UserRegistryConfig.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
namespace VirtualPrinter.Agent.Core
|
||||
{
|
||||
public class UserRegistryConfig : IUserConfig
|
||||
{
|
||||
public bool RedirectEnabled { get; set; }
|
||||
|
||||
public string RedirectPrinter { get; set; }
|
||||
|
||||
public double? UserRenderDpi { get; set; }
|
||||
|
||||
public string Format { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue