Documents: restructure Documents/ directory

This commit is contained in:
2023-10-26 23:27:28 +02:00
parent 105854c389
commit 11ea958059
24 changed files with 14 additions and 13 deletions

View File

@ -12,6 +12,7 @@ using System.Globalization;
using System.Threading; using System.Threading;
using System.Windows.Markup; using System.Windows.Markup;
using System.Reflection; using System.Reflection;
using Elwig.Helpers.Printing;
namespace Elwig { namespace Elwig {
public partial class App : Application { public partial class App : Application {
@ -45,7 +46,7 @@ namespace Elwig {
public static IList<IScale> Scales { get; private set; } public static IList<IScale> Scales { get; private set; }
public static ClientParameters Client { get; private set; } public static ClientParameters Client { get; private set; }
public static bool IsPrintingReady => Documents.Html.IsReady && Documents.Pdf.IsReady; public static bool IsPrintingReady => Html.IsReady && Pdf.IsReady;
public static Dispatcher MainDispatcher { get; private set; } public static Dispatcher MainDispatcher { get; private set; }
public App() : base() { public App() : base() {
@ -92,8 +93,8 @@ namespace Elwig {
} }
} }
Utils.RunBackground("HTML Initialization", () => Documents.Html.Init(PrintingReadyChanged)); Utils.RunBackground("HTML Initialization", () => Html.Init(PrintingReadyChanged));
Utils.RunBackground("PDF Initialization", () => Documents.Pdf.Init(PrintingReadyChanged)); Utils.RunBackground("PDF Initialization", () => Pdf.Init(PrintingReadyChanged));
var list = new List<IScale>(); var list = new List<IScale>();
foreach (var s in Config.Scales) { foreach (var s in Config.Scales) {

View File

@ -2,7 +2,7 @@
@inherits TemplatePage<Elwig.Documents.BusinessDocument> @inherits TemplatePage<Elwig.Documents.BusinessDocument>
@model Elwig.Documents.BusinessDocument @model Elwig.Documents.BusinessDocument
@{ Layout = "Document"; } @{ Layout = "Document"; }
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-businessdocument.css" /> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\BusinessDocument.css"/>
<div class="info-wrapper"> <div class="info-wrapper">
<div class="address-wrapper"> <div class="address-wrapper">
<div class="sender"> <div class="sender">

View File

@ -2,7 +2,7 @@
@inherits TemplatePage<Elwig.Documents.CreditNote> @inherits TemplatePage<Elwig.Documents.CreditNote>
@model Elwig.Documents.CreditNote @model Elwig.Documents.CreditNote
@{ Layout = "BusinessDocument"; } @{ Layout = "BusinessDocument"; }
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-creditnote.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\CreditNote.css"/>
@{ @{
var binNum = Model.BinNames.Length; var binNum = Model.BinNames.Length;
} }

View File

@ -2,7 +2,7 @@
@inherits TemplatePage<Elwig.Documents.DeliveryConfirmation> @inherits TemplatePage<Elwig.Documents.DeliveryConfirmation>
@model Elwig.Documents.DeliveryConfirmation @model Elwig.Documents.DeliveryConfirmation
@{ Layout = "BusinessDocument"; } @{ Layout = "BusinessDocument"; }
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliveryconfirmation.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryConfirmation.css"/>
<main> <main>
<h1>@Model.Title</h1> <h1>@Model.Title</h1>
<table class="delivery-confirmation"> <table class="delivery-confirmation">

View File

@ -2,7 +2,7 @@
@inherits TemplatePage<Elwig.Documents.DeliveryJournal> @inherits TemplatePage<Elwig.Documents.DeliveryJournal>
@model Elwig.Documents.DeliveryJournal @model Elwig.Documents.DeliveryJournal
@{ Layout = "Document"; } @{ Layout = "Document"; }
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliveryjournal.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryJournal.css"/>
<main> <main>
<h1>Lieferjournal</h1> <h1>Lieferjournal</h1>
<h2>@Model.Filter</h2> <h2>@Model.Filter</h2>

View File

@ -2,7 +2,7 @@
@inherits TemplatePage<Elwig.Documents.DeliveryNote> @inherits TemplatePage<Elwig.Documents.DeliveryNote>
@model Elwig.Documents.DeliveryNote @model Elwig.Documents.DeliveryNote
@{ Layout = "BusinessDocument"; } @{ Layout = "BusinessDocument"; }
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliverynote.css" /> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryNote.css" />
<main> <main>
<h1>@Model.Title</h1> <h1>@Model.Title</h1>
<table class="delivery"> <table class="delivery">

View File

@ -4,6 +4,7 @@ using System.IO;
using Elwig.Helpers; using Elwig.Helpers;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Elwig.Helpers.Printing;
namespace Elwig.Documents { namespace Elwig.Documents {
public abstract partial class Document : IDisposable { public abstract partial class Document : IDisposable {

View File

@ -7,8 +7,8 @@
<title>@Model.Title</title> <title>@Model.Title</title>
<meta name="author" value="@Model.Author"/> <meta name="author" value="@Model.Author"/>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.css"/>
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-page.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.Page.css"/>
@if (Model.DoubleSided) { @if (Model.DoubleSided) {
<style> <style>
@@page :left { @@page :left {

View File

@ -2,7 +2,7 @@ using RazorLight;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Elwig.Documents { namespace Elwig.Helpers.Printing {
public static class Html { public static class Html {
private static RazorLightEngine? Engine = null; private static RazorLightEngine? Engine = null;

View File

@ -1,5 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Elwig.Helpers;
using Elwig.Windows; using Elwig.Windows;
using System.Diagnostics; using System.Diagnostics;
using System; using System;
@ -9,7 +8,7 @@ using System.Windows;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Linq; using System.Linq;
namespace Elwig.Documents { namespace Elwig.Helpers.Printing {
public static class Pdf { public static class Pdf {
private static readonly string PdfToPrinter = App.ExePath + "PDFtoPrinter.exe"; private static readonly string PdfToPrinter = App.ExePath + "PDFtoPrinter.exe";