Skip to content

Commit

Permalink
Merge pull request #315 from emoacht/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
emoacht authored Apr 12, 2022
2 parents c16345d + ee32aca commit 28c7d2b
Show file tree
Hide file tree
Showing 24 changed files with 264 additions and 27 deletions.
9 changes: 8 additions & 1 deletion Source/Installer/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="3.10.0"
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="3.10.1"
Language="1033" Codepage="1252" UpgradeCode="{81A4D148-75D3-462E-938D-8C208FB48E3C}">
<Package Id="*" InstallerVersion="500" Compressed="yes"
InstallScope="perMachine" InstallPrivileges="elevated"
Expand Down Expand Up @@ -94,6 +94,12 @@
<File Id="CoreResourcesLibrary_ar" Name="$(var.Monitorian.TargetName).Core.resources.dll" KeyPath="yes"/>
</Component>
</Directory>
<Directory Id="ResourcesFolder_ca" Name="ca"
FileSource="$(var.Monitorian.TargetDir)ca">
<Component Id="CoreResourcesLibrary_ca" Guid="{7E91FC9C-C97E-49F8-813F-AA4EB37D60CD}">
<File Id="CoreResourcesLibrary_ca" Name="$(var.Monitorian.TargetName).Core.resources.dll" KeyPath="yes"/>
</Component>
</Directory>
<Directory Id="ResourcesFolder_de" Name="de"
FileSource="$(var.Monitorian.TargetDir)de">
<Component Id="CoreResourcesLibrary_de" Guid="{4BE0F7FF-08C3-461E-9FED-4037D40BEB45}">
Expand Down Expand Up @@ -216,6 +222,7 @@
<ComponentRef Id="StartupLibrary"/>
<ComponentRef Id="VisualManifest"/>
<ComponentRef Id="CoreResourcesLibrary_ar"/>
<ComponentRef Id="CoreResourcesLibrary_ca"/>
<ComponentRef Id="CoreResourcesLibrary_de"/>
<ComponentRef Id="CoreResourcesLibrary_es"/>
<ComponentRef Id="CoreResourcesLibrary_fr"/>
Expand Down
4 changes: 2 additions & 2 deletions Source/Monitorian.Core/Models/DocumentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void SaveFileAsHtml(string filePath, string title, string body)
private static string BuildHtml(string title, string body)
{
body = body?
.Split(new[] { "\r\n\r\n", "\n\n" }, StringSplitOptions.RemoveEmptyEntries)
.Split(new[] { "\r\n\r\n", "\n\n" /* two consecutive line breaks */ }, StringSplitOptions.RemoveEmptyEntries)
.Select(x =>
{
var array = x.Split(Array.Empty<char>(), 2, StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -72,7 +72,7 @@ private static string BuildHtml(string title, string body)
})
.Aggregate((w, n) => $"{w}\r\n{n}");

return $@"<!DOCTYPE HTML PUBLIC "" -//W3C//DTD HTML 4.01//EN"" ""http://www.w3.org/TR/html4/strict.dtd"">
return $@"<!DOCTYPE html>
<html>
<head>
<meta charset=""utf-8""/>
Expand Down
17 changes: 15 additions & 2 deletions Source/Monitorian.Core/Models/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public static async Task RecordOperationAsync(string content)
/// <summary>
/// Copies operation log from AppData to Desktop.
/// </summary>
public static async Task CopyOperationAsync()
/// <param name="threshold">Threshold of log's content (in the number of characters)</param>
public static async Task CopyOperationAsync(int threshold = 10000)
{
var buffer = new StringBuilder();

Expand All @@ -164,8 +165,20 @@ public static async Task CopyOperationAsync()
if (buffer.Length == 0)
return;

if (buffer.Length < threshold)
{
MessageBox.Show(
Resources.CopyWaitOperationMessage,
ProductInfo.Title,
MessageBoxButton.OK,
MessageBoxImage.Exclamation,
MessageBoxResult.OK);

return;
}

if (MessageBox.Show(
Resources.CopyOperationMessage,
Resources.CopySaveOperationMessage,
ProductInfo.Title,
MessageBoxButton.OKCancel,
MessageBoxImage.Information,
Expand Down
4 changes: 4 additions & 0 deletions Source/Monitorian.Core/Monitorian.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@
<DependentUpon>Resources.resx</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.ca.resx">
<DependentUpon>Resources.resx</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.de.resx">
<DependentUpon>Resources.resx</DependentUpon>
<SubType>Designer</SubType>
Expand Down
4 changes: 2 additions & 2 deletions Source/Monitorian.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.10.0.0")]
[assembly: AssemblyFileVersion("3.10.0.0")]
[assembly: AssemblyVersion("3.10.1.0")]
[assembly: AssemblyFileVersion("3.10.1.0")]
[assembly: NeutralResourcesLanguage("en-US")]

// For unit test
Expand Down
13 changes: 11 additions & 2 deletions Source/Monitorian.Core/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Properties/Resources.ar.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>نسخ سجلات العمليات</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>نسخ سجلات العمليات إلى سطح المكتب</value>
</data>
<data name="DeferChange" xml:space="preserve">
Expand Down
195 changes: 195 additions & 0 deletions Source/Monitorian.Core/Properties/Resources.ca.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Arguments" xml:space="preserve">
<value>Arguments de línia de comandes</value>
</data>
<data name="ChangeContrast" xml:space="preserve">
<value>Canviar contrast</value>
</data>
<data name="ChangeRange" xml:space="preserve">
<value>Canviar rang d'ajustament</value>
</data>
<data name="ChangeUnison" xml:space="preserve">
<value>Canviar la brillantor alhora</value>
</data>
<data name="Close" xml:space="preserve">
<value>Tancar</value>
</data>
<data name="CopyOperation" xml:space="preserve">
<value>Copiar registre d'operació</value>
</data>
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>Desar registre d'operació a l'escriptori?</value>
</data>
<data name="DeferChange" xml:space="preserve">
<value>No fer canvis fins a acabar d'ajustar</value>
</data>
<data name="EnableContrast" xml:space="preserve">
<value>Habilitar el canvi de contrast</value>
</data>
<data name="EnableRange" xml:space="preserve">
<value>Habilitar el canvi del rang d'ajustament</value>
</data>
<data name="EnableUnison" xml:space="preserve">
<value>Habilitar canviar la brillantor alhora</value>
</data>
<data name="MakeOperation" xml:space="preserve">
<value>Registrar operacions</value>
</data>
<data name="OrderArrangement" xml:space="preserve">
<value>Ordenar per posició dels monitors</value>
</data>
<data name="Probe" xml:space="preserve">
<value>Sondejar monitors</value>
</data>
<data name="RecordExceptionMessage" xml:space="preserve">
<value>Ha aparegut un problema inesperat. Desar registre d'errors a l'escriptori?</value>
</data>
<data name="RecordProbeMessage" xml:space="preserve">
<value>Desar registre de sondeig a l'escriptori?</value>
</data>
<data name="Rescan" xml:space="preserve">
<value>Tornar a comprovar monitors</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Ajustaments</value>
</data>
<data name="ShowAdjusted" xml:space="preserve">
<value>Mostrar brillantor ajustada</value>
</data>
<data name="ShowNumber" xml:space="preserve">
<value>Mostrar número</value>
</data>
<data name="StartSignIn" xml:space="preserve">
<value>Executar en iniciar sessió</value>
</data>
<data name="StatusNotControllable" xml:space="preserve">
<value>Monitor no controlable.</value>
</data>
<data name="StatusReasonDdcFailing" xml:space="preserve">
<value>DDC/CI ha fallat repetidament.</value>
</data>
<data name="StatusReasonDdcNotEnabled" xml:space="preserve">
<value>DDC/CI no està suportat o no està habilitat.</value>
</data>
<data name="UseLargeElements" xml:space="preserve">
<value>Utilitzar controls grans</value>
</data>
</root>
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Properties/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>Anwendungsprotokoll kopieren</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>Anwendungsprotokoll auf Desktop speichern?</value>
</data>
<data name="DeferChange" xml:space="preserve">
Expand Down
5 changes: 4 additions & 1 deletion Source/Monitorian.Core/Properties/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Arguments" xml:space="preserve">
<value>Argumentos de línia de comandos</value>
</data>
<data name="ChangeContrast" xml:space="preserve">
<value>Cambiar contraste</value>
</data>
Expand All @@ -132,7 +135,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>Copiar registro de operación</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>¿Guardar registro de operación en el escritorio?</value>
</data>
<data name="DeferChange" xml:space="preserve">
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Properties/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>Copier le journal des opérations</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>Enregistrer le journal des opérations sur le Bureau ?</value>
</data>
<data name="EnableUnison" xml:space="preserve">
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Properties/Resources.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>Copia log operazione</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>Salvare i log dell'operazione sul Desktop?</value>
</data>
<data name="DeferChange" xml:space="preserve">
Expand Down
5 changes: 4 additions & 1 deletion Source/Monitorian.Core/Properties/Resources.ja-JP.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@
<data name="CopyOperation" xml:space="preserve">
<value>動作ログをコピーする</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>動作ログをデスクトップに保存しますか?</value>
</data>
<data name="CopyWaitOperationMessage" xml:space="preserve">
<value>動作ログにもっと情報が記録されるのを待ってください。</value>
</data>
<data name="DeferChange" xml:space="preserve">
<value>止まるまで変更を遅らせる</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Properties/Resources.ko-KR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<data name="CopyOperation" xml:space="preserve">
<value>작업 로그 복사</value>
</data>
<data name="CopyOperationMessage" xml:space="preserve">
<data name="CopySaveOperationMessage" xml:space="preserve">
<value>작업 로그를 데스크톱에 저장하시겠습니까?</value>
</data>
<data name="EnableUnison" xml:space="preserve">
Expand Down
Loading

0 comments on commit 28c7d2b

Please sign in to comment.