Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<ProjectReference Include="..\ref\System.Diagnostics.EventLog.csproj">
<SupportedFramework>net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
<SupportedFramework>uap10.0.16299;net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Diagnostics.EventLog.csproj" />
</ItemGroup>

View File

@@ -374,7 +374,7 @@ namespace System.Diagnostics
public static void Delete(string logName, string machineName)
{
if (!SyntaxCheck.CheckMachineName(machineName))
throw new ArgumentException(SR.InvalidParameterFormat, nameof(machineName));
throw new ArgumentException(SR.Format(SR.InvalidParameterFormat, nameof(machineName)), nameof(machineName));
if (logName == null || logName.Length == 0)
throw new ArgumentException(SR.NoLogName);
if (!ValidLogName(logName, false))
@@ -656,7 +656,7 @@ namespace System.Diagnostics
throw new ArgumentException(SR.Format(SR.InvalidParameter, nameof(machineName), machineName));
}
string[] logNames = new string[0];
string[] logNames = null;
RegistryKey eventkey = null;
try
@@ -814,7 +814,7 @@ namespace System.Diagnostics
}
// If you pass in an empty array UnsafeTryFormatMessage will just pull out the message.
string formatString = UnsafeTryFormatMessage(hModule, messageNum, new string[0]);
string formatString = UnsafeTryFormatMessage(hModule, messageNum, Array.Empty<string>());
if (formatString == null)
{

View File

@@ -677,7 +677,7 @@ namespace System.Diagnostics
return null;
if (insertionStrings == null)
insertionStrings = new string[0];
insertionStrings = Array.Empty<string>();
string[] listDll = dllNameList.Split(';');
@@ -1398,7 +1398,7 @@ namespace System.Diagnostics
{
// check arguments
if (strings == null)
strings = new string[0];
strings = Array.Empty<string>();
if (strings.Length >= 256)
throw new ArgumentException(SR.TooManyReplacementStrings);
@@ -1413,7 +1413,7 @@ namespace System.Diagnostics
throw new ArgumentException(SR.LogEntryTooLong);
}
if (rawData == null)
rawData = new byte[0];
rawData = Array.Empty<byte>();
if (Source.Length == 0)
throw new ArgumentException(SR.NeedSourceToWrite);

View File

@@ -80,7 +80,9 @@ namespace System.Diagnostics.Tests
{
using (EventLog eventLog = new EventLog("Application"))
{
Assert.Equal("Application", eventLog.LogDisplayName);
Assert.False(string.IsNullOrEmpty(eventLog.LogDisplayName));
if (CultureInfo.CurrentCulture.Name.Split('-')[0] == "en" )
Assert.Equal("Application", eventLog.LogDisplayName);
}
}
@@ -109,7 +111,10 @@ namespace System.Diagnostics.Tests
using (EventLog eventLog = new EventLog())
{
eventLog.Log = "Application";
Assert.Equal("Application", eventLog.LogDisplayName);
Assert.False(string.IsNullOrEmpty(eventLog.LogDisplayName));
if (CultureInfo.CurrentCulture.Name.Split('-')[0] == "en" )
Assert.Equal("Application", eventLog.LogDisplayName);
}
}