a TexString is an HtmlString
This commit is contained in:
parent
d6c3e0a595
commit
0bd21a4353
2 changed files with 14 additions and 18 deletions
|
|
@ -11,7 +11,7 @@ using Yavsc.ViewModels.Gen;
|
||||||
|
|
||||||
namespace Yavsc.Helpers
|
namespace Yavsc.Helpers
|
||||||
{
|
{
|
||||||
public class TeXString
|
public class TeXString : HtmlString
|
||||||
{
|
{
|
||||||
|
|
||||||
public class Replacement
|
public class Replacement
|
||||||
|
|
@ -54,28 +54,24 @@ namespace Yavsc.Helpers
|
||||||
new Replacement("†","\\dag"),
|
new Replacement("†","\\dag"),
|
||||||
new Replacement("–","\\textendash")
|
new Replacement("–","\\textendash")
|
||||||
};
|
};
|
||||||
string data;
|
|
||||||
public TeXString(string str)
|
public TeXString(string str) : base(TR(str))
|
||||||
{
|
{
|
||||||
data = str;
|
|
||||||
|
|
||||||
|
}
|
||||||
|
private static string TR(string source)
|
||||||
|
{
|
||||||
|
string result=source;
|
||||||
foreach (var r in SpecialCharsRendering)
|
foreach (var r in SpecialCharsRendering)
|
||||||
{
|
{
|
||||||
data = r.Execute(data);
|
result = r.Execute(result);
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
override public string ToString()
|
|
||||||
{
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
public HtmlString ToHtmlString()
|
|
||||||
{
|
|
||||||
return new HtmlString(ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TeXHelpers
|
public static class TeXHelpers
|
||||||
{
|
{
|
||||||
public static string NewLinesWith(this string target, string separator)
|
public static string NewLinesWith(this string target, string separator)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
||||||
\def\FactureAcquittee {@ViewBag.Acquitted?"oui":"non"} % Facture acquittée : oui/non
|
\def\FactureAcquittee {@ViewBag.Acquitted?"oui":"non"} % Facture acquittée : oui/non
|
||||||
\def\FactureLieu {@proaddrm} % Lieu de l'édition de la facture
|
\def\FactureLieu {@proaddrm} % Lieu de l'édition de la facture
|
||||||
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) @TeXHelpers.ToTeX(Model.Title)} % Objet du document
|
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) : @TeXHelpers.ToTeX(Model.Title)} % Objet du document
|
||||||
% Description de la facture
|
% Description de la facture
|
||||||
\def\FactureDescr {
|
\def\FactureDescr {
|
||||||
@TeXHelpers.ToTeX(Model.Description)
|
@TeXHelpers.ToTeX(Model.Description)
|
||||||
|
|
@ -192,7 +192,7 @@
|
||||||
<text>
|
<text>
|
||||||
\begin{flushright}
|
\begin{flushright}
|
||||||
@(new HtmlString(isestimate?"Devis validé":"Facture validée")) le @TeXHelpers.ToTeX(Model.ProviderValidationDate.ToString("dddd dd MMMM yyyy",
|
@(new HtmlString(isestimate?"Devis validé":"Facture validée")) le @TeXHelpers.ToTeX(Model.ProviderValidationDate.ToString("dddd dd MMMM yyyy",
|
||||||
CultureInfo.CreateSpecificCulture("fr-FR"))).ToHtmlString()
|
CultureInfo.CreateSpecificCulture("fr-FR")))
|
||||||
\end{flushright}
|
\end{flushright}
|
||||||
@if (prosign.Exists) {
|
@if (prosign.Exists) {
|
||||||
<text>
|
<text>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue