mirror of
https://github.com/Maassoft/ColorControl.git
synced 2026-10-21 16:12:18 -05:00
add spanish translations to restart detector
This commit is contained in:
1 parent
b8910a3b64
commit
0c1859f848
2 files changed
+10
-5
No files matched your search
@@ -18,8 +18,8 @@
|
||||
<PublisherName>Maassoft</PublisherName>
|
||||
<Company>Maassoft</Company>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>5.5.0.0</ApplicationVersion>
|
||||
<Version>5.5.0.0</Version>
|
||||
<ApplicationVersion>5.5.1.0</ApplicationVersion>
|
||||
<Version>5.5.1.0</Version>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>false</BootstrapperEnabled>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Win32;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Linq;
|
||||
|
||||
@@ -14,6 +15,9 @@ namespace ColorControl
|
||||
private EventLogWatcher watcher = null;
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static readonly IEnumerable<string> RestartNames = new[] { "restart", "herstart", "reinicio" };
|
||||
private static readonly IEnumerable<string> PowerOffNames = new[] { "power off", "uitschakelen", "apagar" };
|
||||
|
||||
public RestartDetector()
|
||||
{
|
||||
try
|
||||
@@ -56,13 +60,14 @@ namespace ColorControl
|
||||
{
|
||||
foreach (EventProperty x in ((EventLogRecord)arg.EventRecord).Properties)
|
||||
{
|
||||
Logger.Debug("Event value: " + x.Value);
|
||||
if (x.Value.Equals("restart"))
|
||||
var strValue = x.Value.ToString();
|
||||
Logger.Debug("Event value: " + strValue);
|
||||
if (RestartNames.Any(n => n.Equals(strValue, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
RestartDetected = true;
|
||||
break;
|
||||
}
|
||||
if (x.Value.Equals("power off"))
|
||||
if (PowerOffNames.Any(n => n.Equals(strValue, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
PowerOffDetected = true;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user