From 0add5155f0086b4df6f814e66c3eed7e1860cc75 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 7 Sep 2023 19:00:50 -0700 Subject: [PATCH 001/342] WIP to address issue #9807 --- Winforms.sln | 18 + .../Microsoft/VisualBasic/Devices/Network.vb | 345 +++++++++++++----- .../MyServices/Internal/WebClientCopy.vb | 199 ++++++++-- .../src/PublicAPI.Unshipped.txt | 8 + .../ScratchProjectVB/ApplicationEvents.vb | 29 ++ .../ScratchProjectVB/Form1.Designer.vb | 31 ++ .../ScratchProjectVB/Form1.vb | 25 ++ .../My Project/Application.Designer.vb | 37 ++ .../My Project/Application.myapp | 10 + .../ScratchProjectVB/ScratchProjectVB.vbproj | 35 ++ 10 files changed, 624 insertions(+), 113 deletions(-) create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj diff --git a/Winforms.sln b/Winforms.sln index 6dd1b54eeaf..bfe7a56755a 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -162,6 +162,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Drawing.Common.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScratchProject", "src\System.Windows.Forms\tests\IntegrationTests\ScratchProject\ScratchProject.csproj", "{194D9B0B-421B-4485-B67E-B5A448388D39}" EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ScratchProjectVB", "src\System.Windows.Forms\tests\IntegrationTests\ScratchProjectVB\ScratchProjectVB.vbproj", "{4CDC6808-3922-451C-935B-94E1B3A5100E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -886,6 +888,22 @@ Global {194D9B0B-421B-4485-B67E-B5A448388D39}.Release|x64.Build.0 = Release|Any CPU {194D9B0B-421B-4485-B67E-B5A448388D39}.Release|x86.ActiveCfg = Release|Any CPU {194D9B0B-421B-4485-B67E-B5A448388D39}.Release|x86.Build.0 = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|arm64.ActiveCfg = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|arm64.Build.0 = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|x64.ActiveCfg = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|x64.Build.0 = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Debug|x86.Build.0 = Debug|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|Any CPU.Build.0 = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|arm64.ActiveCfg = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|arm64.Build.0 = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|x64.ActiveCfg = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|x64.Build.0 = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|x86.ActiveCfg = Release|Any CPU + {4CDC6808-3922-451C-935B-94E1B3A5100E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index 123d1319407..ecd84ee23a6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -3,15 +3,19 @@ Option Explicit On Option Strict On + Imports System.ComponentModel Imports System.Net +Imports System.Net.Http Imports System.Security Imports System.Threading + Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports Microsoft.VisualBasic.CompilerServices.Utils Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal + Imports NetInfoAlias = System.Net.NetworkInformation Namespace Microsoft.VisualBasic.Devices @@ -21,6 +25,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class NetworkAvailableEventArgs Inherits EventArgs + Public Sub New(networkAvailable As Boolean) IsNetworkAvailable = networkAvailable End Sub @@ -129,6 +134,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then +#Disable Warning IDE0002 ' Simplify Member Access Throw ExceptionUtils.GetArgumentNullException("address") End If Return Ping(address.Host, DEFAULT_PING_TIMEOUT) @@ -149,10 +155,7 @@ Namespace Microsoft.VisualBasic.Devices Dim PingMaker As New NetInfoAlias.Ping Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - If Reply.Status = NetInfoAlias.IPStatus.Success Then - Return True - End If - Return False + Return Reply.Status = NetInfoAlias.IPStatus.Success End Function ''' @@ -176,7 +179,9 @@ Namespace Microsoft.VisualBasic.Devices ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved Public Sub DownloadFile(address As String, destinationFileName As String) - DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -185,7 +190,9 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri to the remote file ''' Name and path of file where download is saved Public Sub DownloadFile(address As Uri, destinationFileName As String) - DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -196,18 +203,9 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -228,7 +226,9 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -262,7 +262,9 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - DownloadFile(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + Task.Run(Async Function() + Await DownloadFileAsync(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -275,7 +277,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not to show a progress bar ''' Time alloted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Sub DownloadFile(address As Uri, + Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String, @@ -283,7 +285,9 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -297,7 +301,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Time alloted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Sub DownloadFile(address As Uri, + Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String, @@ -309,7 +313,9 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -322,15 +328,16 @@ Namespace Microsoft.VisualBasic.Devices ''' Time alloted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Calls to all the other overloads will come through here - Sub DownloadFile(address As Uri, + Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) - + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function).Wait() End Sub ''' @@ -344,7 +351,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here - Sub DownloadFile(address As Uri, + Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, showUI As Boolean, @@ -359,67 +366,240 @@ Namespace Microsoft.VisualBasic.Devices Throw ExceptionUtils.GetArgumentNullException("address") End If - Using client As New WebClientExtended - client.Timeout = connectionTimeout + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, networkCredentials, + showUI, connectionTimeout, overwrite, + onUserCancel).ConfigureAwait(False) + End Function).Wait() + End Sub - ' Don't use passive mode if we're showing UI - client.UseNonPassiveFtp = showUI + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + Public Async Function DownloadFileAsync(address As String, destinationFileName As String) As Task + Await DownloadFileAsync(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String, userName As String, password As String) As Task + Await DownloadFileAsync(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function - ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really - ' have a file and path - If System.IO.Directory.Exists(fullFilename) Then - Throw ExceptionUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + Public Async Function DownloadFileAsync(address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) As Task - 'Throw if the file exists and the user doesn't want to overwrite - If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) - End If + Await DownloadFileAsync(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function - ' Set credentials if we have any - If networkCredentials IsNot Nothing Then - client.Credentials = networkCredentials - End If + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + Public Async Function DownloadFileAsync(address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task - Dim dialog As ProgressDialog = Nothing - If showUI AndAlso System.Environment.UserInteractive Then - dialog = New ProgressDialog With { + ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). + ' However, it is good practice to verify address before calling Trim. + If String.IsNullOrWhiteSpace(address) Then + Throw ExceptionUtils.GetArgumentNullException("address") + End If + + Dim addressUri As Uri = GetUri(address.Trim()) + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Await DownloadFileAsync(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel).ConfigureAwait(False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + Public Async Function DownloadFileAsync(address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + Public Async Function DownloadFileAsync(address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Await DownloadFileAsync(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel).ConfigureAwait(False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Calls to all the other overloads will come through here + Public Async Function DownloadFileAsync(address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException).ConfigureAwait(False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Calls to all the other overloads will come through here + Public Async Function DownloadFileAsync(address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + If connectionTimeout <= 0 Then + Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + End If + + If address Is Nothing Then + Throw ExceptionUtils.GetArgumentNullException("address") + End If + + Dim client As HttpClient + If networkCredentials IsNot Nothing Then + Dim clientHandler = New HttpClientHandler With {.Credentials = networkCredentials} + client = New HttpClient(clientHandler) + Else + client = New HttpClient() + End If + client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) + + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") + + ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really + ' have a file and path + If System.IO.Directory.Exists(fullFilename) Then + Throw ExceptionUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + 'Throw if the file exists and the user doesn't want to overwrite + If IO.File.Exists(fullFilename) And Not overwrite Then + Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + End If + + ' Set credentials if we have any + + Dim dialog As ProgressDialog = Nothing + If showUI AndAlso System.Environment.UserInteractive Then + dialog = New ProgressDialog With { .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) } - End If + End If - 'Check to see if the target directory exists. If it doesn't, create it - Dim targetDirectory As String = System.IO.Path.GetDirectoryName(fullFilename) + 'Check to see if the target directory exists. If it doesn't, create it + Dim targetDirectory As String = System.IO.Path.GetDirectoryName(fullFilename) - ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect - If String.IsNullOrEmpty(targetDirectory) Then - Throw ExceptionUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If + ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect + If String.IsNullOrEmpty(targetDirectory) Then + Throw ExceptionUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If - If Not IO.Directory.Exists(targetDirectory) Then - IO.Directory.CreateDirectory(targetDirectory) - End If + If Not IO.Directory.Exists(targetDirectory) Then + IO.Directory.CreateDirectory(targetDirectory) + End If - 'Create the copier - Dim copier As New WebClientCopy(client, dialog) + 'Create the copier + Dim copier As New HttpClientCopy(client, dialog) - 'Download the file - copier.DownloadFile(address, fullFilename) + 'Download the file + Await copier.DownloadFileAsync(address, fullFilename).ConfigureAwait(False) - 'Handle a dialog cancel - If showUI AndAlso System.Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then - Throw New OperationCanceledException() - End If + 'Handle a dialog cancel + If showUI AndAlso System.Environment.UserInteractive Then + If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then + Throw New OperationCanceledException() End If + End If - End Using - - End Sub + End Function ''' ''' Uploads a file from the local machine to the specified host @@ -704,20 +884,10 @@ Namespace Microsoft.VisualBasic.Devices ''' A NetworkCredentials Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials - ' Make sure all nulls are empty strings - If userName Is Nothing Then - userName = "" - End If - - If password Is Nothing Then - password = "" - End If - - If userName.Length = 0 And password.Length = 0 Then - Return Nothing - End If - - Return New NetworkCredential(userName, password) + Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), + Nothing, + DirectCast(New NetworkCredential(userName, password), ICredentials) + ) End Function 'Holds the buffer for pinging. We lazy initialize on first use @@ -806,8 +976,10 @@ Namespace Microsoft.VisualBasic.Devices End Function #Disable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete + Friend Sub New() End Sub + #Enable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete ' The Timeout value to be used by WebClient's WebRequest for Downloading or Uploading a file @@ -815,6 +987,7 @@ Namespace Microsoft.VisualBasic.Devices ' Flag used to indicate whether or not we should use passive mode when ftp downloading Private _useNonPassiveFtp As Boolean + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 539204e84a8..8760fb8fee2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -6,6 +6,8 @@ Option Strict On Imports System.IO Imports System.Net +Imports System.Net.Http +Imports System.Threading Imports System.Windows.Forms Namespace Microsoft.VisualBasic.MyServices.Internal @@ -29,33 +31,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub - ''' - ''' Downloads a file - ''' - ''' The source for the file - ''' The path and name where the file is saved - Public Sub DownloadFile(address As Uri, destinationFileName As String) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") - - ' If we have a dialog we need to set up an async download - If m_ProgressDialog IsNot Nothing Then - m_WebClient.DownloadFileAsync(address, destinationFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.DownloadFile(address, destinationFileName) - End If - - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer - End If - End If - - End Sub - ''' ''' Uploads a file ''' @@ -209,4 +184,174 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private _percentage As Integer End Class + + ''' + ''' Class that controls the thread that does the actual work of downloading or uploading. + ''' + Friend NotInheritable Class HttpClientCopy + + ''' + ''' Creates an instance of a HttpClientCopy, used to download or upload a file + ''' + ''' The HttpClient used to do the downloading or uploading + ''' UI for indicating progress + Public Sub New(client As HttpClient, dialog As ProgressDialog) + + Debug.Assert(client IsNot Nothing, "No HttpClient") + + _httpClient = client + m_ProgressDialog = dialog + + End Sub + + ''' + ''' Downloads a file + ''' + ''' The source for the file + ''' The path and name where the file is saved + Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String) As Task + Debug.Assert(_httpClient IsNot Nothing, "No HttpClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") + + Using response As HttpResponseMessage = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) + Using responseStream As Stream = Await response.Content.ReadAsStreamAsync().ConfigureAwait(False) + Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) + + Dim buffer(8191) As Byte + Dim totalBytesRead As Long = 0 + Dim bytesRead As Integer + Try + m_ProgressDialog?.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + While (Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False)) > 0 + Dim contentLength? As Long = response.Content.Headers.ContentLength + If Not contentLength.HasValue Then + Continue While + Else + bytesRead = CInt(contentLength.Value) + totalBytesRead += bytesRead + + Dim cancelTokenWrite As CancellationToken = _cancelSourceWrite.Token + + Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) + If m_ProgressDialog IsNot Nothing Then + Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) + InvokeIncrement(percentage) + End If + End If + _cancelSourceRead = New CancellationTokenSource() + _cancelTokenRead = _cancelSourceRead.Token + _cancelSourceWrite = New CancellationTokenSource() + _cancelTokenWrite = _cancelSourceWrite.Token + End While + Catch ex As Exception + Throw + End Try + End Using + End Using + End Using + CloseProgressDialog() + + End Function + +#If False Then + ''' + ''' Uploads a file + ''' + ''' The name and path of the source file + ''' The address to which the file is uploaded + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") + + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If + + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If + End Sub + +#End If + + ''' + ''' Notifies the progress dialog to increment the progress bar + ''' + ''' The percentage of bytes read + Private Sub InvokeIncrement(progressPercentage As Integer) + ' Don't invoke unless dialog is up and running + If m_ProgressDialog IsNot Nothing Then + If m_ProgressDialog.IsHandleCreated Then + + ' For performance, don't invoke if increment is 0 + Dim increment As Integer = progressPercentage - _percentage + _percentage = progressPercentage + If increment > 0 Then + m_ProgressDialog.BeginInvoke(New DoIncrement(AddressOf m_ProgressDialog.Increment), increment) + End If + + End If + End If + End Sub + + ''' + ''' Posts a message to close the progress dialog + ''' + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running + If m_ProgressDialog IsNot Nothing Then + m_ProgressDialog.IndicateClosing() + + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() + End If + End If + End Sub + + ''' + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation + ''' + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + _cancelSourceRead.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + _cancelSourceWrite.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + End Sub + + Private _cancelSourceRead As New CancellationTokenSource() + Private _cancelTokenRead As CancellationToken = _cancelSourceRead.Token + + Private _cancelSourceWrite As New CancellationTokenSource() + Private _cancelTokenWrite As CancellationToken = _cancelSourceRead.Token + + ' The WebClient performs the downloading or uploading operations for us + Private ReadOnly _httpClient As HttpClient + + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog + + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + + ' The percentage of the operation completed + Private _percentage As Integer + + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt index e69de29bb2d..14ba78b16f9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt +++ b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt @@ -0,0 +1,8 @@ +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb new file mode 100644 index 00000000000..cf403a009a2 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb @@ -0,0 +1,29 @@ +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + ' Example: + ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + ' + ' ' Setting the application-wide default Font: + ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + ' + ' ' Setting the HighDpiMode for the Application: + ' e.HighDpiMode = HighDpiMode.PerMonitorV2 + ' + ' ' If a splash dialog is used, this sets the minimum display time: + ' e.MinimumSplashScreenDisplayTime = 4000 + ' End Sub + + Partial Friend Class MyApplication + + End Class +End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb new file mode 100644 index 00000000000..1ccf9d7a614 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb @@ -0,0 +1,31 @@ + +Partial Class Form1 + Inherits Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Text = "Form1" + End Sub + +End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb new file mode 100644 index 00000000000..82ee208dc73 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb @@ -0,0 +1,25 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Option Explicit On +Option Strict On + +Imports System.IO + +Public Class Form1 + + Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown + Dim tmpFilePath = GetTempFolderGuid() + My.Computer.Network.DownloadFile("https://raw.githubusercontent.com/dotnet/winforms/main/README.md", tmpFilePath) + End Sub + + Private Function GetTempFolderGuid() As String + Dim folder As String = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) + Do While Directory.Exists(folder) Or File.Exists(folder) + folder = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) + Loop + + Return folder + End Function + +End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb new file mode 100644 index 00000000000..007b31fc7d3 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb @@ -0,0 +1,37 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = False + Me.EnableVisualStyles = True + Me.SaveMySettingsOnExit = True + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Form1 + End Sub + End Class +End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp new file mode 100644 index 00000000000..0f12f323886 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj new file mode 100644 index 00000000000..a2114f57c43 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj @@ -0,0 +1,35 @@ + + + + WinExe + ScratchProjectVB + enable + + 15.0 + false + false + ScratchProjectVB.Form1 + net8.0-windows7.0 + + + + + + + + + + + + + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + \ No newline at end of file From 6320beba6cee15e98559a8c145f1d65574ca3284 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 7 Sep 2023 19:40:00 -0700 Subject: [PATCH 002/342] Update Form1. Designer to prevent openning in Designer as it currently doesn't work. Add back one missing DownloadFile variant that was deleted by mistake --- .../src/Microsoft/VisualBasic/Devices/Network.vb | 13 +++++++++++++ .../ScratchProjectVB/Form1.Designer.vb | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index ecd84ee23a6..eac183c7048 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -208,6 +208,19 @@ Namespace Microsoft.VisualBasic.Devices End Function).Wait() End Sub + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String) + Task.Run(Async Function() + Await DownloadFileAsync(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False).ConfigureAwait(False) + End Function).Wait() + End Sub + ''' ''' Downloads a file from the network to the specified path ''' diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb index 1ccf9d7a614..76bda47a5f0 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb @@ -1,4 +1,6 @@ - +Imports System.ComponentModel + + Partial Class Form1 Inherits Form From deca209c4bd8e7e19cd20e3b70be8f4c681afdf1 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Sep 2023 18:13:51 -0700 Subject: [PATCH 003/342] Fix spelling errors in comments --- .../Microsoft/VisualBasic/Devices/Network.vb | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index eac183c7048..2cce614994a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -229,7 +229,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As String, destinationFileName As String, @@ -252,7 +252,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As String, @@ -288,7 +288,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As Uri, destinationFileName As String, @@ -311,7 +311,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As Uri, @@ -338,7 +338,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, @@ -360,7 +360,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here @@ -414,7 +414,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Async Function DownloadFileAsync(address As String, destinationFileName As String, @@ -435,7 +435,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Async Function DownloadFileAsync(address As String, @@ -469,7 +469,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String, @@ -490,7 +490,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Async Function DownloadFileAsync(address As Uri, @@ -515,7 +515,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Calls to all the other overloads will come through here Public Async Function DownloadFileAsync(address As Uri, @@ -535,7 +535,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here @@ -662,7 +662,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -681,7 +681,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As String, @@ -717,7 +717,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -736,7 +736,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, @@ -760,7 +760,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri representing the destination ''' The credentials of the user performing the upload ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, @@ -777,7 +777,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri representing the destination ''' The credentials of the user performing the upload ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, @@ -840,7 +840,7 @@ Namespace Microsoft.VisualBasic.Devices Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSyncronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) From f4ee1899c91269f02344352bdd9a285d665e9845 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Sep 2023 23:03:55 -0700 Subject: [PATCH 004/342] Update Upload algorthm --- .../MyServices/Internal/WebClientCopy.vb | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 8760fb8fee2..93aae760a70 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -214,6 +214,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Debug.Assert(address IsNot Nothing, "No address") Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") + _cancelSourceRead = New CancellationTokenSource() + _cancelTokenRead = _cancelSourceRead.Token + _cancelSourceWrite = New CancellationTokenSource() + _cancelTokenWrite = _cancelSourceWrite.Token Using response As HttpResponseMessage = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) Using responseStream As Stream = Await response.Content.ReadAsStreamAsync().ConfigureAwait(False) Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) @@ -223,27 +227,20 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Dim bytesRead As Integer Try m_ProgressDialog?.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - While (Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False)) > 0 + + bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False) + Do While bytesRead > 0 Dim contentLength? As Long = response.Content.Headers.ContentLength - If Not contentLength.HasValue Then - Continue While - Else - bytesRead = CInt(contentLength.Value) + If contentLength.HasValue Then totalBytesRead += bytesRead - Dim cancelTokenWrite As CancellationToken = _cancelSourceWrite.Token - Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) If m_ProgressDialog IsNot Nothing Then - Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) + Dim percentage As Integer = CInt(contentLength.Value / totalBytesRead * 100) InvokeIncrement(percentage) End If End If - _cancelSourceRead = New CancellationTokenSource() - _cancelTokenRead = _cancelSourceRead.Token - _cancelSourceWrite = New CancellationTokenSource() - _cancelTokenWrite = _cancelSourceWrite.Token - End While + Loop Catch ex As Exception Throw End Try @@ -334,11 +331,11 @@ Namespace Microsoft.VisualBasic.MyServices.Internal _cancelSourceWrite.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. End Sub - Private _cancelSourceRead As New CancellationTokenSource() - Private _cancelTokenRead As CancellationToken = _cancelSourceRead.Token + Private _cancelSourceRead As CancellationTokenSource + Private _cancelTokenRead As CancellationToken - Private _cancelSourceWrite As New CancellationTokenSource() - Private _cancelTokenWrite As CancellationToken = _cancelSourceRead.Token + Private _cancelSourceWrite As CancellationTokenSource + Private _cancelTokenWrite As CancellationToken ' The WebClient performs the downloading or uploading operations for us Private ReadOnly _httpClient As HttpClient From e9d4fcd12860c05d9c54c5f519c265a3c7bc7d3e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Sep 2023 23:45:19 -0700 Subject: [PATCH 005/342] Remove Broken VB Scratch project --- .../ScratchProjectVB/ApplicationEvents.vb | 29 --------------- .../ScratchProjectVB/Form1.Designer.vb | 33 ----------------- .../ScratchProjectVB/Form1.vb | 25 ------------- .../My Project/Application.Designer.vb | 37 ------------------- .../My Project/Application.myapp | 10 ----- .../ScratchProjectVB/ScratchProjectVB.vbproj | 35 ------------------ 6 files changed, 169 deletions(-) delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp delete mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb deleted file mode 100644 index cf403a009a2..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb +++ /dev/null @@ -1,29 +0,0 @@ -Imports Microsoft.VisualBasic.ApplicationServices - -Namespace My - ' The following events are available for MyApplication: - ' Startup: Raised when the application starts, before the startup form is created. - ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. - ' UnhandledException: Raised if the application encounters an unhandled exception. - ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. - ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. - - ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. - - ' Example: - ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults - ' - ' ' Setting the application-wide default Font: - ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) - ' - ' ' Setting the HighDpiMode for the Application: - ' e.HighDpiMode = HighDpiMode.PerMonitorV2 - ' - ' ' If a splash dialog is used, this sets the minimum display time: - ' e.MinimumSplashScreenDisplayTime = 4000 - ' End Sub - - Partial Friend Class MyApplication - - End Class -End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb deleted file mode 100644 index 76bda47a5f0..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb +++ /dev/null @@ -1,33 +0,0 @@ -Imports System.ComponentModel - - -Partial Class Form1 - Inherits Form - - 'Form overrides dispose to clean up the component list. - - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - - Private Sub InitializeComponent() - components = New System.ComponentModel.Container() - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(800, 450) - Me.Text = "Form1" - End Sub - -End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb deleted file mode 100644 index 82ee208dc73..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb +++ /dev/null @@ -1,25 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Option Explicit On -Option Strict On - -Imports System.IO - -Public Class Form1 - - Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown - Dim tmpFilePath = GetTempFolderGuid() - My.Computer.Network.DownloadFile("https://raw.githubusercontent.com/dotnet/winforms/main/README.md", tmpFilePath) - End Sub - - Private Function GetTempFolderGuid() As String - Dim folder As String = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) - Do While Directory.Exists(folder) Or File.Exists(folder) - folder = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) - Loop - - Return folder - End Function - -End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb deleted file mode 100644 index 007b31fc7d3..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb +++ /dev/null @@ -1,37 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace My - - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, - ' or if you encounter build errors in this file, go to the Project Designer - ' (go to Project Properties or double-click the My Project node in - ' Solution Explorer), and make changes on the Application tab. - ' - Partial Friend Class MyApplication - - - Public Sub New() - MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = False - Me.EnableVisualStyles = True - Me.SaveMySettingsOnExit = True - Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses - End Sub - - - Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Form1 - End Sub - End Class -End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp deleted file mode 100644 index 0f12f323886..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - true - Form1 - false - 0 - true - 0 - true - \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj deleted file mode 100644 index a2114f57c43..00000000000 --- a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - WinExe - ScratchProjectVB - enable - - 15.0 - false - false - ScratchProjectVB.Form1 - net8.0-windows7.0 - - - - - - - - - - - - - - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - - \ No newline at end of file From 5afa885c90484199af3bed891fbd618ef43a4797 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Sep 2023 14:12:45 -0700 Subject: [PATCH 006/342] Remove the reson of VB Scratch Project Handle Timeout diring getting initial response --- Winforms.sln | 2 - .../MyServices/Internal/WebClientCopy.vb | 62 +++++++------------ 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/Winforms.sln b/Winforms.sln index bfe7a56755a..34fea323f29 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -162,8 +162,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Drawing.Common.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScratchProject", "src\System.Windows.Forms\tests\IntegrationTests\ScratchProject\ScratchProject.csproj", "{194D9B0B-421B-4485-B67E-B5A448388D39}" EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ScratchProjectVB", "src\System.Windows.Forms\tests\IntegrationTests\ScratchProjectVB\ScratchProjectVB.vbproj", "{4CDC6808-3922-451C-935B-94E1B3A5100E}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 93aae760a70..fc8f468fb8b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -95,36 +95,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If End Sub - ''' - ''' Handles the WebClient's DownloadFileCompleted event - ''' - ''' - ''' - Private Sub m_WebClient_DownloadFileCompleted(sender As Object, e As System.ComponentModel.AsyncCompletedEventArgs) Handles m_WebClient.DownloadFileCompleted - Try - ' If the download was interrupted by an exception, keep track of the exception, which we'll throw from the main thread - If e.Error IsNot Nothing Then - _exceptionEncounteredDuringFileTransfer = e.Error - End If - - If Not e.Cancelled AndAlso e.Error Is Nothing Then - InvokeIncrement(100) - End If - Finally - 'We don't close the dialog until we receive the WebClient.DownloadFileCompleted event - CloseProgressDialog() - End Try - End Sub - - ''' - ''' Handles event WebClient fires whenever progress of download changes - ''' - ''' - ''' - Private Sub m_WebClient_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles m_WebClient.DownloadProgressChanged - InvokeIncrement(e.ProgressPercentage) - End Sub - ''' ''' Handles the WebClient's UploadFileCompleted event ''' @@ -218,7 +188,18 @@ Namespace Microsoft.VisualBasic.MyServices.Internal _cancelTokenRead = _cancelSourceRead.Token _cancelSourceWrite = New CancellationTokenSource() _cancelTokenWrite = _cancelSourceWrite.Token - Using response As HttpResponseMessage = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) + Dim response As HttpResponseMessage = Nothing + Try + response = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) + Catch ex As Exception + If ex.Message.Contains("The 'file' scheme is not supported.") Then + ' REVIEW I don't see to be able to detect a timeout except this way + Throw New TimeoutException() + End If + Throw + End Try + Dim contentLength? As Long = response?.Content.Headers.ContentLength + If contentLength.HasValue Then Using responseStream As Stream = Await response.Content.ReadAsStreamAsync().ConfigureAwait(False) Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) @@ -230,23 +211,22 @@ Namespace Microsoft.VisualBasic.MyServices.Internal bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False) Do While bytesRead > 0 - Dim contentLength? As Long = response.Content.Headers.ContentLength - If contentLength.HasValue Then - totalBytesRead += bytesRead - - Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) - If m_ProgressDialog IsNot Nothing Then - Dim percentage As Integer = CInt(contentLength.Value / totalBytesRead * 100) - InvokeIncrement(percentage) - End If + totalBytesRead += bytesRead + + Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) + If m_ProgressDialog IsNot Nothing Then + Dim percentage As Integer = CInt(contentLength.Value / totalBytesRead * 100) + InvokeIncrement(percentage) End If + bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False) Loop Catch ex As Exception Throw End Try End Using End Using - End Using + End If + respone?.dispose CloseProgressDialog() End Function From 5fb3b94cc24d0b36372185fd4550203db73bf367 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Sep 2023 15:14:58 -0700 Subject: [PATCH 007/342] WIP Add and use SR.net_webstatus_Timeout --- .../VisualBasic/MyServices/Internal/WebClientCopy.vb | 5 +++-- src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx | 8 ++++++-- .../src/Resources/xlf/SR.cs.xlf | 5 +++++ .../src/Resources/xlf/SR.de.xlf | 5 +++++ .../src/Resources/xlf/SR.es.xlf | 5 +++++ .../src/Resources/xlf/SR.fr.xlf | 5 +++++ .../src/Resources/xlf/SR.it.xlf | 5 +++++ .../src/Resources/xlf/SR.ja.xlf | 5 +++++ .../src/Resources/xlf/SR.ko.xlf | 5 +++++ .../src/Resources/xlf/SR.pl.xlf | 5 +++++ .../src/Resources/xlf/SR.pt-BR.xlf | 5 +++++ .../src/Resources/xlf/SR.ru.xlf | 5 +++++ .../src/Resources/xlf/SR.tr.xlf | 5 +++++ .../src/Resources/xlf/SR.zh-Hans.xlf | 5 +++++ .../src/Resources/xlf/SR.zh-Hant.xlf | 5 +++++ 15 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index fc8f468fb8b..f0bb9f8020b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -193,8 +193,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal response = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) Catch ex As Exception If ex.Message.Contains("The 'file' scheme is not supported.") Then - ' REVIEW I don't see to be able to detect a timeout except this way - Throw New TimeoutException() + ' REVIEW I don't see to be able to detect a timeout, except this way + ' SR.net_webstatus_Timeout value is needed + Throw New WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout) End If Throw End Try diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx b/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx index ff406c3aee6..3189a81973d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx @@ -1,4 +1,5 @@ - + + - + Microsoft.VisualBasic.Forms true - 15.0 + 16.9 None true true diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 9556f1530fe..adfae35b0a1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -13,7 +13,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices ''' - ''' An object that allows easy access to some simple network properties and functionality. + ''' An object that allows easy access to some simple network properties and functionality. ''' Partial Public Class Network @@ -27,13 +27,13 @@ Namespace Microsoft.VisualBasic.Devices Private Const DEFAULT_USERNAME As String = "" ''' - ''' Creates class and hooks up events + ''' Creates class and hooks up events ''' Public Sub New() End Sub ''' - ''' Posts a message to close the progress dialog + ''' Posts a message to close the progress dialog ''' Private Shared Sub CloseProgressDialog(dialog As ProgressDialog) ' Don't invoke unless dialog is up and running @@ -63,29 +63,28 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Private Shared Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task Dim clientHandler = If(networkCredentials Is Nothing, New HttpClientHandler, New HttpClientHandler With {.Credentials = networkCredentials} ) Return DownloadFileAsync(addressUri, - destinationFileName, - clientHandler, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ) + destinationFileName, + clientHandler, + dialog, + connectionTimeout, + overwrite, + onUserCancel) End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -95,26 +94,25 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Private Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task Await DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - UICancelOption.ThrowException - ).ConfigureAwait(False) + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -125,13 +123,13 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Private Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. @@ -145,13 +143,12 @@ Namespace Microsoft.VisualBasic.Devices Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ).ConfigureAwait(False) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) End Function ''' @@ -165,22 +162,21 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Private Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task Await DownloadFileAsync(addressUri, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - UICancelOption.ThrowException - ).ConfigureAwait(False) + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function ''' @@ -195,25 +191,24 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Private Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ).ConfigureAwait(False) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) End Function #If False Then ' Here in case DownloadFileAsync becomes public @@ -228,20 +223,19 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Calls to all the other overloads will come through here Private Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - UICancelOption.ThrowException - ).ConfigureAwait(False) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function #End If @@ -257,12 +251,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here Private Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - clientHandler As HttpClientHandler, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + destinationFileName As String, + clientHandler As HttpClientHandler, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task If connectionTimeout <= 0 Then Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If @@ -280,7 +274,7 @@ Namespace Microsoft.VisualBasic.Devices client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(fullFilename) Then @@ -309,9 +303,8 @@ Namespace Microsoft.VisualBasic.Devices 'Download the file Try - Await copier.DownloadFileAsync(addressUri, - fullFilename - ).ConfigureAwait(False) + Await copier.DownloadFileAsync(address:=addressUri, + destinationFileName:=fullFilename).ConfigureAwait(continueOnCapturedContext:=False) Catch ex As Exception If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then Throw @@ -335,7 +328,26 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' Indicates whether or not to show a progress bar + ''' + Private Shared Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Return New ProgressDialog With { + .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), + .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) + } + End If + Return Nothing + End Function + + ''' + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) ''' ''' The remote file address ''' A Uri if successful, otherwise it throws an exception @@ -357,13 +369,12 @@ Namespace Microsoft.VisualBasic.Devices destinationFileName As String) Try DownloadFileAsync(address, - destinationFileName, - DEFAULT_USERNAME, - DEFAULT_PASSWORD, - Nothing, - DEFAULT_TIMEOUT, - False - ).Wait() + destinationFileName, + userName:=DEFAULT_USERNAME, + password:=DEFAULT_PASSWORD, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() Catch ex As Exception If ex.InnerException IsNot Nothing Then Throw ex.InnerException @@ -378,16 +389,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri to the remote file ''' Name and path of file where download is saved Public Sub DownloadFile(address As Uri, - destinationFileName As String) + destinationFileName As String) Try - DownloadFileAsync(address, - destinationFileName, - DEFAULT_USERNAME, - DEFAULT_PASSWORD, - Nothing, - DEFAULT_TIMEOUT, - False - ).Wait() + DownloadFileAsync(addressUri:=address, + destinationFileName, + userName:=DEFAULT_USERNAME, + password:=DEFAULT_PASSWORD, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() Catch ex As Exception If ex.InnerException IsNot Nothing Then Throw ex.InnerException @@ -404,17 +414,17 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String) + destinationFileName As String, + userName As String, + password As String) Try DownloadFileAsync(address, - destinationFileName, - userName, password, - Nothing, - DEFAULT_TIMEOUT, - False - ).Wait() + destinationFileName, + userName, + password, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() Catch ex As Exception If ex.InnerException IsNot Nothing Then Throw ex.InnerException @@ -431,18 +441,17 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String) + destinationFileName As String, + userName As String, + password As String) Try - DownloadFileAsync(address, - destinationFileName, - userName, - password, - Nothing, - DEFAULT_TIMEOUT, - False - ).Wait() + DownloadFileAsync(addressUri:=address, + destinationFileName, + userName, + password, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() Catch ex As Exception If ex.InnerException IsNot Nothing Then Throw ex.InnerException @@ -453,7 +462,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -463,30 +472,24 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) Dim dialog As ProgressDialog = Nothing Try - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) - } - End If + dialog = GetProgressDialog(address, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, connectionTimeout, overwrite, - UICancelOption.ThrowException - ) + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else @@ -500,7 +503,11 @@ Namespace Microsoft.VisualBasic.Devices If ex.InnerException IsNot Nothing Then If TryCast(ex.InnerException, OperationCanceledException) IsNot Nothing AndAlso Environment.UserInteractive Then If showUI AndAlso Environment.UserInteractive Then - IO.File.Delete(destinationFileName) + Try + IO.File.Delete(destinationFileName) + Catch + ' ignore error + End Try Throw New OperationCanceledException() End If End If @@ -514,7 +521,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -525,13 +532,13 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. @@ -548,21 +555,17 @@ Namespace Microsoft.VisualBasic.Devices Try If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) - } + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + dialog = GetProgressDialog(address, destinationFileName, showUI) End If Dim t As Task = DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else @@ -593,35 +596,27 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing Try - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) - } - End If + dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - UICancelOption.ThrowException - ) + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else @@ -653,13 +648,13 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) @@ -670,23 +665,14 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) - } - End If - - Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ) + dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) + Dim t As Task = DownloadFileAsync(addressUri:=address, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else @@ -729,23 +715,14 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) - } - End If - + dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - UICancelOption.ThrowException - ) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else @@ -777,12 +754,13 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) + If connectionTimeout <= 0 Then Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If @@ -793,23 +771,14 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") - dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) - } - End If - + dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel - ) + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception Else From 6a830a86e51b965f2fa45a5f72ae54651009c70c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Feb 2024 17:06:23 -0800 Subject: [PATCH 067/342] Allow newwork tests to run in concurrently. --- .../System/Windows/Forms/NetworkTests.vb | 79 +++++++++---------- .../System/Windows/Forms/WebListener.vb | 10 +-- 2 files changed, 41 insertions(+), 48 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb index 9a1869d1a63..d3ddfff1697 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb @@ -4,7 +4,6 @@ Imports System.IO Imports System.Net Imports System.Runtime.CompilerServices -Imports System.Threading Imports Xunit @@ -12,15 +11,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class NetworkTests - Private Const DownloadFileUrl As String = "http://127.0.0.1:8080/HttpListener/t18135" - Private Const DownloadLargeFileUrl As String = "http://127.0.0.1:8080/HttpListener/T104857600" - ' The following URL MUST be replaced with a local URL Private Const UploadFileUrl As String = "ftp://speedtest.tele2.net/upload/testing.txt" - Private Shared ReadOnly s_prefixes As String() = {"http://127.0.0.1:8080/HttpListener/"} Private ReadOnly _baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") - Private ReadOnly _mutex As New Mutex + Private ReadOnly _downloadBaseListenerUrl As String = $"http://127.0.0.1:8080/{NameOf(HttpListener)}/" + Private ReadOnly _downloadFileUrl As String = $"{_downloadBaseListenerUrl}t18135" + Private ReadOnly _downloadLargeFileUrl As String = $"{_downloadBaseListenerUrl}T104857600" ''' ''' If size >= 0 then create the file with size length @@ -53,7 +50,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Sub CleanUp(listener As HttpListener, Optional tmpFilePath As String = Nothing) listener.Stop() listener.Close() - _mutex.ReleaseMutex() If tmpFilePath IsNot Nothing Then Directory.Delete(tmpFilePath, True) End If @@ -78,7 +74,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) Try - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereFileExistsNoOverwrite)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:="", @@ -97,10 +94,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWhereFileExistsOverwrite() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWhereFileExistsOverwrite)) Try - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereFileExistsOverwrite)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:="", @@ -118,12 +115,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWhereTimeoutNegative() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWhereTimeoutNegative)) Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(address:=DownloadLargeFileUrl, + Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereTimeoutNegative)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:="", @@ -141,12 +138,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithExpectedTimeOut() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithExpectedTimeOut)) Try Assert.Throws(Of WebException)( Sub() - My.Computer.Network.DownloadFile(address:=DownloadLargeFileUrl, + Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereTimeoutNegative)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:="", @@ -163,12 +160,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingDestinationFile() - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingDestinationFile)) Try Assert.Throws(Of ArgumentNullException)( Sub() - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingDestinationFile)) + My.Computer.Network.DownloadFile(address, destinationFileName:=Nothing, userName:="", password:="", @@ -185,10 +182,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingPassword() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingPassword)) Try - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingPassword)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:=Nothing) @@ -202,8 +199,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingUri() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingUri)) Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -224,10 +220,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingUsername() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingUsername)) Try - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingUsername)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:=Nothing, password:="", @@ -244,8 +240,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingWebAddress() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingWebAddress)) Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -261,10 +256,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUI() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=0) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUI)) Try - My.Computer.Network.DownloadFile(address:=DownloadLargeFileUrl, + Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUI)) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", password:="", @@ -281,10 +276,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUriFilename() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUriFilename)) Try - My.Computer.Network.DownloadFile(address:=New Uri(DownloadFileUrl), + Dim address As New Uri(_downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUriFilename))) + My.Computer.Network.DownloadFile(address, destinationFileName:=destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally @@ -296,10 +291,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUriFilenameAndUserCredentials() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUriFilenameAndUserCredentials)) Try - My.Computer.Network.DownloadFile(address:=New Uri(DownloadFileUrl), + Dim address As New Uri(_downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUriFilenameAndUserCredentials))) + My.Computer.Network.DownloadFile(address, destinationFilename, userName:="TDB", password:="TBD") @@ -313,10 +308,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUrlDestinationFilename() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - _mutex.WaitOne() - Dim listener As HttpListener = WebListener.ProcessRequests(s_prefixes) + Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUrlDestinationFilename)) Try - My.Computer.Network.DownloadFile(address:=DownloadFileUrl, + Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUrlDestinationFilename)) + My.Computer.Network.DownloadFile(address, destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 0e2e80b4a21..5c89535e0f3 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -8,22 +8,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Class WebListener - Friend Shared Function ProcessRequests(prefixes() As String) As HttpListener + Friend Shared Function ProcessRequests(urlPrefix As String, testName As String) As HttpListener If Not HttpListener.IsSupported Then Console.WriteLine("Windows XP SP2, Server 2003, or higher is required to use the HttpListener class.") End If ' URI prefixes are required, - If prefixes Is Nothing OrElse prefixes.Length = 0 Then - Throw New ArgumentException("prefixes") + If urlPrefix Is Nothing Then + Throw New ArgumentException(NameOf(urlPrefix)) End If ' Create a listener and add the prefixes. Dim listener As New HttpListener() - For Each s As String In prefixes - listener.Prefixes.Add(s) - Next + listener.Prefixes.Add(urlPrefix.Replace(NameOf(HttpListener), testName)) listener.Start() Task.Run( Sub() From 14a9d667aaa8656da40736919e8990a68f6dd79c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Feb 2024 17:34:17 -0800 Subject: [PATCH 068/342] simulate network traffic --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 5c89535e0f3..c00fc36d48a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -39,6 +39,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim rawUrl As String = context.Request.RawUrl.Split("/").Last.Substring(1) Dim size As Integer = Integer.Parse(rawUrl) Dim responseString As String = Strings.StrDup(size, "A") + ' simulate network traffic + Threading.Thread.Sleep(2000) Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) response.ContentLength64 = buffer.Length Dim output As Stream = response.OutputStream From 8470970a6d76e575b0b27f9fab037aa0e9a9a854 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Feb 2024 17:37:33 -0800 Subject: [PATCH 069/342] Simulate network traffic --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 5c89535e0f3..ce39151bf00 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -39,6 +39,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim rawUrl As String = context.Request.RawUrl.Split("/").Last.Substring(1) Dim size As Integer = Integer.Parse(rawUrl) Dim responseString As String = Strings.StrDup(size, "A") + ' Simulate network traffic + Threading.Thread.Sleep(2000) Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) response.ContentLength64 = buffer.Length Dim output As Stream = response.OutputStream From 0117d49cb662a466423405f0d1d0f56ff6345efa Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Feb 2024 17:38:13 -0800 Subject: [PATCH 070/342] Fix spelling error --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index c00fc36d48a..ce39151bf00 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -39,7 +39,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim rawUrl As String = context.Request.RawUrl.Split("/").Last.Substring(1) Dim size As Integer = Integer.Parse(rawUrl) Dim responseString As String = Strings.StrDup(size, "A") - ' simulate network traffic + ' Simulate network traffic Threading.Thread.Sleep(2000) Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) response.ContentLength64 = buffer.Length From a68cc7b38ced33853c5f790ca251350e80bbd52b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Feb 2024 00:57:45 -0800 Subject: [PATCH 071/342] Speed up tests and fix random failing test. --- .../tests/UnitTests/System/Windows/Forms/NetworkTests.vb | 2 +- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb index d3ddfff1697..71319198a71 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb @@ -142,7 +142,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of WebException)( Sub() - Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereTimeoutNegative)) + Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithExpectedTimeOut)) My.Computer.Network.DownloadFile(address, destinationFilename, userName:="", diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index ce39151bf00..28850d9fa06 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim size As Integer = Integer.Parse(rawUrl) Dim responseString As String = Strings.StrDup(size, "A") ' Simulate network traffic - Threading.Thread.Sleep(2000) + Threading.Thread.Sleep(20) Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) response.ContentLength64 = buffer.Length Dim output As Stream = response.OutputStream From 81eb2324d8797f3e3d29cb342b3ee76d5797e03f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Feb 2024 03:15:19 -0800 Subject: [PATCH 072/342] Cleanup and remove duplicate code --- .../System/Windows/Forms/NetworkTests.vb | 78 ++++++++++--------- .../System/Windows/Forms/WebListener.vb | 25 +++--- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb index d3ddfff1697..c572937d969 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb @@ -15,9 +15,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const UploadFileUrl As String = "ftp://speedtest.tele2.net/upload/testing.txt" Private ReadOnly _baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") - Private ReadOnly _downloadBaseListenerUrl As String = $"http://127.0.0.1:8080/{NameOf(HttpListener)}/" - Private ReadOnly _downloadFileUrl As String = $"{_downloadBaseListenerUrl}t18135" - Private ReadOnly _downloadLargeFileUrl As String = $"{_downloadBaseListenerUrl}T104857600" + Private ReadOnly _downloadFileSize As Integer = 18135 + Private ReadOnly _downloadLargeFileSize As Integer = 104857600 ''' ''' If size >= 0 then create the file with size length @@ -73,9 +72,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereFileExistsNoOverwrite)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", @@ -85,7 +85,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Finally Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) - CleanupTempDirectory(tmpFilePath) + CleanUp(listener, tmpFilePath) End Try End Sub) End Sub @@ -94,10 +94,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWhereFileExistsOverwrite() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWhereFileExistsOverwrite)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereFileExistsOverwrite)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", @@ -115,12 +115,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWhereTimeoutNegative() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWhereTimeoutNegative)) + Dim webListener As New WebListener(_downloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentException)( Sub() - Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereTimeoutNegative)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", @@ -138,12 +138,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithExpectedTimeOut() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithExpectedTimeOut)) + Dim webListener As New WebListener(_downloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of WebException)( Sub() - Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWhereTimeoutNegative)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", @@ -160,12 +160,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingDestinationFile() - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingDestinationFile)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentNullException)( Sub() - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingDestinationFile)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFileName:=Nothing, userName:="", password:="", @@ -182,10 +182,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingPassword() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingPassword)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingPassword)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:=Nothing) @@ -199,7 +199,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingUri() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingUri)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -220,10 +221,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingUsername() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingUsername)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithNothingUsername)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:=Nothing, password:="", @@ -240,7 +241,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithNothingWebAddress() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithNothingWebAddress)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -256,10 +258,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUI() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=0) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUI)) + Dim webListener As New WebListener(_downloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadLargeFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUI)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", @@ -276,10 +278,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUriFilename() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUriFilename)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As New Uri(_downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUriFilename))) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFileName:=destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally @@ -291,10 +293,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUriFilenameAndUserCredentials() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUriFilenameAndUserCredentials)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As New Uri(_downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUriFilenameAndUserCredentials))) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="TDB", password:="TBD") @@ -308,10 +310,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWithUrlDestinationFilename() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim listener As HttpListener = WebListener.ProcessRequests(_downloadBaseListenerUrl, NameOf(DownloadWithUrlDestinationFilename)) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim address As String = _downloadFileUrl.Replace(NameOf(HttpListener), NameOf(DownloadWithUrlDestinationFilename)) - My.Computer.Network.DownloadFile(address, + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index ce39151bf00..ced37383f6b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -3,25 +3,30 @@ Imports System.IO Imports System.Net +Imports System.Runtime.CompilerServices Namespace Microsoft.VisualBasic.Forms.Tests Public Class WebListener + Private ReadOnly _downloadFileUrlPrefix As String + Private ReadOnly _fileSize As Integer + Public ReadOnly Address As String - Friend Shared Function ProcessRequests(urlPrefix As String, testName As String) As HttpListener + Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) + _fileSize = fileSize + _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" + Address = $"{_downloadFileUrlPrefix}T{fileSize}" + End Sub + + Friend Function ProcessRequests() As HttpListener If Not HttpListener.IsSupported Then Console.WriteLine("Windows XP SP2, Server 2003, or higher is required to use the HttpListener class.") End If - ' URI prefixes are required, - If urlPrefix Is Nothing Then - Throw New ArgumentException(NameOf(urlPrefix)) - End If - ' Create a listener and add the prefixes. Dim listener As New HttpListener() - listener.Prefixes.Add(urlPrefix.Replace(NameOf(HttpListener), testName)) + listener.Prefixes.Add(_downloadFileUrlPrefix) listener.Start() Task.Run( Sub() @@ -36,11 +41,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' Create the response. response = context.Response - Dim rawUrl As String = context.Request.RawUrl.Split("/").Last.Substring(1) - Dim size As Integer = Integer.Parse(rawUrl) - Dim responseString As String = Strings.StrDup(size, "A") + Dim responseString As String = Strings.StrDup(_fileSize, "A") ' Simulate network traffic - Threading.Thread.Sleep(2000) + Threading.Thread.Sleep(20) Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) response.ContentLength64 = buffer.Length Dim output As Stream = response.OutputStream From fff6e8d58b3e8aafd751f67522bf117da8b0ada4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Feb 2024 15:36:58 -0800 Subject: [PATCH 073/342] Sepatate out common functions, upload and download code and #IF out all of upload testing since it currently requires a 3rd party website wich is not allowed. --- ...etworkTests.vb => NetworkDownloadTests.vb} | 144 ------------------ .../Forms/NetworkTestsCommonFunctions.vb | 47 ++++++ .../Windows/Forms/NetworkUploadTests.vb | 129 ++++++++++++++++ 3 files changed, 176 insertions(+), 144 deletions(-) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/{NetworkTests.vb => NetworkDownloadTests.vb} (66%) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb similarity index 66% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index c572937d969..3b208bab9c5 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -3,7 +3,6 @@ Imports System.IO Imports System.Net -Imports System.Runtime.CompilerServices Imports Xunit @@ -11,34 +10,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class NetworkTests - ' The following URL MUST be replaced with a local URL - Private Const UploadFileUrl As String = "ftp://speedtest.tele2.net/upload/testing.txt" - - Private ReadOnly _baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") Private ReadOnly _downloadFileSize As Integer = 18135 Private ReadOnly _downloadLargeFileSize As Integer = 104857600 - ''' - ''' If size >= 0 then create the file with size length - ''' The file will contain the letters A-Z repeating as needed. - ''' - ''' Full path to working directory - ''' File size to be created - ''' - Private Shared Function CreateTempFile(tmpFilePath As String, Optional size As Integer = -1) As String - Dim filename As String = Path.Combine(tmpFilePath, "testing.txt") - If size >= 0 Then - Using destinationStream As FileStream = File.Create(filename) - For i As Long = 0 To size - 1 - destinationStream.WriteByte(CByte((AscW("A") + (i Mod 26)))) - Next - destinationStream.Flush() - destinationStream.Close() - End Using - End If - Return filename - End Function - Private Shared Function ValidateDownload(tmpFilePath As String, destinationFilename As String) As Long Assert.True(Directory.Exists(tmpFilePath)) Dim fileInfo As New FileInfo(destinationFilename) @@ -54,18 +28,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub - Private Sub CleanupTempDirectory(path As String) - Directory.Delete(path, True) - End Sub - - Private Function CreateTempDirectory( Optional memberName As String = Nothing) As String - - Directory.CreateDirectory(_baseTempPath) - Dim folder As String = Path.Combine(_baseTempPath, $"{memberName}Test") - Directory.CreateDirectory(folder) - Return folder - End Function - Public Sub DownloadWhereFileExistsNoOverwrite() Assert.Throws(Of IOException)( @@ -321,112 +283,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub UploadFilenameUrl() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=1) - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl) - CleanupTempDirectory(tmpFilePath) - End Sub - - - Public Sub UploadWhereTimeoutNegative() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=&H100_0000) - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=-1) - End Sub) - CleanupTempDirectory(tmpFilePath) - End Sub - - - Public Sub UploadWithExpectedTimeOut() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, &H10_0000) - Try - - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=1) - End Sub) - Finally - CleanupTempDirectory(tmpFilePath) - End Try - End Sub - - - Public Sub UploadWithNothingPassword() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:=Nothing) - Finally - CleanupTempDirectory(tmpFilePath) - End Try - End Sub - - - Public Sub UploadWithNothingSourceFile() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network.UploadFile(sourceFileName:=Nothing, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous") - End Sub) - Finally - CleanupTempDirectory(tmpFilePath) - End Try - End Sub - - - Public Sub UploadWithNothingUri() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=CType(Nothing, Uri), - userName:="anonymous", - password:="anonymous") - End Sub) - CleanupTempDirectory(tmpFilePath) - End Sub - - - Public Sub UploadWithUI() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=100000) - Finally - CleanupTempDirectory(tmpFilePath) - End Try - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb new file mode 100644 index 00000000000..c20aa6a3984 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb @@ -0,0 +1,47 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Runtime.CompilerServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class NetworkTests + Private Shared ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") + + Private Shared Function CreateTempDirectory( Optional memberName As String = Nothing) As String + + Directory.CreateDirectory(s_baseTempPath) + Dim folder As String = Path.Combine(s_baseTempPath, $"{memberName}Test") + Directory.CreateDirectory(folder) + Return folder + End Function + + ''' + ''' If size >= 0 then create the file with size length + ''' The file will contain the letters A-Z repeating as needed. + ''' + ''' Full path to working directory + ''' File size to be created + ''' + ''' The full path and file name of the created file + ''' If size = -1 not file is create but the full path is returned + ''' + Private Shared Function CreateTempFile(tmpFilePath As String, Optional size As Integer = -1) As String + Dim filename As String = Path.Combine(tmpFilePath, "testing.txt") + If size >= 0 Then + Using destinationStream As FileStream = File.Create(filename) + ' Below allows for limited testing of download data + For i As Long = 0 To size - 1 + destinationStream.WriteByte(CByte((AscW("A") + (i Mod 26)))) + Next + destinationStream.Flush() + destinationStream.Close() + End Using + End If + Return filename + End Function + + End Class + +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb new file mode 100644 index 00000000000..8108a4d3785 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb @@ -0,0 +1,129 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +' Here for future testing of My.Computer.Network.UploadFile +' the site SpeedTest.tele2.net should not be used +#If False Then + +Imports System.IO +Imports System.Net + +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class NetworkTests + + ' The following URL MUST be replaced with a local URL + Private Const UploadFileUrl As String = "ftp://speedtest.tele2.net/upload/testing.txt" + + + Public Sub UploadFilenameUrl() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=1) + My.Computer.Network.UploadFile(sourceFilename, + address:=UploadFileUrl) + Directory.Delete(tmpFilePath, True) + End Sub + + + Public Sub UploadWhereTimeoutNegative() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=&H100_0000) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network.UploadFile(sourceFilename, + address:=UploadFileUrl, + userName:="anonymous", + password:="anonymous", + showUI:=True, + connectionTimeout:=-1) + End Sub) + Directory.Delete(tmpFilePath, True) + End Sub + + + Public Sub UploadWithExpectedTimeOut() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, &H10_0000) + Try + + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network.UploadFile(sourceFilename, + address:=UploadFileUrl, + userName:="anonymous", + password:="anonymous", + showUI:=True, + connectionTimeout:=1) + End Sub) + Finally + Directory.Delete(tmpFilePath, True) + End Try + End Sub + + + Public Sub UploadWithNothingPassword() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) + Try + My.Computer.Network.UploadFile(sourceFilename, + address:=UploadFileUrl, + userName:="anonymous", + password:=Nothing) + Finally + Directory.Delete(tmpFilePath, True) + End Try + End Sub + + + Public Sub UploadWithNothingSourceFile() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network.UploadFile(sourceFileName:=Nothing, + address:=UploadFileUrl, + userName:="anonymous", + password:="anonymous") + End Sub) + Finally + Directory.Delete(tmpFilePath, True) + End Try + End Sub + + + Public Sub UploadWithNothingUri() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network.UploadFile(sourceFilename, + address:=CType(Nothing, Uri), + userName:="anonymous", + password:="anonymous") + End Sub) + Directory.Delete(tmpFilePath, True) + End Sub + + + Public Sub UploadWithUI() + Dim tmpFilePath As String = CreateTempDirectory() + Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) + Try + My.Computer.Network.UploadFile(sourceFilename, + address:=UploadFileUrl, + userName:="anonymous", + password:="anonymous", + showUI:=True, + connectionTimeout:=100000) + Finally + Directory.Delete(tmpFilePath, True) + End Try + End Sub + + End Class + +End Namespace +#End If From 51188ae7b6372a6ae457753ac4add5224891b84c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Feb 2024 15:53:17 -0800 Subject: [PATCH 074/342] Remove redundant Opttion statements from source files --- .../ApplicationServices/ApplicationBase.vb | 4 +--- .../ApplyApplicationDefaultsEventArgs.vb | 5 +---- .../ApplicationServices/AssemblyInfo.vb | 5 ++--- .../CantStartSingleInstanceException.vb | 8 +++----- .../ConsoleApplicationBase.vb | 3 --- .../NoStartupFormException.vb | 6 ++---- .../SingleInstanceHelpers.vb | 3 --- .../ApplicationServices/StartupEventArgs.vb | 6 ++---- .../StartupNextInstanceEventArgs.vb | 6 ++---- .../UnhandledExceptionEventArgs.vb | 4 ---- .../VisualBasic/ApplicationServices/User.vb | 6 +----- ...wsFormsApplicationBase.WinFormsAppContext.vb | 8 ++++---- .../WindowsFormsApplicationBase.vb | 4 ---- .../src/Microsoft/VisualBasic/Devices/Audio.vb | 7 ++++--- .../src/Microsoft/VisualBasic/Devices/Clock.vb | 7 +++---- .../Microsoft/VisualBasic/Devices/Computer.vb | 4 +--- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 3 --- .../src/Microsoft/VisualBasic/Devices/Mouse.vb | 8 +++----- .../VisualBasic/Devices/ServerComputer.vb | 4 +--- .../VisualBasic/Helpers/FileSystemUtils.vb | 3 --- .../VisualBasic/Helpers/NativeMethods.vb | 7 ++++--- .../VisualBasic/Helpers/NativeTypes.vb | 9 ++++++--- .../VisualBasic/Logging/FileLogTraceListener.vb | 3 --- .../src/Microsoft/VisualBasic/Logging/Log.vb | 8 +++----- .../VisualBasic/MyServices/ClipboardProxy.vb | 17 ++++++++--------- .../VisualBasic/MyServices/FileSystemProxy.vb | 4 +--- .../MyServices/Internal/ContextValue.vb | 8 +++----- .../MyServices/Internal/HttpClientCopy.vb | 3 --- .../MyServices/Internal/ProgressDialog.vb | 5 ++--- .../MyServices/Internal/WebClientCopy.vb | 3 --- 30 files changed, 57 insertions(+), 114 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 3ca6a80b3f3..bb1431b6f5e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -117,4 +114,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _log As Logging.Log 'Lazy-initialized and cached log object. Private _info As AssemblyInfo ' The executing application (the EntryAssembly) End Class 'ApplicationBase + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index cb198ad556f..4dc3b95522f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports System.Drawing Imports System.Runtime.InteropServices @@ -49,4 +45,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property HighDpiMode As HighDpiMode End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index faa2a2ed6c2..20082543193 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Collections.ObjectModel Imports System.Reflection Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils @@ -239,10 +236,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since these properties will not change during runtime, they're cached. ' "" is not Nothing so use Nothing to mark an un-accessed property. Private _description As String ' Cache the assembly's description. + Private _title As String ' Cache the assembly's title. Private _productName As String ' Cache the assembly's product name. Private _companyName As String ' Cache the assembly's company name. Private _trademark As String ' Cache the assembly's trademark. Private _copyright As String ' Cache the assembly's copyright. End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index f6a9d71e011..b297090d1a3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -1,17 +1,13 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when we launch a single-instance application and it can't connect with the + ''' Exception for when we launch a single-instance application and it can't connect with the ''' original instance. ''' @@ -39,5 +35,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Protected Sub New(ByVal info As Runtime.Serialization.SerializationInfo, ByVal context As Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 3ce9e0b1f86..8527fd31597 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.ComponentModel Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 967c9c805c7..1e07570cea3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -38,5 +34,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb index 7001340c1f4..95fd98725b2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.IO Imports System.IO.Pipes Imports System.Runtime.InteropServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index 1520b75763e..579b7174c12 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.Runtime.InteropServices @@ -33,5 +29,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Returns the command line sent to this application ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index fc1f473fb1d..512e9c1c2c3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel @@ -41,5 +37,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they ''' always return the same values Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index cebf5b87ed8..c754381dd29 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports System.Runtime.InteropServices Imports System.Threading diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index 2b4f3e7614b..f5d4721f631 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.ComponentModel Imports System.Security.Principal @@ -65,7 +62,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' The principal representing the current user. ''' ''' An IPrincipal representing the current user - ''' + ''' ''' This should be overridden by derived classes that don't get the current ''' user from the current thread ''' @@ -81,4 +78,3 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Class 'User End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 846eab5d858..76ebec2e782 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -1,7 +1,4 @@ -Option Strict On -Option Explicit On -Option Infer On -' Licensed to the .NET Foundation under one or more agreements. +' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Security @@ -52,6 +49,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub + End Class + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 20b930a2d58..986b25809b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.IO.Pipes diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index a37b22399e5..e6e7d03de0f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.IO Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils @@ -14,8 +11,10 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file ''' Public Enum AudioPlayMode + ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous + Background = 1 'Asynchronous BackgroundLoop = 2 'Asynchronous and looping End Enum @@ -163,5 +162,7 @@ Namespace Microsoft.VisualBasic Private _sound As Media.SoundPlayer End Class 'Audio + End Namespace + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index c7ea5c6fb79..7ac9ea7597d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - - Namespace Microsoft.VisualBasic.Devices ''' @@ -18,6 +14,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' A Date whose value is the current date and time. #Disable Warning IDE0049 ' Simplify Names, Justification:= + Public ReadOnly Property LocalTime() As DateTime Get Return DateTime.Now @@ -34,6 +31,7 @@ Namespace Microsoft.VisualBasic.Devices Return DateTime.UtcNow End Get End Property + #Enable Warning IDE0049 ' Simplify Names ''' @@ -48,4 +46,5 @@ Namespace Microsoft.VisualBasic.Devices End Property End Class 'Clock + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index f4098d32bad..bd33b29323d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports Microsoft.VisualBasic.MyServices Imports System.Windows.Forms @@ -97,4 +94,5 @@ Namespace Microsoft.VisualBasic.Devices Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class End Class 'Computer + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index bb5d1689ba5..14ff9561c05 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index e9174f4d891..45208acba3c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -1,16 +1,13 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices ''' - ''' A wrapper object that acts as a discovery mechanism for finding + ''' A wrapper object that acts as a discovery mechanism for finding ''' information about the mouse on your computer such as whether the mouse ''' exists, the number of buttons, WheelScrolls details. ''' @@ -23,7 +20,7 @@ Namespace Microsoft.VisualBasic.Devices ''' mouses buttons have been swapped. ''' ''' - ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. + ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. ''' ''' If no mouse is installed. Public ReadOnly Property ButtonsSwapped() As Boolean @@ -67,4 +64,5 @@ Namespace Microsoft.VisualBasic.Devices End Property End Class 'Mouse + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 757cd880b0a..131b3d66f5c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports Microsoft.VisualBasic.MyServices Namespace Microsoft.VisualBasic.Devices @@ -104,4 +101,5 @@ Namespace Microsoft.VisualBasic.Devices Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class End Class 'MyServerComputer + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 10357a7ae66..0ae0c807c1c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Security Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 7c9780356c0..48c962c1653 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Runtime.InteropServices Imports System.Text @@ -28,6 +25,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Lib "user32" () As IntPtr #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes + Friend Shared Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes @@ -93,6 +91,7 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning IDE0049 ' Simplify Names, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= + ''' ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' @@ -124,7 +123,9 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub Init() dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub + End Structure + #Enable Warning IDE0049 ' Simplify Names ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index b9eb086fd9e..3be2b6c5560 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Runtime.InteropServices Imports Microsoft.Win32.SafeHandles @@ -13,6 +10,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class NativeTypes #Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. + Friend NotInheritable Class SECURITY_ATTRIBUTES #Enable Warning CA1812 @@ -38,6 +36,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub + End Class ''' @@ -59,6 +58,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function + End Class ''' @@ -79,6 +79,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub + End Class ''' @@ -155,6 +156,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose(True) GC.SuppressFinalize(Me) End Sub + End Class ' Handle Values @@ -162,6 +164,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ' GetWindow() Constants Friend Const GW_HWNDFIRST As Integer = 0 + Friend Const GW_HWNDLAST As Integer = 1 Friend Const GW_HWNDNEXT As Integer = 2 Friend Const GW_HWNDPREV As Integer = 3 diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 936519222af..4bfd20973f0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.ComponentModel Imports System.Globalization Imports System.IO diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 389d7c8b39f..2b7fdcc4de1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text @@ -163,7 +160,7 @@ Namespace Microsoft.VisualBasic.Logging _listenerAttributes = Attributes End If - ' TODO: This is a tempory fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590 + ' TODO: This is a temporary fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590 Return False End Get End Property @@ -233,7 +230,8 @@ Namespace Microsoft.VisualBasic.Logging ' Names of TraceSources Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appconfig + + Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index b60616852ca..6fef2b1c36a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Drawing @@ -38,7 +35,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' The type of text to get ''' The text as a String - Public Function GetText(format As System.Windows.Forms.TextDataFormat) As String + Public Function GetText(format As TextDataFormat) As String Return Clipboard.GetText(format) End Function @@ -51,12 +48,12 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard in + ''' Indicates whether or not text is available on the clipboard in ''' the passed in format ''' ''' The type of text being checked for ''' True if text is available, otherwise False - Public Function ContainsText(format As System.Windows.Forms.TextDataFormat) As Boolean + Public Function ContainsText(format As TextDataFormat) As Boolean Return Clipboard.ContainsText(format) End Function @@ -73,7 +70,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' The String to save ''' The format in which to save the String - Public Sub SetText(text As String, format As System.Windows.Forms.TextDataFormat) + Public Sub SetText(text As String, format As TextDataFormat) Clipboard.SetText(text, format) End Sub @@ -197,7 +194,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' The data object ''' This gives the ability to save an object in multiple formats - Public Function GetDataObject() As System.Windows.Forms.IDataObject + Public Function GetDataObject() As IDataObject Return Clipboard.GetDataObject() End Function @@ -207,8 +204,10 @@ Namespace Microsoft.VisualBasic.MyServices ''' The data object to be saved ''' This gives the ability to save an object in multiple formats - Public Sub SetDataObject(data As System.Windows.Forms.DataObject) + Public Sub SetDataObject(data As DataObject) Clipboard.SetDataObject(data) End Sub + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb index b4a14a98322..b3f0577098f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.Text @@ -278,4 +275,5 @@ Namespace Microsoft.VisualBasic.MyServices Private _specialDirectoriesProxy As SpecialDirectoriesProxy End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 428d45d6e2b..34e0a05d2d6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -1,26 +1,24 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Threading Namespace Microsoft.VisualBasic.MyServices.Internal ''' - ''' Stores an object in a context appropriate for the environment we are + ''' Stores an object in a context appropriate for the environment we are ''' running in (web/windows) ''' ''' ''' - ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the + ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the ''' context of the current request (meaning the object is stored per request on the web). ''' Note that an instance of this class can only be associated ''' with the one item to be stored/retrieved at a time. ''' Public Class ContextValue(Of T) + Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index d0d02c910d3..8cf447bb2c6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.IO Imports System.Net Imports System.Net.Http diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 8ec8036e665..720f46046ea 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Drawing Imports System.Globalization Imports System.Threading @@ -221,6 +218,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub + Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button @@ -274,4 +272,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal #End Region End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index bc0a8f387f4..a159a69ab8b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.IO Imports System.Net From dc948da1b4b836bc8744632ff6daa823e3003630 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 6 Mar 2024 23:53:05 -1000 Subject: [PATCH 075/342] Remove unused code paths and old sample code. --- .../Windows/Forms/NetworkDownloadTests.vb | 23 +++++----- .../System/Windows/Forms/WebListener.vb | 45 +++++++------------ 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 3b208bab9c5..c0fd4d2125b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -36,19 +36,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) Dim webListener As New WebListener(_downloadFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=100000, - overwrite:=False) - Finally - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) - CleanUp(listener, tmpFilePath) - End Try + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=100000, + overwrite:=False) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) + CleanUp(listener, tmpFilePath) End Sub) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index ced37383f6b..1dda0a6e875 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -19,42 +19,29 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub Friend Function ProcessRequests() As HttpListener - - If Not HttpListener.IsSupported Then - Console.WriteLine("Windows XP SP2, Server 2003, or higher is required to use the HttpListener class.") - End If - ' Create a listener and add the prefixes. Dim listener As New HttpListener() listener.Prefixes.Add(_downloadFileUrlPrefix) listener.Start() Task.Run( Sub() + ' Start the listener to begin listening for requests. + Dim response As HttpListenerResponse = Nothing Try - ' Start the listener to begin listening for requests. - Debug.WriteLine("Listening...") - - Dim response As HttpListenerResponse = Nothing - Try - ' Note: GetContext blocks while waiting for a request. - Dim context As HttpListenerContext = listener.GetContext() - - ' Create the response. - response = context.Response - Dim responseString As String = Strings.StrDup(_fileSize, "A") - ' Simulate network traffic - Threading.Thread.Sleep(20) - Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) - response.ContentLength64 = buffer.Length - Dim output As Stream = response.OutputStream - output.Write(buffer, 0, buffer.Length) - Catch ex As HttpListenerException - Debug.WriteLine(ex.Message) - Finally - response?.Close() - End Try - Catch ex As HttpListenerException - Debug.WriteLine(ex.Message) + ' Note: GetContext blocks while waiting for a request. + Dim context As HttpListenerContext = listener.GetContext() + + ' Create the response. + response = context.Response + Dim responseString As String = Strings.StrDup(_fileSize, "A") + ' Simulate network traffic + Threading.Thread.Sleep(20) + Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) + response.ContentLength64 = buffer.Length + Dim output As Stream = response.OutputStream + output.Write(buffer, 0, buffer.Length) + Finally + response?.Close() End Try End Sub) Return listener From 32cb5b4bb488a67ed8a8c0e8c69dd52781618c2a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 7 Mar 2024 01:05:55 -1000 Subject: [PATCH 076/342] Fix DownloadWhereFileExistsNoOverwrite to cleanup after test --- .../Windows/Forms/NetworkDownloadTests.vb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index c0fd4d2125b..bb4979cfd6f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -30,12 +30,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadWhereFileExistsNoOverwrite() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Assert.Throws(Of IOException)( Sub() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) - Dim webListener As New WebListener(_downloadFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, userName:="", @@ -43,10 +43,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, connectionTimeout:=100000, overwrite:=False) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) - CleanUp(listener, tmpFilePath) End Sub) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) + CleanUp(listener, tmpFilePath) End Sub @@ -206,7 +206,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network.DownloadFile(address:=CStr(Nothing), - destinationFileName:=destinationFilename) + destinationFilename) End Sub) Finally CleanUp(listener, tmpFilePath) @@ -241,7 +241,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(webListener.Address, - destinationFileName:=destinationFilename) + destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) From 9ed203f6b8e50f4c9cd634a3e8dc4d3a7c798590 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 7 Mar 2024 16:34:10 -1000 Subject: [PATCH 077/342] Correct DownloadWithUriFilename to pass URI --- .../Windows/Forms/NetworkDownloadTests.vb | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index bb4979cfd6f..1a15745e61b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -117,6 +117,28 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub + + Public Sub DownloadWithInvalidUrl() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim webListener As New WebListener(_downloadFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network.DownloadFile(address:="x", + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=100000, + overwrite:=False) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + Public Sub DownloadWithNothingDestinationFile() Dim webListener As New WebListener(_downloadFileSize) @@ -240,7 +262,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(_downloadFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, + My.Computer.Network.DownloadFile(New Uri(webListener.Address), destinationFilename) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally @@ -255,7 +277,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(_downloadFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, + My.Computer.Network.DownloadFile(New Uri(webListener.Address), destinationFilename, userName:="TDB", password:="TBD") From 2dbd075ab337a2832c102c93434af8e897755694 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 01:15:13 -1000 Subject: [PATCH 078/342] Improve code coverage to 100% for DownloadFIle Organize files to match PublicAPIShipped.txt Test Password Failures --- .gitignore | 1 + CodeMaid.config | 42 -- .../Windows/Forms/NetworkDownloadTests.vb | 400 +++++++++++++----- .../System/Windows/Forms/WebListener.vb | 20 +- 4 files changed, 309 insertions(+), 154 deletions(-) delete mode 100644 CodeMaid.config diff --git a/.gitignore b/.gitignore index 2e7370c1ecb..ed656989e11 100644 --- a/.gitignore +++ b/.gitignore @@ -385,3 +385,4 @@ InteropTests/NativeTests/out # 'git update-index --assume-unchanged ' will allow ignoring changes for tracked files. **/ScratchProject/ **/ScratchProjectWithInternals/ +/CodeMaid.config diff --git a/CodeMaid.config b/CodeMaid.config deleted file mode 100644 index e1ff72e561d..00000000000 --- a/CodeMaid.config +++ /dev/null @@ -1,42 +0,0 @@ - - - - -
- - - - - - Constructors||3||Constructors - - - Methods||8||Methods - - - Properties||5||Properties - - - Enums||9||Enums - - - Destructors||4||Destructors - - - Delegates||2||Delegates - - - True - - - Indexers||6||Indexers - - - Interfaces||10||Interfaces - - - Events||7||Events - - - - \ No newline at end of file diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 1a15745e61b..d63f4211307 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -9,9 +9,11 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class NetworkTests - - Private ReadOnly _downloadFileSize As Integer = 18135 - Private ReadOnly _downloadLargeFileSize As Integer = 104857600 + Private Const DefaultPassword As String = "TBD" + Private Const DefaultUserName As String = "TBD" + Private Const DownloadLargeFileSize As Integer = 104857600 + Private Const DownloadSmallFileSize As Integer = 18135 + Private Const TestingConnectionTimeout As Integer = 100000 Private Shared Function ValidateDownload(tmpFilePath As String, destinationFilename As String) As Long Assert.True(Directory.Exists(tmpFilePath)) @@ -28,88 +30,75 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String) -> Void" + - Public Sub DownloadWhereFileExistsNoOverwrite() + Public Sub DownloadFile_Url_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) - Dim webListener As New WebListener(_downloadFileSize) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Assert.Throws(Of IOException)( - Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=100000, - overwrite:=False) - End Sub) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) - CleanUp(listener, tmpFilePath) + Try + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Finally + CleanUp(listener, tmpFilePath) + End Try End Sub - Public Sub DownloadWhereFileExistsOverwrite() + Public Sub DownloadFile_Url_UrlEqualsNothing_Throw() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) - Dim webListener As New WebListener(_downloadFileSize) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=100000, - overwrite:=True) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 18135) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network.DownloadFile(address:=CStr(Nothing), + destinationFilename) + End Sub) Finally CleanUp(listener, tmpFilePath) End Try End Sub +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String) -> Void" + - Public Sub DownloadWhereTimeoutNegative() + Public Sub DownloadFile_Url_PasswordEqualNothing_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim webListener As New WebListener(_downloadLargeFileSize) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) - End Sub) - Assert.False(File.Exists(destinationFilename)) + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + password:=Nothing) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try End Sub - Public Sub DownloadWithExpectedTimeOut() + Public Sub DownloadFile_Url_PasswordWrong_Throw() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadLargeFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of WebException)( - Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) - End Sub) + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + password:="123") + End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) Finally @@ -117,11 +106,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" + - Public Sub DownloadWithInvalidUrl() + Public Sub DownloadFile_Ur_InvalidUrl_Throw() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentException)( @@ -131,7 +124,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests userName:="", password:="", showUI:=True, - connectionTimeout:=100000, + TestingConnectionTimeout, overwrite:=False) End Sub) Finally @@ -140,8 +133,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadWithNothingDestinationFile() - Dim webListener As New WebListener(_downloadFileSize) + Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throw() + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentNullException)( @@ -151,7 +144,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests userName:="", password:="", showUI:=True, - connectionTimeout:=100000, + TestingConnectionTimeout, overwrite:=False) End Sub) Finally @@ -160,37 +153,62 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadWithNothingPassword() + Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throw() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadFileSize) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Assert.Throws(Of IOException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + End Sub) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) + CleanUp(listener, tmpFilePath) + End Sub + + + Public Sub DownloadFile_Url_FileExistsOverwrite_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:=Nothing) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try End Sub - Public Sub DownloadWithNothingUri() + Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throw() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), + My.Computer.Network.DownloadFile(address:="x", destinationFilename, userName:="", password:="", - showUI:=True, - connectionTimeout:=100000, + showUI:=False, + TestingConnectionTimeout, overwrite:=False) End Sub) Finally @@ -199,88 +217,154 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadWithNothingUsername() + Public Sub DownloadFile_Url_TimeOut_Throw() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) + End Sub) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + + + Public Sub DownloadFile_Url_TimeoutNegative_Throw() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, - userName:=Nothing, + userName:="", password:="", showUI:=True, - connectionTimeout:=100000, + connectionTimeout:=-1, overwrite:=False) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try End Sub - Public Sub DownloadWithNothingWebAddress() + Public Sub DownloadFile_Url_UsernameEqualNothing_Success() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network.DownloadFile(address:=CStr(Nothing), - destinationFilename) - End Sub) + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + userName:=Nothing, + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try End Sub +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> Void" + - Public Sub DownloadWithUI() + Public Sub DownloadFile_Url_AllOptionsSet_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=0) - Dim webListener As New WebListener(_downloadLargeFileSize) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + FileIO.UICancelOption.DoNothing) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + CleanUp(listener, tmpFilePath) + End Sub + +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String) -> Void" + + + Public Sub DownloadFile_Uri_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=100000, - overwrite:=True) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) + My.Computer.Network.DownloadFile(New Uri(webListener.Address), + destinationFilename) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) End Try End Sub +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" + - Public Sub DownloadWithUriFilename() + Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() + ' Get network credentials + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename) + Dim address As Uri = New Uri(webListener.Address) + My.Computer.Network.DownloadFile(address, + destinationFilename, + networkCredentials, + showUI:=False, TestingConnectionTimeout, + True) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) End Try End Sub +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String) -> Void" + - Public Sub DownloadWithUriFilenameAndUserCredentials() + Public Sub DownloadFile_Uri_UserNamePassword_Success() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(New Uri(webListener.Address), destinationFilename, - userName:="TDB", - password:="TBD") + DefaultUserName, + DefaultPassword) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -288,20 +372,114 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadWithUrlDestinationFilename() + Public Sub DownloadFile_Uri_UserNamePassword_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) - Dim webListener As New WebListener(_downloadFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network.DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + password:="123") + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" + + + Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=0) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) Finally CleanUp(listener, tmpFilePath) End Try End Sub + + Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network.DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + CleanUp(listener, tmpFilePath) + End Sub + +#End Region + +#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> Void" + + + Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network.DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + FileIO.UICancelOption.DoNothing) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + CleanUp(listener, tmpFilePath) + End Sub + + + Public Sub DownloadFile_Uri_UriIsNothing_Throws() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + +#End Region + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 1dda0a6e875..48ec9661270 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -4,6 +4,7 @@ Imports System.IO Imports System.Net Imports System.Runtime.CompilerServices +Imports System.Security.Principal Namespace Microsoft.VisualBasic.Forms.Tests @@ -11,6 +12,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private ReadOnly _downloadFileUrlPrefix As String Private ReadOnly _fileSize As Integer Public ReadOnly Address As String + Private _userName As String + Private _password As String Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) _fileSize = fileSize @@ -18,10 +21,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Address = $"{_downloadFileUrlPrefix}T{fileSize}" End Sub + Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) + Me.New(fileSize, memberName) + _userName = userName + _password = password + End Sub + Friend Function ProcessRequests() As HttpListener ' Create a listener and add the prefixes. Dim listener As New HttpListener() listener.Prefixes.Add(_downloadFileUrlPrefix) + If _userName IsNot Nothing AndAlso _password IsNot Nothing Then + listener.AuthenticationSchemes = AuthenticationSchemes.Basic + End If listener.Start() Task.Run( Sub() @@ -30,9 +42,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try ' Note: GetContext blocks while waiting for a request. Dim context As HttpListenerContext = listener.GetContext() - ' Create the response. response = context.Response + Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) + If context.User?.Identity.IsAuthenticated Then + If identity.Password <> _password Then + response.StatusCode = HttpStatusCode.Unauthorized + Exit Try + End If + End If Dim responseString As String = Strings.StrDup(_fileSize, "A") ' Simulate network traffic Threading.Thread.Sleep(20) From 5cea145f2b8601ca548b51af3cff6d540e43dd8d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 16:58:45 -1000 Subject: [PATCH 079/342] Fix Password Nothing Handling --- .../MyServices/Internal/HttpClientCopy.vb | 71 +++++++++++-------- .../Windows/Forms/NetworkDownloadTests.vb | 20 +++--- .../System/Windows/Forms/WebListener.vb | 4 +- 3 files changed, 54 insertions(+), 41 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 8cf447bb2c6..223202180bb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -130,37 +130,48 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Throw New WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout) End If End Try - Dim contentLength? As Long = response?.Content.Headers.ContentLength - If contentLength.HasValue Then - Using responseStream As Stream = Await response.Content.ReadAsStreamAsync(_cancelTokenSourceReadStream.Token).ConfigureAwait(False) - Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) - - Dim buffer(8191) As Byte - Dim totalBytesRead As Long = 0 - Dim bytesRead As Integer - Try - bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenSourceRead.Token).ConfigureAwait(False) - Do While bytesRead > 0 - totalBytesRead += bytesRead - - Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenSourceWrite.Token).ConfigureAwait(False) - If m_ProgressDialog IsNot Nothing Then - Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) - InvokeIncrement(percentage) - End If - bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenSourceRead.Token).ConfigureAwait(False) - Loop - Finally - CloseProgressDialog() - End Try - End Using - End Using - End If - response?.Dispose() - If m_ProgressDialog IsNot Nothing Then - RemoveHandler m_ProgressDialog.UserHitCancel, AddressOf m_ProgressDialog_UserHitCancel - End If + Select Case response.StatusCode + Case HttpStatusCode.OK + Dim contentLength? As Long = response?.Content.Headers.ContentLength + If contentLength.HasValue Then + Using responseStream As Stream = Await response.Content.ReadAsStreamAsync(_cancelTokenSourceReadStream.Token).ConfigureAwait(False) + Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) + + Dim buffer(8191) As Byte + Dim totalBytesRead As Long = 0 + Dim bytesRead As Integer + Try + bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenSourceRead.Token).ConfigureAwait(False) + Do While bytesRead > 0 + totalBytesRead += bytesRead + + Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenSourceWrite.Token).ConfigureAwait(False) + If m_ProgressDialog IsNot Nothing Then + Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) + InvokeIncrement(percentage) + End If + bytesRead = Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenSourceRead.Token).ConfigureAwait(False) + Loop + Finally + CloseProgressDialog() + End Try + End Using + End Using + If response.StatusCode = HttpStatusCode.OK Then + End If + + If m_ProgressDialog IsNot Nothing Then + RemoveHandler m_ProgressDialog.UserHitCancel, AddressOf m_ProgressDialog_UserHitCancel + End If + End If + Case HttpStatusCode.Unauthorized + ' REVIEWER Please check following two web exceptions + Throw New WebException(SR.net_webstatus_Unauthorized, WebExceptionStatus.ProtocolError) + Case Else + Throw New WebException() + End Select + response?.Dispose() End Function #If False Then diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index d63f4211307..b3b376bfa8d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -69,35 +69,37 @@ Namespace Microsoft.VisualBasic.Forms.Tests #Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String) -> Void" - Public Sub DownloadFile_Url_PasswordEqualNothing_Success() + Public Sub DownloadFile_Url_Password_Success() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, DefaultUserName, - password:=Nothing) + DefaultPassword) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try End Sub - - Public Sub DownloadFile_Url_PasswordWrong_Throw() + + + + Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of WebException)( Sub() My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - DefaultUserName, - password:="123") + destinationFilename, + DefaultUserName, + password) End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 48ec9661270..01f6fc4fd86 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -31,7 +31,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' Create a listener and add the prefixes. Dim listener As New HttpListener() listener.Prefixes.Add(_downloadFileUrlPrefix) - If _userName IsNot Nothing AndAlso _password IsNot Nothing Then + If _userName IsNot Nothing OrElse _password IsNot Nothing Then listener.AuthenticationSchemes = AuthenticationSchemes.Basic End If listener.Start() @@ -46,7 +46,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then - If identity.Password <> _password Then + If identity.Name <> _userName OrElse identity.Password <> _password Then response.StatusCode = HttpStatusCode.Unauthorized Exit Try End If From 63ebe2195fa0282226a22e2dd333cae5e4f1e57d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 17:04:32 -1000 Subject: [PATCH 080/342] WebListener to correctly handle Nothing Passwords --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 48ec9661270..05fafb5fcd7 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -4,7 +4,6 @@ Imports System.IO Imports System.Net Imports System.Runtime.CompilerServices -Imports System.Security.Principal Namespace Microsoft.VisualBasic.Forms.Tests @@ -31,7 +30,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' Create a listener and add the prefixes. Dim listener As New HttpListener() listener.Prefixes.Add(_downloadFileUrlPrefix) - If _userName IsNot Nothing AndAlso _password IsNot Nothing Then + If _userName IsNot Nothing OrElse _password IsNot Nothing Then listener.AuthenticationSchemes = AuthenticationSchemes.Basic End If listener.Start() @@ -46,7 +45,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then - If identity.Password <> _password Then + If identity.Name <> _userName OrElse identity.Password <> _password Then response.StatusCode = HttpStatusCode.Unauthorized Exit Try End If From 2c54144283975b818fce1f1c567a33b6f56c6888 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 17:25:33 -1000 Subject: [PATCH 081/342] Add net_webstatus_Unauthorized Message --- .../src/Resources/SR.resx | 60 ++++++++++--------- .../src/Resources/xlf/SR.cs.xlf | 13 ++-- .../src/Resources/xlf/SR.de.xlf | 13 ++-- .../src/Resources/xlf/SR.es.xlf | 11 ++-- .../src/Resources/xlf/SR.fr.xlf | 11 ++-- .../src/Resources/xlf/SR.it.xlf | 11 ++-- .../src/Resources/xlf/SR.ja.xlf | 11 ++-- .../src/Resources/xlf/SR.ko.xlf | 11 ++-- .../src/Resources/xlf/SR.pl.xlf | 11 ++-- .../src/Resources/xlf/SR.pt-BR.xlf | 11 ++-- .../src/Resources/xlf/SR.ru.xlf | 11 ++-- .../src/Resources/xlf/SR.tr.xlf | 11 ++-- .../src/Resources/xlf/SR.zh-Hans.xlf | 11 ++-- .../src/Resources/xlf/SR.zh-Hant.xlf | 11 ++-- 14 files changed, 126 insertions(+), 81 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx b/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx index 7287cdbf6c7..0a72fc1c8c9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx @@ -1,17 +1,17 @@  - @@ -223,7 +223,9 @@ Environment variable is not defined: '{0}'. - The operation has timed out. - + The network operation has timed out. + + + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf index 0d087d35a14..0f1a2be07a6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf @@ -178,10 +178,15 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + + The network operation is unauthorized. + diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.de.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.de.xlf index 54b90e32b10..ba587e889d1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.de.xlf @@ -178,10 +178,15 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + + The network operation is unauthorized. + diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.es.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.es.xlf index de490743059..b928124e52c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.es.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.fr.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.fr.xlf index 9b993e50de5..cfa6763c203 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.fr.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.it.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.it.xlf index 6f320ad96ea..a040a2d48e4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.it.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ja.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ja.xlf index 705d1bd7f61..95057a734e3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ja.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ko.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ko.xlf index 07a8d4c3448..90a42911b9a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ko.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pl.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pl.xlf index 1d601fc3e5c..96ece95f46b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pl.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pt-BR.xlf index 425694b3ebb..4f87094e257 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ru.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ru.xlf index 71f344a6e2e..bfa18e769da 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.ru.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.tr.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.tr.xlf index 7420924ca27..42b54249b7b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.tr.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hans.xlf index f89fcdb6264..27bbc168d6f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hant.xlf index 0c9f35d3625..b9e74cf4c97 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -178,10 +178,13 @@ - The operation has timed out. - - The operation has timed out. - + The network operation has timed out. + The network operation has timed out. + + + + The network operation is unauthorized. + The network operation is unauthorized. From af18261246568992ac2323440703f92ee9bd3d41 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 17:36:40 -1000 Subject: [PATCH 082/342] Fix null password detections --- .../Windows/Forms/NetworkDownloadTests.vb | 20 ++++++++++--------- .../System/Windows/Forms/WebListener.vb | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index d63f4211307..b3b376bfa8d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -69,35 +69,37 @@ Namespace Microsoft.VisualBasic.Forms.Tests #Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String) -> Void" - Public Sub DownloadFile_Url_PasswordEqualNothing_Success() + Public Sub DownloadFile_Url_Password_Success() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network.DownloadFile(webListener.Address, destinationFilename, DefaultUserName, - password:=Nothing) + DefaultPassword) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try End Sub - - Public Sub DownloadFile_Url_PasswordWrong_Throw() + + + + Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of WebException)( Sub() My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - DefaultUserName, - password:="123") + destinationFilename, + DefaultUserName, + password) End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 05fafb5fcd7..6ddb0f5a261 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -45,7 +45,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then - If identity.Name <> _userName OrElse identity.Password <> _password Then + If String.IsNullOrWhiteSpace(identity.Name) OrElse identity.Name <> _userName OrElse String.IsNullOrWhiteSpace(identity.Password) OrElse identity.Password <> _password Then response.StatusCode = HttpStatusCode.Unauthorized Exit Try End If From 70600932e3b0a136b1a06b21e3510279663c5846 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 23:22:01 -1000 Subject: [PATCH 083/342] Improve Test Coverage for FileSystemUtitities.vb --- .../src/Microsoft.VisualBasic.Forms.vbproj | 4 +- .../Windows/Forms/NetworkDownloadTests.vb | 102 +++++++++++++++++- 2 files changed, 103 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index e57cd2e7598..4908ff6766f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -1,10 +1,10 @@ - + - + Microsoft.VisualBasic.Forms true diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index b3b376bfa8d..e433be0e0b1 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -3,6 +3,7 @@ Imports System.IO Imports System.Net +Imports Microsoft.VisualBasic.FileIO Imports Xunit @@ -289,6 +290,104 @@ Namespace Microsoft.VisualBasic.Forms.Tests #Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> Void" + + + + Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + + + Public Sub DownloadFile_GetLongPath_Throw() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFileName:=tmpFilePath, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + + + + + Public Sub DownloadFile_RootDirectory_Throw(root As String) + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + + + + + Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + Public Sub DownloadFile_Url_AllOptionsSet_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -302,7 +401,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True, - FileIO.UICancelOption.DoNothing) + onUserCancel:=UICancelOption.DoNothing) + Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpFilePath) From 753afb44b2781c2d3e5f9027f147bc4895cae9e2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 23:48:08 -1000 Subject: [PATCH 084/342] Add Ping URI test Add tests for Missing filename --- .../Windows/Forms/NetworkDownloadTests.vb | 18 ++++++++++++++++++ .../VisualBasic/Devices/NetworkTests.cs | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index e433be0e0b1..b1949c1c029 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -33,6 +33,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests #Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String) -> Void" + + + + Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) + Dim tmpFilePath As String = CreateTempDirectory() + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network.DownloadFile(webListener.Address, + destinationFilename) + End Sub) + Finally + CleanUp(listener, tmpFilePath) + End Try + End Sub + Public Sub DownloadFile_Url_Success() Dim tmpFilePath As String = CreateTempDirectory() diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index f61ca5b9988..eb77da2926a 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -19,7 +19,13 @@ public void Ping() Assert.True(network.Ping("127.0.0.1")); } + [Fact] + public void PingUrl() + { + Network network = new(); + Assert.True(network.Ping(new Uri("http://127.0.0.1"))); + } + // Not tested: - // Public Sub DownloadFile(...) [multiple overloads] // Public Sub UploadFile(...) [multiple overloads] } From c807719c9073458a3afd0f67a6cc6ed87020ca67 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 8 Mar 2024 23:49:00 -1000 Subject: [PATCH 085/342] Fix Typo --- .../UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index eb77da2926a..9b970b1f89f 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -20,7 +20,7 @@ public void Ping() } [Fact] - public void PingUrl() + public void PingUri() { Network network = new(); Assert.True(network.Ping(new Uri("http://127.0.0.1"))); From 6978f22894e8955a084dc6ea32a843904e05d9dc Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Mar 2024 03:06:52 -1000 Subject: [PATCH 086/342] Cleanup indenting Make tests more uniform --- .../Windows/Forms/NetworkDownloadTests.vb | 405 ++++++++++-------- 1 file changed, 238 insertions(+), 167 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index b1949c1c029..a2b7ef54b2e 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -14,6 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const DefaultUserName As String = "TBD" Private Const DownloadLargeFileSize As Integer = 104857600 Private Const DownloadSmallFileSize As Integer = 18135 + Private Const InvalidUrlAddress As String = "invalidURL" Private Const TestingConnectionTimeout As Integer = 100000 Private Shared Function ValidateDownload(tmpFilePath As String, destinationFilename As String) As Long @@ -40,11 +41,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim tmpFilePath As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentNullException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename) + With My.Computer.Network + .DownloadFile(address, + destinationFilename) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -57,17 +61,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename) + With My.Computer.Network + .DownloadFile(address, + destinationFilename) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) End Try End Sub - - Public Sub DownloadFile_Url_UrlEqualsNothing_Throw() + + + + Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize) @@ -75,9 +84,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - My.Computer.Network.DownloadFile(address:=CStr(Nothing), - destinationFilename) + With My.Computer.Network + .DownloadFile(address, + destinationFilename) + End With End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -93,12 +105,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - DefaultUserName, - DefaultPassword) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + DefaultUserName, + DefaultPassword) + End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), + actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) End Try @@ -106,19 +122,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests - + Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of WebException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - DefaultUserName, - password) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + DefaultUserName, + password) + End With End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) @@ -132,7 +151,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests #Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" - Public Sub DownloadFile_Ur_InvalidUrl_Throw() + Public Sub DownloadFile_Ur_InvalidUrl_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize) @@ -140,13 +159,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(address:="x", - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -154,19 +175,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throw() + Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throws() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentNullException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + End With End Sub) Finally CleanUp(listener) @@ -174,20 +198,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throw() + Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Assert.Throws(Of IOException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + End With End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) @@ -200,14 +227,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + End With Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) Finally @@ -216,7 +246,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throw() + Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize) @@ -224,13 +254,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(address:="x", - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -238,21 +270,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_TimeOut_Throw() + Public Sub DownloadFile_Url_TimeOut_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of WebException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) + End With End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) @@ -262,21 +297,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_TimeoutNegative_Throw() + Public Sub DownloadFile_Url_TimeoutNegative_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) + End With End Sub) Assert.False(File.Exists(destinationFilename)) Finally @@ -290,14 +328,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:=Nothing, - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:=Nothing, + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) @@ -316,17 +357,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - $"{destinationFilename}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + With My.Computer.Network + .DownloadFile(address, + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -334,22 +378,25 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_GetLongPath_Throw() + Public Sub DownloadFile_GetLongPath_Throws() Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of InvalidOperationException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFileName:=tmpFilePath, ' This is a Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + With My.Computer.Network + .DownloadFile(address, + destinationFileName:=tmpFilePath, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -364,17 +411,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of InvalidOperationException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + With My.Computer.Network + .DownloadFile(address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -389,17 +439,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentException)( Sub() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + With My.Computer.Network + .DownloadFile(address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End With End Sub) Finally CleanUp(listener, tmpFilePath) @@ -412,14 +465,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + Dim address As String = webListener.Address + With My.Computer.Network + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End With Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) @@ -437,8 +493,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -455,15 +513,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - ' Get network credentials Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try - Dim address As Uri = New Uri(webListener.Address) - My.Computer.Network.DownloadFile(address, - destinationFilename, - networkCredentials, - showUI:=False, TestingConnectionTimeout, - True) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + networkCredentials, + showUI:=False, TestingConnectionTimeout, + overwrite:=True) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -481,10 +539,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - DefaultPassword) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + DefaultPassword) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -500,10 +560,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of WebException)( Sub() - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - password:="123") + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + "WrongPassword") + End With End Sub) Assert.False(File.Exists(destinationFilename)) Finally @@ -522,13 +584,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network.DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=True) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) + End With Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) Finally CleanUp(listener, tmpFilePath) @@ -541,13 +605,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + End With Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpFilePath) @@ -563,14 +629,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network.DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - FileIO.UICancelOption.DoNothing) + With My.Computer.Network + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + FileIO.UICancelOption.DoNothing) + End With Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpFilePath) @@ -585,14 +653,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + With My.Computer.Network + .DownloadFile(address:=CType(Nothing, Uri), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + End With End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try From b3ed8feff50c8cab2f2d85d0677ee94d56c3c059 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Mar 2024 18:34:52 -1000 Subject: [PATCH 087/342] Improve formatting and code coverage --- .../Windows/Forms/NetworkDownloadTests.vb | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index a2b7ef54b2e..c3d7fb66f4e 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -45,10 +45,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -63,10 +63,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -84,10 +84,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename) - End With + End Sub) Assert.False(File.Exists(destinationFilename)) Finally @@ -107,12 +107,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, DefaultUserName, DefaultPassword) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -132,12 +132,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of WebException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, DefaultUserName, password) - End With + End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) @@ -159,7 +159,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(InvalidUrlAddress, destinationFilename, userName:="", @@ -167,7 +167,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, TestingConnectionTimeout, overwrite:=False) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -182,7 +182,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFileName:=Nothing, userName:="", @@ -190,7 +190,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, TestingConnectionTimeout, overwrite:=False) - End With + End Sub) Finally CleanUp(listener) @@ -206,7 +206,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim address As String = webListener.Address Assert.Throws(Of IOException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:="", @@ -214,7 +214,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=False) - End With + End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) @@ -229,7 +229,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:="", @@ -237,7 +237,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True) - End With + Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) Finally @@ -254,7 +254,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(InvalidUrlAddress, destinationFilename, userName:="", @@ -262,7 +262,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=False) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -279,7 +279,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of WebException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:="", @@ -287,7 +287,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, connectionTimeout:=1, overwrite:=True) - End With + End Sub) Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) @@ -306,7 +306,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:="", @@ -314,7 +314,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, connectionTimeout:=-1, overwrite:=False) - End With + End Sub) Assert.False(File.Exists(destinationFilename)) Finally @@ -330,7 +330,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:=Nothing, @@ -338,7 +338,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, TestingConnectionTimeout, overwrite:=False) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpFilePath) @@ -361,7 +361,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, $"{destinationFilename}{separator}", userName:="", @@ -370,7 +370,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -387,7 +387,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of InvalidOperationException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFileName:=tmpFilePath, ' This is a Directory! userName:="", @@ -396,7 +396,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -415,7 +415,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of InvalidOperationException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFileName:=root, ' This is a Root Directory! userName:="", @@ -424,7 +424,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -443,7 +443,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFileName:=root, ' This is a Root Directory! userName:="", @@ -452,7 +452,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End With + End Sub) Finally CleanUp(listener, tmpFilePath) @@ -466,7 +466,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address, destinationFilename, userName:="", @@ -475,7 +475,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End With Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) @@ -493,10 +492,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -515,13 +514,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, networkCredentials, showUI:=False, TestingConnectionTimeout, overwrite:=True) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -539,12 +538,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, DefaultUserName, DefaultPassword) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, tmpFilePath) @@ -560,12 +559,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of WebException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, DefaultUserName, "WrongPassword") - End With + End Sub) Assert.False(File.Exists(destinationFilename)) Finally @@ -584,7 +583,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, userName:="", @@ -592,7 +591,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, TestingConnectionTimeout, overwrite:=True) - End With + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) Finally CleanUp(listener, tmpFilePath) @@ -605,7 +604,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, userName:="", @@ -613,7 +612,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True) - End With + Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpFilePath) @@ -629,7 +628,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, userName:="", @@ -638,7 +637,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, FileIO.UICancelOption.DoNothing) - End With + Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpFilePath) @@ -653,7 +652,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try Assert.Throws(Of ArgumentNullException)( Sub() - With My.Computer.Network + My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), destinationFilename, userName:="", @@ -661,7 +660,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=True, TestingConnectionTimeout, overwrite:=False) - End With + End Sub) Assert.False(File.Exists(destinationFilename)) Finally From ddab913ae1217971918ebc0170ec4428a8dfce75 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Mar 2024 23:42:26 -1000 Subject: [PATCH 088/342] Add Ping Tests including ones that throw to improve coverage and have timeout but not testing timeout. --- .../VisualBasic/Devices/NetworkTests.cs | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 9b970b1f89f..6ca2fb416c6 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -13,19 +13,47 @@ public void IsAvailable() } [Fact] - public void Ping() + public void Ping_ShortTimeout_Success() + { + Network network = new(); + Assert.True(network.Ping("127.0.0.1", 1)); + } + + [Fact] + public void Ping_Success() { Network network = new(); Assert.True(network.Ping("127.0.0.1")); } [Fact] - public void PingUri() + public void Ping_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((string)null)); + } + + [Fact] + public void PingUri_ShortTimeout_Success() + { + Network network = new(); + Assert.True(network.Ping(new Uri("http://127.0.0.1"), 1)); + } + + [Fact] + public void PingUri_Success() { Network network = new(); Assert.True(network.Ping(new Uri("http://127.0.0.1"))); } + [Fact] + public void PingUri_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((Uri)null)); + } + // Not tested: // Public Sub UploadFile(...) [multiple overloads] } From faac387f72e747ba871436af06dda8e65da34002 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 11 Mar 2024 01:25:06 -0900 Subject: [PATCH 089/342] Improve and clean up tests --- .../Windows/Forms/NetworkDownloadTests.vb | 81 ++++++++++++------- .../Forms/NetworkTestsCommonFunctions.vb | 9 ++- 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index c3d7fb66f4e..fb8d8d0777f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests listener.Stop() listener.Close() If tmpFilePath IsNot Nothing Then - Directory.Delete(tmpFilePath, True) + Directory.Delete(tmpFilePath, recursive:=True) End If End Sub @@ -50,6 +50,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -58,7 +59,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -78,7 +79,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -102,7 +103,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_Password_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -125,7 +126,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -139,7 +140,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests password) End Sub) - Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) @@ -153,7 +153,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Ur_InvalidUrl_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -169,6 +169,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -200,7 +201,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -248,7 +249,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -264,6 +265,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -272,7 +274,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_TimeOut_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -289,7 +291,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) End Sub) - Assert.True(Directory.Exists(tmpFilePath)) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) @@ -299,7 +300,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_TimeoutNegative_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -325,7 +326,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_UsernameEqualNothing_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -354,7 +355,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -372,6 +373,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -380,7 +382,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_GetLongPath_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -398,6 +400,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -408,7 +411,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectory_Throw(root As String) Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -426,6 +429,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -436,7 +440,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -454,6 +458,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, tmpFilePath) End Try @@ -462,7 +467,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_AllOptionsSet_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -488,7 +493,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -509,7 +514,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) @@ -534,7 +539,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_UserNamePassword_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -553,7 +558,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_UserNamePassword_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, -1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -579,7 +584,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=0) + Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -601,7 +606,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ @@ -625,7 +630,29 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, DownloadSmallFileSize) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + CleanUp(listener, tmpFilePath) + End Sub + + + Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Directory.Delete(tmpFilePath, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ @@ -636,7 +663,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True, - FileIO.UICancelOption.DoNothing) + UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpFilePath)) Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) @@ -646,7 +673,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_UriIsNothing_Throws() Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=-1) + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb index c20aa6a3984..7c1233366c5 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb @@ -27,8 +27,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' The full path and file name of the created file ''' If size = -1 not file is create but the full path is returned ''' - Private Shared Function CreateTempFile(tmpFilePath As String, Optional size As Integer = -1) As String - Dim filename As String = Path.Combine(tmpFilePath, "testing.txt") + Private Shared Function CreateTempFile(tmpFilePath As String, size As Integer) As String + Dim filename As String = GetDestinationFileName(tmpFilePath) + If size >= 0 Then Using destinationStream As FileStream = File.Create(filename) ' Below allows for limited testing of download data @@ -42,6 +43,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return filename End Function + Private Shared Function GetDestinationFileName(tmpFilePath As String) As String + Return Path.Combine(tmpFilePath, "testing.txt") + End Function + End Class End Namespace From be62ab7a1789ab971ad06414b2279a772605a84a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 13 Mar 2024 01:25:09 -0930 Subject: [PATCH 090/342] Cleanup Merge --- .../src/Microsoft/VisualBasic/Interaction.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 2a6adc9a162..6a98679e76f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -385,8 +385,8 @@ Namespace Microsoft.VisualBasic Try If Title Is Nothing Then - If vbhost Is Nothing Then - sTitle = GetTitleFromAssembly(System.Reflection.Assembly.GetCallingAssembly()) + If vbHost Is Nothing Then + sTitle = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else sTitle = vbHost.GetWindowTitle() End If @@ -403,7 +403,7 @@ Namespace Microsoft.VisualBasic Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try - Return CType(System.Windows.Forms.MessageBox.Show(parentWindow, sPrompt, sTitle, + Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, CType(Buttons And &HF, MessageBoxButtons), CType(Buttons And &HF0, MessageBoxIcon), CType(Buttons And &HF00, MessageBoxDefaultButton), From 82acdf02db67699c8befe1dcbb867029455a33ce Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 00:49:11 -0930 Subject: [PATCH 091/342] Update editorConfig --- .editorconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index 58670ea60ad..3277eb35643 100644 --- a/.editorconfig +++ b/.editorconfig @@ -90,6 +90,8 @@ dotnet_style_prefer_collection_expression = true:suggestion # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion # C# files @@ -133,7 +135,6 @@ dotnet_diagnostic.IDE0005.severity = error # Expression-level preferences dotnet_style_coalesce_expression = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_conditional_expression_over_assignment = true:silent dotnet_style_prefer_conditional_expression_over_return = true:silent @@ -229,8 +230,6 @@ dotnet_diagnostic.IDE0079.severity = none # Expression-level preferences dotnet_style_coalesce_expression = false:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_coalesce_expression = false:suggestion dotnet_style_prefer_conditional_expression_over_assignment = false:silent dotnet_style_prefer_conditional_expression_over_return = false:silent From fdb5d0978425ae23d8980563ede39df008ae96a9 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 00:53:04 -0930 Subject: [PATCH 092/342] Fix conflicts in editorConfig --- .editorconfig | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index ba94cf602ae..0366df7c6e1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -73,13 +73,9 @@ dotnet_sort_system_directives_first = true dotnet_style_object_initializer = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error dotnet_style_prefer_auto_properties = true:silent -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion @@ -94,6 +90,7 @@ dotnet_style_prefer_collection_expression = true:suggestion # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion # C# files @@ -135,6 +132,11 @@ dotnet_diagnostic.IDE0044.severity = warning dotnet_diagnostic.RS0041.severity = none dotnet_diagnostic.IDE0005.severity = error +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent + # New line preferences csharp_new_line_before_open_brace = all csharp_new_line_before_else = true @@ -222,6 +224,14 @@ csharp_style_deconstructed_variable_declaration = true:suggestion # Modifier preferences visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion +# IDE0079: Remove unnecessary suppression +dotnet_diagnostic.IDE0079.severity = none + +# Expression-level preferences +dotnet_style_coalesce_expression = false:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion +dotnet_style_prefer_conditional_expression_over_return = false:suggestion + # C++ Files [*.{cpp,h,in}] curly_bracket_next_line = true From bc6d448f2ecf584764710fe30c667bcbe39fa23c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 01:05:32 -0930 Subject: [PATCH 093/342] Sync editorConfig --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 0366df7c6e1..5c2c12abb49 100644 --- a/.editorconfig +++ b/.editorconfig @@ -76,6 +76,7 @@ dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion @@ -90,7 +91,6 @@ dotnet_style_prefer_collection_expression = true:suggestion # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion # C# files From 48fd5e9f0af4f619f4d986a720fd78537ce95466 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 10:50:15 -0930 Subject: [PATCH 094/342] Update .editorConfig --- .editorconfig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3277eb35643..5c2c12abb49 100644 --- a/.editorconfig +++ b/.editorconfig @@ -76,6 +76,7 @@ dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion @@ -90,8 +91,6 @@ dotnet_style_prefer_collection_expression = true:suggestion # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion # C# files @@ -230,8 +229,8 @@ dotnet_diagnostic.IDE0079.severity = none # Expression-level preferences dotnet_style_coalesce_expression = false:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = false:silent -dotnet_style_prefer_conditional_expression_over_return = false:silent +dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion +dotnet_style_prefer_conditional_expression_over_return = false:suggestion # C++ Files [*.{cpp,h,in}] From eac904c24d31eab3ac57a049256c9a23779639eb Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 11:51:47 -0930 Subject: [PATCH 095/342] Update editorConfig with prefered values and separate C# from VB where they conflict. --- .editorconfig | 84 ++++++++++++++++----------------------------------- 1 file changed, 26 insertions(+), 58 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5d56f7573ab..5c2c12abb49 100644 --- a/.editorconfig +++ b/.editorconfig @@ -70,16 +70,13 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case dotnet_sort_system_directives_first = true # Expression-level preferences -dotnet_style_object_initializer = true:warning +dotnet_style_object_initializer = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_coalesce_expression = true:warning dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error dotnet_style_prefer_auto_properties = true:silent -dotnet_style_prefer_simplified_boolean_expressions = true:warning -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion @@ -90,7 +87,7 @@ tab_width = 4 end_of_line = crlf dotnet_style_allow_multiple_blank_lines_experimental = true:silent dotnet_style_allow_statement_immediately_after_block_experimental = true:silent -dotnet_style_prefer_collection_expression = true:warning +dotnet_style_prefer_collection_expression = true:suggestion # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error @@ -107,73 +104,39 @@ dotnet_diagnostic.SYSLIB1054.severity = none # SYSLIB1096: Convert to 'GeneratedComInterface' dotnet_diagnostic.SYSLIB1096.severity = none -# CA1310: Specify StringComparison for correctness -dotnet_diagnostic.CA1310.severity = error - -# CA1510: Use ArgumentNullException throw helper -dotnet_diagnostic.CA1510.severity = error +# IDE1006: Naming Styles +dotnet_diagnostic.IDE1006.severity = error # CA1725: Parameter names should match base declaration dotnet_diagnostic.CA1725.severity = error -# CA1859: Use concrete types when possible for improved performance -dotnet_diagnostic.CA1859.severity = error - # DOC100: Place text in paragraphs dotnet_diagnostic.DOC100.severity = error +# CA1859: Use concrete types when possible for improved performance +dotnet_diagnostic.CA1859.severity = error + # IDE0002: Simplify Member Access dotnet_diagnostic.IDE0002.severity = error # IDE0003: Remove qualification dotnet_diagnostic.IDE0003.severity = error -# IDE0017: Simplify object initialization -dotnet_diagnostic.IDE0017.severity = warning - -# IDE0019: Use pattern matching -dotnet_diagnostic.IDE0019.severity = warning - -# IDE0038: Use pattern matching -dotnet_diagnostic.IDE0038.severity = warning - -# IDE0044: Add readonly modifier -dotnet_diagnostic.IDE0044.severity = warning - -# IDE0057: Use range operator -dotnet_diagnostic.IDE0057.severity = error - -# IDE0063: Use simple 'using' statement -dotnet_diagnostic.IDE0063.severity = warning - -# IDE0075: Simplify conditional expression -dotnet_diagnostic.IDE0075.severity = warning - -# IDE0078: Use pattern matching -dotnet_diagnostic.IDE0078.severity = warning - # IDE0079: Remove unnecessary suppression dotnet_diagnostic.IDE0079.severity = error -# IDE0180: Use tuple to swap values -dotnet_diagnostic.IDE0180.severity = warning - -# IDE0251: Make member 'readonly' -dotnet_diagnostic.IDE0251.severity = warning - -# IDE0270: Use coalesce expression -dotnet_diagnostic.IDE0270.severity = warning - -# IDE0300: Simplify collection initialization -dotnet_diagnostic.IDE0300.severity = warning - -# IDE1006: Naming Styles -dotnet_diagnostic.IDE1006.severity = error +# IDE0044: Add readonly modifier +dotnet_diagnostic.IDE0044.severity = warning # .NET diagnostic dotnet_diagnostic.RS0041.severity = none dotnet_diagnostic.IDE0005.severity = error +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent + # New line preferences csharp_new_line_before_open_brace = all csharp_new_line_before_else = true @@ -208,8 +171,8 @@ csharp_style_expression_bodied_indexers = true:silent csharp_style_expression_bodied_accessors = true:silent # Pattern matching -csharp_style_pattern_matching_over_is_with_cast_check = true:warning -csharp_style_pattern_matching_over_as_with_null_check = true:warning +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion # Null checking preferences @@ -240,7 +203,7 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_parentheses = false csharp_space_between_square_brackets = false csharp_using_directive_placement = outside_namespace:silent -csharp_prefer_simple_using_statement = true:warning +csharp_prefer_simple_using_statement = true:suggestion csharp_prefer_braces = true:silent csharp_style_namespace_declarations = file_scoped:silent csharp_style_prefer_method_group_conversion = true:silent @@ -261,6 +224,14 @@ csharp_style_deconstructed_variable_declaration = true:suggestion # Modifier preferences visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion +# IDE0079: Remove unnecessary suppression +dotnet_diagnostic.IDE0079.severity = none + +# Expression-level preferences +dotnet_style_coalesce_expression = false:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion +dotnet_style_prefer_conditional_expression_over_return = false:suggestion + # C++ Files [*.{cpp,h,in}] curly_bracket_next_line = true @@ -301,9 +272,6 @@ end_of_line = crlf # CA1861: Avoid constant arrays as arguments - expected to be inline for test readability (4000 hits) dotnet_diagnostic.CA1861.severity = silent -# This collides with TheoryData usage -dotnet_style_prefer_collection_expression = true:silent - # This should be fixed https://github.com/dotnet/winforms/issues/11041 # xUnit1042: The member referenced by the MemberData attribute returns untyped data rows dotnet_diagnostic.xUnit1042.severity = none From 6f335c9b8b42b09cd12e2309b55721c50453a6aa Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 12:25:49 -0930 Subject: [PATCH 096/342] Add dotnet_separate_import_directive_groups = false to VB section --- .editorconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.editorconfig b/.editorconfig index 5c2c12abb49..a126cc653be 100644 --- a/.editorconfig +++ b/.editorconfig @@ -224,6 +224,8 @@ csharp_style_deconstructed_variable_declaration = true:suggestion # Modifier preferences visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion +dotnet_separate_import_directive_groups = false:warning + # IDE0079: Remove unnecessary suppression dotnet_diagnostic.IDE0079.severity = none From 8e57e77f5518917c9244c03ecf541178f5cc5546 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 14 Mar 2024 14:21:54 -0930 Subject: [PATCH 097/342] Merge .editorConfig with main --- .editorconfig | 66 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index a126cc653be..ba085de9ec2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -70,7 +70,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case dotnet_sort_system_directives_first = true # Expression-level preferences -dotnet_style_object_initializer = true:suggestion +dotnet_style_object_initializer = true:warning dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_null_propagation = true:suggestion @@ -87,7 +87,7 @@ tab_width = 4 end_of_line = crlf dotnet_style_allow_multiple_blank_lines_experimental = true:silent dotnet_style_allow_statement_immediately_after_block_experimental = true:silent -dotnet_style_prefer_collection_expression = true:suggestion +dotnet_style_prefer_collection_expression = true:warning # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0040.severity = error @@ -104,30 +104,69 @@ dotnet_diagnostic.SYSLIB1054.severity = none # SYSLIB1096: Convert to 'GeneratedComInterface' dotnet_diagnostic.SYSLIB1096.severity = none -# IDE1006: Naming Styles -dotnet_diagnostic.IDE1006.severity = error +# CA1310: Specify StringComparison for correctness +dotnet_diagnostic.CA1310.severity = error + +# CA1510: Use ArgumentNullException throw helper +dotnet_diagnostic.CA1510.severity = error # CA1725: Parameter names should match base declaration dotnet_diagnostic.CA1725.severity = error -# DOC100: Place text in paragraphs -dotnet_diagnostic.DOC100.severity = error - # CA1859: Use concrete types when possible for improved performance dotnet_diagnostic.CA1859.severity = error +# DOC100: Place text in paragraphs +dotnet_diagnostic.DOC100.severity = error + # IDE0002: Simplify Member Access dotnet_diagnostic.IDE0002.severity = error # IDE0003: Remove qualification dotnet_diagnostic.IDE0003.severity = error -# IDE0079: Remove unnecessary suppression -dotnet_diagnostic.IDE0079.severity = error +# IDE0017: Simplify object initialization +dotnet_diagnostic.IDE0017.severity = warning + +# IDE0019: Use pattern matching +dotnet_diagnostic.IDE0019.severity = warning + +# IDE0038: Use pattern matching +dotnet_diagnostic.IDE0038.severity = warning # IDE0044: Add readonly modifier dotnet_diagnostic.IDE0044.severity = warning +# IDE0057: Use range operator +dotnet_diagnostic.IDE0057.severity = error + +# IDE0063: Use simple 'using' statement +dotnet_diagnostic.IDE0063.severity = warning + +# IDE0075: Simplify conditional expression +dotnet_diagnostic.IDE0075.severity = warning + +# IDE0078: Use pattern matching +dotnet_diagnostic.IDE0078.severity = warning + +# IDE0079: Remove unnecessary suppression +dotnet_diagnostic.IDE0079.severity = error + +# IDE0180: Use tuple to swap values +dotnet_diagnostic.IDE0180.severity = warning + +# IDE0251: Make member 'readonly' +dotnet_diagnostic.IDE0251.severity = warning + +# IDE0270: Use coalesce expression +dotnet_diagnostic.IDE0270.severity = warning + +# IDE0300: Simplify collection initialization +dotnet_diagnostic.IDE0300.severity = warning + +# IDE1006: Naming Styles +dotnet_diagnostic.IDE1006.severity = error + # .NET diagnostic dotnet_diagnostic.RS0041.severity = none dotnet_diagnostic.IDE0005.severity = error @@ -171,8 +210,8 @@ csharp_style_expression_bodied_indexers = true:silent csharp_style_expression_bodied_accessors = true:silent # Pattern matching -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_pattern_matching_over_as_with_null_check = true:warning csharp_style_inlined_variable_declaration = true:suggestion # Null checking preferences @@ -203,7 +242,7 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_parentheses = false csharp_space_between_square_brackets = false csharp_using_directive_placement = outside_namespace:silent -csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_simple_using_statement = true:warning csharp_prefer_braces = true:silent csharp_style_namespace_declarations = file_scoped:silent csharp_style_prefer_method_group_conversion = true:silent @@ -274,6 +313,9 @@ end_of_line = crlf # CA1861: Avoid constant arrays as arguments - expected to be inline for test readability (4000 hits) dotnet_diagnostic.CA1861.severity = silent +# This collides with TheoryData usage +dotnet_style_prefer_collection_expression = true:silent + # This should be fixed https://github.com/dotnet/winforms/issues/11041 # xUnit1042: The member referenced by the MemberData attribute returns untyped data rows dotnet_diagnostic.xUnit1042.severity = none From c136e3c676acef1466c688cebe0898ffe3240a92 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 15 Mar 2024 00:59:47 -0900 Subject: [PATCH 098/342] Add comments explaining how server and client communicate file size, user name and password. --- .../UnitTests/System/Windows/Forms/WebListener.vb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 6ddb0f5a261..26f920eccb1 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -14,12 +14,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private _userName As String Private _password As String + ''' + ''' The name of the function that creates the server is uses to establish the file to be downloaded + ''' + ''' Is used to create the file name and the size of download + ''' Used to establish the file path to be downloaded Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) _fileSize = fileSize _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" Address = $"{_downloadFileUrlPrefix}T{fileSize}" End Sub + ''' + ''' Used for authenticated download + ''' + ''' Passed to Me.New + ''' Name to match for authorization + ''' Password to match for authorization + ''' Passed to Me.New Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) Me.New(fileSize, memberName) _userName = userName From 1fb0cac56cc3944e56daf280acc88d021081c127 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 15 Mar 2024 14:09:52 -0900 Subject: [PATCH 099/342] Merge editor.config --- .editorconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index d910c996f01..b02ade836af 100644 --- a/.editorconfig +++ b/.editorconfig @@ -73,13 +73,10 @@ dotnet_sort_system_directives_first = true dotnet_style_object_initializer = true:warning dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_coalesce_expression = true:warning dotnet_style_null_propagation = true:warning dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error dotnet_style_prefer_auto_properties = true:silent dotnet_style_prefer_simplified_boolean_expressions = true:warning -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion @@ -207,6 +204,11 @@ dotnet_diagnostic.IDE1006.severity = error dotnet_diagnostic.RS0041.severity = none dotnet_diagnostic.IDE0005.severity = error +# Expression-level preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent + # New line preferences csharp_new_line_before_open_brace = all csharp_new_line_before_else = true From 5aaf222915816dfb66c712ee18aaad67d6c83a2e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 17 Mar 2024 01:56:10 -0900 Subject: [PATCH 100/342] Manually Merge with Main. Inconsistant Hendling of arounf End Class and End Mondule in Main --- eng/Versions.props | 62 +++++++++---------- global.json | 8 +-- .../src/Microsoft.VisualBasic.Forms.vbproj | 1 + .../ApplicationServices/ApplicationBase.vb | 13 ++-- .../ApplyApplicationDefaultsEventArgs.vb | 1 - .../ApplicationServices/AssemblyInfo.vb | 4 +- .../CantStartSingleInstanceException.vb | 1 - .../ConsoleApplicationBase.vb | 1 - .../NoStartupFormException.vb | 1 - .../SingleInstanceHelpers.vb | 13 ++-- .../ApplicationServices/StartupEventArgs.vb | 2 - .../StartupNextInstanceEventArgs.vb | 2 - .../UnhandledExceptionEventArgs.vb | 2 - .../VisualBasic/ApplicationServices/User.vb | 6 +- ...FormsApplicationBase.WinFormsAppContext.vb | 3 - .../WindowsFormsApplicationBase.vb | 18 +++--- .../CompilerServices/ExceptionUtils.vb | 2 - .../VisualBasic/CompilerServices/Utils.vb | 4 +- .../Microsoft/VisualBasic/Devices/Audio.vb | 13 ++-- .../Microsoft/VisualBasic/Devices/Clock.vb | 3 - .../Microsoft/VisualBasic/Devices/Computer.vb | 1 - .../VisualBasic/Devices/ComputerInfo.vb | 5 +- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 2 - .../Microsoft/VisualBasic/Devices/Mouse.vb | 1 - .../Devices/Network/NetworkDownload.vb | 21 +++---- .../Devices/Network/NetworkPing.vb | 7 ++- .../VisualBasic/Devices/ServerComputer.vb | 1 - .../VisualBasic/Helpers/FileSystemUtils.vb | 1 - .../Microsoft/VisualBasic/Helpers/Hosting.vb | 5 -- .../VisualBasic/Helpers/NativeMethods.vb | 5 -- .../VisualBasic/Helpers/NativeTypes.vb | 7 --- .../VisualBasic/Helpers/VBInputBox.vb | 1 - .../src/Microsoft/VisualBasic/Interaction.vb | 14 ++--- .../Logging/FileLogTraceListener.vb | 15 ++--- .../src/Microsoft/VisualBasic/Logging/Log.vb | 4 +- .../VisualBasic/MyServices/ClipboardProxy.vb | 1 - .../VisualBasic/MyServices/FileSystemProxy.vb | 1 - .../MyServices/Internal/ContextValue.vb | 2 - .../MyServices/Internal/HttpClientCopy.vb | 2 - .../MyServices/Internal/ProgressDialog.vb | 2 - .../MyServices/Internal/WebClientCopy.vb | 1 - 41 files changed, 95 insertions(+), 164 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 3091c90fc48..5fed1787c4b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,36 +13,36 @@ - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 5.0.0-preview.7.20320.5 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 6.0.0 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - 9.0.0-preview.3.24164.12 - $(MicrosoftNETCoreILAsmPackageVersion) @@ -54,9 +54,9 @@ - 9.0.0-beta.24164.4 - 9.0.0-beta.24164.4 - 9.0.0-beta.24164.4 + 9.0.0-beta.24165.6 + 9.0.0-beta.24165.6 + 9.0.0-beta.24165.6 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index cc412c14274..7c3c919a931 100644 --- a/global.json +++ b/global.json @@ -14,11 +14,11 @@ "version": "9.0.100-preview.1.24101.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24164.4", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24164.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24164.4", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24165.6", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24165.6", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24165.6", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.3.24164.12" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.3.24165.13" }, "native-tools": { "cmake": "latest" diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index ce689077149..5375d68c271 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -49,6 +49,7 @@ AssignProjectConfiguration;$(GetCopyToOutputDirectoryItemsDependsOn) + Off diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index a4dd572a21b..d471e676844 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -1,6 +1,8 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports System.Threading + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -28,7 +30,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since the explicitly requested a specific environment variable and we couldn't find it, throw If VariableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName("name", SR.EnvVarNotFound_Name, name) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) End If Return VariableValue @@ -67,7 +69,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices '''
Public ReadOnly Property Culture() As Globalization.CultureInfo Get - Return Threading.Thread.CurrentThread.CurrentCulture + Return Thread.CurrentThread.CurrentCulture End Get End Property @@ -81,7 +83,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public ReadOnly Property UICulture() As Globalization.CultureInfo Get - Return Threading.Thread.CurrentThread.CurrentUICulture + Return Thread.CurrentThread.CurrentUICulture End Get End Property @@ -93,7 +95,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeCulture(cultureName As String) - Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) + Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) End Sub ''' @@ -105,11 +107,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeUICulture(cultureName As String) - Threading.Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) + Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub Private _log As Logging.Log 'Lazy-initialized and cached log object. Private _info As AssemblyInfo ' The executing application (the EntryAssembly) End Class 'ApplicationBase - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 4dc3b95522f..206bbaf0344 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -45,5 +45,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property HighDpiMode As HighDpiMode End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 20082543193..b2a270d17b1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -22,7 +22,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then - Throw GetArgumentNullException("CurrentAssembly") + Throw GetArgumentNullException(NameOf(currentAssembly)) End If _assembly = currentAssembly End Sub @@ -236,12 +236,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since these properties will not change during runtime, they're cached. ' "" is not Nothing so use Nothing to mark an un-accessed property. Private _description As String ' Cache the assembly's description. - Private _title As String ' Cache the assembly's title. Private _productName As String ' Cache the assembly's product name. Private _companyName As String ' Cache the assembly's company name. Private _trademark As String ' Cache the assembly's trademark. Private _copyright As String ' Cache the assembly's copyright. End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index b297090d1a3..dca6f506888 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -37,5 +37,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 8527fd31597..5361c7d0b92 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -56,5 +56,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) ' Lazy-initialized and cached collection of command line arguments. End Class 'ApplicationBase - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 1e07570cea3..12ac806163b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -36,5 +36,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb index 95fd98725b2..3b2d5147d9d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb @@ -32,7 +32,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices cancellationToken.ThrowIfCancellationRequested() Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) Try - Dim args = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) + Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) If args IsNot Nothing Then callback(args) End If @@ -54,18 +54,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function Private Async Function ReadArgsAsync(pipeServer As NamedPipeServerStream, cancellationToken As CancellationToken) As Task(Of String()) - Const bufferLength = 1024 - Dim buffer = New Byte(bufferLength - 1) {} + Const bufferLength As Integer = 1024 + Dim buffer As Byte() = New Byte(bufferLength - 1) {} Using stream As New MemoryStream While True - Dim bytesRead = Await pipeServer.ReadAsync(buffer.AsMemory(0, bufferLength), cancellationToken).ConfigureAwait(False) + Dim bytesRead As Integer = Await pipeServer.ReadAsync(buffer.AsMemory(0, bufferLength), cancellationToken).ConfigureAwait(False) If bytesRead = 0 Then Exit While End If Await stream.WriteAsync(buffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(False) End While stream.Seek(0, SeekOrigin.Begin) - Dim serializer = New DataContractSerializer(GetType(String())) + Dim serializer As New DataContractSerializer(GetType(String())) Try Return DirectCast(serializer.ReadObject(stream), String()) Catch ex As Exception @@ -77,7 +77,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private Async Function WriteArgsAsync(pipeClient As NamedPipeClientStream, args As String(), cancellationToken As CancellationToken) As Task Dim content As Byte() Using stream As New MemoryStream - Dim serializer = New DataContractSerializer(GetType(String())) + Dim serializer As New DataContractSerializer(GetType(String())) serializer.WriteObject(stream, args) content = stream.ToArray() End Using @@ -85,5 +85,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function End Module - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index 579b7174c12..b2b5d5a4ff3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -29,7 +29,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Returns the command line sent to this application ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index 512e9c1c2c3..c34bf4c1f50 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -37,7 +37,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they ''' always return the same values Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index c754381dd29..e8a43f13dac 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -23,7 +23,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Indicates whether the application should exit upon exiting the exception handler '''
Public Property ExitApplication() As Boolean - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index f5d4721f631..590b352f1c1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -3,6 +3,7 @@ Imports System.ComponentModel Imports System.Security.Principal +Imports System.Threading Namespace Microsoft.VisualBasic.ApplicationServices @@ -68,13 +69,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Protected Overridable Property InternalPrincipal() As IPrincipal Get - Return Threading.Thread.CurrentPrincipal + Return Thread.CurrentPrincipal End Get Set(value As IPrincipal) - Threading.Thread.CurrentPrincipal = value + Thread.CurrentPrincipal = value End Set End Property End Class 'User - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 76ebec2e782..38bec70b21a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -49,9 +49,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub - End Class - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 6cfe9360957..59ae5c4b86a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -5,11 +5,11 @@ Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.IO.Pipes Imports System.Reflection +Imports System.Runtime.CompilerServices Imports System.Runtime.InteropServices Imports System.Security Imports System.Threading Imports System.Windows.Forms - Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -88,7 +88,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' How long a subsequent instance will wait for the original instance to get on its feet. Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. - Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. Private ReadOnly _splashLock As New Object @@ -105,7 +104,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Whether we have made it through the processing of OnInitialize. Private _finishedOnInitialize As Boolean - Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) Private _networkObject As Devices.Network @@ -127,13 +125,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' For splash screens with a minimum display time, this let's us know when that time ' has expired and it is OK to close the splash screen. Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - Private _formLoadWaiter As AutoResetEvent Private _splashScreen As Form ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext @@ -339,7 +335,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' --- This is the first instance of a single-instance application to run. ' This is the instance that subsequent instances will attach to. Using pipeServer - Dim tokenSource = New CancellationTokenSource() + Dim tokenSource As New CancellationTokenSource() #Disable Warning BC42358 ' Call is not awaited. WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) #Enable Warning BC42358 @@ -349,10 +345,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Else ' --- We are launching a subsequent instance. - Dim tokenSource = New CancellationTokenSource() + Dim tokenSource As New CancellationTokenSource() tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) Try - Dim awaitable = SendSecondInstanceArgsAsync(ApplicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(ApplicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) awaitable.GetAwaiter().GetResult() Catch ex As Exception Throw New CantStartSingleInstanceException() @@ -501,7 +497,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Once all this is done, we give the User another chance to change the value by code through ' the ApplyDefaults event. ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! - Dim applicationDefaultsEventArgs = New ApplyApplicationDefaultsEventArgs( + Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( MinimumSplashScreenDisplayTime, HighDpiMode) With { @@ -523,7 +519,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices _highDpiMode = applicationDefaultsEventArgs.HighDpiMode ' Then, it's applying what we got back as HighDpiMode. - Dim dpiSetResult = Application.SetHighDpiMode(_highDpiMode) + Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) If dpiSetResult Then _highDpiMode = Application.HighDpiMode End If @@ -909,7 +905,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private Sub OnStartupNextInstanceMarshallingAdaptor(ByVal args As String()) - Dim invoked = False + Dim invoked As Boolean = False Try Dim handleNextInstance As New Action( diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index d38b023913a..f421db8f642 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,8 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On - Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.CompilerServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb index bbc67fe3249..c2455e01bc4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Globalization +Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -18,9 +19,8 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function Friend Shared Function GetCultureInfo() As CultureInfo - Return Threading.Thread.CurrentThread.CurrentCulture + Return Thread.CurrentThread.CurrentCulture End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index e6e7d03de0f..fc6da90eb61 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,7 +2,6 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO - Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -11,10 +10,8 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file '''
Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous - Background = 1 'Asynchronous BackgroundLoop = 2 'Asynchronous and looping End Enum @@ -62,7 +59,7 @@ Namespace Microsoft.VisualBasic ''' The mode in which the array should be played Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then - Throw GetArgumentNullException("data") + Throw GetArgumentNullException(NameOf(data)) End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) @@ -79,7 +76,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then - Throw GetArgumentNullException("stream") + Throw GetArgumentNullException(NameOf(stream)) End If Play(New Media.SoundPlayer(stream), playMode) @@ -92,7 +89,7 @@ Namespace Microsoft.VisualBasic ''' Plays the sound asynchronously Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then - Throw GetArgumentNullException("systemSound") + Throw GetArgumentNullException(NameOf(systemSound)) End If systemSound.Play() @@ -142,7 +139,7 @@ Namespace Microsoft.VisualBasic ''' A full name and path of the file Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then - Throw GetArgumentNullException("location") + Throw GetArgumentNullException(NameOf(location)) End If Return location @@ -162,7 +159,5 @@ Namespace Microsoft.VisualBasic Private _sound As Media.SoundPlayer End Class 'Audio - End Namespace - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index 7ac9ea7597d..b1150b27c1d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -14,7 +14,6 @@ Namespace Microsoft.VisualBasic.Devices '''
''' A Date whose value is the current date and time. #Disable Warning IDE0049 ' Simplify Names, Justification:= - Public ReadOnly Property LocalTime() As DateTime Get Return DateTime.Now @@ -31,7 +30,6 @@ Namespace Microsoft.VisualBasic.Devices Return DateTime.UtcNow End Get End Property - #Enable Warning IDE0049 ' Simplify Names ''' @@ -46,5 +44,4 @@ Namespace Microsoft.VisualBasic.Devices End Property End Class 'Clock - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index bd33b29323d..362baf53a0c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -94,5 +94,4 @@ Namespace Microsoft.VisualBasic.Devices Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class End Class 'Computer - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index e289774039a..b6e94972129 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -48,7 +48,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the total size of user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, + ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, ''' in bytes. ''' If we are unable to obtain the memory status. @@ -61,7 +61,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the total size of free user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, + ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, ''' in bytes. ''' If we are unable to obtain the memory status. @@ -241,5 +241,4 @@ Namespace Microsoft.VisualBasic.Devices Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX End Class End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 14ff9561c05..3f1d7fa461b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -108,7 +108,5 @@ Namespace Microsoft.VisualBasic.Devices Return CType((UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1), Boolean) End Get End Property - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index 45208acba3c..f09317e928f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -64,5 +64,4 @@ Namespace Microsoft.VisualBasic.Devices End Property End Class 'Mouse - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index adfae35b0a1..21efe13730c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -3,7 +3,6 @@ Imports System.Net Imports System.Net.Http - Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal @@ -13,7 +12,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices ''' - ''' An object that allows easy access to some simple network properties and functionality. + ''' An object that allows easy access to some simple network properties and functionality. ''' Partial Public Class Network @@ -27,7 +26,7 @@ Namespace Microsoft.VisualBasic.Devices Private Const DEFAULT_USERNAME As String = "" ''' - ''' Creates class and hooks up events + ''' Creates class and hooks up events ''' Public Sub New() End Sub @@ -70,10 +69,10 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) As Task - Dim clientHandler = If(networkCredentials Is Nothing, - New HttpClientHandler, - New HttpClientHandler With {.Credentials = networkCredentials} - ) + Dim clientHandler As HttpClientHandler = If(networkCredentials Is Nothing, + New HttpClientHandler, + New HttpClientHandler With {.Credentials = networkCredentials} + ) Return DownloadFileAsync(addressUri, destinationFileName, clientHandler, @@ -265,10 +264,10 @@ Namespace Microsoft.VisualBasic.Devices Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) End If - Dim client = If(clientHandler IsNot Nothing, - New HttpClient(clientHandler), - New HttpClient() - ) + Dim client As HttpClient = If(clientHandler IsNot Nothing, + New HttpClient(clientHandler), + New HttpClient() + ) ' Set credentials if we have any client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index c18edd14bf7..35b69d9a43b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -27,7 +27,7 @@ Namespace Microsoft.VisualBasic.Devices ReDim _pingBuffer(BUFFER_SIZE - 1) For i As Integer = 0 To BUFFER_SIZE - 1 'This is the same logic Ping.exe uses to fill it's buffer - _pingBuffer(i) = Convert.ToByte(Asc("a"c) + i Mod 23, Globalization.CultureInfo.InvariantCulture) + _pingBuffer(i) = Convert.ToByte(Asc("a"c) + (i Mod 23), Globalization.CultureInfo.InvariantCulture) Next End If @@ -73,7 +73,10 @@ Namespace Microsoft.VisualBasic.Devices Dim PingMaker As New NetInfoAlias.Ping Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - Return Reply.Status = NetInfoAlias.IPStatus.Success + If Reply.Status = NetInfoAlias.IPStatus.Success Then + Return True + End If + Return False End Function ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 131b3d66f5c..f0075c299ce 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -101,5 +101,4 @@ Namespace Microsoft.VisualBasic.Devices Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class End Class 'MyServerComputer - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 0ae0c807c1c..81a206fa421 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -147,5 +147,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb index 50af821b5cd..be0de0702b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb @@ -12,9 +12,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Public NotInheritable Class HostServices -#Disable Warning IDE0032 ' Use auto property, Justification:= Private Shared s_host As IVbHost -#Enable Warning IDE0032 ' Use auto property Public Shared Property VBHost() As IVbHost Get @@ -27,7 +25,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Property End Class - End Namespace - - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 48c962c1653..1020f0ca168 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -25,7 +25,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Lib "user32" () As IntPtr #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes - Friend Shared Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes @@ -91,7 +90,6 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning IDE0049 ' Simplify Names, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= - ''' ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' @@ -123,9 +121,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub Init() dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub - End Structure - #Enable Warning IDE0049 ' Simplify Names ''' @@ -144,5 +140,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 3be2b6c5560..b024511fb82 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -10,7 +10,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class NativeTypes #Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. - Friend NotInheritable Class SECURITY_ATTRIBUTES #Enable Warning CA1812 @@ -36,7 +35,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub - End Class ''' @@ -58,7 +56,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function - End Class ''' @@ -79,7 +76,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub - End Class ''' @@ -156,7 +152,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose(True) GC.SuppressFinalize(Me) End Sub - End Class ' Handle Values @@ -164,7 +159,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ' GetWindow() Constants Friend Const GW_HWNDFIRST As Integer = 0 - Friend Const GW_HWNDLAST As Integer = 1 Friend Const GW_HWNDNEXT As Integer = 2 Friend Const GW_HWNDPREV As Integer = 3 @@ -177,5 +171,4 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 034e6c5deca..6dbef6c9cea 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -127,5 +127,4 @@ Namespace Microsoft.VisualBasic.CompilerServices Close() End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 6a98679e76f..991ef1fdf1f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -63,14 +63,14 @@ Namespace Microsoft.VisualBasic If ok = 0 Then 'succeeded 'Process ran to completion - Shell = 0 + Return 0 Else 'Wait timed out - Shell = ProcessInfo.dwProcessId + Return ProcessInfo.dwProcessId End If Else NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Shell = ProcessInfo.dwProcessId + Return ProcessInfo.dwProcessId End If Else 'Check for a win32 error access denied. If it is, make and throw the exception. @@ -275,13 +275,13 @@ Namespace Microsoft.VisualBasic Return _exception End Get End Property - End Class Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String + Dim vbHost As IVbHost Dim ParentWindow As IWin32Window = Nothing - Dim vbHost As IVbHost = HostServices.VBHost + vbHost = HostServices.VBHost If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. ParentWindow = vbHost.GetParentWindow() End If @@ -352,9 +352,10 @@ Namespace Microsoft.VisualBasic Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String + Dim vbHost As IVbHost Dim parentWindow As IWin32Window = Nothing - Dim vbHost As IVbHost = HostServices.VBHost + vbHost = HostServices.VBHost If vbHost IsNot Nothing Then parentWindow = vbHost.GetParentWindow() End If @@ -412,5 +413,4 @@ Namespace Microsoft.VisualBasic End Function End Module - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 26d305771a9..2007db39ccb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -6,7 +6,6 @@ Imports System.Globalization Imports System.IO Imports System.Text Imports System.Windows.Forms - Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -17,10 +16,8 @@ Namespace Microsoft.VisualBasic.Logging ''' Options for the location of a log's directory ''' Public Enum LogFileLocation As Integer - ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory - LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory @@ -203,7 +200,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As String) If String.IsNullOrEmpty(value) Then - Throw GetArgumentNullException("value", SR.ApplicationLogBaseNameNull) + Throw GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) End If ' Test the file name. This will throw if the name is invalid. @@ -278,7 +275,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < MIN_FILE_SIZE Then - Throw GetArgumentExceptionWithArgName("value", SR.ApplicationLogNumberTooSmall, "MaxFileSize") + Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") End If _maxFileSize = value _propertiesSet(MAXFILESIZE_INDEX) = True @@ -301,7 +298,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < 0 Then - Throw GetArgumentExceptionWithArgName("value", SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") End If _reserveDiskSpace = value _propertiesSet(RESERVEDISKSPACE_INDEX) = True @@ -346,7 +343,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As Encoding) If value Is Nothing Then - Throw GetArgumentNullException("value") + Throw GetArgumentNullException(NameOf(value)) End If _encoding = value _propertiesSet(ENCODING_INDEX) = True @@ -1047,7 +1044,6 @@ Namespace Microsoft.VisualBasic.Logging ' Identifies properties in the BitArray Private Const PROPERTY_COUNT As Integer = 12 - Private Const APPEND_INDEX As Integer = 0 Private Const AUTOFLUSH_INDEX As Integer = 1 Private Const BASEFILENAME_INDEX As Integer = 2 @@ -1073,7 +1069,6 @@ Namespace Microsoft.VisualBasic.Logging ' Attribute keys used to access properties set in the config file Private Const KEY_APPEND As String = "append" - Private Const KEY_APPEND_PASCAL As String = "Append" Private Const KEY_AUTOFLUSH As String = "autoflush" @@ -1258,7 +1253,5 @@ Namespace Microsoft.VisualBasic.Logging Private _disposed As Boolean End Class 'ReferencedStream - End Class 'FileLogTraceListener - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 2b7fdcc4de1..67ebe6f80f5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic.Logging Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String, id As Integer) If ex Is Nothing Then - Throw GetArgumentNullException("ex") + Throw GetArgumentNullException(NameOf(ex)) End If Dim builder As New StringBuilder() @@ -230,9 +230,7 @@ Namespace Microsoft.VisualBasic.Logging ' Names of TraceSources Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index 6fef2b1c36a..c6b8ddf6a01 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -209,5 +209,4 @@ Namespace Microsoft.VisualBasic.MyServices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb index b3f0577098f..e161a134431 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb @@ -275,5 +275,4 @@ Namespace Microsoft.VisualBasic.MyServices Private _specialDirectoriesProxy As SpecialDirectoriesProxy End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 34e0a05d2d6..58b4c73aeb5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -18,7 +18,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Public Class ContextValue(Of T) - Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub @@ -49,5 +48,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private Shared s_threadLocal As ThreadLocal(Of IDictionary) End Class 'ContextValue - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 223202180bb..9776ea840c2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -201,7 +201,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If End Sub #End If - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 720f46046ea..20a8de87469 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -218,7 +218,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub - Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button @@ -272,5 +271,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal #End Region End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index a159a69ab8b..16108f5e49b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -148,5 +148,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private _percentage As Integer End Class - End Namespace From 9e524373521e9908f6fca89f8c58585352c85cdc Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 17 Mar 2024 15:43:22 -0900 Subject: [PATCH 101/342] Remove need for Vb-CodeCleanup PR --- .../VisualBasic/Devices/Network/NetworkAvailability.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index e5ae807acb5..ad0ca236cb7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -59,7 +59,9 @@ Namespace Microsoft.VisualBasic.Devices Return End Try SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. - If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) + If _networkAvailabilityEventHandlers Is Nothing Then + _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) + End If _networkAvailabilityEventHandlers.Add(handler) 'Only setup the event Marshalling infrastructure once From 9868c0ede7384b8511f2dcdf3741b3c1cd4d8ce3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 18 Mar 2024 22:11:42 -0900 Subject: [PATCH 102/342] Simplify VbMakeException, properly wrap parameters --- .../WindowsFormsApplicationBase.vb | 11 ++-- .../CompilerServices/ExceptionUtils.vb | 56 ++++++------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 59ae5c4b86a..4fcd80b563f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -88,6 +88,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' How long a subsequent instance will wait for the original instance to get on its feet. Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. + Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. Private ReadOnly _splashLock As New Object @@ -104,11 +105,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Whether we have made it through the processing of OnInitialize. Private _finishedOnInitialize As Boolean + Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) Private _networkObject As Devices.Network -#Disable Warning IDE0032 ' Use auto property, Justification:= - ' Whether this app runs using Word like instancing behavior. Private _isSingleInstance As Boolean @@ -125,11 +125,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' For splash screens with a minimum display time, this let's us know when that time ' has expired and it is OK to close the splash screen. Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) + Private _formLoadWaiter As AutoResetEvent Private _splashScreen As Form ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT + Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext @@ -139,8 +141,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware -#Enable Warning IDE0032 ' Use auto property - ''' ''' Occurs when the network availability changes. ''' @@ -927,7 +927,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices SynchronizationContext. Send(Sub() handleNextInstance(), Nothing) End If - Catch ex As Exception When Not invoked ' Only catch exceptions thrown when the UI thread is not available, before ' the UI thread has been created or after it has been terminated. Exceptions @@ -1026,5 +1025,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Return Entry.ManifestModule.ModuleVersionId.ToString() End Function + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index f421db8f642..a6fc1158ae9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -19,51 +19,24 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub Friend Shared Function VbMakeException(hr As Integer) As Exception - Dim sMsg As String + Dim description As String = "" If hr > 0 AndAlso hr <= &HFFFFI Then - sMsg = GetResourceString(CType(hr, vbErrors)) - Else - sMsg = "" + description = GetResourceString(CType(hr, vbErrors)) End If - VbMakeException = VbMakeExceptionEx(hr, sMsg) - End Function - - Friend Shared Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception - Dim vBDefinedError As Boolean - - VbMakeExceptionEx = BuildException(number, sMsg, vBDefinedError) - If vBDefinedError Then - ' .NET Framework implementation calls: - ' Err().SetUnmappedError(number) - End If - - End Function - - Friend Shared Function BuildException(Number As Integer, Description As String, ByRef VBDefinedError As Boolean) As Exception - - VBDefinedError = True - - Select Case Number - - Case vbErrors.None + Select Case hr Case vbErrors.FileNotFound - Return New IO.FileNotFoundException(Description) + Return New IO.FileNotFoundException(description) Case vbErrors.PermissionDenied - Return New IO.IOException(Description) + Return New IO.IOException(description) Case Else - 'Fall below to default - VBDefinedError = False - Return New Exception(Description) + Return New Exception(description) End Select - VBDefinedError = False - Return New Exception(Description) - End Function ''' @@ -75,7 +48,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of ArgumentException. ''' This is the preferred way to construct an argument exception. Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException + ResourceID As String, + ParamArray PlaceHolders() As String) As ArgumentException Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function @@ -98,7 +72,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of ArgumentNullException. Friend Shared Function GetArgumentNullException(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException + ResourceID As String, + ParamArray PlaceHolders() As String) As ArgumentNullException Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) End Function @@ -109,8 +84,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.DirectoryNotFoundException. - Friend Shared Function GetDirectoryNotFoundException( - ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException + Friend Shared Function GetDirectoryNotFoundException(ResourceID As String, + ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) End Function @@ -146,7 +121,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.IOException. - Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException + Friend Shared Function GetIOException(ResourceID As String, + ParamArray PlaceHolders() As String) As IO.IOException Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) End Function @@ -159,8 +135,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Shared Function GetWin32Exception( - ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception + Friend Shared Function GetWin32Exception(ResourceID As String, + ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) End Function From beed8907e81e5ad60ca6669dba1ce0629d8af09d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 18 Mar 2024 23:02:59 -0900 Subject: [PATCH 103/342] InternalsVisibleTo("Microsoft.VisualBasic.Forms.Tests") --- .../src/Properties/AssembtyInfo.vb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb new file mode 100644 index 00000000000..489562d97c3 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb @@ -0,0 +1,6 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.CompilerServices + + From ec3566bf7b8f7941407b244a6cfc6b84b095b3d6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 18 Mar 2024 23:12:45 -0900 Subject: [PATCH 104/342] Add InternalsVisibleTo("Microsoft.VisualBasic.Forms.Tests") to --- .../src/Properties/AssemblyInfo.vb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb new file mode 100644 index 00000000000..489562d97c3 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb @@ -0,0 +1,6 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.CompilerServices + + From 62a42aeece8a5a2d901c8430f61e64c0e425e585 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 19 Mar 2024 00:59:30 -0900 Subject: [PATCH 105/342] Enable InternalsVisibleTo for Visual Basic Code Simplify VbMakeException Disambugiate Utils!! Needs REVIEW --- .../CompilerServices/ExceptionUtils.vb | 9 ++++-- .../VisualBasic/CompilerServices/Utils.vb | 8 ++---- .../src/Properties/AssembtyInfo.vb | 2 +- .../AssemblyPublicKeyIsAsExpectedTest.vb | 28 +++++++++++++++++++ .../ApplicationServices/AssemblyInfoTests.cs | 2 +- 5 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index a6fc1158ae9..2dc68959b83 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,7 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.CompilerServices @@ -18,11 +18,16 @@ Namespace Microsoft.VisualBasic.CompilerServices Private Sub New() End Sub + Private Shared Function GetResourceStringResourceId(ResourceId As vbErrors) As String + Dim id As String = "ID" & CStr(ResourceId) + Return SR.GetResourceString(id, id) + End Function + Friend Shared Function VbMakeException(hr As Integer) As Exception Dim description As String = "" If hr > 0 AndAlso hr <= &HFFFFI Then - description = GetResourceString(CType(hr, vbErrors)) + description = GetResourceStringResourceId(CType(hr, vbErrors)) End If Select Case hr diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb index c2455e01bc4..5fa91066fab 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -7,12 +7,7 @@ Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils - - Friend Shared Function GetResourceString(ResourceId As vbErrors) As String - Dim id As String = "ID" & CStr(ResourceId) - Return SR.GetResourceString(id, id) - End Function + Friend NotInheritable Class Utils1 Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String Return String.Format(GetCultureInfo(), resourceKey, args) @@ -23,4 +18,5 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb index 489562d97c3..c236c65fd73 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb @@ -3,4 +3,4 @@ Imports System.Runtime.CompilerServices - + diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb new file mode 100644 index 00000000000..9d97bf4ed63 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -0,0 +1,28 @@ +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Text +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class AssemblyPublicKeyIsAsExpectedTest + Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" + + ''' + ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. + ''' + + Public Sub AssemblyPublicKeyIsAsExpected() + Dim publicKey() As Byte = GetType(NetworkTests).Assembly.GetName().GetPublicKey() + Dim sb = New StringBuilder() + For Each [byte] As Byte In publicKey + sb.AppendFormat("{0:x2}", [byte]) + Next [byte] + + ' Set breakpoint here to find out what's in sb + Assert.Equal(AssemblyPK, sb.ToString()) + End Sub + + End Class + +End Namespace diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs index d05068c54d5..9a1c061e8cb 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs @@ -20,7 +20,7 @@ public void AssemblyProperties(Assembly assembly) AssemblyInfo assemblyInfo = new(assembly); var assemblyName = assembly.GetName(); Assert.Equal(assemblyName.Name, assemblyInfo.AssemblyName); - Assert.Equal(System.IO.Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); + Assert.Equal(Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); Assert.Equal(GetAttributeValue(assembly, attr => attr.Company), assemblyInfo.CompanyName); Assert.Equal(GetAttributeValue(assembly, attr => attr.Copyright), assemblyInfo.Copyright); Assert.Equal(GetAttributeValue(assembly, attr => attr.Description), assemblyInfo.Description); From 2676da4c678a80f4bb322afba8d593cd50f39ab6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 19 Mar 2024 18:23:54 -0800 Subject: [PATCH 106/342] Add AssmenlyInfo.vb for InternalsVisibleTo --- src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb index 489562d97c3..c236c65fd73 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb @@ -3,4 +3,4 @@ Imports System.Runtime.CompilerServices - + From ec174cdeb881a7e90ba155c4aa7734fe7ba29121 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 19 Mar 2024 18:26:09 -0800 Subject: [PATCH 107/342] Delete Assambly Info --- .../src/Microsoft.VisualBasic.Forms.vbproj | 4 ++++ .../src/Properties/AssemblyInfo.vb | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index 4908ff6766f..2ee7e61dbbb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -45,6 +45,10 @@ + + + + diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb deleted file mode 100644 index c236c65fd73..00000000000 --- a/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,6 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Runtime.CompilerServices - - From 93c758b1d3b49ac76468c5c76e5b653ba4e28885 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 19 Mar 2024 18:32:00 -0800 Subject: [PATCH 108/342] Remove Regions --- .../Windows/Forms/NetworkDownloadTests.vb | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index fb8d8d0777f..7be2cb52b3a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -4,7 +4,6 @@ Imports System.IO Imports System.Net Imports Microsoft.VisualBasic.FileIO - Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -32,8 +31,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String) -> Void" - @@ -96,10 +93,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String) -> Void" - Public Sub DownloadFile_Url_Password_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -146,10 +139,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" - Public Sub DownloadFile_Ur_InvalidUrl_Throws() Dim tmpFilePath As String = CreateTempDirectory() @@ -346,10 +335,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> Void" - @@ -486,10 +471,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanUp(listener, tmpFilePath) End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String) -> Void" - Public Sub DownloadFile_Uri_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -507,10 +488,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" - Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -532,10 +509,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String) -> Void" - Public Sub DownloadFile_Uri_UserNamePassword_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -577,10 +550,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> Void" - Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -623,10 +592,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanUp(listener, tmpFilePath) End Sub -#End Region - -#Region "Microsoft.VisualBasic.Devices.Network.DownloadFile(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> Void" - Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() Dim tmpFilePath As String = CreateTempDirectory() @@ -695,8 +660,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub -#End Region - End Class End Namespace From 3c11f4a032ff28b269fb9e8f925cbed695c66450 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 19 Mar 2024 18:42:38 -0800 Subject: [PATCH 109/342] Delete Upload --- .../Windows/Forms/NetworkUploadTests.vb | 129 ------------------ 1 file changed, 129 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb deleted file mode 100644 index 8108a4d3785..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkUploadTests.vb +++ /dev/null @@ -1,129 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -' Here for future testing of My.Computer.Network.UploadFile -' the site SpeedTest.tele2.net should not be used -#If False Then - -Imports System.IO -Imports System.Net - -Imports Xunit - -Namespace Microsoft.VisualBasic.Forms.Tests - - Partial Public Class NetworkTests - - ' The following URL MUST be replaced with a local URL - Private Const UploadFileUrl As String = "ftp://speedtest.tele2.net/upload/testing.txt" - - - Public Sub UploadFilenameUrl() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=1) - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl) - Directory.Delete(tmpFilePath, True) - End Sub - - - Public Sub UploadWhereTimeoutNegative() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, size:=&H100_0000) - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=-1) - End Sub) - Directory.Delete(tmpFilePath, True) - End Sub - - - Public Sub UploadWithExpectedTimeOut() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, &H10_0000) - Try - - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=1) - End Sub) - Finally - Directory.Delete(tmpFilePath, True) - End Try - End Sub - - - Public Sub UploadWithNothingPassword() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:=Nothing) - Finally - Directory.Delete(tmpFilePath, True) - End Try - End Sub - - - Public Sub UploadWithNothingSourceFile() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network.UploadFile(sourceFileName:=Nothing, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous") - End Sub) - Finally - Directory.Delete(tmpFilePath, True) - End Try - End Sub - - - Public Sub UploadWithNothingUri() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network.UploadFile(sourceFilename, - address:=CType(Nothing, Uri), - userName:="anonymous", - password:="anonymous") - End Sub) - Directory.Delete(tmpFilePath, True) - End Sub - - - Public Sub UploadWithUI() - Dim tmpFilePath As String = CreateTempDirectory() - Dim sourceFilename As String = CreateTempFile(tmpFilePath, 1) - Try - My.Computer.Network.UploadFile(sourceFilename, - address:=UploadFileUrl, - userName:="anonymous", - password:="anonymous", - showUI:=True, - connectionTimeout:=100000) - Finally - Directory.Delete(tmpFilePath, True) - End Try - End Sub - - End Class - -End Namespace -#End If From 19f7da74cb859d5164d7a1bd3c45ebe811eedf9a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 00:49:37 -0800 Subject: [PATCH 110/342] Respond to PR feedback add comments --- .../System/Windows/Forms/ControlTests.vb | 3 +- .../Windows/Forms/NetworkDownloadTests.vb | 242 ++++++++++-------- .../Forms/NetworkTestsCommonFunctions.vb | 25 +- .../System/Windows/Forms/WebListener.vb | 13 +- .../ApplicationServices/AssemblyInfoTests.cs | 2 +- 5 files changed, 162 insertions(+), 123 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index ee002f22a79..b468acd10f6 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -5,6 +5,7 @@ Imports System.Windows.Forms Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests + Partial Public Class ControlTests @@ -100,6 +101,4 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function End Class - End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 7be2cb52b3a..577432a6149 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -16,18 +16,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const InvalidUrlAddress As String = "invalidURL" Private Const TestingConnectionTimeout As Integer = 100000 - Private Shared Function ValidateDownload(tmpFilePath As String, destinationFilename As String) As Long - Assert.True(Directory.Exists(tmpFilePath)) + Private Shared Function ValidateDownload(tmpDirectoryPath As String, destinationFilename As String) As Long Dim fileInfo As New FileInfo(destinationFilename) + + Assert.True(Directory.Exists(tmpDirectoryPath)) Assert.True(fileInfo.Exists) + Return fileInfo.Length End Function - Private Sub CleanUp(listener As HttpListener, Optional tmpFilePath As String = Nothing) + Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) listener.Stop() listener.Close() - If tmpFilePath IsNot Nothing Then - Directory.Delete(tmpFilePath, recursive:=True) + If tmpDirectoryPath IsNot Nothing Then + Directory.Delete(tmpDirectoryPath, recursive:=True) End If End Sub @@ -35,10 +37,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) - Dim tmpFilePath As String = CreateTempDirectory() + Dim tmpDirectoryPath As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -49,25 +52,26 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try My.Computer.Network _ .DownloadFile(address, destinationFilename) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -75,10 +79,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -89,17 +94,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_Password_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try My.Computer.Network _ .DownloadFile(address, @@ -107,10 +113,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -118,11 +124,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of WebException)( Sub() @@ -135,16 +142,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Ur_InvalidUrl_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try Assert.Throws(Of ArgumentException)( Sub() @@ -160,7 +168,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -169,6 +177,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -189,11 +198,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=1) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Assert.Throws(Of IOException)( Sub() My.Computer.Network _ @@ -206,18 +216,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), 1) - CleanUp(listener, tmpFilePath) + + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), 1) + + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Url_FileExistsOverwrite_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, 1) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, 1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try My.Computer.Network _ .DownloadFile(address, @@ -228,19 +241,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try Assert.Throws(Of ArgumentException)( Sub() @@ -254,19 +268,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_TimeOut_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of WebException)( Sub() @@ -280,19 +296,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_TimeoutNegative_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of ArgumentException)( Sub() @@ -308,17 +326,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_UsernameEqualNothing_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try My.Computer.Network _ .DownloadFile(address, @@ -329,9 +348,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=False) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -339,11 +358,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of ArgumentException)( Sub() @@ -360,23 +380,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_GetLongPath_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ .DownloadFile(address, - destinationFileName:=tmpFilePath, ' This is a Directory! + destinationFileName:=tmpDirectoryPath, ' This is a Directory! userName:="", password:="", showUI:=False, @@ -387,7 +408,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -395,11 +416,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectory_Throw(root As String) - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of InvalidOperationException)( Sub() @@ -416,7 +438,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -424,11 +446,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address + Try Assert.Throws(Of ArgumentException)( Sub() @@ -445,14 +468,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Url_AllOptionsSet_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -466,35 +489,38 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpFilePath) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) + Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -503,18 +529,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_UserNamePassword_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() + Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -522,18 +549,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_UserNamePassword_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() + Try Assert.Throws(Of WebException)( Sub() @@ -546,16 +574,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpFilePath, size:=1) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -566,18 +595,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=104857600) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, @@ -587,17 +617,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpFilePath) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, @@ -608,16 +640,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpFilePath) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) - Directory.Delete(tmpFilePath, recursive:=True) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Directory.Delete(tmpDirectoryPath, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ @@ -630,17 +663,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpFilePath) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_UriIsNothing_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Try Assert.Throws(Of ArgumentNullException)( Sub() @@ -656,10 +691,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb index 7c1233366c5..53eaab6edeb 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb @@ -7,35 +7,39 @@ Imports System.Runtime.CompilerServices Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class NetworkTests + + ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName Private Shared ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") + ''' + ''' Creates or returns a directory based on the name of the function that + ''' call it. The base directory is described above. + ''' Even if directory exists this call will success and just return it + ''' + ''' + ''' Private Shared Function CreateTempDirectory( Optional memberName As String = Nothing) As String - - Directory.CreateDirectory(s_baseTempPath) Dim folder As String = Path.Combine(s_baseTempPath, $"{memberName}Test") + Directory.CreateDirectory(folder) Return folder End Function ''' - ''' If size >= 0 then create the file with size length - ''' The file will contain the letters A-Z repeating as needed. + ''' If size >= 0 then create the file with size length ''' ''' Full path to working directory ''' File size to be created ''' - ''' The full path and file name of the created file - ''' If size = -1 not file is create but the full path is returned + ''' The full path and file name of the created file + ''' If size = -1 no file is create but the full path is returned ''' Private Shared Function CreateTempFile(tmpFilePath As String, size As Integer) As String Dim filename As String = GetDestinationFileName(tmpFilePath) If size >= 0 Then Using destinationStream As FileStream = File.Create(filename) - ' Below allows for limited testing of download data - For i As Long = 0 To size - 1 - destinationStream.WriteByte(CByte((AscW("A") + (i Mod 26)))) - Next + destinationStream.Write(New Byte(size - 1) {}) destinationStream.Flush() destinationStream.Close() End Using @@ -48,5 +52,4 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 26f920eccb1..7e9fcc5a534 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -10,12 +10,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Class WebListener Private ReadOnly _downloadFileUrlPrefix As String Private ReadOnly _fileSize As Integer - Public ReadOnly Address As String - Private _userName As String + Private _password As String + Private _userName As String + + Public ReadOnly Address As String ''' - ''' The name of the function that creates the server is uses to establish the file to be downloaded + ''' The name of the function that creates the server is uses to establish the file to be downloaded ''' ''' Is used to create the file name and the size of download ''' Used to establish the file path to be downloaded @@ -26,7 +28,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub ''' - ''' Used for authenticated download + ''' Used for authenticated download ''' ''' Passed to Me.New ''' Name to match for authorization @@ -41,6 +43,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Friend Function ProcessRequests() As HttpListener ' Create a listener and add the prefixes. Dim listener As New HttpListener() + listener.Prefixes.Add(_downloadFileUrlPrefix) If _userName IsNot Nothing OrElse _password IsNot Nothing Then listener.AuthenticationSchemes = AuthenticationSchemes.Basic @@ -50,6 +53,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() ' Start the listener to begin listening for requests. Dim response As HttpListenerResponse = Nothing + Try ' Note: GetContext blocks while waiting for a request. Dim context As HttpListenerContext = listener.GetContext() @@ -77,5 +81,4 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs index d05068c54d5..9a1c061e8cb 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs @@ -20,7 +20,7 @@ public void AssemblyProperties(Assembly assembly) AssemblyInfo assemblyInfo = new(assembly); var assemblyName = assembly.GetName(); Assert.Equal(assemblyName.Name, assemblyInfo.AssemblyName); - Assert.Equal(System.IO.Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); + Assert.Equal(Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); Assert.Equal(GetAttributeValue(assembly, attr => attr.Company), assemblyInfo.CompanyName); Assert.Equal(GetAttributeValue(assembly, attr => attr.Copyright), assemblyInfo.Copyright); Assert.Equal(GetAttributeValue(assembly, attr => attr.Description), assemblyInfo.Description); From 19eb0fb938837f3a31924d58dd8db135d45605f7 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 01:05:55 -0800 Subject: [PATCH 111/342] Update GlobalSuppressions to reflect code symplicication --- src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb index 5bdaee2d86d..afae129727a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb +++ b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb @@ -5,4 +5,4 @@ Imports System.Diagnostics.CodeAnalysis - + From e7e28c5b3fbdbde643b121e3971e498316e4d9d5 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 21:49:38 -0800 Subject: [PATCH 112/342] Update GlobalSuppressions.vb to reflect new code --- src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb index 3a8799db6e7..5bdaee2d86d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb +++ b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb @@ -5,4 +5,4 @@ Imports System.Diagnostics.CodeAnalysis - + From cf4840ba4406b372938f73fb575795f50d6a3e94 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 21:54:51 -0800 Subject: [PATCH 113/342] Merge GlobalSuppressions.vb --- src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb index 5bdaee2d86d..4d98c52e39c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb +++ b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb @@ -5,4 +5,4 @@ Imports System.Diagnostics.CodeAnalysis - + From 703ae316a6afe2ab44a266d32538dde52f316550 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 22:43:08 -0800 Subject: [PATCH 114/342] Change Address from Field to Readonly Property in WebListener --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 7e9fcc5a534..d9cfcadd944 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -14,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private _password As String Private _userName As String - Public ReadOnly Address As String + Public ReadOnly Property Address As String ''' ''' The name of the function that creates the server is uses to establish the file to be downloaded From f1dc2eae8a9915c5f06da5a2e057bdfecbf4a328 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 23:23:11 -0800 Subject: [PATCH 115/342] Rewrite Download test to simplify --- .../Windows/Forms/NetworkDownloadTests.vb | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 577432a6149..3ad7ebd8412 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -16,19 +16,30 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const InvalidUrlAddress As String = "invalidURL" Private Const TestingConnectionTimeout As Integer = 100000 - Private Shared Function ValidateDownload(tmpDirectoryPath As String, destinationFilename As String) As Long + ''' + ''' Verify that tmpDirectoryPath exists, that destinationFilename exist and what its length is + ''' + ''' The full path and filename of the new file + ''' + ''' The size in bytes of the destination file, this saves the caller from having to + ''' do another FileInfo call + ''' + Private Shared Function ValidateDownload(destinationFilename As String) As Long Dim fileInfo As New FileInfo(destinationFilename) - Assert.True(Directory.Exists(tmpDirectoryPath)) + ' This directory should not be systems Temp Directory because it may be created + Assert.True(Directory.Exists(fileInfo.DirectoryName)) Assert.True(fileInfo.Exists) Return fileInfo.Length End Function Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) + Debug.Assert(tmpDirectoryPath <> Path.GetTempPath) listener.Stop() listener.Close() - If tmpDirectoryPath IsNot Nothing Then + If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then + Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath)) Directory.Delete(tmpDirectoryPath, recursive:=True) End If End Sub @@ -69,7 +80,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests .DownloadFile(address, destinationFilename) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -113,8 +124,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), - actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -218,7 +228,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), 1) + Assert.Equal(ValidateDownload(destinationFilename), 1) CleanUp(listener, tmpDirectoryPath) End Sub @@ -242,7 +252,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -348,7 +358,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=False) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -490,7 +500,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -507,7 +517,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests .DownloadFile(New Uri(webListener.Address), destinationFilename) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -529,7 +539,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -549,7 +559,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -595,7 +605,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=104857600) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -618,7 +628,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -641,7 +651,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -664,7 +674,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub From 582cddd95f063320ba1b07e937b8ae65a6a693f2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 23:26:31 -0800 Subject: [PATCH 116/342] Simplify tests, add comments --- .../Windows/Forms/NetworkDownloadTests.vb | 44 ++++++++++++------- .../System/Windows/Forms/WebListener.vb | 2 +- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 577432a6149..baf697c26d2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -16,19 +16,30 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const InvalidUrlAddress As String = "invalidURL" Private Const TestingConnectionTimeout As Integer = 100000 - Private Shared Function ValidateDownload(tmpDirectoryPath As String, destinationFilename As String) As Long + ''' + ''' Verify that tmpDirectoryPath exists, that destinationFilename exist and what its length is + ''' + ''' The full path and filename of the new file + ''' + ''' The size in bytes of the destination file, this saves the caller from having to + ''' do another FileInfo call + ''' + Private Shared Function ValidateDownload(destinationFilename As String) As Long Dim fileInfo As New FileInfo(destinationFilename) - Assert.True(Directory.Exists(tmpDirectoryPath)) + ' This directory should not be systems Temp Directory because it may be created + Assert.True(Directory.Exists(fileInfo.DirectoryName)) Assert.True(fileInfo.Exists) Return fileInfo.Length End Function Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) + Debug.Assert(tmpDirectoryPath <> Path.GetTempPath) listener.Stop() listener.Close() - If tmpDirectoryPath IsNot Nothing Then + If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then + Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) Directory.Delete(tmpDirectoryPath, recursive:=True) End If End Sub @@ -69,7 +80,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests .DownloadFile(address, destinationFilename) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -113,8 +124,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), - actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -218,7 +228,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), 1) + Assert.Equal(ValidateDownload(destinationFilename), 1) CleanUp(listener, tmpDirectoryPath) End Sub @@ -242,7 +252,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -348,7 +358,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=False) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -490,7 +500,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -507,7 +517,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests .DownloadFile(New Uri(webListener.Address), destinationFilename) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -529,7 +539,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests showUI:=False, TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -549,7 +559,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -595,7 +605,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), actual:=104857600) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) Finally CleanUp(listener, tmpDirectoryPath) End Try @@ -618,7 +628,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -641,7 +651,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub @@ -664,7 +674,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(tmpDirectoryPath, destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, tmpDirectoryPath) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 7e9fcc5a534..d9cfcadd944 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -14,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private _password As String Private _userName As String - Public ReadOnly Address As String + Public ReadOnly Property Address As String ''' ''' The name of the function that creates the server is uses to establish the file to be downloaded From 8989c3e4637ee238a7ffdd80588e1b505b0366de Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 23:32:04 -0800 Subject: [PATCH 117/342] Fix StartsWith comparison without Culture --- .../UnitTests/System/Windows/Forms/NetworkDownloadTests.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 3ad7ebd8412..baf697c26d2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -39,7 +39,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests listener.Stop() listener.Close() If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then - Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath)) + Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) Directory.Delete(tmpDirectoryPath, recursive:=True) End If End Sub From 230f132812ff5870734f646b73b0e9cbb6aab72f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 23 Mar 2024 00:48:10 -0700 Subject: [PATCH 118/342] Fix file name spelling error and formatting --- .../src/Microsoft.VisualBasic.Forms.vbproj | 4 ---- .../VisualBasic/ApplicationServices/AssemblyInfo.vb | 2 ++ .../WindowsFormsApplicationBase.WinFormsAppContext.vb | 1 + .../ApplicationServices/WindowsFormsApplicationBase.vb | 1 - .../VisualBasic/CompilerServices/ExceptionUtils.vb | 1 - .../Microsoft/VisualBasic/CompilerServices/Utils.vb | 1 - .../src/Microsoft/VisualBasic/Devices/ComputerInfo.vb | 10 ++++++++++ .../VisualBasic/Devices/Network/NetworkAvailability.vb | 1 - .../Devices/Network/NetworkAvailableEventArgs.vb | 2 +- .../VisualBasic/Devices/Network/NetworkDownload.vb | 3 +-- .../VisualBasic/Devices/Network/NetworkPing.vb | 1 - .../VisualBasic/Devices/Network/NetworkUpload.vb | 1 - .../VisualBasic/Devices/Network/WebClientExtended.vb | 1 - .../Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb | 3 +-- .../VisualBasic/MyServices/SpecialDirectoriesProxy.vb | 1 - .../Properties/{AssembtyInfo.vb => AssemblyInfo.vb} | 0 16 files changed, 16 insertions(+), 17 deletions(-) rename src/Microsoft.VisualBasic.Forms/src/Properties/{AssembtyInfo.vb => AssemblyInfo.vb} (100%) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index bec235eef91..5375d68c271 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -45,10 +45,6 @@ - - - - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index b2a270d17b1..68878982fe0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -236,10 +236,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since these properties will not change during runtime, they're cached. ' "" is not Nothing so use Nothing to mark an un-accessed property. Private _description As String ' Cache the assembly's description. + Private _title As String ' Cache the assembly's title. Private _productName As String ' Cache the assembly's product name. Private _companyName As String ' Cache the assembly's company name. Private _trademark As String ' Cache the assembly's trademark. Private _copyright As String ' Cache the assembly's copyright. + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 38bec70b21a..66c61b2d421 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -49,6 +49,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub + End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 4fcd80b563f..2fc5f5f4b85 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -1027,5 +1027,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 2dc68959b83..c5e8528e436 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -147,5 +147,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb index 5fa91066fab..94df154a692 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -18,5 +18,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index b6e94972129..21bb0dcdcd4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -21,6 +21,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:=" + ''' ''' Gets the total size of physical memory on the machine. ''' @@ -70,6 +71,7 @@ Namespace Microsoft.VisualBasic.Devices Return MemoryStatus.AvailableVirtualMemory End Get End Property + #Enable Warning IDE0049 ' Simplify Names ''' @@ -119,11 +121,13 @@ Namespace Microsoft.VisualBasic.Devices ''' so we offer a view that doesn't have that field. ''' Friend NotInheritable Class ComputerInfoDebugView + Public Sub New(RealClass As ComputerInfo) _instanceBeingWatched = RealClass End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= + Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get @@ -151,6 +155,7 @@ Namespace Microsoft.VisualBasic.Devices Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property + #Enable Warning IDE0049 ' Simplify Names @@ -176,6 +181,7 @@ Namespace Microsoft.VisualBasic.Devices Private ReadOnly _instanceBeingWatched As ComputerInfo + End Class ''' @@ -197,10 +203,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Calls GlobalMemoryStatusEx and returns the correct value. ''' Private NotInheritable Class InternalMemoryStatus + Friend Sub New() End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= + Friend ReadOnly Property TotalPhysicalMemory() As UInt64 Get Refresh() @@ -228,6 +236,7 @@ Namespace Microsoft.VisualBasic.Devices Return _memoryStatusEx.ullAvailVirtual End Get End Property + #Enable Warning IDE0049 ' Simplify Names Private Sub Refresh() @@ -239,6 +248,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX + End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index ad0ca236cb7..d1cdcf0d97c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -125,5 +125,4 @@ Namespace Microsoft.VisualBasic.Devices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb index 5cd8c3a3d0a..5413098f516 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Namespace Microsoft.VisualBasic.Devices + ''' ''' Used to pass network connectivity status. ''' @@ -14,5 +15,4 @@ Namespace Microsoft.VisualBasic.Devices Public ReadOnly Property IsNetworkAvailable() As Boolean End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 21efe13730c..14452da1915 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -303,7 +303,7 @@ Namespace Microsoft.VisualBasic.Devices 'Download the file Try Await copier.DownloadFileAsync(address:=addressUri, - destinationFileName:=fullFilename).ConfigureAwait(continueOnCapturedContext:=False) + destinationFileName:=fullFilename).ConfigureAwait(continueOnCapturedContext:=False) Catch ex As Exception If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then Throw @@ -798,5 +798,4 @@ Namespace Microsoft.VisualBasic.Devices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index 35b69d9a43b..bfb915bf6e2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -95,5 +95,4 @@ Namespace Microsoft.VisualBasic.Devices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index ef5245bd36f..2f250cbdc90 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -231,5 +231,4 @@ Namespace Microsoft.VisualBasic.Devices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb index 1ea3c454ac3..0fa08922fd7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -74,5 +74,4 @@ Namespace Microsoft.VisualBasic.Devices End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index e9445f00f5e..63c365ff5dd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -27,7 +27,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Private Sub New() End Sub - End Class + End Class End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb index a28c07a16b3..e131c29b90e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb @@ -73,5 +73,4 @@ Namespace Microsoft.VisualBasic.MyServices End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/src/Properties/AssembtyInfo.vb rename to src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb From be04fef5e835e23c15bb74f7aae926de756595d0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 27 Mar 2024 22:47:37 -0700 Subject: [PATCH 119/342] Merge some code cleanup Fix DocumentComments to include an extra space --- .../ApplicationServices/ApplicationBase.vb | 42 +++-- .../ApplyApplicationDefaultsEventArgs.vb | 14 +- .../ApplicationServices/AssemblyInfo.vb | 36 ++-- .../CantStartSingleInstanceException.vb | 4 +- .../ConsoleApplicationBase.vb | 24 ++- .../NoStartupFormException.vb | 2 +- .../ApplicationServices/StartupEventArgs.vb | 7 +- .../StartupNextInstanceEventArgs.vb | 17 +- .../UnhandledExceptionEventArgs.vb | 5 +- .../VisualBasic/ApplicationServices/User.vb | 18 +- ...FormsApplicationBase.WinFormsAppContext.vb | 14 +- .../WindowsFormsApplicationBase.vb | 175 +++++++++--------- .../CompilerServices/ExceptionUtils.vb | 22 +-- .../Microsoft/VisualBasic/Devices/Audio.vb | 8 +- .../Microsoft/VisualBasic/Devices/Clock.vb | 14 +- .../Microsoft/VisualBasic/Devices/Computer.vb | 14 +- .../VisualBasic/Devices/ComputerInfo.vb | 40 ++-- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 19 +- .../Microsoft/VisualBasic/Devices/Mouse.vb | 18 +- .../VisualBasic/Devices/ServerComputer.vb | 24 +-- .../VisualBasic/Helpers/FileSystemUtils.vb | 10 +- .../VisualBasic/Helpers/NativeMethods.vb | 6 +- .../VisualBasic/Helpers/NativeTypes.vb | 29 +-- .../VisualBasic/Helpers/SafeNativeMethods.vb | 2 +- .../Helpers/UnsafeNativeMethods.vb | 19 +- .../VisualBasic/Helpers/VBInputBox.vb | 1 + .../Logging/FileLogTraceListener.vb | 136 +++++++------- .../src/Microsoft/VisualBasic/Logging/Log.vb | 45 ++--- .../VisualBasic/MyServices/ClipboardProxy.vb | 52 +++--- .../VisualBasic/MyServices/FileSystemProxy.vb | 4 +- .../MyServices/Internal/ContextValue.vb | 15 +- .../MyServices/Internal/HttpClientCopy.vb | 19 +- .../MyServices/Internal/ProgressDialog.vb | 27 ++- .../MyServices/Internal/WebClientCopy.vb | 16 +- .../VisualBasic/MyServices/RegistryProxy.vb | 5 +- .../MyServices/SpecialDirectoriesProxy.vb | 4 +- 36 files changed, 464 insertions(+), 443 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index d471e676844..aef0f95b5b3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -8,8 +8,8 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Abstract class that defines the application Startup/Shutdown model for VB - ''' Windows Applications such as console, WinForms, dll, service. + ''' Abstract class that defines the application Startup/Shutdown model for VB + ''' Windows Applications such as console, WinForms, dll, service. ''' Public Class ApplicationBase @@ -17,7 +17,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the value of the specified environment variable. + ''' Returns the value of the specified environment variable. ''' ''' A String containing the name of the environment variable. ''' A string containing the value of the environment variable. @@ -37,10 +37,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Provides access to logging capability. + ''' Provides access to logging capability. ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' Public ReadOnly Property Log() As Logging.Log Get If _log Is Nothing Then @@ -51,8 +53,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the info about the application. If we are executing in a DLL, we still return the info - ''' about the application, not the DLL. + ''' Returns the info about the application. If we are executing in a DLL, we still return the info + ''' about the application, not the DLL. ''' Public ReadOnly Property Info() As AssemblyInfo Get @@ -65,7 +67,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the information about the current culture used by the current thread. + ''' Gets the information about the current culture used by the current thread. ''' Public ReadOnly Property Culture() As Globalization.CultureInfo Get @@ -74,12 +76,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the information about the current culture used by the Resource - ''' Manager to look up culture-specific resource at run time. + ''' Gets the information about the current culture used by the Resource + ''' Manager to look up culture-specific resource at run time. ''' ''' - ''' The CultureInfo object that represents the culture used by the - ''' Resource Manager to look up culture-specific resources at run time. + ''' The CultureInfo object that represents the culture used by the + ''' Resource Manager to look up culture-specific resources at run time. ''' Public ReadOnly Property UICulture() As Globalization.CultureInfo Get @@ -88,23 +90,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Changes the culture currently in used by the current thread. + ''' Changes the culture currently in used by the current thread. ''' ''' - ''' CultureInfo constructor will throw exceptions if cultureName is Nothing - ''' or an invalid CultureInfo ID. We are not catching those exceptions. + ''' CultureInfo constructor will throw exceptions if cultureName is Nothing + ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeCulture(cultureName As String) Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) End Sub ''' - ''' Changes the culture currently used by the Resource Manager to look - ''' up culture-specific resource at runtime. + ''' Changes the culture currently used by the Resource Manager to look + ''' up culture-specific resource at runtime. ''' ''' - ''' CultureInfo constructor will throw exceptions if cultureName is Nothing - ''' or an invalid CultureInfo ID. We are not catching those exceptions. + ''' CultureInfo constructor will throw exceptions if cultureName is Nothing + ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeUICulture(cultureName As String) Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 206bbaf0344..0033ac0ad62 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -9,7 +9,7 @@ Imports System.Windows.Forms Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the ApplyApplicationDefaults event. + ''' Provides context for the ApplyApplicationDefaults event. ''' Public Class ApplyApplicationDefaultsEventArgs @@ -22,25 +22,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. + ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. ''' ''' - ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the - ''' application is applied by setting this property with a value different than nothing. + ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the + ''' application is applied by setting this property with a value different than nothing. ''' Public Property Font As Font ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. ''' Public Property MinimumSplashScreenDisplayTime As Integer = WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT ''' - ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. + ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' ''' - ''' The default value for this property is SystemAware. + ''' The default value for this property is SystemAware. ''' Public Property HighDpiMode As HighDpiMode diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 68878982fe0..eb71cdc4b5a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -12,12 +12,14 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' specified using the assembly attributes (contained in AssemblyInfo.vb file in case of ''' a VB project in Visual Studio .NET). ''' - ''' This class is based on the FileVersionInfo class of the framework, but - ''' reduced to a number of relevant properties. + ''' + ''' This class is based on the FileVersionInfo class of the framework, but + ''' reduced to a number of relevant properties. + ''' Public Class AssemblyInfo ''' - ''' Creates an AssemblyInfo from an assembly + ''' Creates an AssemblyInfo from an assembly ''' ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) @@ -28,7 +30,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the description associated with the assembly. + ''' Gets the description associated with the assembly. ''' ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. ''' if the AssemblyDescriptionAttribute is not defined. @@ -48,7 +50,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the company name associated with the assembly. + ''' Gets the company name associated with the assembly. ''' ''' A String containing the AssemblyCompanyAttribute associated with the assembly. ''' if the AssemblyCompanyAttribute is not defined. @@ -68,7 +70,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the title associated with the assembly. + ''' Gets the title associated with the assembly. ''' ''' A String containing the AssemblyTitleAttribute associated with the assembly. ''' if the AssemblyTitleAttribute is not defined. @@ -88,7 +90,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the copyright notices associated with the assembly. + ''' Gets the copyright notices associated with the assembly. ''' ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. ''' if the AssemblyCopyrightAttribute is not defined. @@ -107,7 +109,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the trademark notices associated with the assembly. ''' ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. ''' if the AssemblyTrademarkAttribute is not defined. @@ -126,7 +128,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the product name associated with the assembly. + ''' Gets the product name associated with the assembly. ''' ''' A String containing the AssemblyProductAttribute associated with the assembly. ''' if the AssemblyProductAttribute is not defined. @@ -145,7 +147,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the version number of the assembly. + ''' Gets the version number of the assembly. ''' ''' A System.Version class containing the version number of the assembly ''' Cannot use AssemblyVersionAttribute since it always return Nothing. @@ -156,7 +158,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' ''' A String containing the file name. Public ReadOnly Property AssemblyName() As String @@ -166,7 +168,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the directory where the assembly lives. + ''' Gets the directory where the assembly lives. ''' Public ReadOnly Property DirectoryPath() As String Get @@ -175,7 +177,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the names of all assemblies loaded by the current application. + ''' Returns the names of all assemblies loaded by the current application. ''' ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. ''' attempt on an unloaded application domain. @@ -190,7 +192,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the current stack trace information. + ''' Returns the current stack trace information. ''' ''' A string containing stack trace information. Value can be String.Empty. ''' The requested stack trace information is out of range. @@ -201,10 +203,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the amount of physical memory mapped to the process context. + ''' Gets the amount of physical memory mapped to the process context. ''' ''' - ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. + ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. ''' Public ReadOnly Property WorkingSet() As Long Get @@ -213,7 +215,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. + ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. ''' ''' The type of the required attribute. ''' The attribute with the given type gotten from the assembly, or Nothing. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index dca6f506888..74de0ae78c2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -7,8 +7,8 @@ Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when we launch a single-instance application and it can't connect with the - ''' original instance. + ''' Exception for when we launch a single-instance application and it can't connect with the + ''' original instance. ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 5361c7d0b92..d6dd772e365 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -6,17 +6,19 @@ Imports System.ComponentModel Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Abstract class that defines the application Startup/Shutdown model for VB - ''' Windows Applications such as console, winforms, dll, service. + ''' Abstract class that defines the application Startup/Shutdown model for VB + ''' Windows Applications such as console, winforms, dll, service. ''' Public Class ConsoleApplicationBase : Inherits ApplicationBase ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' - ''' We have to have a parameterless constructor because the platform specific Application - ''' object derives from this one and it doesn't define a constructor. The partial class generated by the - ''' designer defines the constructor in order to configure the application. + ''' + ''' We have to have a parameterless constructor because the platform specific Application + ''' object derives from this one and it doesn't define a constructor. The partial class generated by the + ''' designer defines the constructor in order to configure the application. + ''' Public Sub New() MyBase.New() End Sub @@ -24,8 +26,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Returns the command line arguments for the current application. ''' - ''' This function differs from System.Environment.GetCommandLineArgs in that the - ''' path of the executing file (the 0th entry) is omitted from the returned collection + ''' + ''' This function differs from System.Environment.GetCommandLineArgs in that the + ''' path of the executing file (the 0th entry) is omitted from the returned collection + ''' Public ReadOnly Property CommandLineArgs() As ObjectModel.ReadOnlyCollection(Of String) Get If _commandLineArgs Is Nothing Then @@ -44,8 +48,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this - ''' for instance because we snag the command line from Main(). + ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this + ''' for instance because we snag the command line from Main(). ''' Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 12ac806163b..e07e101b40b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -7,7 +7,7 @@ Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when the WinForms VB application model isn't supplied with a startup form + ''' Exception for when the WinForms VB application model isn't supplied with a startup form ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index b2b5d5a4ff3..f99c8d63713 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -8,14 +8,14 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the Startup event. + ''' Provides context for the Startup event. ''' Public Class StartupEventArgs Inherits CancelEventArgs ''' - ''' Creates a new instance of the StartupEventArgs. + ''' Creates a new instance of the StartupEventArgs. ''' Public Sub New(args As ReadOnlyCollection(Of String)) If args Is Nothing Then @@ -26,8 +26,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the command line sent to this application + ''' Returns the command line sent to this application ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index c34bf4c1f50..12f1526872e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -7,14 +7,14 @@ Imports System.ComponentModel Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the StartupNextInstance event. + ''' Provides context for the StartupNextInstance event. ''' Public Class StartupNextInstanceEventArgs Inherits EventArgs ''' - ''' Creates a new instance of the StartupNextInstanceEventArgs. + ''' Creates a new instance of the StartupNextInstanceEventArgs. ''' Public Sub New(args As ReadOnlyCollection(Of String), bringToForegroundFlag As Boolean) If args Is Nothing Then @@ -26,16 +26,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Indicates whether we will bring the application to the foreground when processing the - ''' StartupNextInstance event. + ''' Indicates whether we will bring the application to the foreground when processing the + ''' StartupNextInstance event. ''' Public Property BringToForeground() As Boolean ''' - ''' Returns the command line sent to this application + ''' Returns the command line sent to this application ''' - ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they - ''' always return the same values + ''' + ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they + ''' always return the same values + ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index e8a43f13dac..627c2568d09 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -8,7 +8,7 @@ Imports System.Threading Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides the exception encountered along with a flag on whether to abort the program + ''' Provides the exception encountered along with a flag on whether to abort the program ''' Public Class UnhandledExceptionEventArgs @@ -20,8 +20,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Indicates whether the application should exit upon exiting the exception handler + ''' Indicates whether the application should exit upon exiting the exception handler ''' Public Property ExitApplication() As Boolean + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index 590b352f1c1..25ef7c8acae 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -8,18 +8,18 @@ Imports System.Threading Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Class abstracting the computer user + ''' Class abstracting the computer user ''' Public Class User ''' - ''' Creates an instance of User + ''' Creates an instance of User ''' Public Sub New() End Sub ''' - ''' The name of the current user + ''' The name of the current user ''' Public ReadOnly Property Name() As String Get @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' The current IPrincipal which represents the current user + ''' The current IPrincipal which represents the current user ''' ''' An IPrincipal representing the current user @@ -42,7 +42,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Indicates whether or not the current user has been authenticated. + ''' Indicates whether or not the current user has been authenticated. ''' Public ReadOnly Property IsAuthenticated() As Boolean Get @@ -51,7 +51,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Indicates whether or not the current user is a member of the passed in role + ''' Indicates whether or not the current user is a member of the passed in role ''' ''' The name of the role ''' True if the user is a member of the role otherwise False @@ -60,12 +60,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' The principal representing the current user. + ''' The principal representing the current user. ''' ''' An IPrincipal representing the current user ''' - ''' This should be overridden by derived classes that don't get the current - ''' user from the current thread + ''' This should be overridden by derived classes that don't get the current + ''' user from the current thread ''' Protected Overridable Property InternalPrincipal() As IPrincipal Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 66c61b2d421..e7bf1f2268a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -9,10 +9,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Partial Public Class WindowsFormsApplicationBase ''' - ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we - ''' offer in the application model. This derivation of the ApplicationContext listens for when - ''' the main form closes and provides for shutting down when the main form closes or the - ''' last form closes, depending on the mode this application is running in. + ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we + ''' offer in the application model. This derivation of the ApplicationContext listens for when + ''' the main form closes and provides for shutting down when the main form closes or the + ''' last form closes, depending on the mode this application is running in. ''' Private NotInheritable Class WinFormsAppContext Inherits ApplicationContext @@ -24,9 +24,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the two types of application shutdown: - ''' 1 - shutdown when the main form closes - ''' 2 - shutdown only after the last form closes + ''' Handles the two types of application shutdown: + ''' 1 - shutdown when the main form closes + ''' 2 - shutdown only after the last form closes ''' ''' ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 2fc5f5f4b85..ede8df2bb3c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -28,58 +28,58 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Enum ''' - ''' Signature for the ApplyApplicationDefaults event handler. + ''' Signature for the ApplyApplicationDefaults event handler. ''' Public Delegate Sub ApplyApplicationDefaultsEventHandler(sender As Object, e As ApplyApplicationDefaultsEventArgs) ''' - ''' Signature for the Startup event handler. + ''' Signature for the Startup event handler. ''' Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) ''' - ''' Signature for the StartupNextInstance event handler. + ''' Signature for the StartupNextInstance event handler. ''' Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) ''' - ''' Signature for the Shutdown event handler. + ''' Signature for the Shutdown event handler. ''' Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) ''' - ''' Signature for the UnhandledException event handler. + ''' Signature for the UnhandledException event handler. ''' Public Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As UnhandledExceptionEventArgs) ''' - ''' Provides the infrastructure for the VB Windows Forms application model. + ''' Provides the infrastructure for the VB Windows Forms application model. ''' ''' Don't put access on this definition. Partial Public Class WindowsFormsApplicationBase : Inherits ConsoleApplicationBase ''' - ''' Occurs when the application is ready to accept default values for various application areas. + ''' Occurs when the application is ready to accept default values for various application areas. ''' Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler ''' - ''' Occurs when the application starts. + ''' Occurs when the application starts. ''' Public Event Startup As StartupEventHandler ''' - ''' Occurs when attempting to start a single-instance application and the application is already active. + ''' Occurs when attempting to start a single-instance application and the application is already active. ''' Public Event StartupNextInstance As StartupNextInstanceEventHandler ''' - ''' Occurs when the application shuts down. + ''' Occurs when the application shuts down. ''' Public Event Shutdown As ShutdownEventHandler @@ -142,7 +142,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware ''' - ''' Occurs when the network availability changes. + ''' Occurs when the network availability changes. ''' Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only @@ -212,7 +212,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Event ''' - ''' Occurs when the application encounters an unhandled exception. + ''' Occurs when the application encounters an unhandled exception. ''' Public Custom Event UnhandledException As UnhandledExceptionEventHandler @@ -264,18 +264,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Event ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' ''' - ''' We have to have a parameterless ctor because the platform specific Application object - ''' derives from this one and it doesn't define a ctor because the partial class generated by the - ''' designer does that to configure the application. + ''' We have to have a parameterless ctor because the platform specific Application object + ''' derives from this one and it doesn't define a ctor because the partial class generated by the + ''' designer does that to configure the application. Public Sub New() Me.New(AuthenticationMode.Windows) End Sub ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' Public Sub New(authenticationMode As AuthenticationMode) @@ -310,7 +310,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model + ''' Entry point to kick off the VB Startup/Shutdown Application model ''' ''' The command line from Main() @@ -358,9 +358,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. + ''' Returns the collection of forms that are open. We no longer have thread + ''' affinity meaning that this is the WinForms collection that contains Forms that may + ''' have been opened on another thread then the one we are calling in on right now. ''' Public ReadOnly Property OpenForms() As FormCollection Get @@ -369,7 +369,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides access to the main form for this application + ''' Provides access to the main form for this application ''' Protected Property MainForm() As Form Get @@ -387,7 +387,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides access to the splash screen for this application + ''' Provides access to the splash screen for this application ''' Public Property SplashScreen() As Form Get @@ -405,17 +405,17 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' The splash screen timeout specifies whether there is a minimum time that the splash - ''' screen should be displayed for. When not set then the splash screen is hidden - ''' as soon as the main form becomes active. + ''' The splash screen timeout specifies whether there is a minimum time that the splash + ''' screen should be displayed for. When not set then the splash screen is hidden + ''' as soon as the main form becomes active. ''' ''' The minimum amount of time, in milliseconds, to display the splash screen. ''' - ''' This property, although public, used to be set in an `Overrides Function OnInitialize` _before_ - ''' calling `MyBase.OnInitialize`. We want to phase this out, and with the introduction of the - ''' ApplyApplicationDefaults events have it handled in that event, rather than as awkwardly - ''' as it is currently suggested to be used in the docs. - ''' First step for that is to make it hidden in IntelliSense. + ''' This property, although public, used to be set in an `Overrides Function OnInitialize` _before_ + ''' calling `MyBase.OnInitialize`. We want to phase this out, and with the introduction of the + ''' ApplyApplicationDefaults events have it handled in that event, rather than as awkwardly + ''' as it is currently suggested to be used in the docs. + ''' First step for that is to make it hidden in IntelliSense. ''' Public Property MinimumSplashScreenDisplayTime() As Integer @@ -428,10 +428,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Use GDI for the text rendering engine by default. - ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to - ''' determine how to set the text rendering flag on the WinForms application object. + ''' Use GDI for the text rendering engine by default. + ''' The user can shadow this function to return True if they want their app + ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' determine how to set the text rendering flag on the WinForms application object. ''' ''' True - Use GDI+ renderer. False - use GDI renderer @@ -442,7 +442,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides the WinForms application context that we are running on + ''' Provides the WinForms application context that we are running on ''' Public ReadOnly Property ApplicationContext() As ApplicationContext @@ -452,7 +452,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Informs My.Settings whether to save the settings on exit or not + ''' Informs My.Settings whether to save the settings on exit or not ''' Public Property SaveMySettingsOnExit() As Boolean Get @@ -471,14 +471,16 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows - ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its - ''' variants was passed in. + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its + ''' variants was passed in. ''' ''' ''' Returning True indicates that we should continue on with the application Startup sequence - ''' This extensibility point is exposed for people who want to override the Startup sequence at the earliest possible point - ''' to + ''' + ''' This extensibility point is exposed for people who want to override + ''' the Startup sequence at the earliest possible point to + ''' Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean @@ -545,7 +547,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Extensibility point which raises the Startup event + ''' Extensibility point which raises the Startup event ''' ''' @@ -576,7 +578,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Extensibility point which raises the StartupNextInstance + ''' Extensibility point which raises the StartupNextInstance ''' ''' @@ -596,8 +598,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' At this point, the command line args should have been processed and the application will create the - ''' main form and enter the message loop. + ''' At this point, the command line args should have been processed and the application will create the + ''' main form and enter the message loop. ''' @@ -639,23 +641,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' A designer will override this method and provide a splash screen if this application has one. + ''' A designer will override this method and provide a splash screen if this application has one. ''' - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + ''' For instance, a designer would override this method and emit: Me.Splash = new Splash + ''' where Splash was designated in the application designer as being the splash screen for this app + ''' Protected Overridable Sub OnCreateSplashScreen() End Sub ''' - ''' Provides a hook that designers will override to set the main form. + ''' Provides a hook that designers will override to set the main form. ''' Protected Overridable Sub OnCreateMainForm() End Sub ''' - ''' The last in a series of extensibility points for the Shutdown process + ''' The last in a series of extensibility points for the Shutdown process ''' Protected Overridable Sub OnShutdown() @@ -663,8 +667,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Raises the UnHandled exception event and exits the application if the event handler indicated - ''' that execution shouldn't continue + ''' Raises the UnHandled exception event and exits the application if the event handler indicated + ''' that execution shouldn't continue ''' ''' ''' True indicates the exception event was raised / False it was not @@ -688,8 +692,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, - ''' displays it. + ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, + ''' displays it. ''' Protected Sub ShowSplashScreen() @@ -727,10 +731,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Hide the splash screen. The splash screen was created on another thread - ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. - ''' This function gets called from the main thread by the app fx. + ''' Hide the splash screen. The splash screen was created on another thread + ''' thread (main thread) than the one it was run on (secondary thread for the + ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' This function gets called from the main thread by the app fx. ''' @@ -767,7 +771,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. + ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. ''' Protected Property EnableVisualStyles() As Boolean Get @@ -779,7 +783,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets or sets the HighDpiMode for the Application. + ''' Gets or sets the HighDpiMode for the Application. ''' Protected Property HighDpiMode() As HighDpiMode @@ -802,7 +806,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Validates that the value being passed as an AuthenticationMode enum is a legal value + ''' Validates that the value being passed as an AuthenticationMode enum is a legal value ''' ''' Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) @@ -812,7 +816,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Validates that the value being passed as an ShutdownMode enum is a legal value + ''' Validates that the value being passed as an ShutdownMode enum is a legal value ''' ''' Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) @@ -822,9 +826,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' it doesn't freeze up while the main form is getting it together. ''' Private Sub DisplaySplash() Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") @@ -840,10 +844,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. - ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. + ''' If a splash screen has a minimum time out, then once that is up we check to see whether + ''' we should close the splash screen. If the main form has activated then we close it. + ''' Note that we are getting called on a secondary thread here which isn't necessarily + ''' associated with any form. Don't touch forms from this function. ''' Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) @@ -858,12 +862,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The Load() event happens before the Shown and Paint events. When we get called here - ''' we know that the form load event is done and that the form is about to paint - ''' itself for the first time. - ''' We can now hide the splash screen. - ''' Note that this function gets called from the main thread - the same thread - ''' that creates the startup form. + ''' The Load() event happens before the Shown and Paint events. When we get called here + ''' we know that the form load event is done and that the form is about to paint + ''' itself for the first time. + ''' We can now hide the splash screen. + ''' Note that this function gets called from the main thread - the same thread + ''' that creates the startup form. ''' ''' ''' @@ -892,12 +896,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event ''' ''' - ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' unhandled exception event so we do the translation here before raising our event. + ''' + ''' Our UnHandledException event has a different signature then the Windows.Forms.Application + ''' unhandled exception event so we do the translation here before raising our event. ''' Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) @@ -935,8 +940,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event + ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the + ''' NetworkAvailabilityChanged event ''' ''' Contains the Network instance that raised the event ''' Contains whether the network is available or not @@ -945,7 +950,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Runs the user's program through the VB Startup/Shutdown application model + ''' Runs the user's program through the VB Startup/Shutdown application model ''' Private Sub DoApplicationModel() @@ -1001,8 +1006,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. ''' ''' A string unique to the application that should be the same for versions of ''' the application that have the same Major and Minor Version Number diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index c5e8528e436..f15bf71655c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -45,7 +45,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. @@ -60,7 +60,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." + ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." ''' ''' The name of the argument (parameter). Not localized. ''' A new instance of ArgumentNullException. @@ -70,7 +70,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentNullException with the message from resource file. + ''' Returns a new instance of ArgumentNullException with the message from resource file. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. @@ -84,7 +84,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. + ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. @@ -96,7 +96,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. + ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. ''' ''' The file name (path) of the not found file. ''' The resource ID. @@ -109,7 +109,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of InvalidOperationException with the message from resource file. + ''' Returns a new instance of InvalidOperationException with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. @@ -121,27 +121,25 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.IOException with the message from resource file. + ''' Returns a new instance of IO.IOException with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.IOException. - Friend Shared Function GetIOException(ResourceID As String, - ParamArray PlaceHolders() As String) As IO.IOException + Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' - ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. + ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Shared Function GetWin32Exception(ResourceID As String, - ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception + Friend Shared Function GetWin32Exception(ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index fc6da90eb61..0ed0794f3a7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -38,12 +38,12 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays a .wav file in the passed in mode + ''' Plays a .wav file in the passed in mode ''' ''' The name of the file ''' - ''' An enum value representing the mode, Background (async), - ''' WaitToComplete (sync) or BackgroundLoop + ''' An enum value representing the mode, Background (async), + ''' WaitToComplete (sync) or BackgroundLoop ''' Public Sub Play(location As String, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) @@ -146,7 +146,7 @@ Namespace Microsoft.VisualBasic End Function ''' - ''' Validates that the value being passed as an AudioPlayMode enum is a legal value + ''' Validates that the value being passed as an AudioPlayMode enum is a legal value ''' ''' Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index b1150b27c1d..9a0ec54011e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -4,13 +4,13 @@ Namespace Microsoft.VisualBasic.Devices ''' - ''' A wrapper object that acts as a discovery mechanism to quickly find out - ''' the current local time of the machine and the GMT time. + ''' A wrapper object that acts as a discovery mechanism to quickly find out + ''' the current local time of the machine and the GMT time. ''' Public Class Clock ''' - ''' Gets a Date that is the current local date and time on this computer. + ''' Gets a Date that is the current local date and time on this computer. ''' ''' A Date whose value is the current date and time. #Disable Warning IDE0049 ' Simplify Names, Justification:= @@ -21,8 +21,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets a DateTime that is the current local date and time on this - ''' computer expressed as GMT time. + ''' Gets a DateTime that is the current local date and time on this + ''' computer expressed as GMT time. ''' ''' A Date whose value is the current date and time expressed as GMT time. Public ReadOnly Property GmtTime() As DateTime @@ -33,8 +33,8 @@ Namespace Microsoft.VisualBasic.Devices #Enable Warning IDE0049 ' Simplify Names ''' - ''' This property wraps the Environment.TickCount property to get the - ''' number of milliseconds elapsed since the system started. + ''' This property wraps the Environment.TickCount property to get the + ''' number of milliseconds elapsed since the system started. ''' ''' An Integer containing the amount of time in milliseconds. Public ReadOnly Property TickCount() As Integer diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index 362baf53a0c..6efa0c043e3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.Devices ' If you dim them up yourself, you are responsible for managing the threading. ''' - ''' Gets an Audio object which can play sound files or resources. + ''' Gets an Audio object which can play sound files or resources. ''' ''' A sound object. Public ReadOnly Property Audio() As Audio @@ -36,7 +36,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' A thin wrapper for System.Windows.Forms.Clipboard + ''' A thin wrapper for System.Windows.Forms.Clipboard ''' ''' An object representing the clipboard Public ReadOnly Property Clipboard() As ClipboardProxy @@ -50,8 +50,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Mouse object containing information about - ''' the physical mouse installed to the machine. + ''' This property returns the Mouse object containing information about + ''' the physical mouse installed to the machine. ''' ''' An instance of the Mouse class. Public ReadOnly Property Mouse() As Mouse @@ -63,8 +63,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Keyboard object representing some - ''' keyboard properties and a send keys method + ''' This property returns the Keyboard object representing some + ''' keyboard properties and a send keys method ''' ''' An instance of the Keyboard class. Public ReadOnly Property Keyboard() As Keyboard @@ -76,7 +76,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the primary display screen. + ''' This property returns the primary display screen. ''' ''' A System.Windows.Forms.Screen object as the primary screen. Public ReadOnly Property Screen() As Screen diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 21bb0dcdcd4..10b91950695 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -7,7 +7,7 @@ Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.Devices ''' - ''' Provides configuration information about the current computer and the current process. + ''' Provides configuration information about the current computer and the current process. ''' Public Class ComputerInfo @@ -15,7 +15,7 @@ Namespace Microsoft.VisualBasic.Devices ' Keep the debugger proxy current as you change this class - see the nested ComputerInfoDebugView below. ''' - ''' Default constructor + ''' Default constructor ''' Public Sub New() End Sub @@ -23,7 +23,7 @@ Namespace Microsoft.VisualBasic.Devices #Disable Warning IDE0049 ' Simplify Names, Justification:=" ''' - ''' Gets the total size of physical memory on the machine. + ''' Gets the total size of physical memory on the machine. ''' ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. ''' If we are unable to obtain the memory status. @@ -35,7 +35,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of free physical memory on the machine. + ''' Gets the total size of free physical memory on the machine. ''' ''' A 64-bit unsigned integer containing the size of free physical memory on the machine, in bytes. ''' If we are unable to obtain the memory status. @@ -47,10 +47,12 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of user potion of virtual address space for calling process. + ''' Gets the total size of user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, - ''' in bytes. + ''' + ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, + ''' in bytes. + ''' ''' If we are unable to obtain the memory status. Public ReadOnly Property TotalVirtualMemory() As UInt64 @@ -60,10 +62,12 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of free user potion of virtual address space for calling process. + ''' Gets the total size of free user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, - ''' in bytes. + ''' + ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, + ''' in bytes. + ''' ''' If we are unable to obtain the memory status. Public ReadOnly Property AvailableVirtualMemory() As UInt64 @@ -75,7 +79,7 @@ Namespace Microsoft.VisualBasic.Devices #Enable Warning IDE0049 ' Simplify Names ''' - ''' Gets the current UICulture installed on the machine. + ''' Gets the current UICulture installed on the machine. ''' ''' A CultureInfo object represents the UI culture installed on the machine. Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -85,7 +89,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the full operating system name. + ''' Gets the full operating system name. ''' ''' A string contains the operating system name. Public ReadOnly Property OSFullName() As String @@ -95,7 +99,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the platform OS name. + ''' Gets the platform OS name. ''' ''' A string containing a Platform ID like "Win32NT", "Win32S", "Win32Windows". See PlatformID enum. ''' If cannot obtain the OS Version information. @@ -106,7 +110,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the current version number of the operating system. + ''' Gets the current version number of the operating system. ''' ''' A string contains the current version number of the operating system. ''' If cannot obtain the OS Version information. @@ -117,8 +121,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger - ''' so we offer a view that doesn't have that field. + ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger + ''' so we offer a view that doesn't have that field. ''' Friend NotInheritable Class ComputerInfoDebugView @@ -185,7 +189,7 @@ Namespace Microsoft.VisualBasic.Devices End Class ''' - ''' Gets the whole memory information details. + ''' Gets the whole memory information details. ''' ''' An InternalMemoryStatus class. Private ReadOnly Property MemoryStatus() As InternalMemoryStatus @@ -200,7 +204,7 @@ Namespace Microsoft.VisualBasic.Devices Private _internalMemoryStatus As InternalMemoryStatus ' Cache our InternalMemoryStatus ''' - ''' Calls GlobalMemoryStatusEx and returns the correct value. + ''' Calls GlobalMemoryStatusEx and returns the correct value. ''' Private NotInheritable Class InternalMemoryStatus diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 3f1d7fa461b..60470adc84f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.Devices Public Class Keyboard ''' - ''' Sends keys to the active window as if typed as keyboard with wait = false. + ''' Sends keys to the active window as if typed as keyboard with wait = false. ''' ''' A string containing the keys to be sent (typed). Public Sub SendKeys(keys As String) @@ -21,8 +21,8 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Sends keys to the active window as if typed at keyboard. This overloaded - ''' version uses the same conventions as the VB6 SendKeys. + ''' Sends keys to the active window as if typed at keyboard. This overloaded + ''' version uses the same conventions as the VB6 SendKeys. ''' ''' A string containing the keys to be sent (typed). ''' Wait for messages to be processed before returning. @@ -35,7 +35,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Gets the state (up or down) of the Shift key. + ''' Gets the state (up or down) of the Shift key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property ShiftKeyDown() As Boolean @@ -46,7 +46,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the state (up or down) of the Alt key. + ''' Gets the state (up or down) of the Alt key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property AltKeyDown() As Boolean @@ -57,7 +57,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the state (up or down) of the Ctrl key. + ''' Gets the state (up or down) of the Ctrl key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property CtrlKeyDown() As Boolean @@ -68,7 +68,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the toggle state of the Caps Lock key. + ''' Gets the toggle state of the Caps Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property CapsLock() As Boolean @@ -82,7 +82,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the toggle state of the Num Lock key. + ''' Gets the toggle state of the Num Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property NumLock() As Boolean @@ -96,7 +96,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the toggle state of the Scroll Lock key. + ''' Gets the toggle state of the Scroll Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property ScrollLock() As Boolean @@ -108,5 +108,6 @@ Namespace Microsoft.VisualBasic.Devices Return CType((UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1), Boolean) End Get End Property + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index f09317e928f..ff3240b2629 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -7,20 +7,20 @@ Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices ''' - ''' A wrapper object that acts as a discovery mechanism for finding - ''' information about the mouse on your computer such as whether the mouse - ''' exists, the number of buttons, WheelScrolls details. + ''' A wrapper object that acts as a discovery mechanism for finding + ''' information about the mouse on your computer such as whether the mouse + ''' exists, the number of buttons, WheelScrolls details. ''' - ''' This class is a Singleton Class. See Common.Computer for details. + ''' This class is a Singleton Class. See Common.Computer for details. ''' Public Class Mouse ''' - ''' Gets a value indicating whether the functions of the left and right - ''' mouses buttons have been swapped. + ''' Gets a value indicating whether the functions of the left and right + ''' mouses buttons have been swapped. ''' ''' - ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. + ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. ''' ''' If no mouse is installed. Public ReadOnly Property ButtonsSwapped() As Boolean @@ -34,7 +34,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets a value indicating whether a mouse with a mouse wheel is installed + ''' Gets a value indicating whether a mouse with a mouse wheel is installed ''' ''' true if a mouse with a mouse wheel is installed, false otherwise. ''' If no mouse is installed. @@ -49,7 +49,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the number of lines to scroll when the mouse wheel is rotated. + ''' Gets the number of lines to scroll when the mouse wheel is rotated. ''' ''' The number of lines to scroll. ''' if no mouse is installed or no wheels exists. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index f0075c299ce..6a69169188c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -6,9 +6,9 @@ Imports Microsoft.VisualBasic.MyServices Namespace Microsoft.VisualBasic.Devices ''' - ''' A RAD object representing the server 'computer' for the web/Windows Services - ''' that serves as a discovery mechanism for finding principle abstractions in - ''' the system that you can code against + ''' A RAD object representing the server 'computer' for the web/Windows Services + ''' that serves as a discovery mechanism for finding principle abstractions in + ''' the system that you can code against ''' Public Class ServerComputer @@ -19,7 +19,7 @@ Namespace Microsoft.VisualBasic.Devices 'If you dim them up yourself, you are responsible for managing the threading. ''' - ''' Returns the Clock object which contains the LocalTime and GMTTime. + ''' Returns the Clock object which contains the LocalTime and GMTTime. ''' Public ReadOnly Property Clock() As Clock Get @@ -30,7 +30,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the object representing the file system of the computer. + ''' Gets the object representing the file system of the computer. ''' ''' A System.IO.FileSystem object. ''' The instance returned by this property is lazy initialized and cached. @@ -44,7 +44,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the object representing information about the computer's state + ''' Gets the object representing information about the computer's state ''' ''' A Microsoft.VisualBasic.MyServices.ComputerInfo object. ''' The instance returned by this property is lazy initialized and cached. @@ -58,8 +58,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Network object containing information about - ''' the network the machine is part of. + ''' This property returns the Network object containing information about + ''' the network the machine is part of. ''' ''' An instance of the Network.Network class. Public ReadOnly Property Network() As Network @@ -71,8 +71,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property wraps the System.Environment.MachineName property - ''' in the .NET framework to return the name of the computer. + ''' This property wraps the System.Environment.MachineName property + ''' in the .NET framework to return the name of the computer. ''' ''' A string containing the name of the computer. Public ReadOnly Property Name() As String @@ -82,8 +82,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the Registry object, which can be used to read, set and - ''' enumerate keys and values in the system registry. + ''' Gets the Registry object, which can be used to read, set and + ''' enumerate keys and values in the system registry. ''' ''' An instance of the RegistryProxy object Public ReadOnly Property Registry() As RegistryProxy diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 81a206fa421..760b3329127 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class FileSystemUtils ''' - ''' Normalize the path, but throw exception if the path ends with separator. + ''' Normalize the path, but throw exception if the path ends with separator. ''' ''' The input path. ''' The parameter name to include in the exception if one is raised. @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Get full path, get long format, and remove any pending separator. + ''' Get full path, get long format, and remove any pending separator. ''' ''' The path to be normalized. ''' The normalized path. @@ -35,7 +35,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Throw ArgumentException if the file path ends with a separator. + ''' Throw ArgumentException if the file path ends with a separator. ''' ''' The file path. ''' The parameter name to include in ArgumentException. @@ -104,7 +104,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Checks if the full path is a root path. + ''' Checks if the full path is a root path. ''' ''' The path to check. ''' True if FullPath is a root path, False otherwise. @@ -126,7 +126,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Removes all directory separators at the end of a path. + ''' Removes all directory separators at the end of a path. ''' ''' a full or relative path. ''' If Path is a root path, the same value. Otherwise, removes any directory separators at the end. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 1020f0ca168..691bfc3c2c2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning IDE0049 ' Simplify Names, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= ''' - ''' Contains information about the current state of both physical and virtual memory, including extended memory. + ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' Friend Structure MEMORYSTATUSEX @@ -125,7 +125,7 @@ Namespace Microsoft.VisualBasic.CompilerServices #Enable Warning IDE0049 ' Simplify Names ''' - ''' Obtains information about the system's current usage of both physical and virtual memory. + ''' Obtains information about the system's current usage of both physical and virtual memory. ''' ''' Pointer to a MEMORYSTATUSEX structure. ''' True if the function succeeds. Otherwise, False. @@ -134,7 +134,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. + ''' Adding a private constructor to prevent the compiler from generating a default constructor. ''' Private Sub New() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index b024511fb82..c95068274e8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -38,8 +38,8 @@ Namespace Microsoft.VisualBasic.CompilerServices End Class ''' - ''' Inherits SafeHandleZeroOrMinusOneIsInvalid, with additional InitialSetHandle method. - ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. + ''' Inherits SafeHandleZeroOrMinusOneIsInvalid, with additional InitialSetHandle method. + ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. ''' Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid Inherits SafeHandleZeroOrMinusOneIsInvalid @@ -56,16 +56,17 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function + End Class ''' - ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. + ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. ''' ''' - ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. - ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. - ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class - ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. + ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. + ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. + ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class + ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. ''' Friend NotInheritable Class PROCESS_INFORMATION @@ -76,15 +77,16 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub + End Class ''' - ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead - ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() - ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would - ''' and we got memory corruption problems detectable while running AppVerifier. - ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. - ''' as String so that the memory will get cleaned up. + ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead + ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() + ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would + ''' and we got memory corruption problems detectable while running AppVerifier. + ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. + ''' as String so that the memory will get cleaned up. ''' Friend NotInheritable Class STARTUPINFO @@ -152,6 +154,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose(True) GC.SuppressFinalize(Me) End Sub + End Class ' Handle Values diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index 63c365ff5dd..7a60d8626ab 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -23,7 +23,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Lib "user32" (hwnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. + ''' Adding a private constructor to prevent the compiler from generating a default constructor. ''' Private Sub New() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index c1eee7c5e2f..628b6f045d7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -9,42 +9,43 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class UnsafeNativeMethods ''' - ''' Gets the state of the specified key on the keyboard when the function - ''' is called. + ''' Gets the state of the specified key on the keyboard when the function + ''' is called. ''' ''' Integer representing the key in question. ''' - ''' The high order byte is 1 if the key is down. The low order byte is one - ''' if the key is toggled on (i.e. for keys like CapsLock) + ''' The high order byte is 1 if the key is down. The low order byte is one + ''' if the key is toggled on (i.e. for keys like CapsLock) ''' Friend Shared Function GetKeyState(KeyCode As Integer) As Short End Function ''' - ''' Frees memory allocated from the local heap. i.e. frees memory allocated - ''' by LocalAlloc or LocalReAlloc. + ''' Frees memory allocated from the local heap. i.e. frees memory allocated + ''' by LocalAlloc or LocalReAlloc. ''' Friend Shared Function LocalFree(LocalHandle As IntPtr) As IntPtr End Function ''' - ''' Used to determine how much free space is on a disk + ''' Used to determine how much free space is on a disk ''' ''' Path including drive we're getting information about ''' The amount of free space available to the current user ''' The total amount of space on the disk relative to the current user - ''' The amount of free spave on the disk. + ''' The amount of free space on the disk. ''' True if function succeeds in getting info otherwise False Friend Shared Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean End Function ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. + ''' Adding a private constructor to prevent the compiler from generating a default constructor. ''' Private Sub New() End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 6dbef6c9cea..ac088fd6ae0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -126,5 +126,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Private Sub MyCancelButton_Click(sender As Object, e As EventArgs) Close() End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 2007db39ccb..ba270e9b8fc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -13,7 +13,7 @@ Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory + ''' Options for the location of a log's directory ''' Public Enum LogFileLocation As Integer ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() @@ -25,7 +25,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for the date stamp in the name of a log file + ''' Options for the date stamp in the name of a log file ''' Public Enum LogFileCreationScheduleOption As Integer None '(default) @@ -34,7 +34,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted + ''' Options for behavior when resources are exhausted ''' Public Enum DiskSpaceExhaustedOption As Integer ThrowException @@ -42,18 +42,18 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Class for logging to a text file + ''' Class for logging to a text file ''' ''' - ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). - ''' Therefore, mark FileLogTraceListener as ComVisible(False). + ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). + ''' Therefore, mark FileLogTraceListener as ComVisible(False). ''' Public Class FileLogTraceListener Inherits TraceListener ''' - ''' Creates a FileLogTraceListener with the passed in name + ''' Creates a FileLogTraceListener with the passed in name ''' ''' The name of the listener Public Sub New(name As String) @@ -61,14 +61,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Creates a FileLogTraceListener with default name + ''' Creates a FileLogTraceListener with default name ''' Public Sub New() Me.New(DEFAULT_NAME) End Sub ''' - ''' Indicates the log's directory + ''' Indicates the log's directory ''' ''' An enum which can indicate one of several logical locations for the log Public Property Location() As LogFileLocation @@ -94,7 +94,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the stream should be flushed after every write + ''' Indicates whether or not the stream should be flushed after every write ''' ''' True if the stream should be flushed after every write, otherwise False Public Property AutoFlush() As Boolean @@ -115,8 +115,8 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' ''' True if the HostId should be included, otherwise False Public Property IncludeHostName() As Boolean @@ -136,7 +136,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten + ''' Indicates whether or not the file should be appended to or overwritten ''' ''' True if the file should be appended to, otherwise False Public Property Append() As Boolean @@ -163,8 +163,8 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user ''' ''' An enum indicating the desired behavior (do nothing, throw) Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption @@ -186,7 +186,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The name of the log file not including DateStamp, file number, Path or extension + ''' The name of the log file not including DateStamp, file number, Path or extension ''' ''' The name of the log file Public Property BaseFileName() As String @@ -234,7 +234,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day) + ''' Indicates what Date to stamp the log file with (none, first day of week, day) ''' ''' An enum indicating how to stamp the file Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption @@ -260,7 +260,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The maximum size in bytes the log file is allowed to grow to + ''' The maximum size in bytes the log file is allowed to grow to ''' ''' The maximum size Public Property MaxFileSize() As Long @@ -283,7 +283,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The amount of disk space, in bytes, that must be available after a write + ''' The amount of disk space, in bytes, that must be available after a write ''' ''' The reserved disk space Public Property ReserveDiskSpace() As Long @@ -306,7 +306,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The delimiter to be used to delimit fields in a line of output + ''' The delimiter to be used to delimit fields in a line of output ''' ''' The delimiter Public Property Delimiter() As String @@ -325,12 +325,12 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The encoding to try when opening a file. + ''' The encoding to try when opening a file. ''' ''' The encoding ''' - ''' If Append is true then this value will be trumped by the actual encoding value - ''' of the file + ''' If Append is true then this value will be trumped by the actual encoding value + ''' of the file ''' Public Property Encoding() As Encoding Get @@ -351,7 +351,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom + ''' The directory to be used if Location is set to Custom ''' ''' The name of the directory ''' This will throw if the path cannot be resolved @@ -391,7 +391,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Writes the message to the log + ''' Writes the message to the log ''' ''' The message to be written Public Overloads Overrides Sub Write(message As String) @@ -417,7 +417,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes the message to the log as a line + ''' Writes the message to the log as a line ''' ''' The message to be written Public Overloads Overrides Sub WriteLine(message As String) @@ -442,7 +442,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log ''' ''' Cache of information ''' The name of the TraceSourceListener @@ -513,7 +513,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log ''' ''' Cache of information ''' The name of the TraceSourceListener @@ -535,7 +535,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent ''' ''' Cache of information ''' The name of the TraceSourceListener @@ -553,7 +553,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent ''' ''' Cache of information ''' The name of the TraceSourceListener @@ -577,22 +577,22 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the underlying stream + ''' Flushes the underlying stream ''' Public Overrides Sub Flush() _stream?.Flush() End Sub ''' - ''' Closes the underlying stream + ''' Closes the underlying stream ''' Public Overrides Sub Close() Dispose(True) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception ''' ''' An array of attribute names Protected Overrides Function GetSupportedAttributes() As String() @@ -600,7 +600,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Makes sure stream is flushed + ''' Makes sure stream is flushed ''' ''' Protected Overrides Sub Dispose(disposing As Boolean) @@ -610,12 +610,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Gets the log file name under the current configuration. ''' ''' The log file name ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. ''' Private ReadOnly Property LogFileName() As String Get @@ -663,7 +663,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets the stream to use for writing to the log + ''' Gets the stream to use for writing to the log ''' ''' The stream Private ReadOnly Property ListenerStream() As ReferencedStream @@ -676,7 +676,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets or creates the stream used for writing to the log + ''' Gets or creates the stream used for writing to the log ''' ''' The stream Private Function GetStream() As ReferencedStream @@ -750,7 +750,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Makes sure we have an open stream + ''' Makes sure we have an open stream ''' Private Sub EnsureStreamIsOpen() If _stream Is Nothing Then @@ -759,7 +759,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Closes the stream. + ''' Closes the stream. ''' ''' This method should be safe to call whether or not there is a stream Private Sub CloseCurrentStream() @@ -775,7 +775,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the current date has changed to new day + ''' Indicates whether or not the current date has changed to new day ''' ''' True if the date has changed, otherwise False Private Function DayChanged() As Boolean @@ -783,7 +783,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Indicates whether or not the date has changed to a new week + ''' Indicates whether or not the date has changed to a new week ''' ''' True if the date has changed, otherwise False Private Function WeekChanged() As Boolean @@ -791,7 +791,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Utility to get the date of the first day of the week from the passed in date + ''' Utility to get the date of the first day of the week from the passed in date ''' ''' The date being checked Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date @@ -799,11 +799,11 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Checks for date changes and carries out appropriate actions + ''' Checks for date changes and carries out appropriate actions ''' ''' - ''' If the user has selected a DateStamp option then a change of - ''' date means we need to open a new file. + ''' If the user has selected a DateStamp option then a change of + ''' date means we need to open a new file. ''' Private Sub HandleDateChange() If LogFileCreationSchedule = LogFileCreationScheduleOption.Daily Then @@ -818,8 +818,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Checks the size of the current log plus the new entry and the free disk space against - ''' the user's limits. + ''' Checks the size of the current log plus the new entry and the free disk space against + ''' the user's limits. ''' ''' The size of what's about to be written to the file ''' True if the limits aren't trespassed, otherwise False @@ -844,7 +844,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user + ''' Returns the total amount of free disk space available to the current user ''' ''' The total amount, in bytes, of free disk space available to the current user ''' Throws an exception if API fails @@ -866,7 +866,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Opens a file and attempts to determine the file's encoding + ''' Opens a file and attempts to determine the file's encoding ''' ''' The encoding or Nothing Private Function GetFileEncoding(fileName As String) As Encoding @@ -894,7 +894,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Gets the host name + ''' Gets the host name ''' ''' The host name ''' We use the machine name because we can get that even if not hooked up to a network @@ -909,10 +909,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Demands a FileIO write permission. + ''' Demands a FileIO write permission. ''' ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS + ''' This ensures these API cannot be used to circumvent CAS ''' Private Sub DemandWritePermission() Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") @@ -920,7 +920,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value + ''' Validates that the value being passed as an LogFileLocation enum is a legal value ''' ''' Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) @@ -930,7 +930,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value ''' ''' Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) @@ -940,7 +940,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value ''' ''' Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) @@ -950,7 +950,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Convert a stack into a string + ''' Convert a stack into a string ''' ''' ''' Returns the stack as a .csv string @@ -1153,7 +1153,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Increments the reference count for the stream + ''' Increments the reference count for the stream ''' Friend Sub AddReference() SyncLock _syncObject @@ -1162,7 +1162,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the stream + ''' Flushes the stream ''' Friend Sub Flush() SyncLock _syncObject @@ -1171,8 +1171,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Decrements the reference count to the stream and closes the stream if the reference count - ''' is zero + ''' Decrements the reference count to the stream and closes the stream if the reference count + ''' is zero ''' Friend Sub CloseStream() SyncLock _syncObject @@ -1190,7 +1190,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the stream is still in use by a FileLogTraceListener + ''' Indicates whether or not the stream is still in use by a FileLogTraceListener ''' ''' True if the stream is being used, otherwise False Friend ReadOnly Property IsInUse() As Boolean @@ -1200,7 +1200,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The size of the log file + ''' The size of the log file ''' ''' The size Friend ReadOnly Property FileSize() As Long @@ -1210,7 +1210,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Ensures the stream is closed (flushed) no matter how we are closed + ''' Ensures the stream is closed (flushed) no matter how we are closed ''' ''' Indicates who called dispose Private Overloads Sub Dispose(disposing As Boolean) @@ -1223,7 +1223,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Standard implementation of IDisposable + ''' Standard implementation of IDisposable ''' Public Overloads Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. @@ -1232,7 +1232,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Ensures stream is closed at GC + ''' Ensures stream is closed at GC ''' Protected Overrides Sub Finalize() ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 67ebe6f80f5..0822c2a3dde 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -9,12 +9,12 @@ Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Enables logging to configured TraceListeners + ''' Enables logging to configured TraceListeners ''' Public Class Log ''' - ''' Creates a Log and the underlying TraceSource based on the platform + ''' Creates a Log and the underlying TraceSource based on the platform ''' ''' Right now we only support WinApp as an application platform Public Sub New() @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Creates a Log and the underlying TraceSource based on the passed in name + ''' Creates a Log and the underlying TraceSource based on the passed in name ''' ''' The name of the TraceSource to be created Public Sub New(name As String) @@ -39,7 +39,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners ''' ''' The message to be logged Public Sub WriteEntry(message As String) @@ -47,7 +47,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners ''' ''' The message to be logged ''' The type of message (error, info, etc...) @@ -56,7 +56,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners ''' ''' The message to be logged ''' The type of message (error, info, etc...) @@ -69,7 +69,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message + ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message ''' ''' The exception being logged Public Sub WriteException(ex As Exception) @@ -77,8 +77,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message + ''' and appending additional info ''' ''' The exception being logged ''' The type of message (error, info, etc...) @@ -88,8 +88,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message + ''' and appending additional info ''' ''' The exception being logged ''' The type of message (error, info, etc...) @@ -114,7 +114,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gives access to the log's underlying TraceSource + ''' Gives access to the log's underlying TraceSource ''' ''' The log's underlying TraceSource @@ -125,7 +125,7 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Returns the file log trace listener we create for the Log + ''' Returns the file log trace listener we create for the Log ''' ''' The file log trace listener Public ReadOnly Property DefaultFileLogWriter() As FileLogTraceListener @@ -135,14 +135,14 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that it knows if it was initialized - ''' using a config file or not. + ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that it knows if it was initialized + ''' using a config file or not. ''' Friend NotInheritable Class DefaultTraceSource Inherits TraceSource ''' - ''' TraceSource has other constructors, this is the only one we care about for this internal class + ''' TraceSource has other constructors, this is the only one we care about for this internal class ''' ''' Public Sub New(name As String) @@ -150,7 +150,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Tells us whether this TraceSource found a config file to configure itself from + ''' Tells us whether this TraceSource found a config file to configure itself from ''' ''' True - The TraceSource was configured from a config file Public ReadOnly Property HasBeenConfigured() As Boolean @@ -170,8 +170,8 @@ Namespace Microsoft.VisualBasic.Logging End Class ''' - ''' When there is no config file to configure the trace source, this function is called in order to - ''' configure the trace source according to the defaults they would have had in a default AppConfig + ''' When there is no config file to configure the trace source, this function is called in order to + ''' configure the trace source according to the defaults they would have had in a default AppConfig ''' Protected Friend Overridable Sub InitializeWithDefaultsSinceNoConfigExists() 'By default, you get a file log listener that picks everything from level Information on up. @@ -180,7 +180,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Make sure we flush the log on exit + ''' Make sure we flush the log on exit ''' Private Sub CloseOnProcessExit(sender As Object, e As EventArgs) RemoveHandler AppDomain.CurrentDomain.ProcessExit, AddressOf CloseOnProcessExit @@ -188,7 +188,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Adds the default id values + ''' Adds the default id values ''' ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline Private Shared Function InitializeIDHash() As Dictionary(Of TraceEventType, Integer) @@ -212,7 +212,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Converts a TraceEventType to an Id + ''' Converts a TraceEventType to an Id ''' ''' ''' The Id @@ -232,5 +232,6 @@ Namespace Microsoft.VisualBasic.Logging Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index c6b8ddf6a01..1eb96fc2c19 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -10,20 +10,20 @@ Imports System.Windows.Forms Namespace Microsoft.VisualBasic.MyServices ''' - ''' A class that wraps System.Windows.Forms.Clipboard so that - ''' a clipboard can be instanced. + ''' A class that wraps System.Windows.Forms.Clipboard so that + ''' a clipboard can be instanced. ''' Public Class ClipboardProxy ''' - ''' Only Allows instantiation of the class + ''' Only Allows instantiation of the class ''' Friend Sub New() End Sub ''' - ''' Gets text from the clipboard + ''' Gets text from the clipboard ''' ''' The text as a String Public Function GetText() As String @@ -31,7 +31,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Gets text from the clipboard saved in the passed in format + ''' Gets text from the clipboard saved in the passed in format ''' ''' The type of text to get ''' The text as a String @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard + ''' Indicates whether or not text is available on the clipboard ''' ''' True if text is available, otherwise False Public Function ContainsText() As Boolean @@ -48,8 +48,8 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard in - ''' the passed in format + ''' Indicates whether or not text is available on the clipboard in + ''' the passed in format ''' ''' The type of text being checked for ''' True if text is available, otherwise False @@ -58,7 +58,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in String to the clipboard + ''' Saves the passed in String to the clipboard ''' ''' The String to save Public Sub SetText(text As String) @@ -66,7 +66,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Saves the passed in String to the clipboard in the passed in format + ''' Saves the passed in String to the clipboard in the passed in format ''' ''' The String to save ''' The format in which to save the String @@ -75,7 +75,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets an Image from the clipboard + ''' Gets an Image from the clipboard ''' ''' The image Public Function GetImage() As Image @@ -83,7 +83,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicate whether or not an image has been saved to the clipboard + ''' Indicate whether or not an image has been saved to the clipboard ''' ''' True if an image is available, otherwise False Public Function ContainsImage() As Boolean @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in image to the clipboard + ''' Saves the passed in image to the clipboard ''' ''' The image to be saved Public Sub SetImage(image As Image) @@ -99,7 +99,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets an audio stream from the clipboard + ''' Gets an audio stream from the clipboard ''' ''' The audio stream as a Stream Public Function GetAudioStream() As Stream @@ -107,7 +107,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not there's an audio stream saved to the clipboard + ''' Indicates whether or not there's an audio stream saved to the clipboard ''' ''' True if an audio stream is available, otherwise False Public Function ContainsAudio() As Boolean @@ -115,7 +115,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in audio byte array to the clipboard + ''' Saves the passed in audio byte array to the clipboard ''' ''' The byte array to be saved Public Sub SetAudio(audioBytes As Byte()) @@ -123,7 +123,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Saves the passed in audio stream to the clipboard + ''' Saves the passed in audio stream to the clipboard ''' ''' The stream to be saved Public Sub SetAudio(audioStream As Stream) @@ -131,7 +131,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets a file drop list from the clipboard + ''' Gets a file drop list from the clipboard ''' ''' The list of file paths as a StringCollection Public Function GetFileDropList() As StringCollection @@ -139,7 +139,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not a file drop list has been saved to the clipboard + ''' Indicates whether or not a file drop list has been saved to the clipboard ''' ''' True if a file drop list is available, otherwise False Public Function ContainsFileDropList() As Boolean @@ -147,7 +147,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in file drop list to the clipboard + ''' Saves the passed in file drop list to the clipboard ''' ''' The file drop list as a StringCollection Public Sub SetFileDropList(filePaths As StringCollection) @@ -155,7 +155,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets data from the clipboard that's been saved in the passed in format. + ''' Gets data from the clipboard that's been saved in the passed in format. ''' ''' The type of data being sought ''' The data @@ -164,7 +164,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not there is data on the clipboard in the passed in format + ''' Indicates whether or not there is data on the clipboard in the passed in format ''' ''' ''' True if there's data in the passed in format, otherwise False @@ -173,7 +173,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in data to the clipboard in the passed in format + ''' Saves the passed in data to the clipboard in the passed in format ''' ''' The format in which to save the data ''' The data to be saved @@ -182,14 +182,14 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Removes everything from the clipboard + ''' Removes everything from the clipboard ''' Public Sub Clear() Clipboard.Clear() End Sub ''' - ''' Gets a Data Object from the clipboard. + ''' Gets a Data Object from the clipboard. ''' ''' The data object ''' This gives the ability to save an object in multiple formats @@ -199,7 +199,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves a DataObject to the clipboard + ''' Saves a DataObject to the clipboard ''' ''' The data object to be saved ''' This gives the ability to save an object in multiple formats diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb index e161a134431..f755d24a944 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb @@ -9,7 +9,7 @@ Imports Microsoft.VisualBasic.FileIO Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.FileSystem to expose the type through My. + ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.FileSystem to expose the type through My. ''' Public Class FileSystemProxy @@ -268,7 +268,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 58b4c73aeb5..da2c89db6f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -6,24 +6,25 @@ Imports System.Threading Namespace Microsoft.VisualBasic.MyServices.Internal ''' - ''' Stores an object in a context appropriate for the environment we are - ''' running in (web/windows) + ''' Stores an object in a context appropriate for the environment we are + ''' running in (web/windows) ''' ''' ''' - ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the - ''' context of the current request (meaning the object is stored per request on the web). - ''' Note that an instance of this class can only be associated - ''' with the one item to be stored/retrieved at a time. + ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the + ''' context of the current request (meaning the object is stored per request on the web). + ''' Note that an instance of this class can only be associated + ''' with the one item to be stored/retrieved at a time. ''' Public Class ContextValue(Of T) + Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub ''' - ''' Get the object from the correct thread-appropriate location + ''' Get the object from the correct thread-appropriate location ''' Public Property Value() As T 'No SyncLocks required because we are operating upon instance data and the object is not shared across threads Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 9776ea840c2..140e881ee3d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -20,11 +20,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private ReadOnly _httpClient As HttpClient Private _cancelTokenSourceGet As CancellationTokenSource - Private _cancelTokenSourceRead As CancellationTokenSource - Private _cancelTokenSourceReadStream As CancellationTokenSource - Private _cancelTokenSourceWrite As CancellationTokenSource ' The percentage of the operation completed @@ -34,7 +31,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private Delegate Sub DoIncrement(Increment As Integer) ''' - ''' Creates an instance of a HttpClientCopy, used to download or upload a file + ''' Creates an instance of a HttpClientCopy, used to download or upload a file ''' ''' The HttpClient used to do the downloading or uploading ''' UI for indicating progress @@ -89,12 +86,12 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation - ''' + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation + ''' ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserHitCancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the HttpClient cancels the xfer. @@ -105,7 +102,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Downloads a file + ''' Downloads a file ''' ''' The source for the file ''' The path and name where the file is saved @@ -176,7 +173,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal #If False Then ''' - ''' Uploads a file + ''' Uploads a file ''' ''' The name and path of the source file ''' The address to which the file is uploaded diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 20a8de87469..c4b5d46c72c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -15,7 +15,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Inherits Form ''' - ''' Event raised when user cancels the dialog or closes it before the operation is completed + ''' Event raised when user cancels the dialog or closes it before the operation is completed ''' Public Event UserHitCancel() @@ -80,8 +80,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' Used to set or get the semaphore which signals when the dialog - ''' is in a closable state. + ''' Used to set or get the semaphore which signals when the dialog + ''' is in a closable state. ''' ''' The ManualResetEvent Public ReadOnly Property FormClosableSemaphore() As ManualResetEvent @@ -117,7 +117,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' This enables a dialog with a close button, sizable borders, and no icon + ''' This enables a dialog with a close button, sizable borders, and no icon ''' Protected Overrides ReadOnly Property CreateParams() As CreateParams Get @@ -139,13 +139,13 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Indicates the form is closing + ''' Indicates the form is closing ''' ''' ''' ''' - ''' We listen for this event since we want to make closing the dialog before it's - ''' finished behave the same as a cancel + ''' We listen for this event since we want to make closing the dialog before it's + ''' finished behave the same as a cancel ''' Private Sub ProgressDialog_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing If e.CloseReason = CloseReason.UserClosing And Not _closeDialogInvoked Then @@ -163,14 +163,14 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Ensure the label resizes with the dialog + ''' Ensure the label resizes with the dialog ''' ''' ''' ''' - ''' Since the label has AutoSize set to True we have to set the maximum size so the label - ''' will grow down rather than off the dialog. As the size of the dialog changes, the maximum - ''' size needs to be adjusted. + ''' Since the label has AutoSize set to True we have to set the maximum size so the label + ''' will grow down rather than off the dialog. As the size of the dialog changes, the maximum + ''' size needs to be adjusted. ''' Private Sub ProgressDialog_Resize(sender As Object, e As EventArgs) Handles Me.Resize LabelInfo.MaximumSize = New Size(ClientSize.Width - BORDER_SIZE, 0) @@ -205,8 +205,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' Border area for label (10 pixels on each side) Private Const BORDER_SIZE As Integer = 20 -#Region " Windows Form Designer generated code " - 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(disposing As Boolean) If disposing Then @@ -218,6 +216,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub + Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button @@ -268,7 +267,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub -#End Region - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 16108f5e49b..57854af7c0e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -12,7 +12,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Friend NotInheritable Class WebClientCopy ''' - ''' Creates an instance of a WebClientCopy, used to download or upload a file + ''' Creates an instance of a WebClientCopy, used to download or upload a file ''' ''' The WebClient used to do the downloading or uploading ''' UI for indicating progress @@ -26,7 +26,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Uploads a file + ''' Uploads a file ''' ''' The name and path of the source file ''' The address to which the file is uploaded @@ -90,7 +90,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles the WebClient's UploadFileCompleted event + ''' Handles the WebClient's UploadFileCompleted event ''' ''' ''' @@ -111,7 +111,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles event WebClient fires whenever progress of upload changes + ''' Handles event WebClient fires whenever progress of upload changes ''' ''' ''' @@ -121,12 +121,12 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation ''' ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb index e981b1c5316..505da1308a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb @@ -7,7 +7,7 @@ Imports Microsoft.Win32 Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.Win32.Registry to expose the type through My. + ''' An extremely thin wrapper around Microsoft.Win32.Registry to expose the type through My. ''' Public Class RegistryProxy @@ -65,11 +65,10 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub End Class End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb index e131c29b90e..4fad8e379de 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb @@ -7,7 +7,7 @@ Imports Microsoft.VisualBasic.FileIO Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.SpecialDirectories to expose the type through My. + ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.SpecialDirectories to expose the type through My. ''' Public Class SpecialDirectoriesProxy @@ -67,7 +67,7 @@ Namespace Microsoft.VisualBasic.MyServices End Property ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub From 4d78b352fa8561d84c21f28bc35466b243748449 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 27 Mar 2024 23:25:22 -0700 Subject: [PATCH 120/342] Fix more XML Comments --- .../VisualBasic/Logging/FileLogTraceListener.vb | 11 ++++++----- .../src/Microsoft/VisualBasic/Logging/Log.vb | 1 - .../Forms/AssemblyPublicKeyIsAsExpectedTest.vb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index ba270e9b8fc..899ed6ed652 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -1069,6 +1069,7 @@ Namespace Microsoft.VisualBasic.Logging ' Attribute keys used to access properties set in the config file Private Const KEY_APPEND As String = "append" + Private Const KEY_APPEND_PASCAL As String = "Append" Private Const KEY_AUTOFLUSH As String = "autoflush" @@ -1118,14 +1119,14 @@ Namespace Microsoft.VisualBasic.Logging Private Const STACK_DELIMITER As String = ", " ''' - ''' Wraps a StreamWriter and keeps a reference count. This enables multiple - ''' FileLogTraceListeners on multiple threads to access the same file. + ''' Wraps a StreamWriter and keeps a reference count. This enables multiple + ''' FileLogTraceListeners on multiple threads to access the same file. ''' Friend NotInheritable Class ReferencedStream Implements IDisposable ''' - ''' Creates a new referenced stream + ''' Creates a new referenced stream ''' ''' The stream that does the actual writing Friend Sub New(stream As StreamWriter) @@ -1133,7 +1134,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes a message to the stream + ''' Writes a message to the stream ''' ''' The message to write Friend Sub Write(message As String) @@ -1143,7 +1144,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes a message to the stream as a line + ''' Writes a message to the stream as a line ''' ''' The message to write Friend Sub WriteLine(message As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 0822c2a3dde..6f0d65815dc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -232,6 +232,5 @@ Namespace Microsoft.VisualBasic.Logging Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 9d97bf4ed63..0e6771966fd 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -9,7 +9,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" ''' - ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. + ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. ''' Public Sub AssemblyPublicKeyIsAsExpected() From e8d88a8ba0ce91800053225d92992f643ff55d3a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 27 Mar 2024 23:58:50 -0700 Subject: [PATCH 121/342] More code cleanup --- .../ApplicationServices/ApplicationBase.vb | 6 +- .../Devices/Network/NetworkAvailability.vb | 24 ++-- .../Devices/Network/NetworkDownload.vb | 6 +- .../Devices/Network/NetworkPing.vb | 6 +- .../Devices/Network/NetworkUpload.vb | 16 +-- .../Devices/Network/WebClientExtended.vb | 6 +- .../MyServices/Internal/HttpClientCopy.vb | 7 +- .../MyServices/Internal/WebClientCopy.vb | 108 +++++++++--------- 8 files changed, 93 insertions(+), 86 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index aef0f95b5b3..0d94f221780 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -112,7 +112,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - Private _log As Logging.Log 'Lazy-initialized and cached log object. - Private _info As AssemblyInfo ' The executing application (the EntryAssembly) + 'Lazy-initialized and cached log object. + Private _log As Logging.Log + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index d1cdcf0d97c..1d039028056 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -28,18 +28,6 @@ Namespace Microsoft.VisualBasic.Devices Private _synchronizationContext As SynchronizationContext - ''' - ''' Indicates whether or not the local machine is connected to an IP network. - ''' - ''' True if connected, otherwise False - Public ReadOnly Property IsAvailable() As Boolean - Get - - Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() - - End Get - End Property - ''' ''' Event fired when connected to the network ''' @@ -99,6 +87,18 @@ Namespace Microsoft.VisualBasic.Devices End RaiseEvent End Event + ''' + ''' Indicates whether or not the local machine is connected to an IP network. + ''' + ''' True if connected, otherwise False + Public ReadOnly Property IsAvailable() As Boolean + Get + + Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() + + End Get + End Property + 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) Private Sub NetworkAvailabilityChangedHandler(state As Object) Dim Connected As Boolean = IsAvailable diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 14452da1915..daef3164c74 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -212,7 +212,7 @@ Namespace Microsoft.VisualBasic.Devices #If False Then ' Here in case DownloadFileAsync becomes public ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -220,7 +220,9 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Calls to all the other overloads will come through here + ''' + ''' Calls to all the other overloads will come through here + ''' Private Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, networkCredentials As ICredentials, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index bfb915bf6e2..1b59bbf9432 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -36,7 +36,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Sends and receives a packet to and from the passed in address. + ''' Sends and receives a packet to and from the passed in address. ''' ''' ''' True if ping was successful, otherwise False @@ -45,7 +45,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' ''' A Uri representing the host ''' True if ping was successful, otherwise False @@ -80,7 +80,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' ''' A Uri representing the host ''' Time to wait before aborting ping diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index 2f250cbdc90..b491535d1e3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.Devices Partial Public Class Network ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' The full name and path of the host destination @@ -22,7 +22,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination @@ -31,7 +31,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' The full name and path of the host destination @@ -42,7 +42,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination @@ -108,7 +108,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination @@ -127,7 +127,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination @@ -152,7 +152,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination @@ -169,7 +169,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host ''' ''' The file to be uploaded ''' Uri representing the destination diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb index 0fa08922fd7..c43b5b2d900 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -6,9 +6,11 @@ Imports System.Net Namespace Microsoft.VisualBasic.Devices ''' - ''' Temporary class used to provide WebClient with a timeout property. + ''' Temporary class used to provide WebClient with a timeout property. ''' - ''' This class will be deleted when Timeout is added to WebClient + ''' + ''' This class will be deleted when Timeout is added to WebClient + ''' Friend NotInheritable Class WebClientExtended Inherits WebClient diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 140e881ee3d..3793d646b93 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -27,9 +27,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' The percentage of the operation completed Private _percentage As Integer - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) - ''' ''' Creates an instance of a HttpClientCopy, used to download or upload a file ''' @@ -47,6 +44,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + ''' ''' Posts a message to close the progress dialog ''' @@ -198,5 +198,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If End Sub #End If + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 57854af7c0e..a2aa8092c0c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -11,6 +11,18 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Friend NotInheritable Class WebClientCopy + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog + + ' The WebClient performs the downloading or uploading operations for us + Private WithEvents m_WebClient As WebClient + + 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread + Private _exceptionEncounteredDuringFileTransfer As Exception + + ' The percentage of the operation completed + Private _percentage As Integer + ''' ''' Creates an instance of a WebClientCopy, used to download or upload a file ''' @@ -25,28 +37,23 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + ''' - ''' Uploads a file + ''' Posts a message to close the progress dialog ''' - ''' The name and path of the source file - ''' The address to which the file is uploaded - Public Sub UploadFile(sourceFileName As String, address As Uri) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - - ' If we have a dialog we need to set up an async download + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then - m_WebClient.UploadFileAsync(address, sourceFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.UploadFile(address, sourceFileName) - End If + m_ProgressDialog.IndicateClosing() - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() End If End If End Sub @@ -72,21 +79,15 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Posts a message to close the progress dialog + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation ''' - Private Sub CloseProgressDialog() - ' Don't invoke unless dialog is up and running - If m_ProgressDialog IsNot Nothing Then - m_ProgressDialog.IndicateClosing() - - If m_ProgressDialog.IsHandleCreated Then - m_ProgressDialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - m_ProgressDialog.Close() - End If - End If + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. End Sub ''' @@ -121,31 +122,30 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' Uploads a file ''' - ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. - ''' - Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. - End Sub - - ' The WebClient performs the downloading or uploading operations for us - Private WithEvents m_WebClient As WebClient - - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. - Private WithEvents m_ProgressDialog As ProgressDialog - - 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread - Private _exceptionEncounteredDuringFileTransfer As Exception + ''' The name and path of the source file + ''' The address to which the file is uploaded + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If - ' The percentage of the operation completed - Private _percentage As Integer + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If + End Sub End Class End Namespace From 980964458b7d559bd18323b17294aedf75d8ac6e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 28 Mar 2024 12:49:01 -0700 Subject: [PATCH 122/342] Revert "[main] Update dependencies from dotnet/runtime (#11133)" This reverts commit e2f9efeeb22b733a9c032bf7365725ff5c03a457. --- eng/Version.Details.xml | 172 ++++++++++++++++++++-------------------- eng/Versions.props | 54 ++++++------- global.json | 2 +- 3 files changed, 114 insertions(+), 114 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bd33062fc58..f8734031cd6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,178 +7,178 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - 3a447e4a964f83b2489ca6a37ee29c95322ba583 + 7f555e0834411c18450074c2218f3656251bca9c diff --git a/eng/Versions.props b/eng/Versions.props index 2281ac8d2cd..dfe6d08d52e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,35 +13,35 @@ - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 5.0.0-preview.7.20320.5 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 6.0.0 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 - 9.0.0-preview.4.24176.13 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 diff --git a/global.json b/global.json index fa733d24ca8..78b50d0af82 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24176.6", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24176.6", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24176.13" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24175.10" }, "native-tools": { "cmake": "latest" From d10cb39869bc239e83e5300d5b98d53a4fec5865 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 28 Mar 2024 16:05:23 -0700 Subject: [PATCH 123/342] Fix more document Comments to add space --- .../Devices/Network/NetworkDownload.vb | 42 +++++++++---------- .../Devices/Network/WebClientExtended.vb | 8 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index daef3164c74..baa5b29d37c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -32,7 +32,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Posts a message to close the progress dialog + ''' Posts a message to close the progress dialog ''' Private Shared Sub CloseProgressDialog(dialog As ProgressDialog) ' Don't invoke unless dialog is up and running @@ -50,8 +50,8 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Sends and receives a packet to and from the passed in Uri. - ''' Maps older networkCredentials to HttpClientHandler + ''' Sends and receives a packet to and from the passed in Uri. + ''' Maps older networkCredentials to HttpClientHandler ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -83,7 +83,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -111,7 +111,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -151,7 +151,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -179,7 +179,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -241,7 +241,7 @@ Namespace Microsoft.VisualBasic.Devices #End If ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -315,7 +315,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Gets network credentials from a userName and password + ''' Gets network credentials from a userName and password ''' ''' The name of the user ''' The password of the user @@ -329,7 +329,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -348,7 +348,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) ''' ''' The remote file address ''' A Uri if successful, otherwise it throws an exception @@ -362,7 +362,7 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -385,7 +385,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -408,7 +408,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -435,7 +435,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -463,7 +463,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -522,7 +522,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved @@ -587,7 +587,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -638,7 +638,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -694,7 +694,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved @@ -744,7 +744,7 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path ''' ''' Uri to the remote file ''' Name and path of file where download is saved diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb index c43b5b2d900..406da20d13e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Devices #Enable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete ''' - ''' Sets or indicates the timeout used by WebRequest used by WebClient + ''' Sets or indicates the timeout used by WebRequest used by WebClient ''' Public WriteOnly Property Timeout() As Integer Set(value As Integer) @@ -38,7 +38,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Enables switching the server to non passive mode. + ''' Enables switching the server to non passive mode. ''' ''' We need this in order for the progress UI on a download to work Public WriteOnly Property UseNonPassiveFtp() As Boolean @@ -48,8 +48,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set - ''' to the Timeout value + ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set + ''' to the Timeout value ''' ''' Protected Overrides Function GetWebRequest(address As Uri) As WebRequest From 7d1024fdd4e03a3ad31275d040d1669021de1c99 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 20:52:02 -0700 Subject: [PATCH 124/342] Add FileIoProxyTests and general Cleanup --- .../WindowsFormsApplicationBase.vb | 5 +- .../VisualBasic/Helpers/NativeTypes.vb | 1 + .../Windows/Forms/NetworkDownloadTests.vb | 182 +++++------ .../Forms/NetworkTestsCommonFunctions.vb | 19 +- .../Forms/TempDirectoryFileFunctionsvb.vb | 282 ++++++++++++++++++ .../SpecialDirectoriesProxyTests.cs | 18 +- 6 files changed, 396 insertions(+), 111 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index ede8df2bb3c..8142d9452dd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -269,7 +269,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' We have to have a parameterless ctor because the platform specific Application object ''' derives from this one and it doesn't define a ctor because the partial class generated by the - ''' designer does that to configure the application. + ''' designer does that to configure the application. + ''' Public Sub New() Me.New(AuthenticationMode.Windows) End Sub @@ -480,7 +481,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' This extensibility point is exposed for people who want to override ''' the Startup sequence at the earliest possible point to - ''' + ''' Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index c95068274e8..961a79f2c8c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -35,6 +35,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub + End Class ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index baf697c26d2..aea45ccdea6 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -17,7 +17,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const TestingConnectionTimeout As Integer = 100000 ''' - ''' Verify that tmpDirectoryPath exists, that destinationFilename exist and what its length is + ''' Verify that testDirectory exists, that destinationFilename exist and what its length is ''' ''' The full path and filename of the new file ''' @@ -34,13 +34,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return fileInfo.Length End Function - Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) - Debug.Assert(tmpDirectoryPath <> Path.GetTempPath) + Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) + Debug.Assert(testDirectory <> Path.GetTempPath) listener.Stop() listener.Close() - If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then - Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) - Directory.Delete(tmpDirectoryPath, recursive:=True) + If Not String.IsNullOrWhiteSpace(testDirectory) Then + Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + Directory.Delete(testDirectory, recursive:=True) End If End Sub @@ -48,7 +48,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim testDirectory As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -63,14 +63,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -82,7 +82,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -90,8 +90,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -105,14 +105,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_Password_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -126,7 +126,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -134,8 +134,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -152,14 +152,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Ur_InvalidUrl_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -178,7 +178,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -208,8 +208,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -227,16 +227,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), 1) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub Public Sub DownloadFile_Url_FileExistsOverwrite_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, 1) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -251,17 +251,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -281,14 +281,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_TimeOut_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -309,14 +309,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_TimeoutNegative_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -336,14 +336,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_UsernameEqualNothing_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -360,7 +360,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -368,8 +368,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -390,14 +390,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_GetLongPath_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -407,7 +407,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address, - destinationFileName:=tmpDirectoryPath, ' This is a Directory! + destinationFileName:=testDirectory, ' This is a Directory! userName:="", password:="", showUI:=False, @@ -418,7 +418,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -426,8 +426,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectory_Throw(root As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -448,7 +448,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub @@ -456,8 +456,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -478,14 +478,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Url_AllOptionsSet_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim address As String = webListener.Address @@ -499,16 +499,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub Public Sub DownloadFile_Uri_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -519,14 +519,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) @@ -541,14 +541,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Uri_UserNamePassword_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() @@ -561,14 +561,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Uri_UserNamePassword_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() @@ -584,14 +584,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -607,14 +607,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -627,16 +627,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -650,17 +650,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Directory.Delete(tmpDirectoryPath, recursive:=True) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ @@ -673,16 +673,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub Public Sub DownloadFile_Uri_UriIsNothing_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -701,7 +701,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb index 53eaab6edeb..ce53128e5c0 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb @@ -6,10 +6,10 @@ Imports System.Runtime.CompilerServices Namespace Microsoft.VisualBasic.Forms.Tests - Partial Public Class NetworkTests + Public Module TempDirectoryFileFunctions ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName - Private Shared ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") + Friend ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") ''' ''' Creates or returns a directory based on the name of the function that @@ -18,8 +18,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' ''' ''' - Private Shared Function CreateTempDirectory( Optional memberName As String = Nothing) As String - Dim folder As String = Path.Combine(s_baseTempPath, $"{memberName}Test") + Friend Function CreateTempDirectory( Optional memberName As String = Nothing) As String + Dim folder As String = Path.Combine(s_baseTempPath, memberName) Directory.CreateDirectory(folder) Return folder @@ -29,13 +29,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' If size >= 0 then create the file with size length ''' ''' Full path to working directory + ''' ''' File size to be created ''' ''' The full path and file name of the created file ''' If size = -1 no file is create but the full path is returned ''' - Private Shared Function CreateTempFile(tmpFilePath As String, size As Integer) As String - Dim filename As String = GetDestinationFileName(tmpFilePath) + Friend Function CreateTempFile(tmpFilePath As String, Optional optionalFilename As String = "Testing.Text", Optional size As Integer = -1) As String + Dim filename As String = GetDestinationFileName(tmpFilePath, optionalFilename) If size >= 0 Then Using destinationStream As FileStream = File.Create(filename) @@ -47,9 +48,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return filename End Function - Private Shared Function GetDestinationFileName(tmpFilePath As String) As String - Return Path.Combine(tmpFilePath, "testing.txt") + Friend Function GetDestinationFileName(tmpFilePath As String, Optional filename As String = "testing.txt") As String + Return Path.Combine(tmpFilePath, filename) End Function - End Class + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb new file mode 100644 index 00000000000..c2a77dbf8ef --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb @@ -0,0 +1,282 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.ObjectModel +Imports System.Text +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class FileIoProxyTests + Private ReadOnly _csvSampleData As String = + "Index,Customer Id,First Name,Last Name,Company,City,Country +1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile" + Private ReadOnly _fixedSampleData As String = + "IndexFirstLastCompanyCityCountry +4321;1234;321;654321;123;1234567" + Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem + + + Public Sub DriveProxyTest() + Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) + End Sub + + + Public Sub FindInFilesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) + Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) + _fileSystem.WriteAllText(fileC, "C", append:=False) + Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) + Assert.Equal(filenames.Count, 1) + Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) + filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") + Assert.Equal(filenames.Count, 0) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim text As String = _fileSystem.ReadAllText(fileA) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextWithEncodingProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) + Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllBytesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) + + Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithOverwriteProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2), size:=1) + _fileSystem.CopyFile(file1, file2, overwrite:=True) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) + 'End Sub + + 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) + 'End Sub + + 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) + 'End Sub + + 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) + 'End Sub + + 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) + ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + 'End Sub + + 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) + 'End Sub + + 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) + ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + 'End Sub + + 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) + 'End Sub + + + Public Sub DeleteFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) + ' FileIO.FileSystem.DeleteFile(file, showUI, recycle) + 'End Sub + + 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, + ' onUserCancel As UICancelOption) + + ' FileIO.FileSystem.DeleteFile(file, showUI, recycle, onUserCancel) + 'End Sub + + 'Public Sub DeleteDirectory(directory As String, + ' showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + + ' FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) + 'End Sub + + + + + Public Sub OpenTextFieldParserProxyTest(delimiter As String) + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _csvSampleData, append:=False) + Dim reader As TextFieldParser + If delimiter Is Nothing Then + reader = _fileSystem.OpenTextFieldParser(fileCSV) + reader.TextFieldType = FieldType.Delimited + reader.Delimiters = {","} + Else + reader = _fileSystem.OpenTextFieldParser(fileCSV, delimiter) + End If + Dim currentRow As String() + Dim totalRows As Integer = 0 + While Not reader.EndOfData + totalRows += 1 + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + totalFields += 1 + Next + Assert.Equal(7, totalFields) + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFixedFieldParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _fixedSampleData, append:=False) + Dim reader As TextFieldParser = _fileSystem.OpenTextFieldParser(fileCSV, 5, 5, 4, 7, 4, 7) + Dim currentRow As String() + Dim totalRows As Integer = 0 + Dim splitData As String() = _fixedSampleData.Split(vbCrLf)(1).Split(";") + While Not reader.EndOfData + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + If totalRows = 1 Then + Assert.Equal(splitData(totalFields), currentField.TrimEnd(";"c)) + End If + totalFields += 1 + Next + Assert.Equal(6, totalFields) + totalRows += 1 + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextStreamParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenEncodedTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter + ' Return FileIO.FileSystem.OpenTextFileWriter(file, append) + 'End Function + + 'Public Function OpenTextFileWriter(file As String, append As Boolean, + ' encoding As Encoding) As IO.StreamWriter + + ' Return FileIO.FileSystem.OpenTextFileWriter(file, append, encoding) + 'End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs index 5868f530c06..4cba3f91b99 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs @@ -11,15 +11,15 @@ public class SpecialDirectoriesProxyTests public void Properties() { SpecialDirectoriesProxy specialDirectories = new ServerComputer().FileSystem.SpecialDirectories; - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.AllUsersApplicationData, () => specialDirectories.AllUsersApplicationData); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.CurrentUserApplicationData, () => specialDirectories.CurrentUserApplicationData); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Desktop, () => specialDirectories.Desktop); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyDocuments, () => specialDirectories.MyDocuments); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyMusic, () => specialDirectories.MyMusic); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyPictures, () => specialDirectories.MyPictures); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Programs, () => specialDirectories.Programs); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.ProgramFiles, () => specialDirectories.ProgramFiles); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Temp, () => specialDirectories.Temp); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.AllUsersApplicationData, () => specialDirectories.AllUsersApplicationData); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.CurrentUserApplicationData, () => specialDirectories.CurrentUserApplicationData); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Desktop, () => specialDirectories.Desktop); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyDocuments, () => specialDirectories.MyDocuments); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyMusic, () => specialDirectories.MyMusic); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyPictures, () => specialDirectories.MyPictures); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Programs, () => specialDirectories.Programs); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.ProgramFiles, () => specialDirectories.ProgramFiles); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Temp, () => specialDirectories.Temp); } private static void VerifySpecialDirectory(Func getExpected, Func getActual) From 622a18ab900769b1a7ef443dab3231950423247b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 20:57:17 -0700 Subject: [PATCH 125/342] Corrent filename for Proxy tests --- .../{TempDirectoryFileFunctionsvb.vb => FileIoProxyTests.vb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/{TempDirectoryFileFunctionsvb.vb => FileIoProxyTests.vb} (100%) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb From 8e109299dabe7961fbafa9a7b24f7c9e5ef9ed7a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 21:10:44 -0700 Subject: [PATCH 126/342] Rename files --- .../System/Windows/Forms/FileIoProxyTests.vb | 53 +++---------------- ...tions.vb => TempDirectoryFileFunctions.vb} | 0 2 files changed, 7 insertions(+), 46 deletions(-) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/{NetworkTestsCommonFunctions.vb => TempDirectoryFileFunctions.vb} (100%) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index c2a77dbf8ef..0a7e192d9a5 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -102,38 +102,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - + ' Not tested 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) - 'End Sub - 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) - 'End Sub - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) - 'End Sub - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) - 'End Sub - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI) - 'End Sub - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) - 'End Sub - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) - 'End Sub - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) - 'End Sub Public Sub DeleteFileProxyTest() @@ -149,21 +126,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub + ' Not Tested 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) - ' FileIO.FileSystem.DeleteFile(file, showUI, recycle) - 'End Sub - - 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, - ' onUserCancel As UICancelOption) - - ' FileIO.FileSystem.DeleteFile(file, showUI, recycle, onUserCancel) - 'End Sub - - 'Public Sub DeleteDirectory(directory As String, - ' showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) - - ' FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) - 'End Sub + 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + 'Public Sub DeleteDirectory(directory As String, showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) @@ -268,15 +234,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter - ' Return FileIO.FileSystem.OpenTextFileWriter(file, append) - 'End Function - - 'Public Function OpenTextFileWriter(file As String, append As Boolean, - ' encoding As Encoding) As IO.StreamWriter - ' Return FileIO.FileSystem.OpenTextFileWriter(file, append, encoding) - 'End Function + ' Not Tested + 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter + 'Public Function OpenTextFileWriter(file As String, append As Boolean, encoding As Encoding) As IO.StreamWriter End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkTestsCommonFunctions.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb From df93bf87653b1c8564dad3d987c8d4a8c9da1522 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 22:43:55 -0700 Subject: [PATCH 127/342] Add rest of Proxy tests --- .../System/Windows/Forms/FileIoProxyTests.vb | 169 ++++++++++++++++-- .../Forms/TempDirectoryFileFunctions.vb | 10 +- 2 files changed, 160 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 0a7e192d9a5..3de48035eb9 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -102,15 +102,131 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - ' Not tested - 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + + Public Sub CopyFileWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithShowUIWithCancelOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveFileWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.False(IO.File.Exists(file1)) + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveFileWithShowUIWithCancelOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.False(IO.File.Exists(file1)) + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyDirectoryWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveDirectoryWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + Assert.False(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveDirectoryWithShowUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Assert.False(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub Public Sub DeleteFileProxyTest() @@ -126,10 +242,33 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - ' Not Tested - 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) - 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) - 'Public Sub DeleteDirectory(directory As String, showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + + Public Sub DeleteFileWithRecycleOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub DeleteFileWithUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub @@ -235,9 +374,5 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - ' Not Tested - 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter - 'Public Function OpenTextFileWriter(file As String, append As Boolean, encoding As Encoding) As IO.StreamWriter - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb index ce53128e5c0..d66959e8947 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb @@ -17,9 +17,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' Even if directory exists this call will success and just return it ''' ''' + ''' If >1 use line number as part of name ''' - Friend Function CreateTempDirectory( Optional memberName As String = Nothing) As String - Dim folder As String = Path.Combine(s_baseTempPath, memberName) + Friend Function CreateTempDirectory( Optional memberName As String = Nothing, Optional lineNumber As Integer = -1) As String + Dim folder As String + If lineNumber > 1 Then + folder = Path.Combine(s_baseTempPath, $"{memberName}{lineNumber}") + Else + folder = Path.Combine(s_baseTempPath, memberName) + End If Directory.CreateDirectory(folder) Return folder From 7c9676371a63f3248da4311512f5ce6b62efb4a5 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 23:46:59 -0700 Subject: [PATCH 128/342] Add missing deleteDirectoryTests --- .../System/Windows/Forms/FileIoProxyTests.vb | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 3de48035eb9..4400cb5c679 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -270,6 +270,30 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub + + Public Sub DeleteDirectoryWithUIProxyRecycleTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.Directory.Exists(testDirectory)) + End Sub + + + Public Sub DeleteDirectoryRecycleWithUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.Directory.Exists(testDirectory)) + End Sub + From d206f73e15fe14f6575971fd8857785c93b14d39 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 3 Apr 2024 20:36:55 -0700 Subject: [PATCH 129/342] Add ClipboardProxy Tests --- .../Windows/Forms/ClipboardProxyTests.vb | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb new file mode 100644 index 00000000000..b014ee9e032 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -0,0 +1,56 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.Specialized +Imports System.IO +Imports System.Windows.Forms +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + ''' + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' + Partial Public Class ClipboardProxyTests + Private ReadOnly _clipboardProxy As New MyServices.ClipboardProxy + + + Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() + Dim result As Stream = _clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, _clipboardProxy.GetAudioStream().Length) + End Sub + + + Public Sub Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() + Dim audioBytes As Byte() = {1, 2, 3} + _clipboardProxy.SetAudio(audioBytes) + Assert.True(_clipboardProxy.ContainsAudio()) + Assert.True(_clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(_clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(_clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + End Sub + + + Public Sub Clipboard_SetAudio_InvokeStream_GetReturnsExpected() + Dim audioBytes() As Byte = {1, 2, 3} + Using audioStream As New MemoryStream(audioBytes) + _clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(_clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(_clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(_clipboardProxy.ContainsAudio()) + Assert.True(_clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using + End Sub + + + Public Sub Clipboard_SetFileDropList_Invoke_GetReturnsExpected() + Dim filePaths As New StringCollection From + {"filePath", "filePath2"} + + _clipboardProxy.SetFileDropList(filePaths) + Assert.Equal(filePaths, _clipboardProxy.GetFileDropList()) + Assert.True(_clipboardProxy.ContainsFileDropList()) + End Sub + + End Class +End Namespace From 6d28f47ed1707994465a21afad77e9c46340976a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 19:14:59 -0700 Subject: [PATCH 130/342] Make Async Firend so they can be tested durectly Add more DownloadFile Tests --- .../Devices/Network/NetworkDownload.vb | 18 +- .../Windows/Forms/NetworkDownloadTests.vb | 722 +++++++++++------- 2 files changed, 458 insertions(+), 282 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index baa5b29d37c..7f29d7f3486 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -92,7 +92,7 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Private Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -121,7 +121,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Private Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -160,7 +160,7 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -189,7 +189,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -223,7 +223,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Calls to all the other overloads will come through here ''' - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, networkCredentials As ICredentials, dialog As ProgressDialog, @@ -251,7 +251,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, clientHandler As HttpClientHandler, dialog As ProgressDialog, @@ -266,9 +266,9 @@ Namespace Microsoft.VisualBasic.Devices Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) End If - Dim client As HttpClient = If(clientHandler IsNot Nothing, - New HttpClient(clientHandler), - New HttpClient() + Dim client As HttpClient = If(clientHandler Is Nothing, + New HttpClient(), + New HttpClient(clientHandler) ) ' Set credentials if we have any diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index aea45ccdea6..b5cc87d44f2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -27,7 +27,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Shared Function ValidateDownload(destinationFilename As String) As Long Dim fileInfo As New FileInfo(destinationFilename) - ' This directory should not be systems Temp Directory because it may be created + ' This directory should not be systems Temp Directory because it must be created + Assert.NotEqual(Path.GetTempPath, fileInfo.DirectoryName) Assert.True(Directory.Exists(fileInfo.DirectoryName)) Assert.True(fileInfo.Exists) @@ -35,7 +36,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) - Debug.Assert(testDirectory <> Path.GetTempPath) + Debug.Assert(Path.GetTempPath <> testDirectory) listener.Stop() listener.Close() If Not String.IsNullOrWhiteSpace(testDirectory) Then @@ -44,130 +45,150 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub - - - - Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) + + Public Sub DownloadFile_UriCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=testDirectory, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - Public Sub DownloadFile_Url_Success() + + + + Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - - Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) + + + Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - Public Sub DownloadFile_Url_Password_Success() + + + + Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - DefaultUserName, - DefaultPassword) + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - - - Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) + + Public Sub DownloadFile_UriOnly_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - DefaultUserName, - password) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename) - End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Ur_InvalidUrl_Throws() + Public Sub DownloadFile_UriWhereUriIsNothing_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, + .DownloadFile(address:=CType(Nothing, Uri), destinationFilename, userName:="", password:="", @@ -183,180 +204,176 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throws() + Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFileName:=Nothing, + .DownloadFile(address:=CType(Nothing, Uri), + destinationFilename, userName:="", password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=False) + overwrite:=False, + UICancelOption.DoNothing) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener) + CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() + Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - - Assert.Throws(Of IOException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - End Sub) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), 1) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_FileExistsOverwrite_Success() + Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address + + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(New Uri(webListener.Address), destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, + networkCredentials, + showUI:=False, TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() + Public Sub DownloadFile_UriWithNonexistentTargetDirectory_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) - Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_TimeOut_Throws() + Public Sub DownloadFile_UriWithOverwriteShowUISpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) - - End Sub) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_TimeoutNegative_Throws() + Public Sub DownloadFile_UriWithUriOnly_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename) - End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_UsernameEqualNothing_Success() + Public Sub DownloadFile_UriWithUserNamePassword_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(New Uri(webListener.Address), destinationFilename, - userName:=Nothing, - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + DefaultUserName, + DefaultPassword) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -365,21 +382,43 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) + + + Public Sub DownloadFile_UriWithWrongPassword_Throws(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + password) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ - .DownloadFile(address, - $"{destinationFilename}{separator}", + .DownloadFile(webListener.Address, + destinationFileName:=testDirectory, ' This is a Directory! userName:="", password:="", showUI:=False, @@ -394,20 +433,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_GetLongPath_Throws() + + + + Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of InvalidOperationException)( + Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFileName:=testDirectory, ' This is a Directory! + .DownloadFile(webListener.Address, + $"{destinationFilename}{separator}", userName:="", password:="", showUI:=False, @@ -423,20 +463,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_RootDirectory_Throw(root As String) + + + Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of InvalidOperationException)( + Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(webListener.Address, destinationFileName:=root, ' This is a Root Directory! userName:="", password:="", @@ -453,20 +492,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) + + + Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(webListener.Address, destinationFileName:=root, ' This is a Root Directory! userName:="", password:="", @@ -483,105 +521,218 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_AllOptionsSet_Success() + Public Sub DownloadFile_UrlOnly_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename) - CleanUp(listener, testDirectory) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - - Public Sub DownloadFile_Uri_Success() + + + + Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFilename) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub + + + + Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) + Dim testDirectory As String = CreateTempDirectory() + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + Finally + CleanUp(listener) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + Finally + CleanUp(listener) + End Try + End Sub + - Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() + Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Assert.Throws(Of IOException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), 1) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, TestingConnectionTimeout, - overwrite:=True) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Uri_UserNamePassword_Success() + Public Sub DownloadFile_UrlWhereTimeoutNegative_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - DefaultPassword) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Uri_UserNamePassword_Throws() + Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - "WrongPassword") + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -589,43 +740,44 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() + Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename, - userName:="", + userName:=Nothing, password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=True) + overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() + Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", showUI:=False, TestingConnectionTimeout, - overwrite:=True) + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -634,71 +786,95 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() + Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) - CleanUp(listener, testDirectory) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() + Public Sub DownloadFile_UrlWithPassword_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Directory.Delete(testDirectory, recursive:=True) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + DefaultPassword) - CleanUp(listener, testDirectory) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_UriIsNothing_Throws() + Public Sub DownloadFile_UrlWithTimeOut_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) - End Sub) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWithWrongPassword_Throw(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + password) + + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) From d1279bf3245c85de7a7124e055f7a037f8e2842b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 19:14:59 -0700 Subject: [PATCH 131/342] Make Async Firend so they can be tested durectly Add more DownloadFile Tests --- .../Devices/Network/NetworkDownload.vb | 18 +- .../Windows/Forms/NetworkDownloadTests.vb | 784 +++++++++++------- 2 files changed, 503 insertions(+), 299 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index baa5b29d37c..7f29d7f3486 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -92,7 +92,7 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Private Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -121,7 +121,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Private Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -160,7 +160,7 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -189,7 +189,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -223,7 +223,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Calls to all the other overloads will come through here ''' - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, networkCredentials As ICredentials, dialog As ProgressDialog, @@ -251,7 +251,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here - Private Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, clientHandler As HttpClientHandler, dialog As ProgressDialog, @@ -266,9 +266,9 @@ Namespace Microsoft.VisualBasic.Devices Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) End If - Dim client As HttpClient = If(clientHandler IsNot Nothing, - New HttpClient(clientHandler), - New HttpClient() + Dim client As HttpClient = If(clientHandler Is Nothing, + New HttpClient(), + New HttpClient(clientHandler) ) ' Set credentials if we have any diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index aea45ccdea6..3f7a36917ba 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -27,7 +27,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Shared Function ValidateDownload(destinationFilename As String) As Long Dim fileInfo As New FileInfo(destinationFilename) - ' This directory should not be systems Temp Directory because it may be created + ' This directory should not be systems Temp Directory because it must be created + Assert.NotEqual(Path.GetTempPath, fileInfo.DirectoryName) Assert.True(Directory.Exists(fileInfo.DirectoryName)) Assert.True(fileInfo.Exists) @@ -35,7 +36,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) - Debug.Assert(testDirectory <> Path.GetTempPath) + Debug.Assert(Path.GetTempPath <> testDirectory) listener.Stop() listener.Close() If Not String.IsNullOrWhiteSpace(testDirectory) Then @@ -44,65 +45,114 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub + + Public Sub DownloadFile_UriCheckDestinationIsDirectory_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=testDirectory, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + - - - Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) + + + Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - Public Sub DownloadFile_Url_Success() + + + + Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - - Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) + + + Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -110,19 +160,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_Password_Success() + Public Sub DownloadFile_UriOnly_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - DefaultUserName, - DefaultPassword) + .DownloadFile(New Uri(webListener.Address), + destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -130,26 +177,26 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - - - Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) + + Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - DefaultUserName, - password) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -157,17 +204,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Ur_InvalidUrl_Throws() + Public Sub DownloadFile_UriWhereUriIsNothing_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, + .DownloadFile(address:=CType(Nothing, Uri), destinationFilename, userName:="", password:="", @@ -183,102 +230,53 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throws() + Public Sub DownloadFile_UriWhereUriIsNothingAllParameters_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFileName:=Nothing, + .DownloadFile(address:=CType(Nothing, Uri), + destinationFilename, userName:="", password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=False) + overwrite:=False, + UICancelOption.DoNothing) End Sub) - Finally - CleanUp(listener) - End Try - End Sub - - - Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - - Assert.Throws(Of IOException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), 1) - - CleanUp(listener, testDirectory) - End Sub - - - Public Sub DownloadFile_Url_FileExistsOverwrite_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - - Try - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() + Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, + .DownloadFile(address:=CType(Nothing, Uri), destinationFilename, userName:="", password:="", - showUI:=False, + showUI:=True, TestingConnectionTimeout, - overwrite:=False) + overwrite:=False, + UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -286,77 +284,66 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_TimeOut_Throws() + Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) - End Sub) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_TimeoutNegative_Throws() + Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) - End Sub) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_UsernameEqualNothing_Success() + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(New Uri(webListener.Address), destinationFilename, - userName:=Nothing, - password:="", - showUI:=True, + networkCredentials, + showUI:=False, TestingConnectionTimeout, - overwrite:=False) + overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -364,30 +351,109 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - - - Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) + + Public Sub DownloadFile_UriWithNonexistentTargetDirectory_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UriWithOverwriteShowUISpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - $"{destinationFilename}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) - End Sub) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithUriOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename) + + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithUserNamePassword_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + DefaultPassword) + + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UriWithWrongPassword_Throws(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + DefaultUserName, + password) + + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -395,18 +461,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_GetLongPath_Throws() + Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(webListener.Address, destinationFileName:=testDirectory, ' This is a Directory! userName:="", password:="", @@ -423,21 +488,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_RootDirectory_Throw(root As String) + + + Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try - Assert.Throws(Of InvalidOperationException)( + Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFileName:=root, ' This is a Root Directory! + .DownloadFile(webListener.Address, + $"{destinationFilename}{separator}", userName:="", password:="", showUI:=False, @@ -455,18 +519,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) + Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address Try Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ - .DownloadFile(address, + .DownloadFile(webListener.Address, destinationFileName:=root, ' This is a Root Directory! userName:="", password:="", @@ -482,31 +545,37 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_Url_AllOptionsSet_Success() + + + + Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim address As String = webListener.Address - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - CleanUp(listener, testDirectory) + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_Success() + Public Sub DownloadFile_UrlOnly_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) @@ -514,7 +583,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) @@ -523,65 +592,175 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() + + + + Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, TestingConnectionTimeout, - overwrite:=True) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFilename) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) + Dim testDirectory As String = CreateTempDirectory() + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename) + + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + Finally + CleanUp(listener) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + Finally + CleanUp(listener) + End Try + End Sub + - Public Sub DownloadFile_Uri_UserNamePassword_Success() + Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Assert.Throws(Of IOException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), 1) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - DefaultPassword) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + End Sub) + + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Uri_UserNamePassword_Throws() + Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - "WrongPassword") + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) @@ -589,43 +768,44 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() + Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename, - userName:="", + userName:=Nothing, password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=True) + overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() + Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", showUI:=False, TestingConnectionTimeout, - overwrite:=True) + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -634,71 +814,95 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() + Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) - CleanUp(listener, testDirectory) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() + Public Sub DownloadFile_UrlWithPassword_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Directory.Delete(testDirectory, recursive:=True) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + DefaultPassword) - CleanUp(listener, testDirectory) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_UriIsNothing_Throws() + Public Sub DownloadFile_UrlWithTimeOut_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) - End Sub) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWithWrongPassword_Throw(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + DefaultUserName, + password) + + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) From 03c4de1a0b49863d817b4225e991f2532a6c5944 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 19:48:09 -0700 Subject: [PATCH 132/342] Add tests --- .../Windows/Forms/NetworkDownloadTests.vb | 460 ++++++++---------- 1 file changed, 190 insertions(+), 270 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index ec289ff7e48..3f7a36917ba 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -76,167 +76,163 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of InvalidOperationException)( + Assert.Throws(Of ArgumentException)( Sub() - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - $"{destinationFilename}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.False(File.Exists(destinationFilename)) Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) - End Sub - - - - - Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - Dim listener As HttpListener = webListener.ProcessRequests() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() - Try - Assert.Throws(Of ArgumentNullException)( - Sub() + Try + Assert.Throws(Of ArgumentException)( + Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) - CleanUp(listener, testDirectory) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_Url_Success() - Assert.Throws(Of InvalidOperationException)( - Sub() + Public Sub DownloadFile_UriOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - Try - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + destinationFilename) - End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - - Public Sub DownloadFile_UriOnly_Success() + CleanUp(listener, testDirectory) + End Try End Sub - - - - Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename) - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) - - End Sub) Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() - End Sub - - Dim webListener As New WebListener(DownloadLargeFileSize) - Public Sub DownloadFile_Url_Password_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) - DefaultUserName, - End Sub) - Assert.False(File.Exists(destinationFilename)) - End Sub) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) + + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - - - Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) + + Public Sub DownloadFile_UriWhereUriIsNothing_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - DefaultUserName, - password) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address:=CType(Nothing, Uri), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) - End Sub) + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub + Public Sub DownloadFile_UriWhereUriIsNothingAllParameters_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Public Sub DownloadFile_UriWhereUriIsNothing_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -250,7 +246,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=False) + overwrite:=False, + UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -258,9 +255,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() + - Public Sub DownloadFile_Url_DestinationFileNameEqualNothing_Throws() + Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -276,21 +275,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=False, UICancelOption.DoNothing) - overwrite:=False, + End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try - End Try End Sub + Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() - Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), destinationFilename, @@ -300,20 +299,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True, UICancelOption.DoNothing) - TestingConnectionTimeout, -Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, testDirectory) - Assert.Equal(ValidateDownload(destinationFilename), 1) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) CleanUp(listener, testDirectory) - Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() + End Sub - Public Sub DownloadFile_Url_FileExistsOverwrite_Success() + Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -326,37 +324,37 @@ Assert.True(Directory.Exists(testDirectory)) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Finally + CleanUp(listener, testDirectory) - End Try End Sub + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() - Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() + Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) - Directory.Delete(testDirectory, recursive:=True) - Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + networkCredentials, + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) - CleanUp(listener, testDirectory) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Url_TimeOut_Throws() Public Sub DownloadFile_UriWithNonexistentTargetDirectory_Success() + Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -381,7 +379,7 @@ Assert.True(Directory.Exists(testDirectory)) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) - Dim address As String = webListener.Address + Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ @@ -394,22 +392,22 @@ Assert.True(Directory.Exists(testDirectory)) overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) - Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub + Public Sub DownloadFile_UriWithUriOnly_Success() - Public Sub DownloadFile_Url_TimeoutNegative_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - .DownloadFile(New Uri(webListener.Address), - destinationFilename) + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -427,33 +425,6 @@ Assert.True(Directory.Exists(testDirectory)) Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) - - End Sub) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - Public Sub DownloadFile_Url_UsernameEqualNothing_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - My.Computer.Network _ - .DownloadFile(address, destinationFilename, DefaultUserName, DefaultPassword) @@ -600,15 +571,16 @@ Assert.True(Directory.Exists(testDirectory)) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + End Try End Sub - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + Public Sub DownloadFile_UrlOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + Try My.Computer.Network _ .DownloadFile(webListener.Address, @@ -626,16 +598,15 @@ Assert.True(Directory.Exists(testDirectory)) Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, TestingConnectionTimeout, - overwrite:=True) + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFilename) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -647,7 +618,8 @@ Assert.True(Directory.Exists(testDirectory)) - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) + Dim testDirectory As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -656,40 +628,33 @@ Assert.True(Directory.Exists(testDirectory)) Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename) End Sub) + Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener) + CleanUp(listener, testDirectory) End Try End Sub + - Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) - - Dim webListener As New WebListener(DownloadSmallFileSize) + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename) - destinationFilename:=Nothing, - End Sub) - Assert.False(File.Exists(destinationFilename)) - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) End Sub) Finally @@ -697,30 +662,10 @@ Assert.True(Directory.Exists(testDirectory)) End Try End Sub - - Public Sub DownloadFile_Uri_UserNamePassword_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - DefaultPassword) - - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -734,7 +679,8 @@ Assert.True(Directory.Exists(testDirectory)) password:="", showUI:=True, TestingConnectionTimeout, - overwrite:=False) + overwrite:=False, + UICancelOption.DoNothing) End Sub) Finally @@ -742,6 +688,7 @@ Assert.True(Directory.Exists(testDirectory)) End Try End Sub + Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) @@ -769,52 +716,25 @@ Assert.True(Directory.Exists(testDirectory)) Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() - - - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - password:="", - End Sub) - - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - End Sub) - Finally - CleanUp(listener) - End Try - End Sub - - - Public Sub DownloadFile_Uri_UserNamePassword_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - DefaultUserName, - "WrongPassword") + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) - End Sub) Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) From 7e538481eada394b4bc6746c3ead32fd7d06fec0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 20:36:17 -0700 Subject: [PATCH 133/342] Add ClipboardProxy tests --- .../System/Windows/Forms/ClipboardProxyTests.vb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index b014ee9e032..fa797aff387 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -14,6 +14,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class ClipboardProxyTests Private ReadOnly _clipboardProxy As New MyServices.ClipboardProxy + + Public Sub Clipboard_ContainsText() + Dim text As String = "This is a Test!" + _clipboardProxy.SetText(text) + Assert.Equal(text, _clipboardProxy.GetText()) + End Sub + + + Public Sub Clipboard_ContainsTextWithFormat() + Dim text As String = "This is a Test!" + _clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, _clipboardProxy.GetText(TextDataFormat.Text)) + End Sub + Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() Dim result As Stream = _clipboardProxy.GetAudioStream() From 997371eb789bd57d0f3f0fb52fb594301dbf7e31 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 23:29:11 -0700 Subject: [PATCH 134/342] Update Clipboard tests Add ExceptionUtils Tests --- .../CompilerServices/ExceptionUtils.vb | 12 ++--- .../Windows/Forms/ClipboardProxyTests.vb | 46 ++++++++++--------- .../Windows/Forms/ExceptionUtilsTests.vb | 22 +++++++++ 3 files changed, 53 insertions(+), 27 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index f15bf71655c..6e49ad6ca43 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -18,19 +18,19 @@ Namespace Microsoft.VisualBasic.CompilerServices Private Sub New() End Sub - Private Shared Function GetResourceStringResourceId(ResourceId As vbErrors) As String - Dim id As String = "ID" & CStr(ResourceId) + Private Shared Function GetResourceStringResourceId(ResourceId As Integer) As String + Dim id As String = $"ID{ResourceId}" Return SR.GetResourceString(id, id) End Function - Friend Shared Function VbMakeException(hr As Integer) As Exception + Friend Shared Function VbMakeException(ResourceId As Integer) As Exception Dim description As String = "" - If hr > 0 AndAlso hr <= &HFFFFI Then - description = GetResourceStringResourceId(CType(hr, vbErrors)) + If ResourceId > 0 AndAlso ResourceId <= &HFFFFI Then + description = GetResourceStringResourceId(ResourceId) End If - Select Case hr + Select Case ResourceId Case vbErrors.FileNotFound Return New IO.FileNotFoundException(description) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index fa797aff387..a4adbcde1b2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -12,47 +12,51 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ClipboardProxyTests - Private ReadOnly _clipboardProxy As New MyServices.ClipboardProxy Public Sub Clipboard_ContainsText() Dim text As String = "This is a Test!" - _clipboardProxy.SetText(text) - Assert.Equal(text, _clipboardProxy.GetText()) + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetText(text) + Assert.Equal(text, clipboardProxy.GetText()) End Sub Public Sub Clipboard_ContainsTextWithFormat() Dim text As String = "This is a Test!" - _clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, _clipboardProxy.GetText(TextDataFormat.Text)) + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) End Sub Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() - Dim result As Stream = _clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, _clipboardProxy.GetAudioStream().Length) + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) End Sub Public Sub Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() Dim audioBytes As Byte() = {1, 2, 3} - _clipboardProxy.SetAudio(audioBytes) - Assert.True(_clipboardProxy.ContainsAudio()) - Assert.True(_clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(_clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(_clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) End Sub Public Sub Clipboard_SetAudio_InvokeStream_GetReturnsExpected() Dim audioBytes() As Byte = {1, 2, 3} + Dim clipboardProxy As New MyServices.ClipboardProxy Using audioStream As New MemoryStream(audioBytes) - _clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(_clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(_clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(_clipboardProxy.ContainsAudio()) - Assert.True(_clipboardProxy.ContainsData(DataFormats.WaveAudio)) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) End Using End Sub @@ -60,10 +64,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub Clipboard_SetFileDropList_Invoke_GetReturnsExpected() Dim filePaths As New StringCollection From {"filePath", "filePath2"} - - _clipboardProxy.SetFileDropList(filePaths) - Assert.Equal(filePaths, _clipboardProxy.GetFileDropList()) - Assert.True(_clipboardProxy.ContainsFileDropList()) + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetFileDropList(filePaths) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + Assert.True(clipboardProxy.ContainsFileDropList()) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb new file mode 100644 index 00000000000..197619a684a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -0,0 +1,22 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.Diagnostics.Runtime.ClrDiagnosticsException +Imports Microsoft.VisualBasic.CompilerServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + ''' + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' + Partial Public Class ExceptionUtilsTests + + Public Sub ExceptionUtils_Test() + Dim id As String = $"ID{CStr(vbErrors.FileNotFound)}" + Assert.Equal(ExceptionUtils.VbMakeException(vbErrors.FileNotFound).Message, SR.GetResourceString(id, id)) + End Sub + + + End Class +End Namespace From 0722feacb215fb74b157a3b7a55468c3f4b51e7e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 4 Apr 2024 23:57:26 -0700 Subject: [PATCH 135/342] Prevern crash, by making VbMakeException description nonNull --- .../CompilerServices/ExceptionUtils.vb | 3 ++- .../System/Windows/Forms/ExceptionUtilsTests.vb | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 6e49ad6ca43..e75d651850c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -20,7 +20,8 @@ Namespace Microsoft.VisualBasic.CompilerServices Private Shared Function GetResourceStringResourceId(ResourceId As Integer) As String Dim id As String = $"ID{ResourceId}" - Return SR.GetResourceString(id, id) + ' always return a string + Return $"{SR.GetResourceString(id, id)}" End Function Friend Shared Function VbMakeException(ResourceId As Integer) As Exception diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 197619a684a..d0aae40aa1f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -11,12 +11,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ExceptionUtilsTests + - Public Sub ExceptionUtils_Test() - Dim id As String = $"ID{CStr(vbErrors.FileNotFound)}" - Assert.Equal(ExceptionUtils.VbMakeException(vbErrors.FileNotFound).Message, SR.GetResourceString(id, id)) + Public Sub ExceptionUtilsTest_Fail() + Const BadResourceId As Integer = 20 + Dim id As String = $"ID{CStr(BadResourceId)}" + Assert.Equal(ExceptionUtils.VbMakeException(BadResourceId).Message, $"{SR.GetResourceString(id, id)}") End Sub + + + + + Public Sub ExceptionUtilsTest_Succeed(errorCode As Integer) + Dim id As String = $"ID{CStr(errorCode)}" + Assert.Equal(ExceptionUtils.VbMakeException(errorCode).Message, $"{SR.GetResourceString(id, id)}") + End Sub End Class End Namespace From 809242eba8a6af5eeadbac589f2652dfbdad87eb Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 5 Apr 2024 00:54:18 -0700 Subject: [PATCH 136/342] Add more ExceptionUtils Tests --- .../Windows/Forms/ExceptionUtilsTests.vb | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index d0aae40aa1f..5691276fdd3 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -1,7 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports Microsoft.Diagnostics.Runtime.ClrDiagnosticsException Imports Microsoft.VisualBasic.CompilerServices Imports Xunit @@ -13,19 +12,58 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class ExceptionUtilsTests - Public Sub ExceptionUtilsTest_Fail() - Const BadResourceId As Integer = 20 + Public Sub GetArgumentNullExceptionTest_Succeed() + Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" + Dim ex As Exception = ExceptionUtils.GetArgumentNullException("Test", resourceId) + Assert.IsType(Of ArgumentNullException)(ex) + Assert.Equal($"{resourceId} (Parameter 'Test')", ex.Message) + End Sub + + + Public Sub GetDirectoryNotFoundExceptionTest_Succeed() + Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" + Dim ex As Exception = ExceptionUtils.GetDirectoryNotFoundException(resourceId) + Assert.IsType(Of IO.DirectoryNotFoundException)(ex) + Assert.Equal(resourceId, ex.Message) + End Sub + + + Public Sub GetFileNotFoundExceptionTest_Succeed() + Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" + Dim ex As Exception = ExceptionUtils.GetFileNotFoundException("Test", resourceId) + Assert.IsType(Of IO.FileNotFoundException)(ex) + Assert.Equal(resourceId, ex.Message) + End Sub + + + Public Sub GetIOExceptionTest_Succeed() + Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" + Dim ex As Exception = ExceptionUtils.GetIOException(resourceId) + Assert.IsType(Of IO.IOException)(ex) + End Sub + + + Public Sub GetWin32ExceptionTest_Succeed() + Dim ex As Exception = ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + Assert.IsType(Of System.ComponentModel.Win32Exception)(ex) + End Sub + + + + + + Public Sub VbMakeExceptionInvalidValuesTest_Succeed(BadResourceId As Integer) Dim id As String = $"ID{CStr(BadResourceId)}" - Assert.Equal(ExceptionUtils.VbMakeException(BadResourceId).Message, $"{SR.GetResourceString(id, id)}") + Assert.Equal($"{SR.GetResourceString(id, id)}", ExceptionUtils.VbMakeException(BadResourceId).Message) End Sub - Public Sub ExceptionUtilsTest_Succeed(errorCode As Integer) + Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer) Dim id As String = $"ID{CStr(errorCode)}" - Assert.Equal(ExceptionUtils.VbMakeException(errorCode).Message, $"{SR.GetResourceString(id, id)}") + Assert.Equal($"{SR.GetResourceString(id, id)}", ExceptionUtils.VbMakeException(errorCode).Message) End Sub End Class From 6a8033bb60470b38c622b69104bf2718e2c64610 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 5 Apr 2024 01:26:27 -0700 Subject: [PATCH 137/342] Improve GetArgumentNullExceptionTest_Succeed Tests and GetIOExceptionTest_Succeed --- .../System/Windows/Forms/ExceptionUtilsTests.vb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 5691276fdd3..15ac7d43a71 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -13,10 +13,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetArgumentNullExceptionTest_Succeed() - Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" - Dim ex As Exception = ExceptionUtils.GetArgumentNullException("Test", resourceId) + Dim ex As Exception = ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") Assert.IsType(Of ArgumentNullException)(ex) - Assert.Equal($"{resourceId} (Parameter 'Test')", ex.Message) + Assert.Equal($"Property MainForm cannot be set to Nothing. (Parameter 'MainForm')", ex.Message) End Sub @@ -37,15 +36,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetIOExceptionTest_Succeed() - Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" - Dim ex As Exception = ExceptionUtils.GetIOException(resourceId) - Assert.IsType(Of IO.IOException)(ex) + Dim ex As Exception = ExceptionUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Assert.IsType(Of InvalidOperationException)(ex) End Sub Public Sub GetWin32ExceptionTest_Succeed() Dim ex As Exception = ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) - Assert.IsType(Of System.ComponentModel.Win32Exception)(ex) + Assert.IsType(Of ComponentModel.Win32Exception)(ex) End Sub From 58c83a2d04a74b6bde9eef12dd9834553ee7bbe0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 5 Apr 2024 02:44:17 -0700 Subject: [PATCH 138/342] Add more Network tests Make Async Network downlod functions Friend so they can be tested --- .../Devices/Network/NetworkDownload.vb | 116 +++-- .../Windows/Forms/NetworkDownloadTests.vb | 487 ++++++++++++------ 2 files changed, 404 insertions(+), 199 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 7f29d7f3486..a723c25f51f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -49,6 +49,53 @@ Namespace Microsoft.VisualBasic.Devices End If End Sub + ''' + ''' Gets network credentials from a userName and password + ''' + ''' The name of the user + ''' The password of the user + ''' A NetworkCredentials + Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials + + Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), + Nothing, + DirectCast(New NetworkCredential(userName, password), ICredentials) + ) + End Function + + ''' + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' Indicates whether or not to show a progress bar + ''' + Private Shared Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Return New ProgressDialog With { + .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), + .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) + } + End If + Return Nothing + End Function + + ''' + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' + ''' The remote file address + ''' A Uri if successful, otherwise it throws an exception + Private Shared Function GetUri(address As String) As Uri + Try + Return New Uri(address) + Catch ex As UriFormatException + 'Throw an exception with an error message more appropriate to our API + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) + End Try + End Function + ''' ''' Sends and receives a packet to and from the passed in Uri. ''' Maps older networkCredentials to HttpClientHandler @@ -61,7 +108,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists ''' ''' - Private Shared Function DownloadFileAsync(addressUri As Uri, + Friend Shared Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, networkCredentials As ICredentials, dialog As ProgressDialog, @@ -239,7 +286,6 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function #End If - ''' ''' Downloads a file from the network to the specified path ''' @@ -314,53 +360,6 @@ Namespace Microsoft.VisualBasic.Devices End Function - ''' - ''' Gets network credentials from a userName and password - ''' - ''' The name of the user - ''' The password of the user - ''' A NetworkCredentials - Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials - - Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), - Nothing, - DirectCast(New NetworkCredential(userName, password), ICredentials) - ) - End Function - - ''' - ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' Indicates whether or not to show a progress bar - ''' - Private Shared Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) - Return New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) - } - End If - Return Nothing - End Function - - ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) - ''' - ''' The remote file address - ''' A Uri if successful, otherwise it throws an exception - Private Shared Function GetUri(address As String) As Uri - Try - Return New Uri(address) - Catch ex As UriFormatException - 'Throw an exception with an error message more appropriate to our API - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) - End Try - End Function - ''' ''' Downloads a file from the network to the specified path ''' @@ -491,7 +490,8 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel:=UICancelOption.ThrowException) - If t.IsFaulted Then ' This will be true if any parameters are bad + If t.IsFaulted Then + ' This will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() @@ -567,7 +567,8 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel) - If t.IsFaulted Then ' This will be true if any parameters are bad + If t.IsFaulted Then + ' IsFaulted will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() @@ -618,7 +619,8 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel:=UICancelOption.ThrowException) - If t.IsFaulted Then ' This will be true if any parameters are bad + If t.IsFaulted Then + ' IsFaulted will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() @@ -674,7 +676,8 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel) - If t.IsFaulted Then ' This will be true if any parameters are bad + If t.IsFaulted Then + ' IsFaulted will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() @@ -724,7 +727,9 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel:=UICancelOption.ThrowException) - If t.IsFaulted Then ' This will be true if any parameters are bad + + If t.IsFaulted Then + ' IsFaulted will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() @@ -780,7 +785,8 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout, overwrite, onUserCancel) - If t.IsFaulted Then ' This will be true if any parameters are bad + If t.IsFaulted Then + ' IsFaulted will be true if any parameters are bad Throw t.Exception Else dialog?.ShowProgressDialog() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 3f7a36917ba..3dcecfa3d78 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -40,7 +40,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests listener.Stop() listener.Close() If Not String.IsNullOrWhiteSpace(testDirectory) Then + Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + Directory.Delete(testDirectory, recursive:=True) End If End Sub @@ -67,6 +69,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -96,6 +99,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -125,6 +129,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -154,6 +159,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -172,6 +178,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -189,15 +196,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -215,15 +223,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -241,16 +250,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -268,16 +278,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -292,13 +303,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -315,12 +326,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -328,6 +339,87 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanUp(listener, testDirectory) End Sub + + Public Sub DownloadFile_UriWithAllOptionsSpecifiedWhereInvalidAddress_Fail() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(CType(Nothing, Uri), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Assert.True(Directory.Exists(testDirectory)) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithAllOptionsSpecifiedWhereInvalidTimeout_Fail() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=-1, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Assert.True(Directory.Exists(testDirectory)) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithICredentialsEqualNothingShowUiTimeOutOverwriteSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + networkCredentials:=Nothing, + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim testDirectory As String = CreateTempDirectory() @@ -339,13 +431,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + networkCredentials, + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -360,13 +453,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -384,14 +477,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -410,6 +504,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -430,6 +525,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultPassword) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -455,6 +551,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -472,16 +569,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=testDirectory, ' This is a Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + destinationFileName:=testDirectory, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -501,16 +599,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - $"{destinationFilename}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -530,16 +629,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -559,16 +659,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -587,6 +688,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -605,11 +707,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFilename) + .DownloadFile(address, destinationFilename) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -632,6 +734,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -649,14 +752,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) End Sub) + Finally CleanUp(listener) End Try @@ -674,15 +778,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) + Finally CleanUp(listener) End Try @@ -699,15 +804,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) End Sub) - Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), 1) @@ -726,16 +830,45 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWhereUriIsNothingSpecifyOnUserCancel_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address:=CType(Nothing, String), + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -753,15 +886,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -777,14 +911,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:=Nothing, - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:=Nothing, + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -799,13 +934,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -813,6 +948,66 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanUp(listener, testDirectory) End Sub + + + + Public Sub DownloadFile_UrlWithAllOptionsSpecifiedWhereInvalidAddress_Fail(address As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Assert.True(Directory.Exists(testDirectory)) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWithAllOptionsSpecifiedWhereInvalidTimeout_Fail() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=-1, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub) + + Assert.False(File.Exists(destinationFilename)) + Assert.True(Directory.Exists(testDirectory)) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() Dim testDirectory As String = CreateTempDirectory() @@ -823,15 +1018,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -852,6 +1048,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultPassword) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally CleanUp(listener, testDirectory) End Try @@ -869,16 +1066,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try @@ -904,6 +1102,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) + Finally CleanUp(listener, testDirectory) End Try From 401077800a70c78910ecfc12dc972dc965ea7137 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 5 Apr 2024 03:11:32 -0700 Subject: [PATCH 139/342] Fix license headers --- .../System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 0e6771966fd..75f65ed8825 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -1,4 +1,5 @@ -' The .NET Foundation licenses this file to you under the MIT license. +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. Imports System.Text Imports Xunit From b5a2e407cd3c185e915ea135852bd0a79a705ef3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 03:00:27 -0700 Subject: [PATCH 140/342] Minir code cleanup Improve code coverage --- .../Devices/Network/NetworkDownload.vb | 434 ++++++++---------- .../Devices/Network/NetworkUtilities.vb | 88 ++++ .../MyServices/Internal/HttpClientCopy.vb | 14 +- .../Windows/Forms/NetworkDownloadTests.vb | 49 ++ 4 files changed, 324 insertions(+), 261 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index a723c25f51f..da138f7b122 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -16,86 +16,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Partial Public Class Network - ' Password used in overloads where there is no password parameter - Private Const DEFAULT_PASSWORD As String = "" - - ' Default timeout value - Private Const DEFAULT_TIMEOUT As Integer = 100000 - - ' UserName used in overloads where there is no userName parameter - Private Const DEFAULT_USERNAME As String = "" - ''' ''' Creates class and hooks up events ''' Public Sub New() End Sub - ''' - ''' Posts a message to close the progress dialog - ''' - Private Shared Sub CloseProgressDialog(dialog As ProgressDialog) - ' Don't invoke unless dialog is up and running - If dialog IsNot Nothing Then - dialog.IndicateClosing() - - If dialog.IsHandleCreated Then - dialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf dialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - dialog.Close() - End If - End If - End Sub - - ''' - ''' Gets network credentials from a userName and password - ''' - ''' The name of the user - ''' The password of the user - ''' A NetworkCredentials - Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials - - Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), - Nothing, - DirectCast(New NetworkCredential(userName, password), ICredentials) - ) - End Function - - ''' - ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' Indicates whether or not to show a progress bar - ''' - Private Shared Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) - Return New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) - } - End If - Return Nothing - End Function - - ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) - ''' - ''' The remote file address - ''' A Uri if successful, otherwise it throws an exception - Private Shared Function GetUri(address As String) As Uri - Try - Return New Uri(address) - Catch ex As UriFormatException - 'Throw an exception with an error message more appropriate to our API - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) - End Try - End Function - ''' ''' Sends and receives a packet to and from the passed in Uri. ''' Maps older networkCredentials to HttpClientHandler @@ -132,14 +58,14 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Downloads a file from the network to the specified path ''' - ''' Address to the remote file, http, ftp etc... + ''' Uri to the remote file ''' Name and path of file where download is saved ''' The name of the user performing the download ''' The user's password ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Friend Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -147,7 +73,7 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) As Task - Await DownloadFileAsync(address, + Await DownloadFileAsync(addressUri, destinationFileName, userName, password, @@ -160,15 +86,15 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Downloads a file from the network to the specified path ''' - ''' Address to the remote file, http, ftp etc... + ''' Uri to the remote file ''' Name and path of file where download is saved ''' The name of the user performing the download ''' The user's password - ''' A ProgressDialog or Nothing + ''' ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Friend Shared Async Function DownloadFileAsync(address As String, + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, password As String, @@ -177,14 +103,6 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) As Task - ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). - ' However, it is good practice to verify address before calling Trim. - If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) - End If - - Dim addressUri As Uri = GetUri(address.Trim()) - ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) @@ -202,12 +120,87 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Uri to the remote file ''' Name and path of file where download is saved + ''' An HttpClientHandler of the user performing the download + ''' Progress Dialog + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Calls to all the other overloads will come through here + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + clientHandler As HttpClientHandler, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + If connectionTimeout <= 0 Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + End If + + If addressUri Is Nothing Then + Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) + End If + + Dim client As HttpClient = If(clientHandler Is Nothing, + New HttpClient(), + New HttpClient(clientHandler) + ) + + ' Set credentials if we have any + client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) + + 'Construct the local file. This will validate the full name and path + Dim normalizedFilePath As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really + ' have a file and path + If IO.Directory.Exists(normalizedFilePath) Then + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + 'Throw if the file exists and the user doesn't want to overwrite + If Not overwrite AndAlso IO.File.Exists(normalizedFilePath) Then + Throw New IO.IOException(Utils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + End If + + 'Check to see if the target directory exists. If it doesn't, create it + Dim targetDirectory As String = IO.Path.GetDirectoryName(normalizedFilePath) + + ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect + If String.IsNullOrEmpty(targetDirectory) Then + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + If Not IO.Directory.Exists(targetDirectory) Then + IO.Directory.CreateDirectory(targetDirectory) + End If + + 'Create the copier + Dim copier As New HttpClientCopy(client, dialog) + + 'Download the file + Try + Await copier.DownloadFileWorkerAsync(addressUri, + normalizedFilePath).ConfigureAwait(continueOnCapturedContext:=False) + Catch ex As Exception + If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then + Throw + End If + End Try + + End Function + + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved ''' The name of the user performing the download ''' The user's password ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -215,7 +208,7 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) As Task - Await DownloadFileAsync(addressUri, + Await DownloadFileAsync(address, destinationFileName, userName, password, @@ -228,15 +221,15 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file + ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved ''' The name of the user performing the download ''' The user's password - ''' ProgressDialog or Nothing + ''' A ProgressDialog or Nothing ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, @@ -245,6 +238,12 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) As Task + If String.IsNullOrWhiteSpace(address) Then + Throw ExUtils.GetArgumentNullException(NameOf(address)) + End If + + Dim addressUri As Uri = GetUri(address.Trim()) + ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) @@ -257,7 +256,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) End Function -#If False Then ' Here in case DownloadFileAsync becomes public +#If False Then ' Future API ''' ''' Downloads a file from the network to the specified path ''' @@ -286,79 +285,6 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function #End If - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' An HttpClientHandler of the user performing the download - ''' Progress Dialog - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - clientHandler As HttpClientHandler, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task - If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) - End If - - If addressUri Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) - End If - - Dim client As HttpClient = If(clientHandler Is Nothing, - New HttpClient(), - New HttpClient(clientHandler) - ) - - ' Set credentials if we have any - client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) - - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) - ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really - ' have a file and path - If IO.Directory.Exists(fullFilename) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - 'Throw if the file exists and the user doesn't want to overwrite - If Not overwrite AndAlso IO.File.Exists(fullFilename) Then - Throw New IO.IOException(Utils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) - End If - - 'Check to see if the target directory exists. If it doesn't, create it - Dim targetDirectory As String = IO.Path.GetDirectoryName(fullFilename) - - ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect - If String.IsNullOrEmpty(targetDirectory) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - If Not IO.Directory.Exists(targetDirectory) Then - IO.Directory.CreateDirectory(targetDirectory) - End If - - 'Create the copier - Dim copier As New HttpClientCopy(client, dialog) - - 'Download the file - Try - Await copier.DownloadFileAsync(address:=addressUri, - destinationFileName:=fullFilename).ConfigureAwait(continueOnCapturedContext:=False) - Catch ex As Exception - If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then - Throw - End If - End Try - - End Function ''' ''' Downloads a file from the network to the specified path @@ -383,29 +309,6 @@ Namespace Microsoft.VisualBasic.Devices End Try End Sub - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - Public Sub DownloadFile(address As Uri, - destinationFileName As String) - Try - DownloadFileAsync(addressUri:=address, - destinationFileName, - userName:=DEFAULT_USERNAME, - password:=DEFAULT_PASSWORD, - dialog:=Nothing, - connectionTimeout:=DEFAULT_TIMEOUT, - overwrite:=False).Wait() - Catch ex As Exception - If ex.InnerException IsNot Nothing Then - Throw ex.InnerException - End If - Throw - End Try - End Sub - ''' ''' Downloads a file from the network to the specified path ''' @@ -433,34 +336,6 @@ Namespace Microsoft.VisualBasic.Devices End Try End Sub - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String) - Try - DownloadFileAsync(addressUri:=address, - destinationFileName, - userName, - password, - dialog:=Nothing, - connectionTimeout:=DEFAULT_TIMEOUT, - overwrite:=False).Wait() - Catch ex As Exception - If ex.InnerException IsNot Nothing Then - Throw ex.InnerException - End If - Throw - End Try - - End Sub - ''' ''' Downloads a file from the network to the specified path ''' @@ -592,18 +467,18 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Uri to the remote file ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password + ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If @@ -613,12 +488,12 @@ Namespace Microsoft.VisualBasic.Devices dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, destinationFileName, - userName, - password, + networkCredentials, dialog, connectionTimeout, overwrite, onUserCancel:=UICancelOption.ThrowException) + If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -644,32 +519,32 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Uri to the remote file ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password + ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, destinationFileName As String, - userName As String, - password As String, + networkCredentials As ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As UICancelOption) + If connectionTimeout <= 0 Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + End If + If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(addressUri:=address, + Dim t As Task = DownloadFileAsync(address, destinationFileName, networkCredentials, dialog, @@ -701,18 +576,18 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Uri to the remote file ''' Name and path of file where download is saved - ''' The credentials of the user performing the download + ''' The name of the user performing the download + ''' The user's password ''' Indicates whether or not to show a progress bar ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) - + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If @@ -722,12 +597,12 @@ Namespace Microsoft.VisualBasic.Devices dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, destinationFileName, - networkCredentials, + userName, + password, dialog, connectionTimeout, overwrite, onUserCancel:=UICancelOption.ThrowException) - If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -753,32 +628,32 @@ Namespace Microsoft.VisualBasic.Devices '''
''' Uri to the remote file ''' Name and path of file where download is saved - ''' The credentials of the user performing the download + ''' The name of the user performing the download + ''' The user's password ''' Indicates whether or not to show a progress bar ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, destinationFileName As String, - networkCredentials As ICredentials, + userName As String, + password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As UICancelOption) - If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) - End If - If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(address, + Dim t As Task = DownloadFileAsync(addressUri:=address, destinationFileName, networkCredentials, dialog, @@ -805,5 +680,56 @@ Namespace Microsoft.VisualBasic.Devices End Try End Sub + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + Public Sub DownloadFile(address As Uri, + destinationFileName As String) + Try + DownloadFileAsync(addressUri:=address, + destinationFileName, + userName:=DEFAULT_USERNAME, + password:=DEFAULT_PASSWORD, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() + Catch ex As Exception + If ex.InnerException IsNot Nothing Then + Throw ex.InnerException + End If + Throw + End Try + End Sub + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + Public Sub DownloadFile(address As Uri, + destinationFileName As String, + userName As String, + password As String) + Try + DownloadFileAsync(addressUri:=address, + destinationFileName, + userName, + password, + dialog:=Nothing, + connectionTimeout:=DEFAULT_TIMEOUT, + overwrite:=False).Wait() + Catch ex As Exception + If ex.InnerException IsNot Nothing Then + Throw ex.InnerException + End If + Throw + End Try + + End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb new file mode 100644 index 00000000000..11823c86937 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -0,0 +1,88 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.MyServices.Internal + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Namespace Microsoft.VisualBasic.Devices + Friend Module NetworkUtilities + + ' Password used in overloads where there is no password parameter + Friend Const DEFAULT_PASSWORD As String = "" + + ' Default timeout value + Friend Const DEFAULT_TIMEOUT As Integer = 100000 + + ' UserName used in overloads where there is no userName parameter + Friend Const DEFAULT_USERNAME As String = "" + + ''' + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' Indicates whether or not to show a progress bar + ''' New ProgressDialog + Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Return New ProgressDialog With { + .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), + .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) + } + End If + Return Nothing + End Function + + ''' + ''' Posts a message to close the progress dialog + ''' + Friend Sub CloseProgressDialog(dialog As ProgressDialog) + ' Don't invoke unless dialog is up and running + If dialog IsNot Nothing Then + dialog.IndicateClosing() + + If dialog.IsHandleCreated Then + dialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf dialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + dialog.Close() + End If + End If + End Sub + + ''' + ''' Gets network credentials from a userName and password + ''' + ''' The name of the user + ''' The password of the user + ''' A new NetworkCredentials or Nothing + Friend Function GetNetworkCredentials(userName As String, password As String) As ICredentials + + Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), + Nothing, + DirectCast(New NetworkCredential(userName, password), ICredentials) + ) + End Function + + ''' + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' + ''' The remote file address + ''' A Uri if successful, otherwise it throws an exception + Friend Function GetUri(address As String) As Uri + Try + Return New Uri(address) + Catch ex As UriFormatException + 'Throw an exception with an error message more appropriate to our API + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) + End Try + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 3793d646b93..160663953d2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -104,12 +104,12 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Downloads a file ''' - ''' The source for the file - ''' The path and name where the file is saved - Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String) As Task + ''' The source for the file + ''' The path and name where the file is to be saved + Friend Async Function DownloadFileWorkerAsync(addressUri As Uri, normalizedFilePath As String) As Task Debug.Assert(_httpClient IsNot Nothing, "No HttpClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") + Debug.Assert(addressUri IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(normalizedFilePath)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(normalizedFilePath))), "Invalid path") _cancelTokenSourceGet = New CancellationTokenSource() _cancelTokenSourceRead = New CancellationTokenSource() @@ -118,7 +118,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Dim response As HttpResponseMessage = Nothing Try - response = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead, _cancelTokenSourceGet.Token).ConfigureAwait(False) + response = Await _httpClient.GetAsync(addressUri, HttpCompletionOption.ResponseHeadersRead, _cancelTokenSourceGet.Token).ConfigureAwait(False) Catch ex As TaskCanceledException If ex.CancellationToken = _cancelTokenSourceRead.Token Then ' a real cancellation, triggered by the caller @@ -132,7 +132,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Dim contentLength? As Long = response?.Content.Headers.ContentLength If contentLength.HasValue Then Using responseStream As Stream = Await response.Content.ReadAsStreamAsync(_cancelTokenSourceReadStream.Token).ConfigureAwait(False) - Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) + Using fileStream As New FileStream(normalizedFilePath, FileMode.Create, FileAccess.Write, FileShare.None) Dim buffer(8191) As Byte Dim totalBytesRead As Long = 0 diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 3dcecfa3d78..6fd2d62a52a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -4,6 +4,7 @@ Imports System.IO Imports System.Net Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices.Internal Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -420,6 +421,29 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub + + Public Sub DownloadFile_UrlWithICredentialsEqualNothingShowUiTimeOutOverwriteSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + networkCredentials:=Nothing, + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim testDirectory As String = CreateTempDirectory() @@ -1054,6 +1078,31 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub + + Public Sub DownloadFile_UriNetworkCredentials_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) + + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + networkCredentials, + Nothing, + TestingConnectionTimeout, + overwrite:=False) + + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + Public Sub DownloadFile_UrlWithTimeOut_Throws() Dim testDirectory As String = CreateTempDirectory() From a305fc7054a69c40cb757257bc4493ad17193cfd Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 03:44:06 -0700 Subject: [PATCH 141/342] Separate out Async functions Add More Tests --- .../Devices/Network/NetworkDownload.vb | 282 +----------------- .../Devices/Network/NetworkDownloadAsync.vb | 277 +++++++++++++++++ .../Windows/Forms/ClipboardProxyTests.vb | 81 +++-- .../Windows/Forms/NetworkDownloadTests.vb | 38 --- 4 files changed, 334 insertions(+), 344 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index da138f7b122..93e5b52ca52 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -2,7 +2,6 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Net -Imports System.Net.Http Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal @@ -11,9 +10,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices - ''' - ''' An object that allows easy access to some simple network properties and functionality. - ''' Partial Public Class Network ''' @@ -22,277 +18,12 @@ Namespace Microsoft.VisualBasic.Devices Public Sub New() End Sub - ''' - ''' Sends and receives a packet to and from the passed in Uri. - ''' Maps older networkCredentials to HttpClientHandler - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' - ''' - Friend Shared Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task - - Dim clientHandler As HttpClientHandler = If(networkCredentials Is Nothing, - New HttpClientHandler, - New HttpClientHandler With {.Credentials = networkCredentials} - ) - Return DownloadFileAsync(addressUri, - destinationFileName, - clientHandler, - dialog, - connectionTimeout, - overwrite, - onUserCancel) - End Function - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(addressUri, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) - End Function - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task - - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) - End Function - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' An HttpClientHandler of the user performing the download - ''' Progress Dialog - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - clientHandler As HttpClientHandler, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task - If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) - End If - - If addressUri Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) - End If - - Dim client As HttpClient = If(clientHandler Is Nothing, - New HttpClient(), - New HttpClient(clientHandler) - ) - - ' Set credentials if we have any - client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) - - 'Construct the local file. This will validate the full name and path - Dim normalizedFilePath As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) - ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really - ' have a file and path - If IO.Directory.Exists(normalizedFilePath) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - 'Throw if the file exists and the user doesn't want to overwrite - If Not overwrite AndAlso IO.File.Exists(normalizedFilePath) Then - Throw New IO.IOException(Utils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) - End If - - 'Check to see if the target directory exists. If it doesn't, create it - Dim targetDirectory As String = IO.Path.GetDirectoryName(normalizedFilePath) - - ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect - If String.IsNullOrEmpty(targetDirectory) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - If Not IO.Directory.Exists(targetDirectory) Then - IO.Directory.CreateDirectory(targetDirectory) - End If - - 'Create the copier - Dim copier As New HttpClientCopy(client, dialog) - - 'Download the file - Try - Await copier.DownloadFileWorkerAsync(addressUri, - normalizedFilePath).ConfigureAwait(continueOnCapturedContext:=False) - Catch ex As Exception - If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then - Throw - End If - End Try - - End Function - - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - Friend Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) - End Function - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Friend Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task - - If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) - End If - - Dim addressUri As Uri = GetUri(address.Trim()) - - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) - End Function - -#If False Then ' Future API - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' - ''' Calls to all the other overloads will come through here - ''' - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) - End Function -#End If - ''' ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved - Public Sub DownloadFile(address As String, - destinationFileName As String) + Public Sub DownloadFile(address As String, destinationFileName As String) Try DownloadFileAsync(address, destinationFileName, @@ -491,8 +222,8 @@ Namespace Microsoft.VisualBasic.Devices networkCredentials, dialog, connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException) + overwrite + ) If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad @@ -593,12 +324,14 @@ Namespace Microsoft.VisualBasic.Devices End If Dim dialog As ProgressDialog = Nothing + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, destinationFileName, - userName, - password, + networkCredentials, dialog, connectionTimeout, overwrite, @@ -688,6 +421,7 @@ Namespace Microsoft.VisualBasic.Devices Public Sub DownloadFile(address As Uri, destinationFileName As String) Try + DownloadFileAsync(addressUri:=address, destinationFileName, userName:=DEFAULT_USERNAME, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb new file mode 100644 index 00000000000..d7b0e95f243 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb @@ -0,0 +1,277 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net +Imports System.Net.Http +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices.Internal + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Namespace Microsoft.VisualBasic.Devices + + Partial Public Class Network + + ''' + ''' Sends and receives a packet to and from the passed in Uri. + ''' Maps older networkCredentials to HttpClientHandler + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' A ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' + Friend Shared Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + + Dim clientHandler As HttpClientHandler = If(networkCredentials Is Nothing, + New HttpClientHandler, + New HttpClientHandler With {.Credentials = networkCredentials} + ) + Return DownloadFileAsync(addressUri, + destinationFileName, + clientHandler, + dialog, + connectionTimeout, + overwrite, + onUserCancel) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' A ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync(addressUri, + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Await DownloadFileAsync(addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' An HttpClientHandler of the user performing the download + ''' Progress Dialog + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Calls to all the other overloads will come through here + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + clientHandler As HttpClientHandler, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + If connectionTimeout <= 0 Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + End If + + If addressUri Is Nothing Then + Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) + End If + + Dim client As HttpClient = If(clientHandler Is Nothing, + New HttpClient(), + New HttpClient(clientHandler) + ) + + ' Set credentials if we have any + client.Timeout = New TimeSpan(0, 0, 0, 0, connectionTimeout) + + 'Construct the local file. This will validate the full name and path + Dim normalizedFilePath As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really + ' have a file and path + If IO.Directory.Exists(normalizedFilePath) Then + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + 'Throw if the file exists and the user doesn't want to overwrite + If Not overwrite AndAlso IO.File.Exists(normalizedFilePath) Then + Throw New IO.IOException(Utils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + End If + + 'Check to see if the target directory exists. If it doesn't, create it + Dim targetDirectory As String = IO.Path.GetDirectoryName(normalizedFilePath) + + ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect + If String.IsNullOrEmpty(targetDirectory) Then + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + If Not IO.Directory.Exists(targetDirectory) Then + IO.Directory.CreateDirectory(targetDirectory) + End If + + 'Create the copier + Dim copier As New HttpClientCopy(client, dialog) + + 'Download the file + Try + Await copier.DownloadFileWorkerAsync(addressUri, + normalizedFilePath).ConfigureAwait(continueOnCapturedContext:=False) + Catch ex As Exception + If onUserCancel = UICancelOption.ThrowException OrElse Not dialog.UserCanceledTheDialog Then + Throw + End If + End Try + + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' A ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + Friend Shared Async Function DownloadFileAsync(address As String, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync(address, + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' A ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + Friend Shared Async Function DownloadFileAsync(address As String, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + + If String.IsNullOrWhiteSpace(address) Then + Throw ExUtils.GetArgumentNullException(NameOf(address)) + End If + + Dim addressUri As Uri = GetUri(address.Trim()) + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Await DownloadFileAsync(addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) + End Function + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' A ProgressDialog or Nothing + ''' Time allotted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' + ''' Function will Throw on unhandled exceptions + ''' + Friend Shared Async Function DownloadFileAsync(addressUri As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync(addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index a4adbcde1b2..23ed588ddf4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -12,62 +12,79 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ClipboardProxyTests + Private ReadOnly _lockObject As New Object + + Private Function GetUniqueText() As String + Return Guid.NewGuid().ToString("D") + End Function Public Sub Clipboard_ContainsText() - Dim text As String = "This is a Test!" - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetText(text) - Assert.Equal(text, clipboardProxy.GetText()) + SyncLock _lockObject + Dim text As String = GetUniqueText() + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetText(text) + Assert.Equal(text, clipboardProxy.GetText()) + End SyncLock End Sub Public Sub Clipboard_ContainsTextWithFormat() - Dim text As String = "This is a Test!" - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + SyncLock _lockObject + Dim text As String = GetUniqueText() + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + End SyncLock End Sub Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim result As Stream = clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + SyncLock _lockObject + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + End SyncLock End Sub Public Sub Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() - Dim audioBytes As Byte() = {1, 2, 3} - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetAudio(audioBytes) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + SyncLock _lockObject + Dim audioBytes As Byte() = {1, 2, 3} + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + End SyncLock End Sub Public Sub Clipboard_SetAudio_InvokeStream_GetReturnsExpected() - Dim audioBytes() As Byte = {1, 2, 3} - Dim clipboardProxy As New MyServices.ClipboardProxy - Using audioStream As New MemoryStream(audioBytes) - clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - End Using + SyncLock _lockObject + Dim audioBytes() As Byte = {1, 2, 3} + Dim clipboardProxy As New MyServices.ClipboardProxy + Using audioStream As New MemoryStream(audioBytes) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using + End SyncLock End Sub Public Sub Clipboard_SetFileDropList_Invoke_GetReturnsExpected() - Dim filePaths As New StringCollection From + SyncLock _lockObject + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim filePaths As New StringCollection From {"filePath", "filePath2"} - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetFileDropList(filePaths) - Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) - Assert.True(clipboardProxy.ContainsFileDropList()) + clipboardProxy.SetFileDropList(filePaths) + Assert.True(clipboardProxy.ContainsFileDropList()) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + End SyncLock End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 6fd2d62a52a..654fc16bbd8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -4,7 +4,6 @@ Imports System.IO Imports System.Net Imports Microsoft.VisualBasic.FileIO -Imports Microsoft.VisualBasic.MyServices.Internal Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -70,7 +69,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -100,7 +98,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -130,7 +127,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -160,7 +156,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -179,7 +174,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -206,7 +200,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -233,7 +226,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -261,7 +253,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -289,7 +280,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -363,7 +353,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Assert.True(Directory.Exists(testDirectory)) - Finally CleanUp(listener, testDirectory) End Try @@ -392,7 +381,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Assert.True(Directory.Exists(testDirectory)) - Finally CleanUp(listener, testDirectory) End Try @@ -415,7 +403,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -462,7 +449,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -509,7 +495,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -528,7 +513,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -549,7 +533,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultPassword) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -575,7 +558,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -603,7 +585,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -633,7 +614,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -663,7 +643,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -693,7 +672,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -712,7 +690,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests destinationFilename) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -735,7 +712,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -758,7 +734,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -784,7 +759,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) - Finally CleanUp(listener) End Try @@ -811,7 +785,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) End Sub) - Finally CleanUp(listener) End Try @@ -864,7 +837,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -892,7 +864,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -919,7 +890,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -943,7 +913,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -997,7 +966,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Assert.True(Directory.Exists(testDirectory)) - Finally CleanUp(listener, testDirectory) End Try @@ -1026,7 +994,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.False(File.Exists(destinationFilename)) Assert.True(Directory.Exists(testDirectory)) - Finally CleanUp(listener, testDirectory) End Try @@ -1051,7 +1018,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -1072,7 +1038,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests DefaultPassword) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -1097,7 +1062,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally CleanUp(listener, testDirectory) End Try @@ -1125,7 +1089,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try @@ -1151,7 +1114,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Finally CleanUp(listener, testDirectory) End Try From 7fcf0524a2d56196ecf9bf055230197b4498e890 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 03:49:54 -0700 Subject: [PATCH 142/342] Fix ClipBoard tests to avoid race condition --- .../Windows/Forms/ClipboardProxyTests.vb | 80 +++++++------------ 1 file changed, 31 insertions(+), 49 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 23ed588ddf4..30fdd1a54cd 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -12,7 +12,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere '''
Partial Public Class ClipboardProxyTests - Private ReadOnly _lockObject As New Object Private Function GetUniqueText() As String Return Guid.NewGuid().ToString("D") @@ -20,71 +19,54 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub Clipboard_ContainsText() - SyncLock _lockObject - Dim text As String = GetUniqueText() - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetText(text) - Assert.Equal(text, clipboardProxy.GetText()) - End SyncLock - End Sub - - - Public Sub Clipboard_ContainsTextWithFormat() - SyncLock _lockObject - Dim text As String = GetUniqueText() - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) - End SyncLock + Dim text As String = GetUniqueText() + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetText(text) + Assert.Equal(text, clipboardProxy.GetText()) + text = GetUniqueText() + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) End Sub Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() - SyncLock _lockObject - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim result As Stream = clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) End Sub Public Sub Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() - SyncLock _lockObject - Dim audioBytes As Byte() = {1, 2, 3} - Dim clipboardProxy As New MyServices.ClipboardProxy - clipboardProxy.SetAudio(audioBytes) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) - End SyncLock + Dim audioBytes As Byte() = {1, 2, 3} + Dim clipboardProxy As New MyServices.ClipboardProxy + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) End Sub Public Sub Clipboard_SetAudio_InvokeStream_GetReturnsExpected() - SyncLock _lockObject - Dim audioBytes() As Byte = {1, 2, 3} - Dim clipboardProxy As New MyServices.ClipboardProxy - Using audioStream As New MemoryStream(audioBytes) - clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - End Using - End SyncLock + Dim audioBytes() As Byte = {1, 2, 3} + Dim clipboardProxy As New MyServices.ClipboardProxy + Using audioStream As New MemoryStream(audioBytes) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using End Sub Public Sub Clipboard_SetFileDropList_Invoke_GetReturnsExpected() - SyncLock _lockObject - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim filePaths As New StringCollection From + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim filePaths As New StringCollection From {"filePath", "filePath2"} - clipboardProxy.SetFileDropList(filePaths) - Assert.True(clipboardProxy.ContainsFileDropList()) - Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) - End SyncLock + clipboardProxy.SetFileDropList(filePaths) + Assert.True(clipboardProxy.ContainsFileDropList()) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) End Sub End Class From 24d86ca5b712c1608e22971fe05c072ab8ccfc30 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 14:32:53 -0700 Subject: [PATCH 143/342] Convert ExceptionUtils to a Module to improve code coverage --- .../CompilerServices/ExceptionUtils.vb | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index e75d651850c..b9961279b9c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -12,19 +12,15 @@ Namespace Microsoft.VisualBasic.CompilerServices End Enum ' Implements error utilities for Basic - Friend NotInheritable Class ExceptionUtils + Friend Module ExceptionUtils - ' Prevent creation. - Private Sub New() - End Sub - - Private Shared Function GetResourceStringResourceId(ResourceId As Integer) As String + Private Function GetResourceStringResourceId(ResourceId As Integer) As String Dim id As String = $"ID{ResourceId}" ' always return a string Return $"{SR.GetResourceString(id, id)}" End Function - Friend Shared Function VbMakeException(ResourceId As Integer) As Exception + Friend Function VbMakeException(ResourceId As Integer) As Exception Dim description As String = "" If ResourceId > 0 AndAlso ResourceId <= &HFFFFI Then @@ -53,9 +49,9 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of ArgumentException. ''' This is the preferred way to construct an argument exception. - Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, - ResourceID As String, - ParamArray PlaceHolders() As String) As ArgumentException + Friend Function GetArgumentExceptionWithArgName(ArgumentName As String, + ResourceID As String, + ParamArray PlaceHolders() As String) As ArgumentException Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function @@ -65,7 +61,7 @@ Namespace Microsoft.VisualBasic.CompilerServices '''
''' The name of the argument (parameter). Not localized. ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException + Friend Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) End Function @@ -77,9 +73,9 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String, - ResourceID As String, - ParamArray PlaceHolders() As String) As ArgumentNullException + Friend Function GetArgumentNullException(ArgumentName As String, + ResourceID As String, + ParamArray PlaceHolders() As String) As ArgumentNullException Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) End Function @@ -90,8 +86,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.DirectoryNotFoundException. - Friend Shared Function GetDirectoryNotFoundException(ResourceID As String, - ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException + Friend Function GetDirectoryNotFoundException(ResourceID As String, + ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) End Function @@ -103,8 +99,9 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.FileNotFoundException. - Friend Shared Function GetFileNotFoundException(FileName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException + Friend Function GetFileNotFoundException(FileName As String, + ResourceID As String, + ParamArray PlaceHolders() As String) As IO.FileNotFoundException Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) End Function @@ -115,8 +112,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of InvalidOperationException. - Friend Shared Function GetInvalidOperationException( - ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException + Friend Function GetInvalidOperationException(ResourceID As String, + ParamArray PlaceHolders() As String) As InvalidOperationException Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) End Function @@ -127,7 +124,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.IOException. - Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException + Friend Function GetIOException(ResourceID As String, + ParamArray PlaceHolders() As String) As IO.IOException Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) End Function @@ -140,10 +138,11 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Shared Function GetWin32Exception(ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception + Friend Function GetWin32Exception(ResourceID As String, + ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) End Function - End Class + End Module End Namespace From b122a660b9347094662a4e453ee56e5dd29a2b61 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 16:42:38 -0700 Subject: [PATCH 144/342] Refactor Hosting file to HostingServices Fix related spelling errors --- .../Helpers/{Hosting.vb => HostServices.vb} | 11 ------- .../Microsoft/VisualBasic/Helpers/IVbHost.vb | 13 ++++++++ .../src/Microsoft/VisualBasic/Interaction.vb | 30 ++++++++----------- 3 files changed, 26 insertions(+), 28 deletions(-) rename src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/{Hosting.vb => HostServices.vb} (62%) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/HostServices.vb similarity index 62% rename from src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb rename to src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/HostServices.vb index 50af821b5cd..279f65886b8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/HostServices.vb @@ -3,18 +3,10 @@ Namespace Microsoft.VisualBasic.CompilerServices - - Public Interface IVbHost - Function GetParentWindow() As System.Windows.Forms.IWin32Window - Function GetWindowTitle() As String - End Interface - Public NotInheritable Class HostServices -#Disable Warning IDE0032 ' Use auto property, Justification:= Private Shared s_host As IVbHost -#Enable Warning IDE0032 ' Use auto property Public Shared Property VBHost() As IVbHost Get @@ -27,7 +19,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Property End Class - End Namespace - - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb new file mode 100644 index 00000000000..660b6709762 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb @@ -0,0 +1,13 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.CompilerServices + + Public Interface IVbHost + Function GetParentWindow() As System.Windows.Forms.IWin32Window + Function GetWindowTitle() As String + End Interface + +End Namespace + + diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index fa8e2231587..12fab773f43 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -12,7 +12,7 @@ Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic - ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. + ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. ' Do not change this API without also updating that dependent module. Friend Module _Interaction @@ -278,19 +278,18 @@ Namespace Microsoft.VisualBasic End Class Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String - Dim vbhost As IVbHost Dim ParentWindow As IWin32Window = Nothing - vbhost = HostServices.VBHost - If vbhost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. - ParentWindow = vbhost.GetParentWindow() + Dim vbHost As IVbHost = HostServices.VBHost + If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. + ParentWindow = vbHost.GetParentWindow() End If If String.IsNullOrEmpty(Title) Then - If vbhost Is Nothing Then + If vbHost Is Nothing Then Title = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - Title = vbhost.GetWindowTitle() + Title = vbHost.GetWindowTitle() End If End If @@ -317,7 +316,7 @@ Namespace Microsoft.VisualBasic Dim Title As String - 'Get the Assembly name of the calling assembly + 'Get the Assembly name of the calling assembly 'Assembly.GetName requires PathDiscovery permission so we try this first 'and if it throws we catch the security exception and parse the name 'from the full assembly name @@ -352,12 +351,11 @@ Namespace Microsoft.VisualBasic Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String - Dim vbhost As IVbHost Dim ParentWindow As IWin32Window = Nothing - vbhost = HostServices.VBHost - If vbhost IsNot Nothing Then - ParentWindow = vbhost.GetParentWindow() + Dim vbHost As IVbHost = HostServices.VBHost + If vbHost IsNot Nothing Then + ParentWindow = vbHost.GetParentWindow() End If 'Only allow legal button combinations to be set, one choice from each group @@ -386,13 +384,13 @@ Namespace Microsoft.VisualBasic Try If Title Is Nothing Then - If vbhost Is Nothing Then + If vbHost Is Nothing Then sTitle = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - sTitle = vbhost.GetWindowTitle() + sTitle = vbHost.GetWindowTitle() End If Else - sTitle = CStr(Title) 'allows the title to be an expression, e.g. msgbox(prompt, Title:=1+5) + sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) End If Catch ex As StackOverflowException Throw @@ -413,6 +411,4 @@ Namespace Microsoft.VisualBasic End Function End Module - End Namespace - From ac9af8ee0cc0d3fcfc600d14d83e4932e0df0591 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 17:35:11 -0700 Subject: [PATCH 145/342] Move InputBoxHandler to separate file Reorginize File to match VB reccommendation (private, friend public) --- .../Microsoft/VisualBasic/InputBoxHandler.vb | 51 +++ .../src/Microsoft/VisualBasic/Interaction.vb | 332 ++++++++---------- 2 files changed, 197 insertions(+), 186 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb new file mode 100644 index 00000000000..35e555c1477 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -0,0 +1,51 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Windows.Forms + +Namespace Microsoft.VisualBasic + + Partial Friend Module _Interaction + + Private NotInheritable Class InputBoxHandler + Private ReadOnly _prompt As String + Private ReadOnly _title As String + Private ReadOnly _defaultResponse As String + Private ReadOnly _xPos As Integer + Private ReadOnly _yPos As Integer + Private _result As String + Private ReadOnly _parentWindow As IWin32Window + Private _exception As Exception + + Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) + _prompt = Prompt + _title = Title + _defaultResponse = DefaultResponse + _xPos = XPos + _yPos = YPos + _parentWindow = ParentWindow + End Sub + + Public Sub StartHere() + Try + _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) + Catch ex As Exception + _exception = ex + End Try + End Sub + + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property + End Class + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 12fab773f43..79e28db09c6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -14,81 +14,88 @@ Namespace Microsoft.VisualBasic ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. ' Do not change this API without also updating that dependent module. - Friend Module _Interaction + Partial Friend Module _Interaction - Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer - Dim StartupInfo As New NativeTypes.STARTUPINFO - Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION - Dim ok As Integer - Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim ErrorCode As Integer = 0 + Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) + ' if no window with name (full or truncated) or task id, return an error + ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible + Dim hwndOwned As IntPtr + If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then + ' scan to the next window until failure + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) + If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then + If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then + hwndApp = hwndOwned + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Else + Exit Do + End If + End If + hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) + Loop - If (PathName Is Nothing) Then - Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) - End If + ' if scan failed, return an error + If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then + Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) + End If - If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + ' set active window to the owned one + hwndApp = hwndOwned End If - NativeMethods.GetStartupInfo(StartupInfo) - Try - StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. - StartupInfo.wShowWindow = Style + ' SetActiveWindow on Win32 only activates the Window - it does + ' not bring to to the foreground unless the window belongs to + ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' window, moves it to the foreground, and bumps the priority + ' of the thread which owns the window. - 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant - 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version - 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory - 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) - If ok = 0 Then - ErrorCode = Marshal.GetLastWin32Error() - End If - If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then - safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) - End If - If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then - safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) - End If + ' Attach ourselves to the window we want to set focus to + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) + ' Make it foreground and give it focus, this will occur + ' synchronously because we are attached. + NativeMethods.SetForegroundWindow(hwndApp) + NativeMethods.SetFocus(hwndApp) + ' Unattached ourselves from the window + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) + End Sub - Try - If (ok <> 0) Then - If Wait Then - ' Is infinite wait okay here ? - ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights - ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - If ok = 0 Then 'succeeded - 'Process ran to completion - Shell = 0 - Else - 'Wait timed out - Shell = ProcessInfo.dwProcessId - End If - Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Shell = ProcessInfo.dwProcessId - End If - Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If ErrorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) - End If + Dim Title As String - Throw VbMakeException(vbErrors.FileNotFound) - End If - Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. - safeThreadHandle.Close() - End Try - Finally - StartupInfo.Dispose() + 'Get the Assembly name of the calling assembly + 'Assembly.GetName requires PathDiscovery permission so we try this first + 'and if it throws we catch the security exception and parse the name + 'from the full assembly name + Try + Title = CallingAssembly.GetName().Name + Catch ex As SecurityException + Dim FullName As String = CallingAssembly.FullName + + 'Find the text up to the first comma. Note, this fails if the assembly has + 'a comma in its name + Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) + If FirstCommaLocation >= 0 Then + Title = FullName.Substring(0, FirstCommaLocation) + Else + 'The name is not in the format we're expecting so return an empty string + Title = "" + End If End Try + + Return Title + + End Function + + Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String + Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + Box.ShowDialog(ParentWindow) + + InternalInputBox = Box.Output + Box.Dispose() End Function Public Sub AppActivateByProcessId(ProcessId As Integer) @@ -191,92 +198,6 @@ Namespace Microsoft.VisualBasic End If End Sub - Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) - ' if no window with name (full or truncated) or task id, return an error - ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible - Dim hwndOwned As IntPtr - If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then - ' scan to the next window until failure - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) - If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then - If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then - hwndApp = hwndOwned - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Else - Exit Do - End If - End If - hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) - Loop - - ' if scan failed, return an error - If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) - End If - - ' set active window to the owned one - hwndApp = hwndOwned - End If - - ' SetActiveWindow on Win32 only activates the Window - it does - ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the - ' window, moves it to the foreground, and bumps the priority - ' of the thread which owns the window. - - Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - - ' Attach ourselves to the window we want to set focus to - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) - ' Make it foreground and give it focus, this will occur - ' synchronously because we are attached. - NativeMethods.SetForegroundWindow(hwndApp) - NativeMethods.SetFocus(hwndApp) - ' Unattached ourselves from the window - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) - End Sub - - Private NotInheritable Class InputBoxHandler - Private ReadOnly _prompt As String - Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String - Private ReadOnly _xPos As Integer - Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window - Private _exception As Exception - - Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) - _prompt = Prompt - _title = Title - _defaultResponse = DefaultResponse - _xPos = XPos - _yPos = YPos - _parentWindow = ParentWindow - End Sub - - Public Sub StartHere() - Try - _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) - Catch ex As Exception - _exception = ex - End Try - End Sub - - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property - End Class - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String Dim ParentWindow As IWin32Window = Nothing @@ -312,42 +233,6 @@ Namespace Microsoft.VisualBasic End If End Function - Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - - Dim Title As String - - 'Get the Assembly name of the calling assembly - 'Assembly.GetName requires PathDiscovery permission so we try this first - 'and if it throws we catch the security exception and parse the name - 'from the full assembly name - Try - Title = CallingAssembly.GetName().Name - Catch ex As SecurityException - Dim FullName As String = CallingAssembly.FullName - - 'Find the text up to the first comma. Note, this fails if the assembly has - 'a comma in its name - Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) - If FirstCommaLocation >= 0 Then - Title = FullName.Substring(0, FirstCommaLocation) - Else - 'The name is not in the format we're expecting so return an empty string - Title = "" - End If - End Try - - Return Title - - End Function - - Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - Box.ShowDialog(ParentWindow) - - InternalInputBox = Box.Output - Box.Dispose() - End Function - Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String @@ -410,5 +295,80 @@ Namespace Microsoft.VisualBasic MsgBoxResult) End Function + Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer + Dim StartupInfo As New NativeTypes.STARTUPINFO + Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION + Dim ok As Integer + Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim ErrorCode As Integer = 0 + + If (PathName Is Nothing) Then + Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + End If + + If (Style < 0 OrElse Style > 9) Then + Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + End If + + NativeMethods.GetStartupInfo(StartupInfo) + Try + StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + StartupInfo.wShowWindow = Style + + 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant + 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version + 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + + ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) + If ok = 0 Then + ErrorCode = Marshal.GetLastWin32Error() + End If + If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then + safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) + End If + If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then + safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) + End If + + Try + If (ok <> 0) Then + If Wait Then + ' Is infinite wait okay here ? + ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights + ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + + If ok = 0 Then 'succeeded + 'Process ran to completion + Shell = 0 + Else + 'Wait timed out + Shell = ProcessInfo.dwProcessId + End If + Else + NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) + Shell = ProcessInfo.dwProcessId + End If + Else + 'Check for a win32 error access denied. If it is, make and throw the exception. + 'If not, throw FileNotFound + Const ERROR_ACCESS_DENIED As Integer = 5 + If ErrorCode = ERROR_ACCESS_DENIED Then + Throw VbMakeException(vbErrors.PermissionDenied) + End If + + Throw VbMakeException(vbErrors.FileNotFound) + End If + Finally + safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + safeThreadHandle.Close() + End Try + Finally + StartupInfo.Dispose() + End Try + End Function + End Module End Namespace From 082e555341adc5680c3a7f9affe2dae2f9451de2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 17:48:41 -0700 Subject: [PATCH 146/342] Merge Refactor-Hosting --- .../Microsoft/VisualBasic/InputBoxHandler.vb | 50 +++ .../src/Microsoft/VisualBasic/Interaction.vb | 336 ++++++++---------- 2 files changed, 198 insertions(+), 188 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb new file mode 100644 index 00000000000..6edab51ec5a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -0,0 +1,50 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Windows.Forms + +Namespace Microsoft.VisualBasic + + Partial Friend Module _Interaction + Private NotInheritable Class InputBoxHandler + Private ReadOnly _prompt As String + Private ReadOnly _title As String + Private ReadOnly _defaultResponse As String + Private ReadOnly _xPos As Integer + Private ReadOnly _yPos As Integer + Private _result As String + Private ReadOnly _parentWindow As IWin32Window + Private _exception As Exception + + Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) + _prompt = Prompt + _title = Title + _defaultResponse = DefaultResponse + _xPos = XPos + _yPos = YPos + _parentWindow = ParentWindow + End Sub + + Public Sub StartHere() + Try + _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) + Catch ex As Exception + _exception = ex + End Try + End Sub + + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property + End Class + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index a2fd5c96bac..8db6fa3531b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -14,81 +14,88 @@ Namespace Microsoft.VisualBasic ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. ' Do not change this API without also updating that dependent module. - Friend Module _Interaction + Partial Friend Module _Interaction - Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer - Dim StartupInfo As New NativeTypes.STARTUPINFO - Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION - Dim ok As Integer - Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim ErrorCode As Integer = 0 + Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) + ' if no window with name (full or truncated) or task id, return an error + ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible + Dim hwndOwned As IntPtr + If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then + ' scan to the next window until failure + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) + If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then + If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then + hwndApp = hwndOwned + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Else + Exit Do + End If + End If + hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) + Loop - If (PathName Is Nothing) Then - Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) - End If + ' if scan failed, return an error + If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then + Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) + End If - If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + ' set active window to the owned one + hwndApp = hwndOwned End If - NativeMethods.GetStartupInfo(StartupInfo) - Try - StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. - StartupInfo.wShowWindow = Style + ' SetActiveWindow on Win32 only activates the Window - it does + ' not bring to to the foreground unless the window belongs to + ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' window, moves it to the foreground, and bumps the priority + ' of the thread which owns the window. - 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant - 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version - 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory - 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) - If ok = 0 Then - ErrorCode = Marshal.GetLastWin32Error() - End If - If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then - safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) - End If - If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then - safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) - End If + ' Attach ourselves to the window we want to set focus to + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) + ' Make it foreground and give it focus, this will occur + ' synchronously because we are attached. + NativeMethods.SetForegroundWindow(hwndApp) + NativeMethods.SetFocus(hwndApp) + ' Unattached ourselves from the window + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) + End Sub - Try - If (ok <> 0) Then - If Wait Then - ' Is infinite wait okay here ? - ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights - ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - If ok = 0 Then 'succeeded - 'Process ran to completion - Return 0 - Else - 'Wait timed out - Return ProcessInfo.dwProcessId - End If - Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Return ProcessInfo.dwProcessId - End If - Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If ErrorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) - End If + Dim Title As String - Throw VbMakeException(vbErrors.FileNotFound) - End If - Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. - safeThreadHandle.Close() - End Try - Finally - StartupInfo.Dispose() + 'Get the Assembly name of the calling assembly + 'Assembly.GetName requires PathDiscovery permission so we try this first + 'and if it throws we catch the security exception and parse the name + 'from the full assembly name + Try + Title = CallingAssembly.GetName().Name + Catch ex As SecurityException + Dim FullName As String = CallingAssembly.FullName + + 'Find the text up to the first comma. Note, this fails if the assembly has + 'a comma in its name + Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) + If FirstCommaLocation >= 0 Then + Title = FullName.Substring(0, FirstCommaLocation) + Else + 'The name is not in the format we're expecting so return an empty string + Title = "" + End If End Try + + Return Title + + End Function + + Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String + Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + Box.ShowDialog(ParentWindow) + + InternalInputBox = Box.Output + Box.Dispose() End Function Public Sub AppActivateByProcessId(ProcessId As Integer) @@ -191,92 +198,6 @@ Namespace Microsoft.VisualBasic End If End Sub - Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) - ' if no window with name (full or truncated) or task id, return an error - ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible - Dim hwndOwned As IntPtr - If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then - ' scan to the next window until failure - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) - If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then - If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then - hwndApp = hwndOwned - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Else - Exit Do - End If - End If - hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) - Loop - - ' if scan failed, return an error - If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) - End If - - ' set active window to the owned one - hwndApp = hwndOwned - End If - - ' SetActiveWindow on Win32 only activates the Window - it does - ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the - ' window, moves it to the foreground, and bumps the priority - ' of the thread which owns the window. - - Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - - ' Attach ourselves to the window we want to set focus to - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) - ' Make it foreground and give it focus, this will occur - ' synchronously because we are attached. - NativeMethods.SetForegroundWindow(hwndApp) - NativeMethods.SetFocus(hwndApp) - ' Unattached ourselves from the window - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) - End Sub - - Private NotInheritable Class InputBoxHandler - Private ReadOnly _prompt As String - Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String - Private ReadOnly _xPos As Integer - Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window - Private _exception As Exception - - Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) - _prompt = Prompt - _title = Title - _defaultResponse = DefaultResponse - _xPos = XPos - _yPos = YPos - _parentWindow = ParentWindow - End Sub - - Public Sub StartHere() - Try - _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) - Catch ex As Exception - _exception = ex - End Try - End Sub - - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property - End Class - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String Dim ParentWindow As IWin32Window = Nothing @@ -312,42 +233,6 @@ Namespace Microsoft.VisualBasic End If End Function - Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - - Dim Title As String - - 'Get the Assembly name of the calling assembly - 'Assembly.GetName requires PathDiscovery permission so we try this first - 'and if it throws we catch the security exception and parse the name - 'from the full assembly name - Try - Title = CallingAssembly.GetName().Name - Catch ex As SecurityException - Dim FullName As String = CallingAssembly.FullName - - 'Find the text up to the first comma. Note, this fails if the assembly has - 'a comma in its name - Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) - If FirstCommaLocation >= 0 Then - Title = FullName.Substring(0, FirstCommaLocation) - Else - 'The name is not in the format we're expecting so return an empty string - Title = "" - End If - End Try - - Return Title - - End Function - - Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - Box.ShowDialog(ParentWindow) - - InternalInputBox = Box.Output - Box.Dispose() - End Function - Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String @@ -384,10 +269,10 @@ Namespace Microsoft.VisualBasic Try If Title Is Nothing Then - If vbhost Is Nothing Then + If vbHost Is Nothing Then sTitle = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - sTitle = vbhost.GetWindowTitle() + sTitle = vbHost.GetWindowTitle() End If Else sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) @@ -410,5 +295,80 @@ Namespace Microsoft.VisualBasic MsgBoxResult) End Function + Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer + Dim StartupInfo As New NativeTypes.STARTUPINFO + Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION + Dim ok As Integer + Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim ErrorCode As Integer = 0 + + If (PathName Is Nothing) Then + Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + End If + + If (Style < 0 OrElse Style > 9) Then + Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + End If + + NativeMethods.GetStartupInfo(StartupInfo) + Try + StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + StartupInfo.wShowWindow = Style + + 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant + 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version + 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + + ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) + If ok = 0 Then + ErrorCode = Marshal.GetLastWin32Error() + End If + If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then + safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) + End If + If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then + safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) + End If + + Try + If (ok <> 0) Then + If Wait Then + ' Is infinite wait okay here ? + ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights + ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + + If ok = 0 Then 'succeeded + 'Process ran to completion + Return 0 + Else + 'Wait timed out + Return ProcessInfo.dwProcessId + End If + Else + NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) + Return ProcessInfo.dwProcessId + End If + Else + 'Check for a win32 error access denied. If it is, make and throw the exception. + 'If not, throw FileNotFound + Const ERROR_ACCESS_DENIED As Integer = 5 + If ErrorCode = ERROR_ACCESS_DENIED Then + Throw VbMakeException(vbErrors.PermissionDenied) + End If + + Throw VbMakeException(vbErrors.FileNotFound) + End If + Finally + safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + safeThreadHandle.Close() + End Try + Finally + StartupInfo.Dispose() + End Try + End Function + End Module End Namespace From f8ac3971808f8ab8b174e29faaae49148376d582 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 17:55:01 -0700 Subject: [PATCH 147/342] Cleanup ordering in InputBoxHandling --- .../Microsoft/VisualBasic/InputBoxHandler.vb | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index 35e555c1477..cd552dc6d07 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -8,14 +8,14 @@ Namespace Microsoft.VisualBasic Partial Friend Module _Interaction Private NotInheritable Class InputBoxHandler + Private ReadOnly _defaultResponse As String + Private ReadOnly _parentWindow As IWin32Window Private ReadOnly _prompt As String Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String Private ReadOnly _xPos As Integer Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window Private _exception As Exception + Private _result As String Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) _prompt = Prompt @@ -26,6 +26,18 @@ Namespace Microsoft.VisualBasic _parentWindow = ParentWindow End Sub + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property + + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + Public Sub StartHere() Try _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) @@ -34,17 +46,6 @@ Namespace Microsoft.VisualBasic End Try End Sub - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property End Class End Module From 4412ce1b45f16a676b7f58d12efba3789a7eb9db Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 21:32:34 -0700 Subject: [PATCH 148/342] Cleanuo code --- .../WindowsFormsApplicationBase.vb | 2 +- .../VisualBasic/Devices/ComputerInfo.vb | 198 +++++++++--------- .../Devices/Network/NetworkDownload.vb | 15 +- .../Devices/Network/NetworkDownloadAsync.vb | 12 +- .../Devices/Network/NetworkUpload.vb | 10 +- .../Devices/Network/NetworkUtilities.vb | 42 ++-- .../VisualBasic/Helpers/FileSystemUtils.vb | 76 ++++--- 7 files changed, 172 insertions(+), 183 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 8142d9452dd..cfb1f1f0e28 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -378,7 +378,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get Set(value As Form) If value Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Throw GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 10b91950695..a246550ffbc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -14,6 +14,9 @@ Namespace Microsoft.VisualBasic.Devices ' Keep the debugger proxy current as you change this class - see the nested ComputerInfoDebugView below. + ' Cache our InternalMemoryStatus + Private _internalMemoryStatus As InternalMemoryStatus + ''' ''' Default constructor ''' @@ -23,14 +26,15 @@ Namespace Microsoft.VisualBasic.Devices #Disable Warning IDE0049 ' Simplify Names, Justification:=" ''' - ''' Gets the total size of physical memory on the machine. + ''' Gets the whole memory information details. ''' - ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 + ''' An InternalMemoryStatus class. + Private ReadOnly Property MemoryStatus() As InternalMemoryStatus Get - Return MemoryStatus.TotalPhysicalMemory + If _internalMemoryStatus Is Nothing Then + _internalMemoryStatus = New InternalMemoryStatus + End If + Return _internalMemoryStatus End Get End Property @@ -46,21 +50,6 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - ''' - ''' Gets the total size of user potion of virtual address space for calling process. - ''' - ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, - ''' in bytes. - ''' - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Return MemoryStatus.TotalVirtualMemory - End Get - End Property - ''' ''' Gets the total size of free user potion of virtual address space for calling process. ''' @@ -76,8 +65,6 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property -#Enable Warning IDE0049 ' Simplify Names - ''' ''' Gets the current UICulture installed on the machine. ''' @@ -121,138 +108,151 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger - ''' so we offer a view that doesn't have that field. + ''' Gets the total size of physical memory on the machine. ''' - Friend NotInheritable Class ComputerInfoDebugView + ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. + ''' If we are unable to obtain the memory status. + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Return MemoryStatus.TotalPhysicalMemory + End Get + End Property - Public Sub New(RealClass As ComputerInfo) - _instanceBeingWatched = RealClass + ''' + ''' Gets the total size of user potion of virtual address space for calling process. + ''' + ''' + ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, + ''' in bytes. + ''' + ''' If we are unable to obtain the memory status. + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return MemoryStatus.TotalVirtualMemory + End Get + End Property + +#Enable Warning IDE0049 ' Simplify Names + + ''' + ''' Calls GlobalMemoryStatusEx and returns the correct value. + ''' + Private NotInheritable Class InternalMemoryStatus + + Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX + + Friend Sub New() End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalPhysicalMemory + Refresh() + Return _memoryStatusEx.ullAvailPhys End Get End Property - - Public ReadOnly Property AvailablePhysicalMemory() As UInt64 + Friend ReadOnly Property AvailableVirtualMemory() As UInt64 Get - Return _instanceBeingWatched.AvailablePhysicalMemory + Refresh() + Return _memoryStatusEx.ullAvailVirtual End Get End Property - - Public ReadOnly Property TotalVirtualMemory() As UInt64 + Friend ReadOnly Property TotalPhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalVirtualMemory + Refresh() + Return _memoryStatusEx.ullTotalPhys End Get End Property - - Public ReadOnly Property AvailableVirtualMemory() As UInt64 + Friend ReadOnly Property TotalVirtualMemory() As UInt64 Get - Return _instanceBeingWatched.AvailableVirtualMemory + Refresh() + Return _memoryStatusEx.ullTotalVirtual End Get End Property #Enable Warning IDE0049 ' Simplify Names + Private Sub Refresh() + _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX + _memoryStatusEx.Init() + If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then + Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + End If + End Sub + + End Class + + ''' + ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger + ''' so we offer a view that doesn't have that field. + ''' + Friend NotInheritable Class ComputerInfoDebugView + + + Private ReadOnly _instanceBeingWatched As ComputerInfo + + Public Sub New(RealClass As ComputerInfo) + _instanceBeingWatched = RealClass + End Sub + +#Disable Warning IDE0049 ' Simplify Names, Justification:= + - Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo + Public ReadOnly Property AvailablePhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.InstalledUICulture + Return _instanceBeingWatched.AvailablePhysicalMemory End Get End Property - Public ReadOnly Property OSPlatform() As String + Public ReadOnly Property AvailableVirtualMemory() As UInt64 Get - Return _instanceBeingWatched.OSPlatform + Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property - Public ReadOnly Property OSVersion() As String + Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo Get - Return _instanceBeingWatched.OSVersion + Return _instanceBeingWatched.InstalledUICulture End Get End Property - - Private ReadOnly _instanceBeingWatched As ComputerInfo - - End Class - - ''' - ''' Gets the whole memory information details. - ''' - ''' An InternalMemoryStatus class. - Private ReadOnly Property MemoryStatus() As InternalMemoryStatus - Get - If _internalMemoryStatus Is Nothing Then - _internalMemoryStatus = New InternalMemoryStatus - End If - Return _internalMemoryStatus - End Get - End Property - - Private _internalMemoryStatus As InternalMemoryStatus ' Cache our InternalMemoryStatus - - ''' - ''' Calls GlobalMemoryStatusEx and returns the correct value. - ''' - Private NotInheritable Class InternalMemoryStatus - - Friend Sub New() - End Sub - -#Disable Warning IDE0049 ' Simplify Names, Justification:= - - Friend ReadOnly Property TotalPhysicalMemory() As UInt64 + + Public ReadOnly Property OSPlatform() As String Get - Refresh() - Return _memoryStatusEx.ullTotalPhys + Return _instanceBeingWatched.OSPlatform End Get End Property - Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 + + Public ReadOnly Property OSVersion() As String Get - Refresh() - Return _memoryStatusEx.ullAvailPhys + Return _instanceBeingWatched.OSVersion End Get End Property - Friend ReadOnly Property TotalVirtualMemory() As UInt64 + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get - Refresh() - Return _memoryStatusEx.ullTotalVirtual + Return _instanceBeingWatched.TotalPhysicalMemory End Get End Property - Friend ReadOnly Property AvailableVirtualMemory() As UInt64 + + Public ReadOnly Property TotalVirtualMemory() As UInt64 Get - Refresh() - Return _memoryStatusEx.ullAvailVirtual + Return _instanceBeingWatched.TotalVirtualMemory End Get End Property #Enable Warning IDE0049 ' Simplify Names - - Private Sub Refresh() - _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX - _memoryStatusEx.Init() - If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then - Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) - End If - End Sub - - Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX - End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 93e5b52ca52..dea0987a8e7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -6,8 +6,6 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.Devices Partial Public Class Network @@ -150,7 +148,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -211,7 +209,7 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean) If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -265,11 +263,11 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -320,13 +318,12 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync(address, @@ -377,7 +374,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If ' Get network credentials diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb index d7b0e95f243..101cabf8364 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb @@ -7,8 +7,6 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.Devices Partial Public Class Network @@ -124,11 +122,11 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) As Task If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If addressUri Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) + Throw GetArgumentNullException(NameOf(addressUri)) End If Dim client As HttpClient = If(clientHandler Is Nothing, @@ -144,7 +142,7 @@ Namespace Microsoft.VisualBasic.Devices ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(normalizedFilePath) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If 'Throw if the file exists and the user doesn't want to overwrite @@ -157,7 +155,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect If String.IsNullOrEmpty(targetDirectory) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If If Not IO.Directory.Exists(targetDirectory) Then @@ -228,7 +226,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) As Task If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index b491535d1e3..0136d7cfeba 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -6,8 +6,6 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.Devices Partial Public Class Network @@ -92,7 +90,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). ' However, it is good practice to verify address before calling address.Trim. If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If ' Getting a uri will validate the form of the host address @@ -100,7 +98,7 @@ Namespace Microsoft.VisualBasic.Devices ' For uploads, we need to make sure the address includes the filename If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) + Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) End If UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) @@ -191,11 +189,11 @@ Namespace Microsoft.VisualBasic.Devices End If If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException(NameOf(address)) End If Using client As New WebClientExtended() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index 11823c86937..ede572a8bba 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -5,8 +5,6 @@ Imports System.Net Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.MyServices.Internal -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.Devices Friend Module NetworkUtilities @@ -19,25 +17,6 @@ Namespace Microsoft.VisualBasic.Devices ' UserName used in overloads where there is no userName parameter Friend Const DEFAULT_USERNAME As String = "" - ''' - ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' Indicates whether or not to show a progress bar - ''' New ProgressDialog - Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog - If showUI AndAlso Environment.UserInteractive Then - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) - Return New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), - .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) - } - End If - Return Nothing - End Function - ''' ''' Posts a message to close the progress dialog ''' @@ -70,6 +49,25 @@ Namespace Microsoft.VisualBasic.Devices ) End Function + ''' + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved + ''' Indicates whether or not to show a progress bar + ''' New ProgressDialog + Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Return New ProgressDialog With { + .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), + .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) + } + End If + Return Nothing + End Function + ''' ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) ''' @@ -80,7 +78,7 @@ Namespace Microsoft.VisualBasic.Devices Return New Uri(address) Catch ex As UriFormatException 'Throw an exception with an error message more appropriate to our API - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) + Throw GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) End Try End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 760b3329127..3401e6af9ef 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -3,8 +3,6 @@ Imports System.Security -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.CompilerServices ''' @@ -12,43 +10,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Friend NotInheritable Class FileSystemUtils - ''' - ''' Normalize the path, but throw exception if the path ends with separator. - ''' - ''' The input path. - ''' The parameter name to include in the exception if one is raised. - ''' The normalized path. - Friend Shared Function NormalizeFilePath(Path As String, ParamName As String) As String - CheckFilePathTrailingSeparator(Path, ParamName) - Return NormalizePath(Path) - End Function - - ''' - ''' Get full path, get long format, and remove any pending separator. - ''' - ''' The path to be normalized. - ''' The normalized path. - ''' See IO.Path.GetFullPath for possible exceptions. - ''' Keep this function since we might change the implementation / behavior later. - Friend Shared Function NormalizePath(Path As String) As String - Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) - End Function - - ''' - ''' Throw ArgumentException if the file path ends with a separator. - ''' - ''' The file path. - ''' The parameter name to include in ArgumentException. - Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) - If String.IsNullOrEmpty(path) Then ' Check for argument null - Throw ExUtils.GetArgumentNullException(paramName) - End If - If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or - path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then - Throw ExUtils.GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) - End If - End Sub - ''' ''' Returns the given path in long format (v.s 8.3 format) if the path exists. ''' @@ -146,5 +107,42 @@ Namespace Microsoft.VisualBasic.CompilerServices Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) End Function + ''' + ''' Throw ArgumentException if the file path ends with a separator. + ''' + ''' The file path. + ''' The parameter name to include in ArgumentException. + Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) + If String.IsNullOrEmpty(path) Then ' Check for argument null + Throw GetArgumentNullException(paramName) + End If + If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or + path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then + Throw GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) + End If + End Sub + + ''' + ''' Normalize the path, but throw exception if the path ends with separator. + ''' + ''' The input path. + ''' The parameter name to include in the exception if one is raised. + ''' The normalized path. + Friend Shared Function NormalizeFilePath(Path As String, ParamName As String) As String + CheckFilePathTrailingSeparator(Path, ParamName) + Return NormalizePath(Path) + End Function + + ''' + ''' Get full path, get long format, and remove any pending separator. + ''' + ''' The path to be normalized. + ''' The normalized path. + ''' See IO.Path.GetFullPath for possible exceptions. + ''' Keep this function since we might change the implementation / behavior later. + Friend Shared Function NormalizePath(Path As String) As String + Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) + End Function + End Class End Namespace From b5a2548ad45d8954e8a9846b74e746ea3a17aa41 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 7 Apr 2024 01:41:21 -0700 Subject: [PATCH 149/342] Clean up comments --- .../ApplicationServices/AssemblyInfo.vb | 23 +++++++++++-------- .../ConsoleApplicationBase.vb | 3 ++- .../VisualBasic/Devices/ComputerInfo.vb | 2 +- .../Devices/Network/NetworkAvailability.vb | 3 ++- .../VisualBasic/Helpers/FileSystemUtils.vb | 6 +++-- .../VisualBasic/Helpers/NativeTypes.vb | 6 +++-- .../src/Microsoft/VisualBasic/Interaction.vb | 9 +++++--- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index eb71cdc4b5a..cbce7abf545 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -232,18 +232,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End Function - ' Private fields. - Private ReadOnly _assembly As Assembly ' The assembly with the information. + ' The assembly with the information. + Private ReadOnly _assembly As Assembly ' Since these properties will not change during runtime, they're cached. ' "" is not Nothing so use Nothing to mark an un-accessed property. - Private _description As String ' Cache the assembly's description. - - Private _title As String ' Cache the assembly's title. - Private _productName As String ' Cache the assembly's product name. - Private _companyName As String ' Cache the assembly's company name. - Private _trademark As String ' Cache the assembly's trademark. - Private _copyright As String ' Cache the assembly's copyright. + ' Cache the assembly's description. + Private _description As String + ' Cache the assembly's title. + Private _title As String + ' Cache the assembly's product name. + Private _productName As String + ' Cache the assembly's company name. + Private _companyName As String + ' Cache the assembly's trademark. + Private _trademark As String + ' Cache the assembly's copyright. + Private _copyright As String End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index d6dd772e365..fdf0e134110 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -58,6 +58,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property - Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) ' Lazy-initialized and cached collection of command line arguments. + ' Lazy-initialized and cached collection of command line arguments. + Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index a246550ffbc..42928764707 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -182,7 +182,7 @@ Namespace Microsoft.VisualBasic.Devices _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX _memoryStatusEx.Init() If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then - Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + Throw GetWin32Exception(SR.DiagnosticInfo_Memory) End If End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index 1d039028056..2a355d82d61 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -57,7 +57,8 @@ Namespace Microsoft.VisualBasic.Devices _networkAvailabilityChangedCallback = New SendOrPostCallback(AddressOf NetworkAvailabilityChangedHandler) 'the async operation posts to this delegate If AsyncOperationManager.SynchronizationContext IsNot Nothing Then _synchronizationContext = AsyncOperationManager.SynchronizationContext 'We need to hang on to the synchronization context associated with the thread the network object is created on - Try ' Exceptions are thrown if the user isn't an admin. + Try + ' Exceptions are thrown if the user isn't an admin. AddHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) 'listen to the OS event Catch ex As PlatformNotSupportedException Catch ex As NetInfoAlias.NetworkInformationException diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 3401e6af9ef..b20c13c27cb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -39,7 +39,8 @@ Namespace Microsoft.VisualBasic.CompilerServices "Must found exactly 1") Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName Else - Return FullPath ' Path does not exist, cannot resolve. + ' Path does not exist, cannot resolve. + Return FullPath End If Catch ex As Exception ' Ignore these type of exceptions and return FullPath. These type of exceptions should either be caught by calling functions @@ -113,7 +114,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The file path. ''' The parameter name to include in ArgumentException. Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) - If String.IsNullOrEmpty(path) Then ' Check for argument null + ' Check for argument null + If String.IsNullOrEmpty(path) Then Throw GetArgumentNullException(paramName) End If If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 961a79f2c8c..f967c0bb01d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -115,7 +115,8 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub - Private _hasBeenDisposed As Boolean ' To detect redundant calls. Default initialize = False. + ' To detect redundant calls. Default initialize = False. + Private _hasBeenDisposed As Boolean Protected Overrides Sub Finalize() Dispose(False) @@ -127,7 +128,8 @@ Namespace Microsoft.VisualBasic.CompilerServices If disposing Then _hasBeenDisposed = True - Const STARTF_USESTDHANDLES As Integer = 256 'Defined in windows.h + ' 256 Defined in windows.h + Const STARTF_USESTDHANDLES As Integer = 256 If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then NativeMethods.CloseHandle(hStdInput) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 8db6fa3531b..790e1537713 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -50,7 +50,8 @@ Namespace Microsoft.VisualBasic ' window, moves it to the foreground, and bumps the priority ' of the thread which owns the window. - Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId + ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId + Dim dwDummy As Integer ' Attach ourselves to the window we want to set focus to NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) @@ -313,7 +314,8 @@ Namespace Microsoft.VisualBasic NativeMethods.GetStartupInfo(StartupInfo) Try - StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + ' We want to specify the initial window style (minimized, etc) so set this bit. + StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW StartupInfo.wShowWindow = Style 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant @@ -362,7 +364,8 @@ Namespace Microsoft.VisualBasic Throw VbMakeException(vbErrors.FileNotFound) End If Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + ' Close the process handle will not cause the process to stop. + safeProcessHandle.Close() safeThreadHandle.Close() End Try Finally From fc5097217e40bad58b58a7417455cf799e39c777 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 8 Apr 2024 17:45:33 -0700 Subject: [PATCH 150/342] More test utilites to separate Module --- .../System/Windows/Forms/ClipboardProxyTests.vb | 4 ---- .../UnitTests/System/Windows/Forms/TestUtilities.vb | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 30fdd1a54cd..279ef2b5b76 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -13,10 +13,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests '''
Partial Public Class ClipboardProxyTests - Private Function GetUniqueText() As String - Return Guid.NewGuid().ToString("D") - End Function - Public Sub Clipboard_ContainsText() Dim text As String = GetUniqueText() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb new file mode 100644 index 00000000000..4ab1c219a32 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb @@ -0,0 +1,12 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.Forms.Tests + Friend Module TestUtilities + + Friend Function GetUniqueText() As String + Return Guid.NewGuid().ToString("D") + End Function + + End Module +End Namespace From 35981e091ab79e9e234e0a1b05ccad13c495b9c1 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 8 Apr 2024 23:27:39 -0700 Subject: [PATCH 151/342] Update TestUtilities --- .../tests/UnitTests/System/Windows/Forms/TestUtilities.vb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb index 4ab1c219a32..8fc64d6bb12 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb @@ -4,6 +4,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Friend Module TestUtilities + Friend Function GetUniqueInteger(positiveOnly As Boolean) As Integer + If positiveOnly Then + Return Math.Abs(Guid.NewGuid().GetHashCode()) + End If + Return Guid.NewGuid().GetHashCode() + End Function + Friend Function GetUniqueText() As String Return Guid.NewGuid().ToString("D") End Function From e8d68ba06f188775b164237b5978939eaee06486 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 7 Sep 2023 19:00:50 -0700 Subject: [PATCH 152/342] WIP to address issue #9807 --- .../MyServices/Internal/WebClientCopy.vb | 170 ++++++++++++++++++ .../src/PublicAPI.Unshipped.txt | 8 + .../ScratchProjectVB/ApplicationEvents.vb | 29 +++ .../ScratchProjectVB/Form1.Designer.vb | 31 ++++ .../ScratchProjectVB/Form1.vb | 25 +++ .../My Project/Application.Designer.vb | 37 ++++ .../My Project/Application.myapp | 10 ++ .../ScratchProjectVB/ScratchProjectVB.vbproj | 35 ++++ 8 files changed, 345 insertions(+) create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index a2aa8092c0c..cea792bbb9e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -148,4 +148,174 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub End Class + + ''' + ''' Class that controls the thread that does the actual work of downloading or uploading. + ''' + Friend NotInheritable Class HttpClientCopy + + ''' + ''' Creates an instance of a HttpClientCopy, used to download or upload a file + ''' + ''' The HttpClient used to do the downloading or uploading + ''' UI for indicating progress + Public Sub New(client As HttpClient, dialog As ProgressDialog) + + Debug.Assert(client IsNot Nothing, "No HttpClient") + + _httpClient = client + m_ProgressDialog = dialog + + End Sub + + ''' + ''' Downloads a file + ''' + ''' The source for the file + ''' The path and name where the file is saved + Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String) As Task + Debug.Assert(_httpClient IsNot Nothing, "No HttpClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") + + Using response As HttpResponseMessage = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) + Using responseStream As Stream = Await response.Content.ReadAsStreamAsync().ConfigureAwait(False) + Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) + + Dim buffer(8191) As Byte + Dim totalBytesRead As Long = 0 + Dim bytesRead As Integer + Try + m_ProgressDialog?.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + While (Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False)) > 0 + Dim contentLength? As Long = response.Content.Headers.ContentLength + If Not contentLength.HasValue Then + Continue While + Else + bytesRead = CInt(contentLength.Value) + totalBytesRead += bytesRead + + Dim cancelTokenWrite As CancellationToken = _cancelSourceWrite.Token + + Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) + If m_ProgressDialog IsNot Nothing Then + Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) + InvokeIncrement(percentage) + End If + End If + _cancelSourceRead = New CancellationTokenSource() + _cancelTokenRead = _cancelSourceRead.Token + _cancelSourceWrite = New CancellationTokenSource() + _cancelTokenWrite = _cancelSourceWrite.Token + End While + Catch ex As Exception + Throw + End Try + End Using + End Using + End Using + CloseProgressDialog() + + End Function + +#If False Then + ''' + ''' Uploads a file + ''' + ''' The name and path of the source file + ''' The address to which the file is uploaded + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") + + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If + + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If + End Sub + +#End If + + ''' + ''' Notifies the progress dialog to increment the progress bar + ''' + ''' The percentage of bytes read + Private Sub InvokeIncrement(progressPercentage As Integer) + ' Don't invoke unless dialog is up and running + If m_ProgressDialog IsNot Nothing Then + If m_ProgressDialog.IsHandleCreated Then + + ' For performance, don't invoke if increment is 0 + Dim increment As Integer = progressPercentage - _percentage + _percentage = progressPercentage + If increment > 0 Then + m_ProgressDialog.BeginInvoke(New DoIncrement(AddressOf m_ProgressDialog.Increment), increment) + End If + + End If + End If + End Sub + + ''' + ''' Posts a message to close the progress dialog + ''' + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running + If m_ProgressDialog IsNot Nothing Then + m_ProgressDialog.IndicateClosing() + + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() + End If + End If + End Sub + + ''' + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation + ''' + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + _cancelSourceRead.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + _cancelSourceWrite.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + End Sub + + Private _cancelSourceRead As New CancellationTokenSource() + Private _cancelTokenRead As CancellationToken = _cancelSourceRead.Token + + Private _cancelSourceWrite As New CancellationTokenSource() + Private _cancelTokenWrite As CancellationToken = _cancelSourceRead.Token + + ' The WebClient performs the downloading or uploading operations for us + Private ReadOnly _httpClient As HttpClient + + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog + + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + + ' The percentage of the operation completed + Private _percentage As Integer + + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt index e69de29bb2d..14ba78b16f9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt +++ b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt @@ -0,0 +1,8 @@ +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task +Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb new file mode 100644 index 00000000000..cf403a009a2 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb @@ -0,0 +1,29 @@ +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + ' Example: + ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + ' + ' ' Setting the application-wide default Font: + ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + ' + ' ' Setting the HighDpiMode for the Application: + ' e.HighDpiMode = HighDpiMode.PerMonitorV2 + ' + ' ' If a splash dialog is used, this sets the minimum display time: + ' e.MinimumSplashScreenDisplayTime = 4000 + ' End Sub + + Partial Friend Class MyApplication + + End Class +End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb new file mode 100644 index 00000000000..1ccf9d7a614 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb @@ -0,0 +1,31 @@ + +Partial Class Form1 + Inherits Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Text = "Form1" + End Sub + +End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb new file mode 100644 index 00000000000..82ee208dc73 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb @@ -0,0 +1,25 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Option Explicit On +Option Strict On + +Imports System.IO + +Public Class Form1 + + Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown + Dim tmpFilePath = GetTempFolderGuid() + My.Computer.Network.DownloadFile("https://raw.githubusercontent.com/dotnet/winforms/main/README.md", tmpFilePath) + End Sub + + Private Function GetTempFolderGuid() As String + Dim folder As String = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) + Do While Directory.Exists(folder) Or File.Exists(folder) + folder = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString) + Loop + + Return folder + End Function + +End Class diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb new file mode 100644 index 00000000000..007b31fc7d3 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb @@ -0,0 +1,37 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = False + Me.EnableVisualStyles = True + Me.SaveMySettingsOnExit = True + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Form1 + End Sub + End Class +End Namespace diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp new file mode 100644 index 00000000000..0f12f323886 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj new file mode 100644 index 00000000000..a2114f57c43 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj @@ -0,0 +1,35 @@ + + + + WinExe + ScratchProjectVB + enable + + 15.0 + false + false + ScratchProjectVB.Form1 + net8.0-windows7.0 + + + + + + + + + + + + + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + \ No newline at end of file From 4f229bab0bad20f0b4bf08183965d0caed4ef9e3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 9 Sep 2023 14:12:45 -0700 Subject: [PATCH 153/342] Remove the reson of VB Scratch Project Handle Timeout diring getting initial response --- .../VisualBasic/MyServices/Internal/WebClientCopy.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index cea792bbb9e..68b0933905a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -213,8 +213,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Try End Using End Using - End Using - CloseProgressDialog() + End If + respone?.dispose + CloseProgressDialog() End Function From ed35a7ea5093d4bc2342d9cc6660bff5f41bf59a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 17 Oct 2023 20:29:32 -0700 Subject: [PATCH 154/342] Address PR update editorConfig --- .../ApplicationServices/ConsoleApplicationBase.vb | 1 + .../ApplicationServices/UnhandledExceptionEventArgs.vb | 1 + .../src/Microsoft/VisualBasic/Devices/Audio.vb | 5 +++++ .../Microsoft/VisualBasic/Logging/FileLogTraceListener.vb | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index fdf0e134110..10a9294a4a2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -61,4 +61,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Lazy-initialized and cached collection of command line arguments. Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) End Class 'ApplicationBase + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index 627c2568d09..55da05aa13d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -25,4 +25,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property ExitApplication() As Boolean End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 0ed0794f3a7..c1193d749d4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO + Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -10,8 +11,10 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file '''
Public Enum AudioPlayMode + ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous + Background = 1 'Asynchronous BackgroundLoop = 2 'Asynchronous and looping End Enum @@ -159,5 +162,7 @@ Namespace Microsoft.VisualBasic Private _sound As Media.SoundPlayer End Class 'Audio + End Namespace + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 899ed6ed652..ce54c981795 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -6,6 +6,7 @@ Imports System.Globalization Imports System.IO Imports System.Text Imports System.Windows.Forms + Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -16,8 +17,10 @@ Namespace Microsoft.VisualBasic.Logging ''' Options for the location of a log's directory '''
Public Enum LogFileLocation As Integer + ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory + LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory @@ -1044,6 +1047,7 @@ Namespace Microsoft.VisualBasic.Logging ' Identifies properties in the BitArray Private Const PROPERTY_COUNT As Integer = 12 + Private Const APPEND_INDEX As Integer = 0 Private Const AUTOFLUSH_INDEX As Integer = 1 Private Const BASEFILENAME_INDEX As Integer = 2 From 3548d8be8d22eb190102746a375b0869b02624cf Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 17 Jan 2024 16:35:04 -0800 Subject: [PATCH 155/342] Add VB Tests --- .../System/Windows/Forms/TimeTests.vb | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb new file mode 100644 index 00000000000..62ac69219af --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -0,0 +1,43 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class TimeTests + Private Const PrecisionTickLimit As Integer = 1000 + + Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean + Dim diff As TimeSpan = systemLocalTime - vbLocalTime + Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks + End Function + + + Public Sub SystemTimeNotNew() + Assert.True(Date.Now > New Date) + End Sub + + + Public Sub VbTimeNotNew() + Assert.True(My.Computer.Clock.LocalTime > New Date) + End Sub + + + Public Sub VbGmtTimeCloseToDateUtcNow() + Assert.True(timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit)) + End Sub + + + Public Sub VbLocalTimeCloseToDateNow() + Assert.True(timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit)) + End Sub + + + Public Sub VbTickCountCloseToEnvironmentTickCount() + Assert.True(Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit) + End Sub + + End Class + +End Namespace From 1a0e6b4902cb3b312e5db3d073ee753765692381 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Feb 2024 03:15:19 -0800 Subject: [PATCH 156/342] Cleanup and remove duplicate code --- .../UnitTests/System/Windows/Forms/WebListener.vb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index d9cfcadd944..36f8c2fad97 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -43,21 +43,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Friend Function ProcessRequests() As HttpListener ' Create a listener and add the prefixes. Dim listener As New HttpListener() - - listener.Prefixes.Add(_downloadFileUrlPrefix) - If _userName IsNot Nothing OrElse _password IsNot Nothing Then - listener.AuthenticationSchemes = AuthenticationSchemes.Basic - End If + listener.Prefixes.Add(urlPrefix.Replace(NameOf(HttpListener), testName)) listener.Start() Task.Run( + Sub() + End If + listener.Start() + Task.Run( Sub() ' Start the listener to begin listening for requests. Dim response As HttpListenerResponse = Nothing + Dim response As HttpListenerResponse = Nothing Try ' Note: GetContext blocks while waiting for a request. Dim context As HttpListenerContext = listener.GetContext() - ' Create the response. response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then @@ -77,7 +77,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests response?.Close() End Try End Sub) - Return listener + Return listener End Function End Class From 93001631b1ac677efde09c06d80d950702ae4f2c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 17 Mar 2024 01:56:10 -0900 Subject: [PATCH 157/342] Manually Merge with Main. Inconsistant Hendling of arounf End Class and End Mondule in Main --- eng/Versions.props | 64 +++++++++---------- global.json | 8 +-- .../ConsoleApplicationBase.vb | 1 - .../ApplicationServices/StartupEventArgs.vb | 1 - .../StartupNextInstanceEventArgs.vb | 1 - .../UnhandledExceptionEventArgs.vb | 2 - ...FormsApplicationBase.WinFormsAppContext.vb | 1 - .../Microsoft/VisualBasic/Devices/Audio.vb | 5 -- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 1 - .../VisualBasic/Helpers/NativeTypes.vb | 4 -- .../src/Microsoft/VisualBasic/Interaction.vb | 55 ++++++++-------- .../Logging/FileLogTraceListener.vb | 5 -- .../MyServices/Internal/ContextValue.vb | 1 - .../MyServices/Internal/HttpClientCopy.vb | 1 - .../MyServices/Internal/ProgressDialog.vb | 1 - .../MyServices/Internal/WebClientCopy.vb | 1 - 16 files changed, 64 insertions(+), 88 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 3d92601a31c..5fed1787c4b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,43 +6,43 @@ 0 preview - 4 + 3 $(MajorVersion).$(MinorVersion).$(PatchVersion) false release - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 5.0.0-preview.7.20320.5 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 + 9.0.0-preview.3.24165.13 + 9.0.0-preview.3.24165.13 6.0.0 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - 9.0.0-preview.4.24210.9 - $(MicrosoftNETCoreILAsmPackageVersion) @@ -54,9 +54,9 @@ - 9.0.0-beta.24210.4 - 9.0.0-beta.24210.4 - 9.0.0-beta.24210.4 + 9.0.0-beta.24165.6 + 9.0.0-beta.24165.6 + 9.0.0-beta.24165.6 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 9c038aefed6..7c3c919a931 100644 --- a/global.json +++ b/global.json @@ -14,11 +14,11 @@ "version": "9.0.100-preview.1.24101.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24210.4", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24210.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24210.4", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24165.6", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24165.6", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24165.6", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24210.9" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.3.24165.13" }, "native-tools": { "cmake": "latest" diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 10a9294a4a2..fdf0e134110 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -61,5 +61,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Lazy-initialized and cached collection of command line arguments. Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) End Class 'ApplicationBase - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index f99c8d63713..55adb14b565 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -29,6 +29,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Returns the command line sent to this application '''
Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index 12f1526872e..721a37554cb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -39,6 +39,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' always return the same values ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index 55da05aa13d..8893bc33607 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -23,7 +23,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Indicates whether the application should exit upon exiting the exception handler '''
Public Property ExitApplication() As Boolean - End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index e7bf1f2268a..598aa8996b2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -49,7 +49,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub - End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index c1193d749d4..0ed0794f3a7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,7 +2,6 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO - Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -11,10 +10,8 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file '''
Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous - Background = 1 'Asynchronous BackgroundLoop = 2 'Asynchronous and looping End Enum @@ -162,7 +159,5 @@ Namespace Microsoft.VisualBasic Private _sound As Media.SoundPlayer End Class 'Audio - End Namespace - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 60470adc84f..1199ffff10b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -108,6 +108,5 @@ Namespace Microsoft.VisualBasic.Devices Return CType((UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1), Boolean) End Get End Property - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index f967c0bb01d..82d895f4b4e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -35,7 +35,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub - End Class ''' @@ -57,7 +56,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function - End Class ''' @@ -78,7 +76,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub - End Class ''' @@ -157,7 +154,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose(True) GC.SuppressFinalize(Me) End Sub - End Class ' Handle Values diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 790e1537713..2a703bb216b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -199,31 +199,32 @@ Namespace Microsoft.VisualBasic End If End Sub - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String - Dim ParentWindow As IWin32Window = Nothing - - Dim vbHost As IVbHost = HostServices.VBHost - If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. - ParentWindow = vbHost.GetParentWindow() - End If + Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) + ' if no window with name (full or truncated) or task id, return an error + ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible + Dim hwndOwned As IntPtr + If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then + ' scan to the next window until failure + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) + If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then + If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then + hwndApp = hwndOwned + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Else + Exit Do + End If + End If + hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) + Loop - If String.IsNullOrEmpty(Title) Then - If vbHost Is Nothing Then - Title = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) - Else - Title = vbHost.GetWindowTitle() + ' if scan failed, return an error + If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then + Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) End If - End If - - 'Threading state can only be set once, and will most often be already set - 'but set to STA and check if it isn't STA, then we need to start another thread - 'to display the InputBox - If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then - Dim InputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) - Dim thread As New Thread(New ThreadStart(AddressOf InputHandler.StartHere)) - thread.Start() - thread.Join() + ' set active window to the owned one + hwndApp = hwndOwned If InputHandler.Exception IsNot Nothing Then Throw InputHandler.Exception End If @@ -232,16 +233,16 @@ Namespace Microsoft.VisualBasic Else Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) End If - End Function + End Function Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String - Dim ParentWindow As IWin32Window = Nothing + Dim parentWindow As IWin32Window = Nothing - Dim vbHost As IVbHost = HostServices.VBHost + vbHost = HostServices.VBHost If vbHost IsNot Nothing Then - ParentWindow = vbHost.GetParentWindow() + parentWindow = vbHost.GetParentWindow() End If 'Only allow legal button combinations to be set, one choice from each group @@ -288,7 +289,7 @@ Namespace Microsoft.VisualBasic Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try - Return CType(MessageBox.Show(ParentWindow, sPrompt, sTitle, + Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, CType(Buttons And &HF, MessageBoxButtons), CType(Buttons And &HF0, MessageBoxIcon), CType(Buttons And &HF00, MessageBoxDefaultButton), diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index ce54c981795..5cdcaa9dcdc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -6,7 +6,6 @@ Imports System.Globalization Imports System.IO Imports System.Text Imports System.Windows.Forms - Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -17,10 +16,8 @@ Namespace Microsoft.VisualBasic.Logging ''' Options for the location of a log's directory ''' Public Enum LogFileLocation As Integer - ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory - LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory @@ -1047,7 +1044,6 @@ Namespace Microsoft.VisualBasic.Logging ' Identifies properties in the BitArray Private Const PROPERTY_COUNT As Integer = 12 - Private Const APPEND_INDEX As Integer = 0 Private Const AUTOFLUSH_INDEX As Integer = 1 Private Const BASEFILENAME_INDEX As Integer = 2 @@ -1073,7 +1069,6 @@ Namespace Microsoft.VisualBasic.Logging ' Attribute keys used to access properties set in the config file Private Const KEY_APPEND As String = "append" - Private Const KEY_APPEND_PASCAL As String = "Append" Private Const KEY_AUTOFLUSH As String = "autoflush" diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index da2c89db6f8..ea965581a38 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -18,7 +18,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Public Class ContextValue(Of T) - Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 160663953d2..71887927ea9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -198,6 +198,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If End Sub #End If - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index c4b5d46c72c..c8a5f5d84c6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -216,7 +216,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub - Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 68b0933905a..2c8d1bb5a68 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -318,5 +318,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private _percentage As Integer End Class - End Namespace From 927471717903cf99f788d0a4dc12c700dffae7b1 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 20 Mar 2024 00:49:37 -0800 Subject: [PATCH 158/342] Respond to PR feedback add comments --- .../Windows/Forms/NetworkDownloadTests.vb | 76 +++++++++---------- .../System/Windows/Forms/WebListener.vb | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 654fc16bbd8..527a365d66f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -791,13 +791,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - - Assert.Throws(Of IOException)( + Try + My.Computer.Network _ Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -810,14 +810,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), 1) + Assert.Equal(ValidateDownload(destinationFilename), 1) - CleanUp(listener, testDirectory) - End Sub + CleanUp(listener, testDirectory) + Finally - Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -836,15 +836,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UrlWhereUriIsNothingSpecifyOnUserCancel_Throws() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_UserNamePassword_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -862,16 +862,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False, UICancelOption.DoNothing) - End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) Finally + Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_UserNamePassword_Throws() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -891,13 +891,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, testDirectory) + CleanUp(listener, tmpFilePath) End Try End Sub - Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -912,15 +912,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -938,19 +938,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, testDirectory) - End Sub + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - - + + Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() Public Sub DownloadFile_UrlWithAllOptionsSpecifiedWhereInvalidAddress_Fail(address As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - - Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ @@ -965,15 +965,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) - Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) Finally - CleanUp(listener, testDirectory) + CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UrlWithAllOptionsSpecifiedWhereInvalidTimeout_Fail() - Dim testDirectory As String = CreateTempDirectory() + Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() + Dim tmpFilePath As String = CreateTempDirectory() Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -992,17 +992,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) - Assert.True(Directory.Exists(testDirectory)) + Assert.True(Directory.Exists(tmpFilePath)) + Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Public Sub DownloadFile_Uri_UriIsNothing_Throws() + Dim tmpFilePath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -1115,7 +1115,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, testDirectory) + CleanUp(listener, tmpFilePath) End Try End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 36f8c2fad97..6bcc2df6cf3 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -77,7 +77,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests response?.Close() End Try End Sub) - Return listener + Return listener End Function End Class From 864f1246a1622360600f63c9f70c68ef37a35b89 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 27 Mar 2024 22:47:37 -0700 Subject: [PATCH 159/342] Merge some code cleanup Fix DocumentComments to include an extra space --- .../ApplicationServices/StartupEventArgs.vb | 1 + .../StartupNextInstanceEventArgs.vb | 1 + .../UnhandledExceptionEventArgs.vb | 1 + .../VisualBasic/Devices/ComputerInfo.vb | 102 +++++++++--------- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 1 + .../VisualBasic/Helpers/NativeTypes.vb | 3 + .../src/Microsoft/VisualBasic/Logging/Log.vb | 1 + .../MyServices/Internal/ContextValue.vb | 1 + .../MyServices/Internal/ProgressDialog.vb | 1 + .../MyServices/Internal/WebClientCopy.vb | 4 +- 10 files changed, 63 insertions(+), 53 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index 55adb14b565..f99c8d63713 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -29,5 +29,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Returns the command line sent to this application ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index 721a37554cb..12f1526872e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -39,5 +39,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' always return the same values ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index 8893bc33607..627c2568d09 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -23,5 +23,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Indicates whether the application should exit upon exiting the exception handler ''' Public Property ExitApplication() As Boolean + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 42928764707..c13547739b1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -198,61 +198,61 @@ Namespace Microsoft.VisualBasic.Devices Private ReadOnly _instanceBeingWatched As ComputerInfo Public Sub New(RealClass As ComputerInfo) - _instanceBeingWatched = RealClass - End Sub + _instanceBeingWatched = RealClass + End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= - - Public ReadOnly Property AvailablePhysicalMemory() As UInt64 - Get - Return _instanceBeingWatched.AvailablePhysicalMemory - End Get - End Property - - - Public ReadOnly Property AvailableVirtualMemory() As UInt64 - Get - Return _instanceBeingWatched.AvailableVirtualMemory - End Get - End Property - - - Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo - Get - Return _instanceBeingWatched.InstalledUICulture - End Get - End Property - - - Public ReadOnly Property OSPlatform() As String - Get - Return _instanceBeingWatched.OSPlatform - End Get - End Property - - - Public ReadOnly Property OSVersion() As String - Get - Return _instanceBeingWatched.OSVersion - End Get - End Property - - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 - Get - Return _instanceBeingWatched.TotalPhysicalMemory - End Get - End Property - - - Public ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Return _instanceBeingWatched.TotalVirtualMemory - End Get - End Property + + Public ReadOnly Property AvailablePhysicalMemory() As UInt64 + Get + Return _instanceBeingWatched.AvailablePhysicalMemory + End Get + End Property + + + Public ReadOnly Property AvailableVirtualMemory() As UInt64 + Get + Return _instanceBeingWatched.AvailableVirtualMemory + End Get + End Property + + + Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo + Get + Return _instanceBeingWatched.InstalledUICulture + End Get + End Property + + + Public ReadOnly Property OSPlatform() As String + Get + Return _instanceBeingWatched.OSPlatform + End Get + End Property + + + Public ReadOnly Property OSVersion() As String + Get + Return _instanceBeingWatched.OSVersion + End Get + End Property + + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalPhysicalMemory + End Get + End Property + + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalVirtualMemory + End Get + End Property #Enable Warning IDE0049 ' Simplify Names + End Class End Class - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 1199ffff10b..60470adc84f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -108,5 +108,6 @@ Namespace Microsoft.VisualBasic.Devices Return CType((UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1), Boolean) End Get End Property + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 82d895f4b4e..425054d0d80 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -56,6 +56,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function + End Class ''' @@ -76,6 +77,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub + End Class ''' @@ -154,6 +156,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose(True) GC.SuppressFinalize(Me) End Sub + End Class ' Handle Values diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 6f0d65815dc..0822c2a3dde 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -232,5 +232,6 @@ Namespace Microsoft.VisualBasic.Logging Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index ea965581a38..da2c89db6f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -18,6 +18,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Public Class ContextValue(Of T) + Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index c8a5f5d84c6..c4b5d46c72c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -216,6 +216,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub + Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 2c8d1bb5a68..3504d10f7ee 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -291,8 +291,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' the current async file transfer operation ''' ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel _cancelSourceRead.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. From 583fc4a90eaf11c46ae37ffb313f6e17b936c5a6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 28 Mar 2024 12:49:01 -0700 Subject: [PATCH 160/342] Revert "[main] Update dependencies from dotnet/runtime (#11133)" This reverts commit e2f9efeeb22b733a9c032bf7365725ff5c03a457. --- eng/Version.Details.xml | 196 ++++++++++++++++++++-------------------- eng/Versions.props | 64 ++++++------- global.json | 8 +- 3 files changed, 134 insertions(+), 134 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ef6cf57eaf0..f8734031cd6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,205 +7,205 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/runtime - f0991722db63e0b4962439469efb4ea1b72923f3 + 7f555e0834411c18450074c2218f3656251bca9c - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 - + https://github.com/dotnet/arcade - a26575045adf694ecd7af6b1a310d2324ef5682b + b6fada3ec4fa37e08dcbafaa6ddf59213f3f8687 diff --git a/eng/Versions.props b/eng/Versions.props index 5fed1787c4b..dfe6d08d52e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,43 +6,43 @@ 0 preview - 3 + 4 $(MajorVersion).$(MinorVersion).$(PatchVersion) false release - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 5.0.0-preview.7.20320.5 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 + 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24175.10 6.0.0 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - 9.0.0-preview.3.24165.13 - $(MicrosoftNETCoreILAsmPackageVersion) @@ -54,9 +54,9 @@ - 9.0.0-beta.24165.6 - 9.0.0-beta.24165.6 - 9.0.0-beta.24165.6 + 9.0.0-beta.24176.6 + 9.0.0-beta.24176.6 + 9.0.0-beta.24176.6 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 7c3c919a931..78b50d0af82 100644 --- a/global.json +++ b/global.json @@ -14,11 +14,11 @@ "version": "9.0.100-preview.1.24101.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24165.6", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24165.6", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24165.6", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24176.6", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24176.6", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24176.6", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.3.24165.13" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24175.10" }, "native-tools": { "cmake": "latest" From b9b89e0c7505662df7b2b412982c6a4a3b54e815 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 30 Mar 2024 20:52:02 -0700 Subject: [PATCH 161/342] Add FileIoProxyTests and general Cleanup --- .../VisualBasic/Helpers/NativeTypes.vb | 1 + .../Windows/Forms/NetworkDownloadTests.vb | 427 ++++++------------ .../Forms/TempDirectoryFileFunctionsvb.vb | 282 ++++++++++++ 3 files changed, 432 insertions(+), 278 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 425054d0d80..f967c0bb01d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -35,6 +35,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub + End Class ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 527a365d66f..93ef3bdb3bb 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -35,15 +35,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return fileInfo.Length End Function - Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) - Debug.Assert(Path.GetTempPath <> testDirectory) + Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) + Debug.Assert(tmpDirectoryPath <> Path.GetTempPath) listener.Stop() listener.Close() - If Not String.IsNullOrWhiteSpace(testDirectory) Then - - Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) - - Directory.Delete(testDirectory, recursive:=True) + If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then + Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + Directory.Delete(tmpDirectoryPath, recursive:=True) End If End Sub @@ -75,11 +73,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + + + Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -103,12 +100,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - - - Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + + Public Sub DownloadFile_Url_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -133,11 +128,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + + + Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -162,10 +157,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UriOnly_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Public Sub DownloadFile_Url_Password_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -179,11 +174,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadLargeFileSize) + + + + Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -206,9 +203,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UriWhereUriIsNothing_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Ur_InvalidUrl_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -259,9 +256,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -285,33 +282,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(destinationFilename), 1) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - - CleanUp(listener, testDirectory) + CleanUp(listener, tmpDirectoryPath) End Sub - Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Url_FileExistsOverwrite_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, 1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -324,16 +304,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests TestingConnectionTimeout, overwrite:=True) - Assert.True(Directory.Exists(testDirectory)) + Assert.True(Directory.Exists(tmpDirectoryPath)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - - CleanUp(listener, testDirectory) + Finally + CleanUp(listener, tmpDirectoryPath) + End Try End Sub - Public Sub DownloadFile_UriWithAllOptionsSpecifiedWhereInvalidAddress_Fail() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -359,10 +340,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UriWithAllOptionsSpecifiedWhereInvalidTimeout_Fail() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Public Sub DownloadFile_Url_TimeOut_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -387,10 +368,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UriWithICredentialsEqualNothingShowUiTimeOutOverwriteSpecified_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Public Sub DownloadFile_Url_TimeoutNegative_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -409,9 +390,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UrlWithICredentialsEqualNothingShowUiTimeOutOverwriteSpecified_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Url_UsernameEqualNothing_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -431,11 +412,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + + + + Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) @@ -564,9 +547,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_GetLongPath_Throws() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -574,14 +557,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=testDirectory, ' This is a Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + .DownloadFile(address, + destinationFileName:=tmpDirectoryPath, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -591,11 +574,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + + + Public Sub DownloadFile_RootDirectory_Throw(root As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -622,9 +605,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -648,12 +631,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - - - Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + + Public Sub DownloadFile_Url_AllOptionsSet_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -670,17 +651,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End Sub) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + + CleanUp(listener, tmpDirectoryPath) + End Sub - Public Sub DownloadFile_UrlOnly_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Public Sub DownloadFile_Uri_Success() + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -691,102 +671,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - - - Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, destinationFilename) - - End Sub) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - - - Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) - Dim testDirectory As String = CreateTempDirectory() - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename) - - End Sub) - Assert.False(File.Exists(destinationFilename)) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - - - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - Finally - CleanUp(listener) - End Try - End Sub - - - - - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - End Sub) - Finally - CleanUp(listener) + CleanUp(listener, tmpDirectoryPath) End Try End Sub @@ -817,9 +702,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -844,9 +729,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_Uri_UserNamePassword_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -862,18 +747,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False, UICancelOption.DoNothing) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - Finally - CleanUp(listener, testDirectory) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_UserNamePassword_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -891,15 +775,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -920,8 +804,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -938,71 +822,58 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) + CleanUp(listener, tmpDirectoryPath) + End Sub Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() - - Public Sub DownloadFile_UrlWithAllOptionsSpecifiedWhereInvalidAddress_Fail(address As String) - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.False(File.Exists(destinationFilename)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Directory.Delete(tmpDirectoryPath, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=-1, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub) - - Assert.True(Directory.Exists(tmpFilePath)) - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, tmpDirectoryPath) End Sub Public Sub DownloadFile_Uri_UriIsNothing_Throws() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpFilePath) + Dim tmpDirectoryPath As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -1115,7 +986,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpFilePath) + CleanUp(listener, tmpDirectoryPath) End Try End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb new file mode 100644 index 00000000000..c2a77dbf8ef --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb @@ -0,0 +1,282 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.ObjectModel +Imports System.Text +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class FileIoProxyTests + Private ReadOnly _csvSampleData As String = + "Index,Customer Id,First Name,Last Name,Company,City,Country +1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile" + Private ReadOnly _fixedSampleData As String = + "IndexFirstLastCompanyCityCountry +4321;1234;321;654321;123;1234567" + Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem + + + Public Sub DriveProxyTest() + Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) + End Sub + + + Public Sub FindInFilesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) + Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) + _fileSystem.WriteAllText(fileC, "C", append:=False) + Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) + Assert.Equal(filenames.Count, 1) + Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) + filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") + Assert.Equal(filenames.Count, 0) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim text As String = _fileSystem.ReadAllText(fileA) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextWithEncodingProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) + Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllBytesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) + + Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithOverwriteProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2), size:=1) + _fileSystem.CopyFile(file1, file2, overwrite:=True) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) + 'End Sub + + 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) + 'End Sub + + 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) + 'End Sub + + 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) + 'End Sub + + 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) + ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + 'End Sub + + 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) + 'End Sub + + 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) + ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + 'End Sub + + 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) + 'End Sub + + + Public Sub DeleteFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) + ' FileIO.FileSystem.DeleteFile(file, showUI, recycle) + 'End Sub + + 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, + ' onUserCancel As UICancelOption) + + ' FileIO.FileSystem.DeleteFile(file, showUI, recycle, onUserCancel) + 'End Sub + + 'Public Sub DeleteDirectory(directory As String, + ' showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + + ' FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) + 'End Sub + + + + + Public Sub OpenTextFieldParserProxyTest(delimiter As String) + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _csvSampleData, append:=False) + Dim reader As TextFieldParser + If delimiter Is Nothing Then + reader = _fileSystem.OpenTextFieldParser(fileCSV) + reader.TextFieldType = FieldType.Delimited + reader.Delimiters = {","} + Else + reader = _fileSystem.OpenTextFieldParser(fileCSV, delimiter) + End If + Dim currentRow As String() + Dim totalRows As Integer = 0 + While Not reader.EndOfData + totalRows += 1 + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + totalFields += 1 + Next + Assert.Equal(7, totalFields) + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFixedFieldParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _fixedSampleData, append:=False) + Dim reader As TextFieldParser = _fileSystem.OpenTextFieldParser(fileCSV, 5, 5, 4, 7, 4, 7) + Dim currentRow As String() + Dim totalRows As Integer = 0 + Dim splitData As String() = _fixedSampleData.Split(vbCrLf)(1).Split(";") + While Not reader.EndOfData + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + If totalRows = 1 Then + Assert.Equal(splitData(totalFields), currentField.TrimEnd(";"c)) + End If + totalFields += 1 + Next + Assert.Equal(6, totalFields) + totalRows += 1 + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextStreamParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenEncodedTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter + ' Return FileIO.FileSystem.OpenTextFileWriter(file, append) + 'End Function + + 'Public Function OpenTextFileWriter(file As String, append As Boolean, + ' encoding As Encoding) As IO.StreamWriter + + ' Return FileIO.FileSystem.OpenTextFileWriter(file, append, encoding) + 'End Function + + End Class +End Namespace From d602b8fd211c36568dcf61b4b3d01ef12975d5b4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 6 Apr 2024 17:48:41 -0700 Subject: [PATCH 162/342] Merge Refactor-Hosting --- .../Microsoft/VisualBasic/InputBoxHandler.vb | 14 + .../src/Microsoft/VisualBasic/Interaction.vb | 243 +++++++++++------- 2 files changed, 167 insertions(+), 90 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index cd552dc6d07..3e0d4559529 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -12,8 +12,11 @@ Namespace Microsoft.VisualBasic Private ReadOnly _parentWindow As IWin32Window Private ReadOnly _prompt As String Private ReadOnly _title As String + Private ReadOnly _defaultResponse As String Private ReadOnly _xPos As Integer Private ReadOnly _yPos As Integer + Private _result As String + Private ReadOnly _parentWindow As IWin32Window Private _exception As Exception Private _result As String @@ -46,6 +49,17 @@ Namespace Microsoft.VisualBasic End Try End Sub + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property End Class End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 2a703bb216b..83372a7460d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -50,8 +50,11 @@ Namespace Microsoft.VisualBasic ' window, moves it to the foreground, and bumps the priority ' of the thread which owns the window. - ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - Dim dwDummy As Integer + 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant + 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version + 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. ' Attach ourselves to the window we want to set focus to NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) @@ -76,19 +79,34 @@ Namespace Microsoft.VisualBasic Catch ex As SecurityException Dim FullName As String = CallingAssembly.FullName - 'Find the text up to the first comma. Note, this fails if the assembly has - 'a comma in its name - Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) - If FirstCommaLocation >= 0 Then - Title = FullName.Substring(0, FirstCommaLocation) + If ok = 0 Then 'succeeded + 'Process ran to completion + Return 0 Else - 'The name is not in the format we're expecting so return an empty string - Title = "" + 'Wait timed out + Return ProcessInfo.dwProcessId + End If + Else + NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) + Return ProcessInfo.dwProcessId + End If + Else + 'Check for a win32 error access denied. If it is, make and throw the exception. + 'If not, throw FileNotFound + Const ERROR_ACCESS_DENIED As Integer = 5 + If ErrorCode = ERROR_ACCESS_DENIED Then + Throw VbMakeException(vbErrors.PermissionDenied) End If - End Try - - Return Title + Throw VbMakeException(vbErrors.FileNotFound) + End If + Finally + safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + safeThreadHandle.Close() + End Try + Finally + StartupInfo.Dispose() + End Try End Function Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String @@ -225,6 +243,92 @@ Namespace Microsoft.VisualBasic ' set active window to the owned one hwndApp = hwndOwned + End If + + ' SetActiveWindow on Win32 only activates the Window - it does + ' not bring to to the foreground unless the window belongs to + ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' window, moves it to the foreground, and bumps the priority + ' of the thread which owns the window. + + Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId + + ' Attach ourselves to the window we want to set focus to + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) + ' Make it foreground and give it focus, this will occur + ' synchronously because we are attached. + NativeMethods.SetForegroundWindow(hwndApp) + NativeMethods.SetFocus(hwndApp) + ' Unattached ourselves from the window + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) + End Sub + + Private NotInheritable Class InputBoxHandler + Private ReadOnly _prompt As String + Private ReadOnly _title As String + Private ReadOnly _defaultResponse As String + Private ReadOnly _xPos As Integer + Private ReadOnly _yPos As Integer + Private _result As String + Private ReadOnly _parentWindow As IWin32Window + Private _exception As Exception + + Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) + _prompt = Prompt + _title = Title + _defaultResponse = DefaultResponse + _xPos = XPos + _yPos = YPos + _parentWindow = ParentWindow + End Sub + + Public Sub StartHere() + Try + _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) + Catch ex As Exception + _exception = ex + End Try + End Sub + + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property + End Class + + Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String + Dim vbHost As IVbHost + Dim ParentWindow As IWin32Window = Nothing + + vbHost = HostServices.VBHost + If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. + ParentWindow = vbHost.GetParentWindow() + End If + + If String.IsNullOrEmpty(Title) Then + If vbHost Is Nothing Then + Title = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) + Else + Title = vbHost.GetWindowTitle() + End If + End If + + 'Threading state can only be set once, and will most often be already set + 'but set to STA and check if it isn't STA, then we need to start another thread + 'to display the InputBox + If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then + Dim InputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) + Dim thread As New Thread(New ThreadStart(AddressOf InputHandler.StartHere)) + thread.Start() + thread.Join() + If InputHandler.Exception IsNot Nothing Then Throw InputHandler.Exception End If @@ -233,7 +337,43 @@ Namespace Microsoft.VisualBasic Else Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) End If - End Function + End Function + + Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String + + Dim Title As String + + 'Get the Assembly name of the calling assembly + 'Assembly.GetName requires PathDiscovery permission so we try this first + 'and if it throws we catch the security exception and parse the name + 'from the full assembly name + Try + Title = CallingAssembly.GetName().Name + Catch ex As SecurityException + Dim FullName As String = CallingAssembly.FullName + + 'Find the text up to the first comma. Note, this fails if the assembly has + 'a comma in its name + Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) + If FirstCommaLocation >= 0 Then + Title = FullName.Substring(0, FirstCommaLocation) + Else + 'The name is not in the format we're expecting so return an empty string + Title = "" + End If + End Try + + Return Title + + End Function + + Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String + Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + Box.ShowDialog(ParentWindow) + + InternalInputBox = Box.Output + Box.Dispose() + End Function Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing @@ -297,82 +437,5 @@ Namespace Microsoft.VisualBasic MsgBoxResult) End Function - Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer - Dim StartupInfo As New NativeTypes.STARTUPINFO - Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION - Dim ok As Integer - Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim ErrorCode As Integer = 0 - - If (PathName Is Nothing) Then - Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) - End If - - If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) - End If - - NativeMethods.GetStartupInfo(StartupInfo) - Try - ' We want to specify the initial window style (minimized, etc) so set this bit. - StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW - StartupInfo.wShowWindow = Style - - 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant - 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version - 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory - 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. - - ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) - If ok = 0 Then - ErrorCode = Marshal.GetLastWin32Error() - End If - If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then - safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) - End If - If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then - safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) - End If - - Try - If (ok <> 0) Then - If Wait Then - ' Is infinite wait okay here ? - ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights - ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) - - If ok = 0 Then 'succeeded - 'Process ran to completion - Return 0 - Else - 'Wait timed out - Return ProcessInfo.dwProcessId - End If - Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Return ProcessInfo.dwProcessId - End If - Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If ErrorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) - End If - - Throw VbMakeException(vbErrors.FileNotFound) - End If - Finally - ' Close the process handle will not cause the process to stop. - safeProcessHandle.Close() - safeThreadHandle.Close() - End Try - Finally - StartupInfo.Dispose() - End Try - End Function - End Module End Namespace From c264023833f47a771dd2a972ec016a48728c5ed7 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 12 Apr 2024 19:49:19 -0700 Subject: [PATCH 163/342] Rebase Cleanup --- eng/Versions.props | 62 +- global.json | 8 +- .../ApplicationServices/ApplicationBase.vb | 10 +- .../ApplicationServices/AssemblyInfo.vb | 50 +- .../ConsoleApplicationBase.vb | 10 +- .../WindowsFormsApplicationBase.vb | 12 +- .../Microsoft/VisualBasic/Devices/Computer.vb | 2 +- .../VisualBasic/Devices/ComputerInfo.vb | 102 +-- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 12 +- .../Devices/Network/NetworkAvailability.vb | 8 +- .../Devices/Network/NetworkPing.vb | 6 +- .../Devices/Network/NetworkUpload.vb | 8 +- .../VisualBasic/Helpers/FileSystemUtils.vb | 26 +- .../VisualBasic/Helpers/VBInputBox.vb | 16 +- .../Microsoft/VisualBasic/InputBoxHandler.vb | 16 - .../src/Microsoft/VisualBasic/Interaction.vb | 313 +++----- .../Logging/FileLogTraceListener.vb | 38 +- .../src/Microsoft/VisualBasic/Logging/Log.vb | 6 +- .../MyServices/Internal/ProgressDialog.vb | 2 +- .../MyServices/Internal/WebClientCopy.vb | 169 ---- .../src/PublicAPI.Unshipped.txt | 8 - .../Windows/Forms/ClipboardProxyTests.vb | 18 +- .../System/Windows/Forms/FileIoProxyTests.vb | 295 +++---- .../Windows/Forms/NetworkDownloadTests.vb | 725 ++++++++---------- .../Forms/TempDirectoryFileFunctionsvb.vb | 282 ------- .../System/Windows/Forms/WebListener.vb | 12 +- 26 files changed, 799 insertions(+), 1417 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb diff --git a/eng/Versions.props b/eng/Versions.props index dfe6d08d52e..5a702c19cf7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,36 +13,36 @@ - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 5.0.0-preview.7.20320.5 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 + 9.0.0-preview.4.24210.9 + 9.0.0-preview.4.24210.9 6.0.0 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - 9.0.0-preview.4.24175.10 - $(MicrosoftNETCoreILAsmPackageVersion) @@ -54,9 +54,9 @@ - 9.0.0-beta.24176.6 - 9.0.0-beta.24176.6 - 9.0.0-beta.24176.6 + 9.0.0-beta.24210.4 + 9.0.0-beta.24210.4 + 9.0.0-beta.24210.4 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 78b50d0af82..9c038aefed6 100644 --- a/global.json +++ b/global.json @@ -14,11 +14,11 @@ "version": "9.0.100-preview.1.24101.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24176.6", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24176.6", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24176.6", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24210.4", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24210.4", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24210.4", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24175.10" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24210.9" }, "native-tools": { "cmake": "latest" diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 0d94f221780..1739fe1fa8f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -26,14 +26,14 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Function GetEnvironmentVariable(name As String) As String ' Framework returns Null if not found. - Dim VariableValue As String = Environment.GetEnvironmentVariable(name) + Dim variableValue As String = Environment.GetEnvironmentVariable(name) ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If VariableValue Is Nothing Then + If variableValue Is Nothing Then Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) End If - Return VariableValue + Return variableValue End Function ''' @@ -59,8 +59,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property Info() As AssemblyInfo Get If _info Is Nothing Then - Dim Assembly As Reflection.Assembly = If(Reflection.Assembly.GetEntryAssembly(), Reflection.Assembly.GetCallingAssembly()) - _info = New AssemblyInfo(Assembly) + Dim assembly As Reflection.Assembly = If(Reflection.Assembly.GetEntryAssembly(), Reflection.Assembly.GetCallingAssembly()) + _info = New AssemblyInfo(assembly) End If Return _info End Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index cbce7abf545..22d0c622474 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -37,12 +37,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property Description() As String Get If _description Is Nothing Then - Dim Attribute As AssemblyDescriptionAttribute = + Dim attribute As AssemblyDescriptionAttribute = CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _description = "" Else - _description = Attribute.Description + _description = attribute.Description End If End If Return _description @@ -57,12 +57,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property CompanyName() As String Get If _companyName Is Nothing Then - Dim Attribute As AssemblyCompanyAttribute = + Dim attribute As AssemblyCompanyAttribute = CType(GetAttribute(GetType(AssemblyCompanyAttribute)), AssemblyCompanyAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _companyName = "" Else - _companyName = Attribute.Company + _companyName = attribute.Company End If End If Return _companyName @@ -77,12 +77,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property Title() As String Get If _title Is Nothing Then - Dim Attribute As AssemblyTitleAttribute = + Dim attribute As AssemblyTitleAttribute = CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _title = "" Else - _title = Attribute.Title + _title = attribute.Title End If End If Return _title @@ -97,11 +97,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property Copyright() As String Get If _copyright Is Nothing Then - Dim Attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) + If attribute Is Nothing Then _copyright = "" Else - _copyright = Attribute.Copyright + _copyright = attribute.Copyright End If End If Return _copyright @@ -116,11 +116,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property Trademark() As String Get If _trademark Is Nothing Then - Dim Attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If attribute Is Nothing Then _trademark = "" Else - _trademark = Attribute.Trademark + _trademark = attribute.Trademark End If End If Return _trademark @@ -135,11 +135,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property ProductName() As String Get If _productName Is Nothing Then - Dim Attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) + If attribute Is Nothing Then _productName = "" Else - _productName = Attribute.Product + _productName = attribute.Product End If End If Return _productName @@ -183,11 +183,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' attempt on an unloaded application domain. Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) Get - Dim Result As New Collection(Of Assembly) - For Each Assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - Result.Add(Assembly) + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) Next - Return New ReadOnlyCollection(Of Assembly)(Result) + Return New ReadOnlyCollection(Of Assembly)(result) End Get End Property @@ -223,12 +223,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices Debug.Assert(_assembly IsNot Nothing, "Null m_Assembly") - Dim Attributes() As Object = _assembly.GetCustomAttributes(AttributeType, inherit:=True) + Dim attributes() As Object = _assembly.GetCustomAttributes(AttributeType, inherit:=True) - If Attributes.Length = 0 Then + If attributes.Length = 0 Then Return Nothing Else - Return Attributes(0) + Return attributes(0) End If End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index fdf0e134110..10e30935252 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -34,11 +34,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices Get If _commandLineArgs Is Nothing Then 'Get rid of Arg(0) which is the path of the executing program. Main(args() as string) doesn't report the name of the app and neither will we - Dim EnvArgs As String() = Environment.GetCommandLineArgs - If EnvArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments - Dim NewArgs(EnvArgs.GetLength(0) - 2) As String 'dimming z(0) gives a z() of 1 element. - Array.Copy(EnvArgs, 1, NewArgs, 0, EnvArgs.GetLength(0) - 1) 'copy everything but the 0th element (the path of the executing program) - _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(NewArgs) + Dim envArgs As String() = Environment.GetCommandLineArgs + If envArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments + Dim newArgs(envArgs.GetLength(0) - 2) As String 'dimming z(0) gives a z() of 1 element. + Array.Copy(envArgs, 1, newArgs, 0, envArgs.GetLength(0) - 1) 'copy everything but the 0th element (the path of the executing program) + _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(newArgs) Else _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(Array.Empty(Of String)()) 'provide the empty set End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index cfb1f1f0e28..f33e82c5cd1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -328,10 +328,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Note: Must pass the calling assembly from here so we can get the running app. ' Otherwise, can break single instance. - Dim ApplicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) + Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) Dim pipeServer As NamedPipeServerStream = Nothing - If TryCreatePipeServer(ApplicationInstanceID, pipeServer) Then + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then ' --- This is the first instance of a single-instance application to run. ' This is the instance that subsequent instances will attach to. @@ -349,7 +349,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim tokenSource As New CancellationTokenSource() tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) Try - Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(ApplicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) awaitable.GetAwaiter().GetResult() Catch ex As Exception Throw New CantStartSingleInstanceException() @@ -955,7 +955,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Private Sub DoApplicationModel() - Dim EventArgs As New StartupEventArgs(CommandLineArgs) + Dim eventArgs As New StartupEventArgs(CommandLineArgs) ' Only do the try/catch if we aren't running under the debugger. ' If we do try/catch under the debugger the debugger never gets @@ -967,7 +967,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' need to be mirrored in the ELSE debugger attached clause below. Try If OnInitialize(CommandLineArgs) Then - If OnStartup(EventArgs) Then + If OnStartup(eventArgs) Then OnRun() OnShutdown() End If @@ -998,7 +998,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' We also don't hook up the Application.ThreadException event because WinForms ignores it ' when we are running under the debugger. If OnInitialize(CommandLineArgs) Then - If OnStartup(EventArgs) Then + If OnStartup(eventArgs) Then OnRun() OnShutdown() End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index 6efa0c043e3..5c328b2e90d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -1,8 +1,8 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports Microsoft.VisualBasic.MyServices Imports System.Windows.Forms +Imports Microsoft.VisualBasic.MyServices Namespace Microsoft.VisualBasic.Devices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index c13547739b1..42928764707 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -198,61 +198,61 @@ Namespace Microsoft.VisualBasic.Devices Private ReadOnly _instanceBeingWatched As ComputerInfo Public Sub New(RealClass As ComputerInfo) - _instanceBeingWatched = RealClass - End Sub + _instanceBeingWatched = RealClass + End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= - - Public ReadOnly Property AvailablePhysicalMemory() As UInt64 - Get - Return _instanceBeingWatched.AvailablePhysicalMemory - End Get - End Property - - - Public ReadOnly Property AvailableVirtualMemory() As UInt64 - Get - Return _instanceBeingWatched.AvailableVirtualMemory - End Get - End Property - - - Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo - Get - Return _instanceBeingWatched.InstalledUICulture - End Get - End Property - - - Public ReadOnly Property OSPlatform() As String - Get - Return _instanceBeingWatched.OSPlatform - End Get - End Property - - - Public ReadOnly Property OSVersion() As String - Get - Return _instanceBeingWatched.OSVersion - End Get - End Property - - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 - Get - Return _instanceBeingWatched.TotalPhysicalMemory - End Get - End Property - - - Public ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Return _instanceBeingWatched.TotalVirtualMemory - End Get - End Property + + Public ReadOnly Property AvailablePhysicalMemory() As UInt64 + Get + Return _instanceBeingWatched.AvailablePhysicalMemory + End Get + End Property + + + Public ReadOnly Property AvailableVirtualMemory() As UInt64 + Get + Return _instanceBeingWatched.AvailableVirtualMemory + End Get + End Property + + + Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo + Get + Return _instanceBeingWatched.InstalledUICulture + End Get + End Property + + + Public ReadOnly Property OSPlatform() As String + Get + Return _instanceBeingWatched.OSPlatform + End Get + End Property + + + Public ReadOnly Property OSVersion() As String + Get + Return _instanceBeingWatched.OSVersion + End Get + End Property + + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalPhysicalMemory + End Get + End Property + + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalVirtualMemory + End Get + End Property #Enable Warning IDE0049 ' Simplify Names - End Class End Class + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 60470adc84f..66d5f93603b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -40,8 +40,8 @@ Namespace Microsoft.VisualBasic.Devices ''' True if the key is down otherwise false. Public ReadOnly Property ShiftKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Shift, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And keys.Shift, Boolean) End Get End Property @@ -51,8 +51,8 @@ Namespace Microsoft.VisualBasic.Devices ''' True if the key is down otherwise false. Public ReadOnly Property AltKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Alt, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And keys.Alt, Boolean) End Get End Property @@ -62,8 +62,8 @@ Namespace Microsoft.VisualBasic.Devices ''' True if the key is down otherwise false. Public ReadOnly Property CtrlKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Control, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And keys.Control, Boolean) End Get End Property diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index 2a355d82d61..07e39d0f658 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -102,11 +102,11 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) Private Sub NetworkAvailabilityChangedHandler(state As Object) - Dim Connected As Boolean = IsAvailable + Dim connected As Boolean = IsAvailable ' Fire an event only if the connected state has changed - If _connected <> Connected Then - _connected = Connected - RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(Connected)) + If _connected <> connected Then + _connected = connected + RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(connected)) End If End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index 1b59bbf9432..a274c244bfd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -71,9 +71,9 @@ Namespace Microsoft.VisualBasic.Devices Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) End If - Dim PingMaker As New NetInfoAlias.Ping - Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - If Reply.Status = NetInfoAlias.IPStatus.Success Then + Dim pingMaker As New NetInfoAlias.Ping + Dim reply As NetInfoAlias.PingReply = pingMaker.Send(hostNameOrAddress, timeout, PingBuffer) + If reply.Status = NetInfoAlias.IPStatus.Success Then Return True End If Return False diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index 0136d7cfeba..bc22199b744 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -204,23 +204,23 @@ Namespace Microsoft.VisualBasic.Devices client.Credentials = networkCredentials End If - Dim Dialog As ProgressDialog = Nothing + Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then - Dialog = New ProgressDialog With { + dialog = New ProgressDialog With { .Text = Utils.GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), .LabelText = Utils.GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) } End If 'Create the copier - Dim copier As New WebClientCopy(client, Dialog) + Dim copier As New WebClientCopy(client, dialog) 'Download the file copier.UploadFile(sourceFileName, address) 'Handle a dialog cancel If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then + If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then Throw New OperationCanceledException() End If End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index b20c13c27cb..83b7496da9e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -19,28 +19,28 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' GetLongPathName is a PInvoke call and requires unmanaged code permission. ''' Use DirectoryInfo.GetFiles and GetDirectories (which call FindFirstFile) so that we always have permission. ''' - Private Shared Function GetLongPath(FullPath As String) As String - Debug.Assert(Not String.IsNullOrEmpty(FullPath) AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") + Private Shared Function GetLongPath(fullPath As String) As String + Debug.Assert(Not String.IsNullOrEmpty(fullPath) AndAlso IO.Path.IsPathRooted(fullPath), "Must be full path") Try ' If root path, return itself. UNC path do not recognize 8.3 format in root path, so this is fine. - If IsRoot(FullPath) Then - Return FullPath + If IsRoot(fullPath) Then + Return fullPath End If ' DirectoryInfo.GetFiles and GetDirectories call FindFirstFile which resolves 8.3 path. ' Get the DirectoryInfo (user must have code permission or access permission). - Dim DInfo As New IO.DirectoryInfo(FileIO.FileSystem.GetParentPath(FullPath)) + Dim dInfo As New IO.DirectoryInfo(FileIO.FileSystem.GetParentPath(fullPath)) - If IO.File.Exists(FullPath) Then - Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") - Return DInfo.GetFiles(IO.Path.GetFileName(FullPath))(0).FullName - ElseIf IO.Directory.Exists(FullPath) Then - Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, + If IO.File.Exists(fullPath) Then + Debug.Assert(dInfo.GetFiles(IO.Path.GetFileName(fullPath)).Length = 1, "Must found exactly 1") + Return dInfo.GetFiles(IO.Path.GetFileName(fullPath))(0).FullName + ElseIf IO.Directory.Exists(fullPath) Then + Debug.Assert(dInfo.GetDirectories(IO.Path.GetFileName(fullPath)).Length = 1, "Must found exactly 1") - Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName + Return dInfo.GetDirectories(IO.Path.GetFileName(fullPath))(0).FullName Else ' Path does not exist, cannot resolve. - Return FullPath + Return fullPath End If Catch ex As Exception ' Ignore these type of exceptions and return FullPath. These type of exceptions should either be caught by calling functions @@ -58,7 +58,7 @@ Namespace Microsoft.VisualBasic.CompilerServices TypeOf ex Is IO.PathTooLongException OrElse TypeOf ex Is NotSupportedException), "These exceptions should be caught above") - Return FullPath + Return fullPath Else Throw End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index ac088fd6ae0..41607fafe4f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -95,16 +95,16 @@ Namespace Microsoft.VisualBasic.CompilerServices AddHandler MyCancelButton.Click, AddressOf MyCancelButton_Click 'Re-size the dialog if the prompt is too large - Dim LabelGraphics As Graphics = Label.CreateGraphics - Dim LabelSizeNeeded As SizeF = LabelGraphics.MeasureString(Prompt, Label.Font, Label.Width) - LabelGraphics.Dispose() - If LabelSizeNeeded.Height > Label.Height Then + Dim labelGraphics As Graphics = Label.CreateGraphics + Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(Prompt, Label.Font, Label.Width) + labelGraphics.Dispose() + If labelSizeNeeded.Height > Label.Height Then 'The current label size is not large enough to accommodate the prompt. We need ' to expand the label and the dialog, and move the textbox to make room. - Dim DialogHeightChange As Integer = CInt(LabelSizeNeeded.Height) - Label.Height - Label.Height += DialogHeightChange - TextBox.Top += DialogHeightChange - Height += DialogHeightChange + Dim dialogHeightChange As Integer = CInt(labelSizeNeeded.Height) - Label.Height + Label.Height += dialogHeightChange + TextBox.Top += dialogHeightChange + Height += dialogHeightChange End If 'Position the form diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index 3e0d4559529..2462dbe10dc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -12,14 +12,10 @@ Namespace Microsoft.VisualBasic Private ReadOnly _parentWindow As IWin32Window Private ReadOnly _prompt As String Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String Private ReadOnly _xPos As Integer Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window Private _exception As Exception Private _result As String - Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) _prompt = Prompt _title = Title @@ -48,18 +44,6 @@ Namespace Microsoft.VisualBasic _exception = ex End Try End Sub - - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property End Class End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 83372a7460d..e8550390d18 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -14,206 +14,180 @@ Namespace Microsoft.VisualBasic ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. ' Do not change this API without also updating that dependent module. - Partial Friend Module _Interaction - - Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) - ' if no window with name (full or truncated) or task id, return an error - ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible - Dim hwndOwned As IntPtr - If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then - ' scan to the next window until failure - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) - If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then - If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then - hwndApp = hwndOwned - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Else - Exit Do - End If - End If - hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) - Loop - - ' if scan failed, return an error - If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) - End If - - ' set active window to the owned one - hwndApp = hwndOwned + Friend Module _Interaction + + Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer + Dim startupInfo As New NativeTypes.STARTUPINFO + Dim processInfo As New NativeTypes.PROCESS_INFORMATION + Dim ok As Integer + Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim errorCode As Integer = 0 + + If (PathName Is Nothing) Then + Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If - ' SetActiveWindow on Win32 only activates the Window - it does - ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the - ' window, moves it to the foreground, and bumps the priority - ' of the thread which owns the window. - - 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant - 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version - 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory - 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. - - ' Attach ourselves to the window we want to set focus to - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) - ' Make it foreground and give it focus, this will occur - ' synchronously because we are attached. - NativeMethods.SetForegroundWindow(hwndApp) - NativeMethods.SetFocus(hwndApp) - ' Unattached ourselves from the window - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) - End Sub - - Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - - Dim Title As String + If (Style < 0 OrElse Style > 9) Then + Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + End If - 'Get the Assembly name of the calling assembly - 'Assembly.GetName requires PathDiscovery permission so we try this first - 'and if it throws we catch the security exception and parse the name - 'from the full assembly name + NativeMethods.GetStartupInfo(startupInfo) Try - Title = CallingAssembly.GetName().Name - Catch ex As SecurityException - Dim FullName As String = CallingAssembly.FullName - - If ok = 0 Then 'succeeded - 'Process ran to completion - Return 0 - Else - 'Wait timed out - Return ProcessInfo.dwProcessId + startupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + startupInfo.wShowWindow = Style + + 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant + 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version + 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + + ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, startupInfo, processInfo) + If ok = 0 Then + errorCode = Marshal.GetLastWin32Error() End If - Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Return ProcessInfo.dwProcessId + If processInfo.hProcess <> IntPtr.Zero AndAlso processInfo.hProcess <> NativeTypes.s_invalidHandle Then + safeProcessHandle.InitialSetHandle(processInfo.hProcess) End If - Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If ErrorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) + If processInfo.hThread <> IntPtr.Zero AndAlso processInfo.hThread <> NativeTypes.s_invalidHandle Then + safeThreadHandle.InitialSetHandle(processInfo.hThread) End If - Throw VbMakeException(vbErrors.FileNotFound) - End If - Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. - safeThreadHandle.Close() - End Try + Try + If (ok <> 0) Then + If Wait Then + ' Is infinite wait okay here ? + ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights + ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + + If ok = 0 Then 'succeeded + 'Process ran to completion + Shell = 0 + Else + 'Wait timed out + Shell = processInfo.dwProcessId + End If + Else + NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) + Shell = processInfo.dwProcessId + End If + Else + 'Check for a win32 error access denied. If it is, make and throw the exception. + 'If not, throw FileNotFound + Const ERROR_ACCESS_DENIED As Integer = 5 + If errorCode = ERROR_ACCESS_DENIED Then + Throw VbMakeException(vbErrors.PermissionDenied) + End If + + Throw VbMakeException(vbErrors.FileNotFound) + End If + Finally + safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + safeThreadHandle.Close() + End Try Finally - StartupInfo.Dispose() + startupInfo.Dispose() End Try End Function - Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - Box.ShowDialog(ParentWindow) - - InternalInputBox = Box.Output - Box.Dispose() - End Function - Public Sub AppActivateByProcessId(ProcessId As Integer) 'As an optimization, we will only check the UI permission once we actually know we found the app to activate - we'll do that in AppActivateHelper - Dim ProcessIdOwningWindow As Integer + Dim processIdOwningWindow As Integer 'Note, a process can have multiple windows. What we want to do is dig through to find one 'that we can actually activate. So first ignore all the ones that are not visible and don't support mouse 'or keyboard input - Dim WindowHandle As IntPtr = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + Dim windowHandle As IntPtr = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While (IntPtr.op_Inequality(WindowHandle, IntPtr.Zero)) - SafeNativeMethods.GetWindowThreadProcessId(WindowHandle, ProcessIdOwningWindow) - If (ProcessIdOwningWindow = ProcessId) AndAlso SafeNativeMethods.IsWindowEnabled(WindowHandle) AndAlso SafeNativeMethods.IsWindowVisible(WindowHandle) Then + Do While (IntPtr.op_Inequality(windowHandle, IntPtr.Zero)) + SafeNativeMethods.GetWindowThreadProcessId(windowHandle, processIdOwningWindow) + If (processIdOwningWindow = ProcessId) AndAlso SafeNativeMethods.IsWindowEnabled(windowHandle) AndAlso SafeNativeMethods.IsWindowVisible(windowHandle) Then Exit Do 'We found a window belonging to the desired process that we can actually activate and will support user input End If 'keep rummaging through windows looking for one that belongs to the process we are after - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop 'If we didn't find a window during the pass above, try the less desirable route of finding any window that belongs to the process - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) - SafeNativeMethods.GetWindowThreadProcessId(WindowHandle, ProcessIdOwningWindow) - If (ProcessIdOwningWindow = ProcessId) Then + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) + SafeNativeMethods.GetWindowThreadProcessId(windowHandle, processIdOwningWindow) + If (processIdOwningWindow = ProcessId) Then Exit Do End If 'keep rummaging through windows looking for one that belongs to the process we are after - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop End If - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else - AppActivateHelper(WindowHandle, CStr(ProcessId)) + AppActivateHelper(windowHandle, CStr(ProcessId)) End If End Sub Public Sub AppActivateByTitle(Title As String) 'As an optimization, we will only check the UI permission once we actually know we found the app to activate - we'll do that in AppActivateHelper - Dim WindowHandle As IntPtr = NativeMethods.FindWindow(Nothing, Title) 'see if we can find the window using an exact match on the title + Dim windowHandle As IntPtr = NativeMethods.FindWindow(Nothing, Title) 'see if we can find the window using an exact match on the title Const MAX_TITLE_LENGTH As Integer = 511 ' if no match, search through all parent windows - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then - Dim AppTitle As String + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then + Dim appTitle As String ' Old implementation uses MAX_TITLE_LENGTH characters, INCLUDING NULL character. ' Interop code will extend string builder to handle NULL character. - Dim AppTitleBuilder As New StringBuilder(MAX_TITLE_LENGTH) - Dim AppTitleLength As Integer - Dim TitleLength As Integer = Len(Title) + Dim appTitleBuilder As New StringBuilder(MAX_TITLE_LENGTH) + Dim appTitleLength As Integer + Dim titleLength As Integer = Len(Title) 'Loop through all children of the desktop - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) ' get the window caption and test for a left-aligned substring - AppTitleLength = NativeMethods.GetWindowText(WindowHandle, AppTitleBuilder, AppTitleBuilder.Capacity) - AppTitle = AppTitleBuilder.ToString() + appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity) + appTitle = appTitleBuilder.ToString() - If AppTitleLength >= TitleLength Then - If String.Compare(AppTitle, 0, Title, 0, TitleLength, StringComparison.OrdinalIgnoreCase) = 0 Then + If appTitleLength >= titleLength Then + If String.Compare(appTitle, 0, Title, 0, titleLength, StringComparison.OrdinalIgnoreCase) = 0 Then Exit Do 'found one End If End If 'keep looking - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then ' We didn't find it so try right aligned - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) ' get the window caption and test for a right-aligned substring - AppTitleLength = NativeMethods.GetWindowText(WindowHandle, AppTitleBuilder, AppTitleBuilder.Capacity) - AppTitle = AppTitleBuilder.ToString() + appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity) + appTitle = appTitleBuilder.ToString() - If AppTitleLength >= TitleLength Then - If String.Compare(Right(AppTitle, TitleLength), 0, Title, 0, TitleLength, StringComparison.OrdinalIgnoreCase) = 0 Then + If appTitleLength >= titleLength Then + If String.Compare(Right(appTitle, titleLength), 0, Title, 0, titleLength, StringComparison.OrdinalIgnoreCase) = 0 Then Exit Do 'found a match End If End If 'keep looking - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop End If End If - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then 'no match + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, Title)) Else - AppActivateHelper(WindowHandle, Title) + AppActivateHelper(windowHandle, Title) End If End Sub @@ -263,53 +237,13 @@ Namespace Microsoft.VisualBasic NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) End Sub - Private NotInheritable Class InputBoxHandler - Private ReadOnly _prompt As String - Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String - Private ReadOnly _xPos As Integer - Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window - Private _exception As Exception - - Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) - _prompt = Prompt - _title = Title - _defaultResponse = DefaultResponse - _xPos = XPos - _yPos = YPos - _parentWindow = ParentWindow - End Sub - - Public Sub StartHere() - Try - _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) - Catch ex As Exception - _exception = ex - End Try - End Sub - - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property - End Class - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String Dim vbHost As IVbHost - Dim ParentWindow As IWin32Window = Nothing + Dim parentWindow As IWin32Window = Nothing vbHost = HostServices.VBHost If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. - ParentWindow = vbHost.GetParentWindow() + parentWindow = vbHost.GetParentWindow() End If If String.IsNullOrEmpty(Title) Then @@ -324,60 +258,61 @@ Namespace Microsoft.VisualBasic 'but set to STA and check if it isn't STA, then we need to start another thread 'to display the InputBox If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then - Dim InputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) - Dim thread As New Thread(New ThreadStart(AddressOf InputHandler.StartHere)) + Dim inputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, parentWindow) + Dim thread As New Thread(New ThreadStart(AddressOf inputHandler.StartHere)) thread.Start() thread.Join() - If InputHandler.Exception IsNot Nothing Then - Throw InputHandler.Exception + If inputHandler.Exception IsNot Nothing Then + Throw inputHandler.Exception End If - Return InputHandler.Result + Return inputHandler.Result Else - Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) + Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, parentWindow) End If End Function Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String - Dim Title As String + Dim title As String 'Get the Assembly name of the calling assembly 'Assembly.GetName requires PathDiscovery permission so we try this first 'and if it throws we catch the security exception and parse the name 'from the full assembly name Try - Title = CallingAssembly.GetName().Name + title = CallingAssembly.GetName().Name Catch ex As SecurityException - Dim FullName As String = CallingAssembly.FullName + Dim fullName As String = CallingAssembly.FullName 'Find the text up to the first comma. Note, this fails if the assembly has 'a comma in its name - Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) - If FirstCommaLocation >= 0 Then - Title = FullName.Substring(0, FirstCommaLocation) + Dim firstCommaLocation As Integer = fullName.IndexOf(","c) + If firstCommaLocation >= 0 Then + title = fullName.Substring(0, firstCommaLocation) Else 'The name is not in the format we're expecting so return an empty string - Title = "" + title = "" End If End Try - Return Title + Return title End Function Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - Box.ShowDialog(ParentWindow) + Dim box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + box.ShowDialog(ParentWindow) - InternalInputBox = Box.Output - Box.Dispose() + InternalInputBox = box.Output + box.Dispose() End Function Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String + Dim vbHost As IVbHost Dim parentWindow As IWin32Window = Nothing vbHost = HostServices.VBHost @@ -417,7 +352,7 @@ Namespace Microsoft.VisualBasic sTitle = vbHost.GetWindowTitle() End If Else - sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) + sTitle = CStr(Title) 'allows the title to be an expression, e.g. msgBox(prompt, Title:=1+5) End If Catch ex As StackOverflowException Throw diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 5cdcaa9dcdc..751286bcc2a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -401,9 +401,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message) + Dim newEntrySize As Long = Encoding.GetByteCount(message) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.Write(message) If AutoFlush Then ListenerStream.Flush() @@ -427,9 +427,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) + Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.WriteLine(message) If AutoFlush Then ListenerStream.Flush() @@ -685,7 +685,7 @@ Namespace Microsoft.VisualBasic.Logging ' FileLogTraceListener in the same process Dim i As Integer = 0 Dim refStream As ReferencedStream = Nothing - Dim BaseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) + Dim baseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) While refStream Is Nothing AndAlso i < MAX_OPEN_ATTEMPTS ' This should only be true if processes outside our process have @@ -746,7 +746,7 @@ Namespace Microsoft.VisualBasic.Logging End While 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, BaseStreamName) + Throw GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' @@ -849,16 +849,16 @@ Namespace Microsoft.VisualBasic.Logging ''' The total amount, in bytes, of free disk space available to the current user ''' Throws an exception if API fails Private Function GetFreeDiskSpace() As Long - Dim PathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) + Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim FreeUserSpace As Long = -1 - Dim TotalUserSpace As Long - Dim TotalFreeSpace As Long + Dim freeUserSpace As Long = -1 + Dim totalUserSpace As Long + Dim totalFreeSpace As Long - If UnsafeNativeMethods.GetDiskFreeSpaceEx(PathName, FreeUserSpace, TotalUserSpace, TotalFreeSpace) Then - If FreeUserSpace > -1 Then - Return FreeUserSpace + If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then + If freeUserSpace > -1 Then + Return freeUserSpace End If End If @@ -872,21 +872,21 @@ Namespace Microsoft.VisualBasic.Logging Private Function GetFileEncoding(fileName As String) As Encoding If File.Exists(fileName) Then - Dim Reader As StreamReader = Nothing + Dim reader As StreamReader = Nothing Try 'Attempt to determine the encoding of the file. The call to Reader.ReadLine 'will change the current encoding of Reader to that of the file. - Reader = New StreamReader(fileName, Encoding, True) + reader = New StreamReader(fileName, Encoding, True) 'Ignore 0 length file - If Reader.BaseStream.Length > 0 Then - Reader.ReadLine() + If reader.BaseStream.Length > 0 Then + reader.ReadLine() - Return Reader.CurrentEncoding + Return reader.CurrentEncoding End If Finally - Reader?.Close() + reader?.Close() End Try End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 0822c2a3dde..1c451266820 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -217,9 +217,9 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' The Id Private Shared Function TraceEventTypeToId(traceEventValue As TraceEventType) As Integer - Dim Id As Integer = 0 - s_idHash.TryGetValue(traceEventValue, Id) - Return Id + Dim id As Integer = 0 + s_idHash.TryGetValue(traceEventValue, id) + Return id End Function ' The underlying TraceSource for the log diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index c4b5d46c72c..8e95c640b6d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -229,7 +229,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal 'Do not modify it using the code editor. Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) + Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) LabelInfo = New Label ProgressBarWork = New ProgressBar ButtonCloseDialog = New Button diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 3504d10f7ee..db3399432a4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -149,173 +149,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Class - ''' - ''' Class that controls the thread that does the actual work of downloading or uploading. - ''' - Friend NotInheritable Class HttpClientCopy - - ''' - ''' Creates an instance of a HttpClientCopy, used to download or upload a file - ''' - ''' The HttpClient used to do the downloading or uploading - ''' UI for indicating progress - Public Sub New(client As HttpClient, dialog As ProgressDialog) - - Debug.Assert(client IsNot Nothing, "No HttpClient") - - _httpClient = client - m_ProgressDialog = dialog - - End Sub - - ''' - ''' Downloads a file - ''' - ''' The source for the file - ''' The path and name where the file is saved - Public Async Function DownloadFileAsync(address As Uri, destinationFileName As String) As Task - Debug.Assert(_httpClient IsNot Nothing, "No HttpClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") - - Using response As HttpResponseMessage = Await _httpClient.GetAsync(address, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False) - Using responseStream As Stream = Await response.Content.ReadAsStreamAsync().ConfigureAwait(False) - Using fileStream As New FileStream(destinationFileName, FileMode.Create, FileAccess.Write, FileShare.None) - - Dim buffer(8191) As Byte - Dim totalBytesRead As Long = 0 - Dim bytesRead As Integer - Try - m_ProgressDialog?.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - While (Await responseStream.ReadAsync(buffer.AsMemory(0, buffer.Length), _cancelTokenRead).ConfigureAwait(False)) > 0 - Dim contentLength? As Long = response.Content.Headers.ContentLength - If Not contentLength.HasValue Then - Continue While - Else - bytesRead = CInt(contentLength.Value) - totalBytesRead += bytesRead - - Dim cancelTokenWrite As CancellationToken = _cancelSourceWrite.Token - - Await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), _cancelTokenWrite).ConfigureAwait(False) - If m_ProgressDialog IsNot Nothing Then - Dim percentage As Integer = CInt(totalBytesRead / contentLength.Value * 100) - InvokeIncrement(percentage) - End If - End If - _cancelSourceRead = New CancellationTokenSource() - _cancelTokenRead = _cancelSourceRead.Token - _cancelSourceWrite = New CancellationTokenSource() - _cancelTokenWrite = _cancelSourceWrite.Token - End While - Catch ex As Exception - Throw - End Try - End Using - End Using - End If - respone?.dispose - CloseProgressDialog() - - End Function - -#If False Then - ''' - ''' Uploads a file - ''' - ''' The name and path of the source file - ''' The address to which the file is uploaded - Public Sub UploadFile(sourceFileName As String, address As Uri) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - - ' If we have a dialog we need to set up an async download - If m_ProgressDialog IsNot Nothing Then - m_WebClient.UploadFileAsync(address, sourceFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.UploadFile(address, sourceFileName) - End If - - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer - End If - End If - End Sub - -#End If - - ''' - ''' Notifies the progress dialog to increment the progress bar - ''' - ''' The percentage of bytes read - Private Sub InvokeIncrement(progressPercentage As Integer) - ' Don't invoke unless dialog is up and running - If m_ProgressDialog IsNot Nothing Then - If m_ProgressDialog.IsHandleCreated Then - - ' For performance, don't invoke if increment is 0 - Dim increment As Integer = progressPercentage - _percentage - _percentage = progressPercentage - If increment > 0 Then - m_ProgressDialog.BeginInvoke(New DoIncrement(AddressOf m_ProgressDialog.Increment), increment) - End If - - End If - End If - End Sub - - ''' - ''' Posts a message to close the progress dialog - ''' - Private Sub CloseProgressDialog() - ' Don't invoke unless dialog is up and running - If m_ProgressDialog IsNot Nothing Then - m_ProgressDialog.IndicateClosing() - - If m_ProgressDialog.IsHandleCreated Then - m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - m_ProgressDialog.Close() - End If - End If - End Sub - - ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation - ''' - ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. - ''' - Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - _cancelSourceRead.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. - _cancelSourceWrite.Cancel() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. - End Sub - - Private _cancelSourceRead As New CancellationTokenSource() - Private _cancelTokenRead As CancellationToken = _cancelSourceRead.Token - - Private _cancelSourceWrite As New CancellationTokenSource() - Private _cancelTokenWrite As CancellationToken = _cancelSourceRead.Token - - ' The WebClient performs the downloading or uploading operations for us - Private ReadOnly _httpClient As HttpClient - - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. - Private WithEvents m_ProgressDialog As ProgressDialog - - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) - - ' The percentage of the operation completed - Private _percentage As Integer - - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt index 14ba78b16f9..e69de29bb2d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt +++ b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt @@ -1,8 +0,0 @@ -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As String, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, networkCredentials As System.Net.ICredentials, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean) -> System.Threading.Tasks.Task -Microsoft.VisualBasic.Devices.Network.DownloadFileAsync(address As System.Uri, destinationFileName As String, userName As String, password As String, showUI As Boolean, connectionTimeout As Integer, overwrite As Boolean, onUserCancel As Microsoft.VisualBasic.FileIO.UICancelOption) -> System.Threading.Tasks.Task \ No newline at end of file diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 279ef2b5b76..f3ffc394d4a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -14,9 +14,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class ClipboardProxyTests - Public Sub Clipboard_ContainsText() - Dim text As String = GetUniqueText() + Public Sub ClipboardProxy_ContainsText() Dim clipboardProxy As New MyServices.ClipboardProxy + Dim text As String = GetUniqueText() clipboardProxy.SetText(text) Assert.Equal(text, clipboardProxy.GetText()) text = GetUniqueText() @@ -25,16 +25,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub Clipboard_GetAudioStream_InvokeMultipleTimes_Success() + Public Sub ClipboardProxy_GetAudioStream_InvokeMultipleTimes_Success() Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) Dim result As Stream = clipboardProxy.GetAudioStream() Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) End Sub - Public Sub Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() - Dim audioBytes As Byte() = {1, 2, 3} + Public Sub ClipboardProxy_SetAudio_InvokeByteArray_GetReturnsExpected() Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} clipboardProxy.SetAudio(audioBytes) Assert.True(clipboardProxy.ContainsAudio()) Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) @@ -43,9 +45,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub Clipboard_SetAudio_InvokeStream_GetReturnsExpected() - Dim audioBytes() As Byte = {1, 2, 3} + Public Sub ClipboardProxy_SetAudio_InvokeStream_GetReturnsExpected() Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes() As Byte = {1, 2, 3} Using audioStream As New MemoryStream(audioBytes) clipboardProxy.SetAudio(audioStream) Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) @@ -56,7 +58,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub Clipboard_SetFileDropList_Invoke_GetReturnsExpected() + Public Sub ClipboardProxy_SetFileDropList_Invoke_GetReturnsExpected() Dim clipboardProxy As New MyServices.ClipboardProxy Dim filePaths As New StringCollection From {"filePath", "filePath2"} diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 4400cb5c679..f3c30bef19d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -10,66 +10,47 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Public Class FileIoProxyTests + Private ReadOnly _csvSampleData As String = "Index,Customer Id,First Name,Last Name,Company,City,Country 1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile" - Private ReadOnly _fixedSampleData As String = - "IndexFirstLastCompanyCityCountry -4321;1234;321;654321;123;1234567" - Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem - - Public Sub DriveProxyTest() - Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) - End Sub + Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem - - Public Sub FindInFilesProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) - Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) - _fileSystem.WriteAllText(fileC, "C", append:=False) - Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) - Assert.Equal(filenames.Count, 1) - Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) - filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") - Assert.Equal(filenames.Count, 0) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub + Private ReadOnly _fixedSampleData As String = + "IndexFirstLastCompanyCityCountry +4321;1234;321;654321;123;1234567" - Public Sub ReadAllTextProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Dim text As String = _fileSystem.ReadAllText(fileA) - Assert.Equal(text, "A") - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - - Public Sub ReadAllTextWithEncodingProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) - Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) - Assert.Equal(text, "A") + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub ReadAllBytesProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + Public Sub CopyDirectoryWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -133,80 +114,101 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub MoveFileWithShowUIProxyTest() + Public Sub DeleteDirectoryRecycleWithUICancelOptionsProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) - Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) - _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) - Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.False(IO.File.Exists(file1)) - Assert.True(IO.File.Exists(file2)) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.Directory.Exists(testDirectory)) End Sub - Public Sub MoveFileWithShowUIWithCancelOptionProxyTest() + Public Sub DeleteDirectoryWithUIProxyRecycleTest() Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) - Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) - _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) - Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.Directory.Exists(testDirectory)) + End Sub + + + Public Sub DeleteFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1) Assert.False(IO.File.Exists(file1)) - Assert.True(IO.File.Exists(file2)) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub CopyDirectoryWithShowUIProxyTest() - Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Public Sub DeleteFileWithRecycleOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.File.Exists(file1)) - Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) - _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) - Assert.True(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() - Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Public Sub DeleteFileWithUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.File.Exists(file1)) - Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) - _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) - Assert.True(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub MoveDirectoryWithShowUIProxyTest() + Public Sub DriveProxyTest() + Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) + End Sub + + + Public Sub FindInFilesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) + Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) + _fileSystem.WriteAllText(fileC, "C", append:=False) + Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) + Assert.Equal(filenames.Count, 1) + Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) + filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") + Assert.Equal(filenames.Count, 0) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveDirectoryWithShowUICancelOptionsProxyTest() Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) - _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) Assert.False(IO.Directory.Exists(testDirectory)) Assert.True(IO.Directory.Exists(destinationDirectory)) Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) @@ -214,14 +216,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub MoveDirectoryWithShowUICancelOptionsProxyTest() + Public Sub MoveDirectoryWithShowUIProxyTest() Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) - _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) Assert.False(IO.Directory.Exists(testDirectory)) Assert.True(IO.Directory.Exists(destinationDirectory)) Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) @@ -229,71 +231,55 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DeleteFileProxyTest() + Public Sub MoveFileWithShowUIProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - _fileSystem.DeleteFile(file1) + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) Assert.False(IO.File.Exists(file1)) - + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub DeleteFileWithRecycleOptionProxyTest() + Public Sub MoveFileWithShowUIWithCancelOptionProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) Assert.False(IO.File.Exists(file1)) - + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub DeleteFileWithUIProxyTest() + Public Sub OpenEncodedTextFileWriterProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - - _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) - Assert.False(IO.File.Exists(file1)) + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - - Public Sub DeleteDirectoryWithUIProxyRecycleTest() - Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - - _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) - Assert.False(IO.Directory.Exists(testDirectory)) - End Sub - - - Public Sub DeleteDirectoryRecycleWithUICancelOptionsProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - - _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) - Assert.False(IO.Directory.Exists(testDirectory)) - End Sub - @@ -326,6 +312,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub + + Public Sub OpenTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + Public Sub OpenTextFixedFieldParserProxyTest() Dim testDirectory As String = CreateTempDirectory() @@ -367,34 +369,35 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub OpenTextFileWriterProxyTest() + Public Sub ReadAllBytesProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) - fileWriter.WriteLine("A") - End Using - Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) - Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") - End Using + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub - Public Sub OpenEncodedTextFileWriterProxyTest() + Public Sub ReadAllTextProxyTest() Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory) + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) _fileSystem.WriteAllText(fileA, "A", append:=False) - Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) - fileWriter.WriteLine("A") - End Using - Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) - Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") - End Using + Dim text As String = _fileSystem.ReadAllText(fileA) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + Public Sub ReadAllTextWithEncodingProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) + Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) + Assert.Equal(text, "A") _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 93ef3bdb3bb..3f7a36917ba 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -35,13 +35,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return fileInfo.Length End Function - Private Sub CleanUp(listener As HttpListener, Optional tmpDirectoryPath As String = Nothing) - Debug.Assert(tmpDirectoryPath <> Path.GetTempPath) + Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) + Debug.Assert(Path.GetTempPath <> testDirectory) listener.Stop() listener.Close() - If Not String.IsNullOrWhiteSpace(tmpDirectoryPath) Then - Assert.True(tmpDirectoryPath.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) - Directory.Delete(tmpDirectoryPath, recursive:=True) + If Not String.IsNullOrWhiteSpace(testDirectory) Then + Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + Directory.Delete(testDirectory, recursive:=True) End If End Sub @@ -73,10 +73,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_Url_destinationFilename_Throw(destinationFilename As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() + + + Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -100,10 +101,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_Url_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + + + + Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -128,11 +131,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_Url_UrlEqualsNothing_Throws(address As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + + + Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -157,10 +160,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_Password_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Public Sub DownloadFile_UriOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -174,13 +177,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - - - Public Sub DownloadFile_Url_WrongPassword_Throw(password As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + + Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try @@ -188,12 +189,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -203,9 +204,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Ur_InvalidUrl_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UriWhereUriIsNothing_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -214,12 +215,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -240,13 +241,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -256,9 +257,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_Url_FileExistsNoOverwrite_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) + Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -267,13 +268,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -282,154 +283,67 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(destinationFilename), 1) - - CleanUp(listener, tmpDirectoryPath) - End Sub - - Public Sub DownloadFile_Url_FileExistsOverwrite_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, 1) + Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - - Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Finally - CleanUp(listener, tmpDirectoryPath) - End Try - End Sub - - - Public Sub DownloadFile_Url_InvalidUrlDoNotShowUI_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) - Try - Assert.Throws(Of ArgumentNullException)( - Sub() - My.Computer.Network _ - .DownloadFile(CType(Nothing, Uri), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.False(File.Exists(destinationFilename)) - Assert.True(Directory.Exists(testDirectory)) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_TimeOut_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadLargeFileSize) + Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Try - Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=-1, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub) - - Assert.False(File.Exists(destinationFilename)) - Assert.True(Directory.Exists(testDirectory)) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - Public Sub DownloadFile_Url_TimeoutNegative_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadLargeFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials:=Nothing, - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Url_UsernameEqualNothing_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials:=Nothing, - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - - - - - Public Sub DownloadFile_CheckFilePathTrailingSeparator_Throw(separator As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize) + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + networkCredentials, + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally @@ -446,13 +360,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -470,12 +384,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) Finally @@ -547,9 +461,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub DownloadFile_GetLongPath_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -557,8 +471,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ - .DownloadFile(address, - destinationFileName:=tmpDirectoryPath, ' This is a Directory! + .DownloadFile(webListener.Address, + destinationFileName:=testDirectory, ' This is a Directory! userName:="", password:="", showUI:=False, @@ -574,11 +488,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - Public Sub DownloadFile_RootDirectory_Throw(root As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + + + Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -587,13 +501,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - $"{destinationFilename}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + $"{destinationFilename}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -605,9 +519,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_RootDirectoryTrailingSeparator_Throw(root As String) - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -616,13 +530,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) End Sub) Assert.False(File.Exists(destinationFilename)) @@ -631,10 +545,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_Url_AllOptionsSet_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + + + + Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -643,24 +559,25 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) - CleanUp(listener, tmpDirectoryPath) - End Sub + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub - Public Sub DownloadFile_Uri_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() @@ -671,221 +588,247 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub - - Public Sub DownloadFile_Uri_Success() - Dim tmpFilePath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + + + + Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Try - My.Computer.Network _ - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - End Sub) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), 1) + Try + Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFilename) - CleanUp(listener, testDirectory) + End Sub) + Assert.False(File.Exists(destinationFilename)) Finally + CleanUp(listener, testDirectory) + End Try + End Sub - - Public Sub DownloadFile_Uri_ICredentialsShowUiTimeOutOverwriteSpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + + + + Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) + Dim testDirectory As String = CreateTempDirectory() + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) + .DownloadFile(webListener.Address, + destinationFilename) End Sub) - - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=18135) + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - - Public Sub DownloadFile_Uri_UserNamePassword_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, String), - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener) End Try End Sub - - Public Sub DownloadFile_Uri_UserNamePassword_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFilename, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener) End Try End Sub - Public Sub DownloadFile_Uri_OverwriteShowUISpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(tmpDirectoryPath, size:=1) - Dim webListener As New WebListener(DownloadLargeFileSize) + Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Assert.Throws(Of IOException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFilename), 1) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename, - userName:=Nothing, - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - Assert.Equal(ValidateDownload(tmpFilePath, destinationFilename), actual:=104857600) + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.False(File.Exists(destinationFilename)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UriWhereAllOptionsSpecifiedExceptUserCancel_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFilename, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) - CleanUp(listener, tmpDirectoryPath) + End Sub) + Assert.False(File.Exists(destinationFilename)) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_AllOptionsSpecified_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpDirectoryPath)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFilename, + userName:=Nothing, + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) - CleanUp(listener, tmpDirectoryPath) + Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Finally + CleanUp(listener, testDirectory) + End Try End Sub - Public Sub DownloadFile_Uri_TargetDirectoryDoesNotExist_Success() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) - Directory.Delete(tmpDirectoryPath, recursive:=True) + Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + .DownloadFile(webListener.Address, destinationFilename, userName:="", password:="", showUI:=False, TestingConnectionTimeout, overwrite:=True, - UICancelOption.DoNothing) + onUserCancel:=UICancelOption.DoNothing) - Assert.True(Directory.Exists(tmpDirectoryPath)) + Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Sub - Public Sub DownloadFile_Uri_UriIsNothing_Throws() - Dim tmpDirectoryPath As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(tmpDirectoryPath) + Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) @@ -914,30 +857,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub - - Public Sub DownloadFile_UriNetworkCredentials_Success() - Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) - Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) - - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFilename, - networkCredentials, - Nothing, - TestingConnectionTimeout, - overwrite:=False) - - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try - End Sub - Public Sub DownloadFile_UrlWithTimeOut_Throws() Dim testDirectory As String = CreateTempDirectory() @@ -950,12 +869,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) + destinationFilename, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) End Sub) @@ -986,7 +905,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) Assert.False(File.Exists(destinationFilename)) Finally - CleanUp(listener, tmpDirectoryPath) + CleanUp(listener, testDirectory) End Try End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb deleted file mode 100644 index c2a77dbf8ef..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctionsvb.vb +++ /dev/null @@ -1,282 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Collections.ObjectModel -Imports System.Text -Imports Microsoft.VisualBasic.FileIO -Imports Microsoft.VisualBasic.MyServices -Imports Xunit - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class FileIoProxyTests - Private ReadOnly _csvSampleData As String = - "Index,Customer Id,First Name,Last Name,Company,City,Country -1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile" - Private ReadOnly _fixedSampleData As String = - "IndexFirstLastCompanyCityCountry -4321;1234;321;654321;123;1234567" - Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem - - - Public Sub DriveProxyTest() - Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) - End Sub - - - Public Sub FindInFilesProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) - Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) - _fileSystem.WriteAllText(fileC, "C", append:=False) - Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) - Assert.Equal(filenames.Count, 1) - Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) - filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") - Assert.Equal(filenames.Count, 0) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub ReadAllTextProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Dim text As String = _fileSystem.ReadAllText(fileA) - Assert.Equal(text, "A") - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub ReadAllTextWithEncodingProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) - Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) - Assert.Equal(text, "A") - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub ReadAllBytesProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) - - Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub CopyFileProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - - Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) - _fileSystem.CopyFile(file1, file2) - Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub CopyFileWithOverwriteProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - - Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2), size:=1) - _fileSystem.CopyFile(file1, file2, overwrite:=True) - Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) - 'End Sub - - 'Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) - 'End Sub - - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) - 'End Sub - - 'Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) - 'End Sub - - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI) - 'End Sub - - 'Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) - 'End Sub - - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) - 'End Sub - - 'Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - ' FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) - 'End Sub - - - Public Sub DeleteFileProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) - Dim byteArray As Byte() = {4} - _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) - - _fileSystem.DeleteFile(file1) - Assert.False(IO.File.Exists(file1)) - - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) - ' FileIO.FileSystem.DeleteFile(file, showUI, recycle) - 'End Sub - - 'Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption, - ' onUserCancel As UICancelOption) - - ' FileIO.FileSystem.DeleteFile(file, showUI, recycle, onUserCancel) - 'End Sub - - 'Public Sub DeleteDirectory(directory As String, - ' showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) - - ' FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) - 'End Sub - - - - - Public Sub OpenTextFieldParserProxyTest(delimiter As String) - Dim testDirectory As String = CreateTempDirectory() - Dim fileCSV As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileCSV, _csvSampleData, append:=False) - Dim reader As TextFieldParser - If delimiter Is Nothing Then - reader = _fileSystem.OpenTextFieldParser(fileCSV) - reader.TextFieldType = FieldType.Delimited - reader.Delimiters = {","} - Else - reader = _fileSystem.OpenTextFieldParser(fileCSV, delimiter) - End If - Dim currentRow As String() - Dim totalRows As Integer = 0 - While Not reader.EndOfData - totalRows += 1 - currentRow = reader.ReadFields() - Dim currentField As String - Dim totalFields As Integer = 0 - For Each currentField In currentRow - totalFields += 1 - Next - Assert.Equal(7, totalFields) - End While - Assert.Equal(2, totalRows) - reader.Close() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub OpenTextFixedFieldParserProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileCSV As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileCSV, _fixedSampleData, append:=False) - Dim reader As TextFieldParser = _fileSystem.OpenTextFieldParser(fileCSV, 5, 5, 4, 7, 4, 7) - Dim currentRow As String() - Dim totalRows As Integer = 0 - Dim splitData As String() = _fixedSampleData.Split(vbCrLf)(1).Split(";") - While Not reader.EndOfData - currentRow = reader.ReadFields() - Dim currentField As String - Dim totalFields As Integer = 0 - For Each currentField In currentRow - If totalRows = 1 Then - Assert.Equal(splitData(totalFields), currentField.TrimEnd(";"c)) - End If - totalFields += 1 - Next - Assert.Equal(6, totalFields) - totalRows += 1 - End While - Assert.Equal(2, totalRows) - reader.Close() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub OpenTextStreamParserProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA) - Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") - End Using - - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub OpenTextFileWriterProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) - fileWriter.WriteLine("A") - End Using - Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) - Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") - End Using - - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - - - Public Sub OpenEncodedTextFileWriterProxyTest() - Dim testDirectory As String = CreateTempDirectory() - Dim fileA As String = CreateTempFile(testDirectory) - _fileSystem.WriteAllText(fileA, "A", append:=False) - Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) - fileWriter.WriteLine("A") - End Using - Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) - Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") - End Using - - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - End Sub - 'Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter - ' Return FileIO.FileSystem.OpenTextFileWriter(file, append) - 'End Function - - 'Public Function OpenTextFileWriter(file As String, append As Boolean, - ' encoding As Encoding) As IO.StreamWriter - - ' Return FileIO.FileSystem.OpenTextFileWriter(file, append, encoding) - 'End Function - - End Class -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index 6bcc2df6cf3..d996860508d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -43,17 +43,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Friend Function ProcessRequests() As HttpListener ' Create a listener and add the prefixes. Dim listener As New HttpListener() - listener.Prefixes.Add(urlPrefix.Replace(NameOf(HttpListener), testName)) + + listener.Prefixes.Add(_downloadFileUrlPrefix) + If _userName IsNot Nothing OrElse _password IsNot Nothing Then + listener.AuthenticationSchemes = AuthenticationSchemes.Basic + End If listener.Start() Task.Run( - Sub() - End If - listener.Start() - Task.Run( Sub() ' Start the listener to begin listening for requests. - Dim response As HttpListenerResponse = Nothing - Dim response As HttpListenerResponse = Nothing Try ' Note: GetContext blocks while waiting for a request. From 8abfa5e4def4693b93dccae1b77c294de2277260 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 13 Apr 2024 15:51:17 -0700 Subject: [PATCH 164/342] Fix comments in WebListener --- .../tests/UnitTests/System/Windows/Forms/WebListener.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index d996860508d..d9cfcadd944 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -53,9 +53,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Sub() ' Start the listener to begin listening for requests. Dim response As HttpListenerResponse = Nothing + Try ' Note: GetContext blocks while waiting for a request. Dim context As HttpListenerContext = listener.GetContext() + ' Create the response. response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then From e104e6dd09783b8f26baee3c4026a7cd08885d81 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 13 Apr 2024 16:05:14 -0700 Subject: [PATCH 165/342] Add more tests and Fix Option Infer Off issues --- .../Microsoft/VisualBasic/InputBoxHandler.vb | 2 +- .../Microsoft.VisualBasic.Forms.Tests.vbproj | 1 + .../AssemblyPublicKeyIsAsExpectedTest.vb | 2 +- .../System/Windows/Forms/ControlTests.vb | 8 +-- .../System/Windows/Forms/HostServicesTests.vb | 55 +++++++++++++++++++ 5 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index 2462dbe10dc..f607cbae47e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -7,7 +7,7 @@ Namespace Microsoft.VisualBasic Partial Friend Module _Interaction - Private NotInheritable Class InputBoxHandler + Friend NotInheritable Class InputBoxHandler Private ReadOnly _defaultResponse As String Private ReadOnly _parentWindow As IWin32Window Private ReadOnly _prompt As String diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index cff4929da3a..9ffca4e34bb 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -12,6 +12,7 @@ WindowsFormsWithCustomSubMain True Library + Off diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 75f65ed8825..09cabcab783 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -15,7 +15,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub AssemblyPublicKeyIsAsExpected() Dim publicKey() As Byte = GetType(NetworkTests).Assembly.GetName().GetPublicKey() - Dim sb = New StringBuilder() + Dim sb As New StringBuilder For Each [byte] As Byte In publicKey sb.AppendFormat("{0:x2}", [byte]) Next [byte] diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index b468acd10f6..aa570b816b8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -14,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As Action = AddressOf FaultingMethod - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() _control.Invoke(invoker)) ' Expecting something Like the following. @@ -42,7 +42,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As New MethodInvoker(AddressOf FaultingMethod) - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() _control.Invoke(invoker)) ' Expecting something Like the following. @@ -70,9 +70,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() - Dim result = _control.Invoke(Function() invoker(19)) + Dim result As Integer = _control.Invoke(Function() invoker(19)) End Sub) ' Expecting something Like the following. diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb new file mode 100644 index 00000000000..f98ac773aab --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb @@ -0,0 +1,55 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Windows.Forms +Imports Microsoft.VisualBasic.CompilerServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class HostServicesTests + Private Shared ReadOnly s_control As New Control() + Private Shared ReadOnly s_title As String = GetUniqueText() + + + Public Sub GetUniqueIntegerTests_Success() + Assert.True(GetUniqueInteger(positiveOnly:=True) >= 0) + Assert.NotEqual(GetUniqueInteger(positiveOnly:=False), GetUniqueInteger(positiveOnly:=False)) + End Sub + + + Public Sub InputHandlerTests_Success() + Dim prompt As String = GetUniqueText() + Dim title As String = GetUniqueText() + Dim defaultResponse As String = GetUniqueText() + Dim xPos As Integer = -1 + Dim yPos As Integer = -1 + Dim parentWindow As IWin32Window = Nothing + Dim vbHost As IVbHost = HostServices.VBHost + Dim inputHandler As New InputBoxHandler(prompt, title, defaultResponse, xPos, yPos, parentWindow) + Assert.Equal(Nothing, vbHost) + Assert.Equal(Nothing, inputHandler.Exception) + Assert.Equal(Nothing, inputHandler.Result) + End Sub + + + Public Sub VbHostTests_Success() + Dim vbHost As IVbHost = New TestVbHost + Assert.Equal(s_control, vbHost.GetParentWindow) + Assert.Equal(s_title, vbHost.GetWindowTitle) + End Sub + + Private NotInheritable Class TestVbHost + Implements IVbHost + + Public Function GetParentWindow() As IWin32Window Implements IVbHost.GetParentWindow + Return s_control + End Function + + Public Function GetWindowTitle() As String Implements IVbHost.GetWindowTitle + Return s_title + End Function + + End Class + End Class +End Namespace From 2c69f3b4e250069aa54177b89197552ec84313c2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 13 Apr 2024 16:24:36 -0700 Subject: [PATCH 166/342] Remove extra NL --- .../Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb | 1 - .../System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb | 1 - .../tests/UnitTests/System/Windows/Forms/TimeTests.vb | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index db3399432a4..a2aa8092c0c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -148,5 +148,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 09cabcab783..580d8843a0b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -25,5 +25,4 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index 62ac69219af..f86844de95c 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -39,5 +39,4 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub End Class - End Namespace From 2e7693a0ecc1395583fd7077803dc5c09eb89334 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 13 Apr 2024 19:20:08 -0700 Subject: [PATCH 167/342] Fix spelling of keys and currentAssembly --- .../VisualBasic/ApplicationServices/AssemblyInfo.vb | 2 +- .../src/Microsoft/VisualBasic/Devices/Keyboard.vb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 22d0c622474..2782ac2a774 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -21,7 +21,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Creates an AssemblyInfo from an assembly ''' - ''' The assembly for which we want to obtain the information. + ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then Throw GetArgumentNullException(NameOf(currentAssembly)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 66d5f93603b..eb1d8110b33 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -41,7 +41,7 @@ Namespace Microsoft.VisualBasic.Devices Public ReadOnly Property ShiftKeyDown() As Boolean Get Dim keys As Keys = Control.ModifierKeys - Return CType(keys And keys.Shift, Boolean) + Return CType(keys And Keys.Shift, Boolean) End Get End Property @@ -52,7 +52,7 @@ Namespace Microsoft.VisualBasic.Devices Public ReadOnly Property AltKeyDown() As Boolean Get Dim keys As Keys = Control.ModifierKeys - Return CType(keys And keys.Alt, Boolean) + Return CType(keys And Keys.Alt, Boolean) End Get End Property @@ -63,7 +63,7 @@ Namespace Microsoft.VisualBasic.Devices Public ReadOnly Property CtrlKeyDown() As Boolean Get Dim keys As Keys = Control.ModifierKeys - Return CType(keys And keys.Control, Boolean) + Return CType(keys And Keys.Control, Boolean) End Get End Property From 60b34db94c3a9298f62cbbefdd0123cfecdfcce4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 13 Apr 2024 20:22:16 -0700 Subject: [PATCH 168/342] Update .editorConfig for VB --- .editorconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index a5b52c7ebe2..d12cb10f1e8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -494,7 +494,7 @@ dotnet_diagnostic.CA1070.severity = error # CA2016: Forward the CancellationToken parameter to methods that take one dotnet_diagnostic.CA2016.severity = warning -# CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr +# CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr dotnet_diagnostic.CA2020.severity = warning # .NET diagnostic @@ -595,6 +595,12 @@ visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public dotnet_separate_import_directive_groups = false:warning +# IDE0001: Simplify Names +dotnet_diagnostic.IDE0001.severity = silent + +# IDE0002: Simplify Member Access +dotnet_diagnostic.IDE0002.severity = silent + # IDE0079: Remove unnecessary suppression dotnet_diagnostic.IDE0079.severity = none From 5597e8ce2f6c50317ddef0728e254ac5183f8811 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Apr 2024 14:08:09 -0700 Subject: [PATCH 169/342] Fix duplicate entried in project file --- .../UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index 9ffca4e34bb..ee3c2f5310d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -4,12 +4,10 @@ $(TargetFramework) $(TargetFramework)-windows7.0 true - Microsoft.VisualBasic.Forms.Tests - latest - WindowsFormsWithCustomSubMain - True true + 16.9 WindowsFormsWithCustomSubMain + Microsoft.VisualBasic.Forms.Tests True Library Off From 30791ca370012ada8f04efd78eb4e954e3bc3064 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Apr 2024 16:49:07 -0700 Subject: [PATCH 170/342] Update test --- .../CompilerServices/ExceptionUtils.vb | 8 +- .../VisualBasic/CompilerServices/Utils.vb | 10 ++- .../AssemblyPublicKeyIsAsExpectedTest.vb | 2 +- .../Windows/Forms/ClipboardProxyTests.vb | 77 +++++++++++-------- .../Windows/Forms/ExceptionUtilsTests.vb | 26 ++++--- .../System/Windows/Forms/TimeTests.vb | 10 +-- .../System/Windows/Forms/WebListener.vb | 4 +- 7 files changed, 74 insertions(+), 63 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index b9961279b9c..88dd2eb08ba 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -14,17 +14,11 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils - Private Function GetResourceStringResourceId(ResourceId As Integer) As String - Dim id As String = $"ID{ResourceId}" - ' always return a string - Return $"{SR.GetResourceString(id, id)}" - End Function - Friend Function VbMakeException(ResourceId As Integer) As Exception Dim description As String = "" If ResourceId > 0 AndAlso ResourceId <= &HFFFFI Then - description = GetResourceStringResourceId(ResourceId) + description = GetResourceString(ResourceId) End If Select Case ResourceId diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb index 94df154a692..04a439d19e1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -8,14 +8,18 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Purpose: various helpers for the vb runtime functions Friend NotInheritable Class Utils1 + Friend Shared Function GetCultureInfo() As CultureInfo + Return Thread.CurrentThread.CurrentCulture + End Function Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String Return String.Format(GetCultureInfo(), resourceKey, args) End Function - Friend Shared Function GetCultureInfo() As CultureInfo - Return Thread.CurrentThread.CurrentCulture + Friend Shared Function GetResourceString(ResourceId As Integer) As String + Dim id As String = $"ID{ResourceId}" + ' always return a string + Return $"{SR.GetResourceString(id, id)}" End Function - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 580d8843a0b..d073fea6f40 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -14,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' Public Sub AssemblyPublicKeyIsAsExpected() - Dim publicKey() As Byte = GetType(NetworkTests).Assembly.GetName().GetPublicKey() + Dim publicKey() As Byte = GetType(ControlTests).Assembly.GetName().GetPublicKey() Dim sb As New StringBuilder For Each [byte] As Byte In publicKey sb.AppendFormat("{0:x2}", [byte]) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index f3ffc394d4a..d335bd8889d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -12,59 +12,70 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ClipboardProxyTests + Private _clipBoardMutex As New Object() Public Sub ClipboardProxy_ContainsText() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim text As String = GetUniqueText() - clipboardProxy.SetText(text) - Assert.Equal(text, clipboardProxy.GetText()) - text = GetUniqueText() - clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + SyncLock _clipBoardMutex + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim text As String = GetUniqueText() + clipboardProxy.SetText(text) + Assert.Equal(text, clipboardProxy.GetText()) + text = GetUniqueText() + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + End SyncLock End Sub Public Sub ClipboardProxy_GetAudioStream_InvokeMultipleTimes_Success() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes As Byte() = {1, 2, 3} - clipboardProxy.SetAudio(audioBytes) - Dim result As Stream = clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + SyncLock _clipBoardMutex + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + End SyncLock End Sub Public Sub ClipboardProxy_SetAudio_InvokeByteArray_GetReturnsExpected() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes As Byte() = {1, 2, 3} - clipboardProxy.SetAudio(audioBytes) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + SyncLock _clipBoardMutex + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + End SyncLock End Sub Public Sub ClipboardProxy_SetAudio_InvokeStream_GetReturnsExpected() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes() As Byte = {1, 2, 3} - Using audioStream As New MemoryStream(audioBytes) - clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - End Using + SyncLock _clipBoardMutex + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes() As Byte = {1, 2, 3} + Using audioStream As New MemoryStream(audioBytes) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using + End SyncLock End Sub Public Sub ClipboardProxy_SetFileDropList_Invoke_GetReturnsExpected() - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim filePaths As New StringCollection From + SyncLock _clipBoardMutex + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim filePaths As New StringCollection From {"filePath", "filePath2"} - clipboardProxy.SetFileDropList(filePaths) - Assert.True(clipboardProxy.ContainsFileDropList()) - Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + clipboardProxy.SetFileDropList(filePaths) + Assert.True(clipboardProxy.ContainsFileDropList()) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + End SyncLock End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 15ac7d43a71..05211ae16f9 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -16,22 +16,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim ex As Exception = ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") Assert.IsType(Of ArgumentNullException)(ex) Assert.Equal($"Property MainForm cannot be set to Nothing. (Parameter 'MainForm')", ex.Message) + Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) End Sub Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" - Dim ex As Exception = ExceptionUtils.GetDirectoryNotFoundException(resourceId) + Dim resourceString As String = Utils1.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExceptionUtils.GetDirectoryNotFoundException(resourceString) Assert.IsType(Of IO.DirectoryNotFoundException)(ex) - Assert.Equal(resourceId, ex.Message) + Assert.Equal("File not found.", ex.Message) End Sub Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceId As String = $"ID{CStr(vbErrors.FileNotFound)}" - Dim ex As Exception = ExceptionUtils.GetFileNotFoundException("Test", resourceId) + Dim resourceString As String = Utils1.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExceptionUtils.GetFileNotFoundException("Test", resourceString) Assert.IsType(Of IO.FileNotFoundException)(ex) - Assert.Equal(resourceId, ex.Message) + Assert.Equal("File not found.", ex.Message) + Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) End Sub @@ -49,19 +51,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub VbMakeExceptionInvalidValuesTest_Succeed(BadResourceId As Integer) Dim id As String = $"ID{CStr(BadResourceId)}" Assert.Equal($"{SR.GetResourceString(id, id)}", ExceptionUtils.VbMakeException(BadResourceId).Message) End Sub - - - - Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer) + + + + Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer, expected As String) Dim id As String = $"ID{CStr(errorCode)}" - Assert.Equal($"{SR.GetResourceString(id, id)}", ExceptionUtils.VbMakeException(errorCode).Message) + Dim message As String = ExceptionUtils.VbMakeException(errorCode).Message + Assert.Equal(expected, message) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index f86844de95c..db0283b9434 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -18,11 +18,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.True(Date.Now > New Date) End Sub - - Public Sub VbTimeNotNew() - Assert.True(My.Computer.Clock.LocalTime > New Date) - End Sub - Public Sub VbGmtTimeCloseToDateUtcNow() Assert.True(timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit)) @@ -38,5 +33,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.True(Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit) End Sub + + Public Sub VbTimeNotNew() + Assert.True(My.Computer.Clock.LocalTime > New Date) + End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index d9cfcadd944..fe4c5c87f8b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -14,8 +14,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private _password As String Private _userName As String - Public ReadOnly Property Address As String - ''' ''' The name of the function that creates the server is uses to establish the file to be downloaded ''' @@ -40,6 +38,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests _password = password End Sub + Public ReadOnly Property Address As String + Friend Function ProcessRequests() As HttpListener ' Create a listener and add the prefixes. Dim listener As New HttpListener() From f78284b7df077816df94943bd2d9fb013fdc32dc Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Apr 2024 22:02:24 -0700 Subject: [PATCH 171/342] Test NormalizePath --- .../UnitTests/System/Windows/Forms/FileIoProxyTests.vb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index f3c30bef19d..9092cec9be7 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -3,6 +3,7 @@ Imports System.Collections.ObjectModel Imports System.Text +Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices Imports Xunit @@ -184,6 +185,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) End Sub + + Public Sub FileNormalizePathTest() + Assert.Throws(Of ArgumentException)( + Sub() + Dim fullFilename As String = FileSystemUtils.NormalizePath("") + End Sub) + End Sub + Public Sub FindInFilesProxyTest() Dim testDirectory As String = CreateTempDirectory() From d9757536d6ab712e2016baf3183c4323f2269861 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Apr 2024 22:12:43 -0700 Subject: [PATCH 172/342] Add test for PingUriTimeout --- .../Microsoft/VisualBasic/Devices/NetworkTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 6ca2fb416c6..504a78bae96 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -54,6 +54,13 @@ public void PingUri_Throw() Assert.Throws(() => network.Ping((Uri)null)); } + [Fact] + public void PingUriTimeout_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((Uri)null, 1)); + } + // Not tested: // Public Sub UploadFile(...) [multiple overloads] } From ad2665676f32d5b89d67ca61ced949eebae50abd Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Apr 2024 01:44:18 -0700 Subject: [PATCH 173/342] Add Tests --- .../System/Windows/Forms/FileIoProxyTests.vb | 2 +- .../Windows/Forms/UserTests.ProxyUser.vb | 31 ++++++++++++++ .../Windows/Forms/UserTests.UserIdentity.vb | 42 +++++++++++++++++++ .../Windows/Forms/UserTests.UserPrincipal.vb | 34 +++++++++++++++ .../System/Windows/Forms/UserTests.vb | 31 ++++++++++++++ 5 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 9092cec9be7..e9f9e5e38bf 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -189,7 +189,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub FileNormalizePathTest() Assert.Throws(Of ArgumentException)( Sub() - Dim fullFilename As String = FileSystemUtils.NormalizePath("") + FileSystemUtils.NormalizePath("") End Sub) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb new file mode 100644 index 00000000000..6317dff2562 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb @@ -0,0 +1,31 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Public Class ProxyUser + Inherits User + Private _newIPrincipal As IPrincipal + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) + _newIPrincipal = New UserPrincipal(authenticationType, name, isAuthenticated, role) + End Sub + + Protected Overrides Property InternalPrincipal() As IPrincipal + Get + Return _newIPrincipal + End Get + Set(value As IPrincipal) + _newIPrincipal = value + End Set + End Property + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb new file mode 100644 index 00000000000..a086c0709d1 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb @@ -0,0 +1,42 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Public Class UserIdentity + Implements IIdentity + + Private ReadOnly _authenticationType As String + Private ReadOnly _name As String + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean) + _authenticationType = authenticationType + _name = name + End Sub + + Public ReadOnly Property AuthenticationType As String Implements IIdentity.AuthenticationType + Get + Return _authenticationType + End Get + End Property + + Public ReadOnly Property IsAuthenticated As Boolean Implements IIdentity.IsAuthenticated + Get + Return True + End Get + End Property + + Public ReadOnly Property Name As String Implements IIdentity.Name + Get + Return _name + End Get + End Property + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb new file mode 100644 index 00000000000..97277355929 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb @@ -0,0 +1,34 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Private Class UserPrincipal + Implements IPrincipal + + Private _role As String + Private _userIdentity As IIdentity + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) + _userIdentity = New UserIdentity(authenticationType, name, isAuthenticated) + _role = role + End Sub + + Public ReadOnly Property Identity As IIdentity Implements IPrincipal.Identity + Get + Return _userIdentity + End Get + End Property + + Public Function IsInRole(role As String) As Boolean Implements IPrincipal.IsInRole + Return role = _role + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb new file mode 100644 index 00000000000..56d6a4ebe5a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -0,0 +1,31 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Threading +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + + Public Sub UserGetNameTest() + Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Assert.Equal("Test", testUser.Name) + End Sub + + + Public Sub UserIsAuthenticatedTest() + Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Assert.Equal(True, testUser.IsAuthenticated) + End Sub + + + Public Sub UserIsInRoleTest() + Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Assert.True(testUser.IsInRole("Guest")) + Assert.False(testUser.IsInRole("Basic")) + End Sub + + End Class +End Namespace From 44ed0ef5003fbbdd9ec848159e9827dfc800c920 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Apr 2024 02:19:45 -0700 Subject: [PATCH 174/342] Improve User Testing --- .../Windows/Forms/UserTests.ProxyUser.vb | 31 -------------- .../System/Windows/Forms/UserTests.vb | 41 +++++++++++++++++-- 2 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb deleted file mode 100644 index 6317dff2562..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.ProxyUser.vb +++ /dev/null @@ -1,31 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Security.Principal -Imports Microsoft.VisualBasic.ApplicationServices - -Namespace Microsoft.VisualBasic.Forms.Tests - - Partial Public Class UserTests - - Public Class ProxyUser - Inherits User - Private _newIPrincipal As IPrincipal - - Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) - _newIPrincipal = New UserPrincipal(authenticationType, name, isAuthenticated, role) - End Sub - - Protected Overrides Property InternalPrincipal() As IPrincipal - Get - Return _newIPrincipal - End Get - Set(value As IPrincipal) - _newIPrincipal = value - End Set - End Property - - End Class - - End Class -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb index 56d6a4ebe5a..440248d96c8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -1,28 +1,61 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Threading +Imports Microsoft.VisualBasic.ApplicationServices + Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class UserTests + + Public Sub UserBaseTest() + Dim testUser As New User + Assert.Null(testUser.CurrentPrincipal) + Dim userPrincipal As UserPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + testUser.CurrentPrincipal = userPrincipal + Assert.NotNull(testUser.CurrentPrincipal) + Assert.Equal(userPrincipal, testUser.CurrentPrincipal) + End Sub + Public Sub UserGetNameTest() - Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } Assert.Equal("Test", testUser.Name) End Sub Public Sub UserIsAuthenticatedTest() - Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } Assert.Equal(True, testUser.IsAuthenticated) End Sub Public Sub UserIsInRoleTest() - Dim testUser As New ProxyUser("Basic", "Test", True, "Guest") + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } Assert.True(testUser.IsInRole("Guest")) Assert.False(testUser.IsInRole("Basic")) End Sub From 59bd0bb1a23d8b0dd210783034d9d6e1a6fbe0e3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Apr 2024 02:54:54 -0700 Subject: [PATCH 175/342] Improve ClipboardProxy Tests --- .../tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index d335bd8889d..d0082c25f27 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -20,6 +20,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim clipboardProxy As New MyServices.ClipboardProxy Dim text As String = GetUniqueText() clipboardProxy.SetText(text) + Assert.True(clipboardProxy.ContainsText) + Assert.True(clipboardProxy.ContainsData(DataFormats.Text)) Assert.Equal(text, clipboardProxy.GetText()) text = GetUniqueText() clipboardProxy.SetText(text, TextDataFormat.Text) From ccbd160be053e53c3677de1f1204e5e1f1d66654 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Apr 2024 15:01:18 -0700 Subject: [PATCH 176/342] Improve Clipboard and User Tests --- .../UnitTests/System/Windows/Forms/ClipboardProxyTests.vb | 5 +++-- .../System/Windows/Forms/UserTests.UserPrincipal.vb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index d0082c25f27..13ccccba3d2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -20,8 +20,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim clipboardProxy As New MyServices.ClipboardProxy Dim text As String = GetUniqueText() clipboardProxy.SetText(text) - Assert.True(clipboardProxy.ContainsText) - Assert.True(clipboardProxy.ContainsData(DataFormats.Text)) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText(TextDataFormat.Text)) + Assert.Equal(Clipboard.ContainsData(DataFormats.Text), clipboardProxy.ContainsData(DataFormats.Text)) Assert.Equal(text, clipboardProxy.GetText()) text = GetUniqueText() clipboardProxy.SetText(text, TextDataFormat.Text) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb index 97277355929..c38fa0e7363 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb @@ -7,7 +7,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class UserTests - Private Class UserPrincipal + Private NotInheritable Class UserPrincipal Implements IPrincipal Private _role As String From b24966676a3f663882d3041395a5fb4da7d723fa Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 17 Apr 2024 02:55:09 -0700 Subject: [PATCH 177/342] Replace ambagous Utils and fix related issues --- .../ApplicationServices/ApplicationBase.vb | 5 ++-- .../ApplicationServices/AssemblyInfo.vb | 4 +-- .../CompilerServices/ExceptionUtils.vb | 17 ++++++++++++- .../VisualBasic/CompilerServices/Utils.vb | 25 ------------------- .../Microsoft/VisualBasic/Devices/Audio.vb | 4 +-- .../Devices/Network/NetworkPing.vb | 8 +++--- .../src/Microsoft/VisualBasic/Interaction.vb | 2 -- .../Logging/FileLogTraceListener.vb | 6 ++--- .../Windows/Forms/ExceptionUtilsTests.vb | 4 +-- 9 files changed, 30 insertions(+), 45 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 1739fe1fa8f..018e7917514 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -2,8 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Threading - -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.ApplicationServices @@ -30,7 +29,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since the explicitly requested a specific environment variable and we couldn't find it, throw If variableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) End If Return variableValue diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 2782ac2a774..b673ba145ee 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -3,7 +3,7 @@ Imports System.Collections.ObjectModel Imports System.Reflection -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.ApplicationServices @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then - Throw GetArgumentNullException(NameOf(currentAssembly)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(currentAssembly)) End If _assembly = currentAssembly End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 88dd2eb08ba..2532c39ed87 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,7 +1,8 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports Microsoft.VisualBasic.CompilerServices.Utils1 +Imports System.Globalization +Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -14,6 +15,20 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils + Friend Function GetCultureInfo() As CultureInfo + Return Thread.CurrentThread.CurrentCulture + End Function + + Friend Function GetResourceString(resourceKey As String, ParamArray args() As String) As String + Return String.Format(GetCultureInfo(), resourceKey, args) + End Function + + Friend Function GetResourceString(ResourceId As Integer) As String + Dim id As String = $"ID{ResourceId}" + ' always return a string + Return $"{SR.GetResourceString(id, id)}" + End Function + Friend Function VbMakeException(ResourceId As Integer) As Exception Dim description As String = "" diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb deleted file mode 100644 index 04a439d19e1..00000000000 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ /dev/null @@ -1,25 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Globalization -Imports System.Threading - -Namespace Microsoft.VisualBasic.CompilerServices - - ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils1 - Friend Shared Function GetCultureInfo() As CultureInfo - Return Thread.CurrentThread.CurrentCulture - End Function - - Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String - Return String.Format(GetCultureInfo(), resourceKey, args) - End Function - - Friend Shared Function GetResourceString(ResourceId As Integer) As String - Dim id As String = $"ID{ResourceId}" - ' always return a string - Return $"{SR.GetResourceString(id, id)}" - End Function - End Class -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 0ed0794f3a7..21656fc3b4e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic @@ -59,7 +59,7 @@ Namespace Microsoft.VisualBasic ''' The mode in which the array should be played Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then - Throw GetArgumentNullException(NameOf(data)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(data)) End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index a274c244bfd..e80121143e1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -1,7 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices Imports NetInfoAlias = System.Net.NetworkInformation Namespace Microsoft.VisualBasic.Devices @@ -53,7 +53,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, DEFAULT_PING_TIMEOUT) End Function @@ -68,7 +68,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure a network is available If Not IsAvailable Then - Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) + Throw ExceptionUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) End If Dim pingMaker As New NetInfoAlias.Ping @@ -89,7 +89,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, timeout) End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index e8550390d18..c1c6bde8733 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -7,8 +7,6 @@ Imports System.Text Imports System.Threading Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 751286bcc2a..f5d3b5fe063 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -7,8 +7,6 @@ Imports System.IO Imports System.Text Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.Logging @@ -828,14 +826,14 @@ Namespace Microsoft.VisualBasic.Logging If ListenerStream.FileSize + newEntrySize > MaxFileSize Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) + Throw New InvalidOperationException(Utils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) End If Return False End If If GetFreeDiskSpace() - newEntrySize < ReserveDiskSpace Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) + Throw New InvalidOperationException(Utils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) End If Return False End If diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 05211ae16f9..8626424b12e 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -21,7 +21,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = Utils1.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExceptionUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExceptionUtils.GetDirectoryNotFoundException(resourceString) Assert.IsType(Of IO.DirectoryNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) @@ -29,7 +29,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = Utils1.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExceptionUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExceptionUtils.GetFileNotFoundException("Test", resourceString) Assert.IsType(Of IO.FileNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) From 4152c8f6b6e5c7a91b6ea9b7b17622159e742bbf Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 17 Apr 2024 15:56:15 -0700 Subject: [PATCH 178/342] Add coverage for NormalizePath --- .../UnitTests/System/Windows/Forms/FileIoProxyTests.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index e9f9e5e38bf..3bae226e678 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -186,13 +186,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub FileNormalizePathTest() + Public Sub FileNormalizePathTest_Fail() Assert.Throws(Of ArgumentException)( Sub() FileSystemUtils.NormalizePath("") End Sub) End Sub + + Public Sub FileNormalizePathTest_Success() + FileSystemUtils.NormalizePath(IO.Path.GetTempPath) + End Sub + Public Sub FindInFilesProxyTest() Dim testDirectory As String = CreateTempDirectory() From b2455da073e8f32ac32333414c6a0ca2fb5da69f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 17 Apr 2024 16:57:03 -0700 Subject: [PATCH 179/342] Add ComputerInfoDebugView Tests --- .../Forms/ComputerInfoDebugViewTests.vb | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb new file mode 100644 index 00000000000..2aecae290c8 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb @@ -0,0 +1,32 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.VisualBasic.Devices +Imports Microsoft.VisualBasic.Devices.ComputerInfo +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class ComputerInfoDebugViewTests + + + Public Sub Memory() + Dim info As New ComputerInfoDebugView(New ComputerInfo) + If PlatformDetection.IsWindows Then + Assert.NotEqual(0UI, info.AvailablePhysicalMemory) + Assert.NotEqual(0UI, info.AvailableVirtualMemory) + Assert.NotEqual(0UI, info.TotalPhysicalMemory) + Assert.NotEqual(0UI, info.TotalVirtualMemory) + End If + End Sub + + + Public Sub Properties() + Dim info As New ComputerInfoDebugView(New ComputerInfo) + Assert.Equal(Globalization.CultureInfo.InstalledUICulture, info.InstalledUICulture) + Assert.Equal(Environment.OSVersion.Platform.ToString(), info.OSPlatform) + Assert.Equal(Environment.OSVersion.Version.ToString(), info.OSVersion) + End Sub + + End Class +End Namespace From 0d5ee1ffe4edb73ace5c7d9d18e860d1738d4e38 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 18 Apr 2024 00:45:51 -0700 Subject: [PATCH 180/342] Simplify ExceptionUtils XML Comments --- .../WindowsFormsApplicationBase.vb | 2 +- .../CompilerServices/ExceptionUtils.vb | 23 ++++++++----------- .../Microsoft/VisualBasic/Devices/Audio.vb | 6 ++--- .../Devices/Network/NetworkDownload.vb | 10 ++++---- .../VisualBasic/Helpers/FileSystemUtils.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 14 +++++------ .../Logging/FileLogTraceListener.vb | 12 +++++----- .../src/Microsoft/VisualBasic/Logging/Log.vb | 8 +++---- .../Windows/Forms/ClipboardProxyTests.vb | 2 +- .../Windows/Forms/ExceptionUtilsTests.vb | 2 +- 10 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index f33e82c5cd1..aa71a93d3b7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -378,7 +378,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get Set(value As Form) If value Is Nothing Then - Throw GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Throw ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 2532c39ed87..2a0dd650583 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,7 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Globalization Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -15,12 +14,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils - Friend Function GetCultureInfo() As CultureInfo - Return Thread.CurrentThread.CurrentCulture - End Function - Friend Function GetResourceString(resourceKey As String, ParamArray args() As String) As String - Return String.Format(GetCultureInfo(), resourceKey, args) + Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) End Function Friend Function GetResourceString(ResourceId As Integer) As String @@ -62,7 +57,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException - Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function ''' @@ -72,7 +67,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of ArgumentNullException. Friend Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(ArgumentName, ExceptionUtils.GetResourceString(SR.General_ArgumentNullException)) End Function ''' @@ -86,7 +81,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) + Return New ArgumentNullException(ArgumentName, ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -98,7 +93,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetDirectoryNotFoundException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -112,7 +107,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException - Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) + Return New IO.FileNotFoundException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders), FileName) End Function ''' @@ -124,7 +119,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetInvalidOperationException(ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException - Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -136,7 +131,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException - Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -150,7 +145,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetWin32Exception(ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 21656fc3b4e..1ab4204146f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -76,7 +76,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then - Throw GetArgumentNullException(NameOf(stream)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(stream)) End If Play(New Media.SoundPlayer(stream), playMode) @@ -89,7 +89,7 @@ Namespace Microsoft.VisualBasic ''' Plays the sound asynchronously Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then - Throw GetArgumentNullException(NameOf(systemSound)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(systemSound)) End If systemSound.Play() @@ -139,7 +139,7 @@ Namespace Microsoft.VisualBasic ''' A full name and path of the file Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then - Throw GetArgumentNullException(NameOf(location)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(location)) End If Return location diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index dea0987a8e7..4c25d8c4d86 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -148,7 +148,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -209,7 +209,7 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean) If address Is Nothing Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -267,7 +267,7 @@ Namespace Microsoft.VisualBasic.Devices End If If address Is Nothing Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -318,7 +318,7 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) If address Is Nothing Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -374,7 +374,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If address Is Nothing Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) End If ' Get network credentials diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 83b7496da9e..4316c2510a4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -116,7 +116,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) ' Check for argument null If String.IsNullOrEmpty(path) Then - Throw GetArgumentNullException(paramName) + Throw ExceptionUtils.GetArgumentNullException(paramName) End If If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index c1c6bde8733..a8dc2d4a95d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -23,11 +23,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExceptionUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If NativeMethods.GetStartupInfo(startupInfo) @@ -124,7 +124,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else AppActivateHelper(windowHandle, CStr(ProcessId)) End If @@ -183,7 +183,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, Title)) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, Title)) Else AppActivateHelper(windowHandle, Title) End If @@ -210,7 +210,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, ProcessId)) End If ' set active window to the owned one @@ -339,7 +339,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try @@ -359,7 +359,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index f5d3b5fe063..de766a83726 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -198,7 +198,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As String) If String.IsNullOrEmpty(value) Then - Throw GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) + Throw ExceptionUtils.GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) End If ' Test the file name. This will throw if the name is invalid. @@ -273,7 +273,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < MIN_FILE_SIZE Then - Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") + Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") End If _maxFileSize = value _propertiesSet(MAXFILESIZE_INDEX) = True @@ -296,7 +296,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < 0 Then - Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") End If _reserveDiskSpace = value _propertiesSet(RESERVEDISKSPACE_INDEX) = True @@ -341,7 +341,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As Encoding) If value Is Nothing Then - Throw GetArgumentNullException(NameOf(value)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(value)) End If _encoding = value _propertiesSet(ENCODING_INDEX) = True @@ -744,7 +744,7 @@ Namespace Microsoft.VisualBasic.Logging End While 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) + Throw ExceptionUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' @@ -860,7 +860,7 @@ Namespace Microsoft.VisualBasic.Logging End If End If - Throw GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + Throw ExceptionUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) End Function ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 1c451266820..8bdc1d63578 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -4,7 +4,7 @@ Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.Logging @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic.Logging Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String, id As Integer) If ex Is Nothing Then - Throw GetArgumentNullException(NameOf(ex)) + Throw ExceptionUtils.GetArgumentNullException(NameOf(ex)) End If Dim builder As New StringBuilder() @@ -230,8 +230,8 @@ Namespace Microsoft.VisualBasic.Logging ' Names of TraceSources Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appConfig - + 'Taken from appConfig + Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 13ccccba3d2..17dd3b179b0 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -9,7 +9,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ClipboardProxyTests Private _clipBoardMutex As New Object() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 8626424b12e..e5d8870adbd 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -7,7 +7,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' Partial Public Class ExceptionUtilsTests From 9a27f817a15d171cb0b1633d032dede4b1a9b668 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 16:05:54 -0700 Subject: [PATCH 181/342] Code Cleanup and merge Master --- .../ApplicationServices/ApplicationBase.vb | 5 +- .../ApplicationServices/AssemblyInfo.vb | 4 +- .../CantStartSingleInstanceException.vb | 10 +-- .../NoStartupFormException.vb | 4 +- .../WindowsFormsApplicationBase.vb | 9 +- .../CompilerServices/ExceptionUtils.vb | 16 ++-- .../Microsoft/VisualBasic/Devices/Audio.vb | 10 +-- .../Microsoft/VisualBasic/Devices/Mouse.vb | 8 +- .../Devices/Network/NetworkUtilities.vb | 2 +- .../VisualBasic/Helpers/FileSystemUtils.vb | 36 ++++---- .../VisualBasic/Helpers/NativeMethods.vb | 18 ++-- .../VisualBasic/Helpers/SafeNativeMethods.vb | 11 +-- .../Helpers/UnsafeNativeMethods.vb | 16 ++-- .../src/Microsoft/VisualBasic/Interaction.vb | 31 +++---- .../Logging/FileLogTraceListener.vb | 17 ++-- .../src/Microsoft/VisualBasic/Logging/Log.vb | 4 +- .../Windows/Forms/ClipboardProxyTests.vb | 89 +++++++++---------- .../System/Windows/Forms/ExceptionTests.vb | 44 +++++++++ .../Windows/Forms/ExceptionUtilsTests.vb | 9 +- .../System/Windows/Forms/PipeListener.vb | 30 +++++++ .../Forms/SingleInstanceHelpersTests.vb | 80 +++++++++++++++++ .../System/Windows/Forms/UserTests.vb | 2 +- 22 files changed, 295 insertions(+), 160 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 018e7917514..5a39acf5ece 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Threading -Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -29,7 +29,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Since the explicitly requested a specific environment variable and we couldn't find it, throw If variableValue Is Nothing Then - Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) End If Return variableValue @@ -115,5 +115,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _log As Logging.Log ' The executing application (the EntryAssembly) Private _info As AssemblyInfo + End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index b673ba145ee..f609f0d4710 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -3,7 +3,7 @@ Imports System.Collections.ObjectModel Imports System.Reflection -Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(currentAssembly)) + Throw ExUtils.GetArgumentNullException(NameOf(currentAssembly)) End If _assembly = currentAssembly End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index 74de0ae78c2..a56fc81f9c8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.ComponentModel -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -18,21 +18,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(GetResourceString(SR.AppModel_SingleInstanceCantConnect)) + MyBase.New(ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) End Sub - Public Sub New(ByVal message As String) + Public Sub New(message As String) MyBase.New(message) End Sub - Public Sub New(ByVal message As String, ByVal inner As Exception) + Public Sub New(message As String, inner As Exception) MyBase.New(message, inner) End Sub ' Deserialization constructor must be defined since we are serializable - Protected Sub New(ByVal info As Runtime.Serialization.SerializationInfo, ByVal context As Runtime.Serialization.StreamingContext) + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index e07e101b40b..31e284c1c92 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.ComponentModel -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -17,7 +17,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(GetResourceString(SR.AppModel_NoStartupForm)) + MyBase.New(ExUtils.GetResourceString(SR.AppModel_NoStartupForm)) End Sub Public Sub New(message As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index aa71a93d3b7..d15e0ac032e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -10,8 +10,7 @@ Imports System.Runtime.InteropServices Imports System.Security Imports System.Threading Imports System.Windows.Forms -Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -378,10 +377,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get Set(value As Form) If value Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then - Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _appContext.MainForm = value End Set @@ -398,7 +397,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Allow for the case where they set splash screen = nothing and mainForm is currently nothing. If value IsNot Nothing AndAlso value Is _appContext.MainForm Then - Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _splashScreen = value diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 2a0dd650583..51583c544b2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -57,7 +57,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException - Return New ArgumentException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function ''' @@ -67,7 +67,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of ArgumentNullException. Friend Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, ExceptionUtils.GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' @@ -81,7 +81,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) + Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -93,7 +93,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetDirectoryNotFoundException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -107,7 +107,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException - Return New IO.FileNotFoundException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders), FileName) + Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) End Function ''' @@ -119,7 +119,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetInvalidOperationException(ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException - Return New InvalidOperationException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -131,7 +131,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException - Return New IO.IOException(ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -145,7 +145,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetWin32Exception(ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), ExceptionUtils.GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 1ab4204146f..302385b8c7a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO -Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -59,7 +59,7 @@ Namespace Microsoft.VisualBasic ''' The mode in which the array should be played Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(data)) + Throw ExUtils.GetArgumentNullException(NameOf(data)) End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) @@ -76,7 +76,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(stream)) + Throw ExUtils.GetArgumentNullException(NameOf(stream)) End If Play(New Media.SoundPlayer(stream), playMode) @@ -89,7 +89,7 @@ Namespace Microsoft.VisualBasic ''' Plays the sound asynchronously Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(systemSound)) + Throw ExUtils.GetArgumentNullException(NameOf(systemSound)) End If systemSound.Play() @@ -139,7 +139,7 @@ Namespace Microsoft.VisualBasic ''' A full name and path of the file Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(location)) + Throw ExUtils.GetArgumentNullException(NameOf(location)) End If Return location diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index ff3240b2629..701ab90c1d1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Devices If SystemInformation.MousePresent Then Return SystemInformation.MouseButtonsSwapped Else - Throw GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) End If End Get End Property @@ -43,7 +43,7 @@ Namespace Microsoft.VisualBasic.Devices If SystemInformation.MousePresent Then Return SystemInformation.MouseWheelPresent Else - Throw GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) End If End Get End Property @@ -58,7 +58,7 @@ Namespace Microsoft.VisualBasic.Devices If WheelExists Then Return SystemInformation.MouseWheelScrollLines Else - Throw GetInvalidOperationException(SR.Mouse_NoWheelIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoWheelIsPresent) End If End Get End Property diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index ede572a8bba..a413e63874c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -59,7 +59,7 @@ Namespace Microsoft.VisualBasic.Devices Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(Path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, ParamName:=NameOf(destinationFileName)) Return New ProgressDialog With { .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 4316c2510a4..5f0865df473 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -68,44 +68,44 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' ''' Checks if the full path is a root path. ''' - ''' The path to check. + ''' The path to check. ''' True if FullPath is a root path, False otherwise. ''' ''' IO.Path.GetPathRoot: C: -> C:, C:\ -> C:\, \\machine\share -> \\machine\share, ''' BUT \\machine\share\ -> \\machine\share (No separator here). ''' Therefore, remove any separators at the end to have correct result. ''' - Private Shared Function IsRoot(Path As String) As Boolean + Private Shared Function IsRoot(path As String) As Boolean ' This function accepts a relative path since GetParentPath will call this, ' and GetParentPath accept relative paths. - If Not IO.Path.IsPathRooted(Path) Then + If Not IO.Path.IsPathRooted(path) Then Return False End If - Path = Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) - Return String.Equals(Path, IO.Path.GetPathRoot(Path), + path = path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) + Return String.Equals(path, IO.Path.GetPathRoot(path), StringComparison.OrdinalIgnoreCase) End Function ''' ''' Removes all directory separators at the end of a path. ''' - ''' a full or relative path. + ''' a full or relative path. ''' If Path is a root path, the same value. Otherwise, removes any directory separators at the end. ''' We decided not to return path with separators at the end. - Private Shared Function RemoveEndingSeparator(Path As String) As String - If IO.Path.IsPathRooted(Path) Then + Private Shared Function RemoveEndingSeparator(path As String) As String + If IO.Path.IsPathRooted(path) Then ' If the path is rooted, attempt to check if it is a root path. ' Note: IO.Path.GetPathRoot: C: -> C:, C:\ -> C:\, \\myshare\mydir -> \\myshare\mydir ' BUT \\myshare\mydir\ -> \\myshare\mydir!!! This function will remove the ending separator of ' \\myshare\mydir\ as well. Do not use IsRoot here. - If Path.Equals(IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) Then - Return Path + If path.Equals(IO.Path.GetPathRoot(path), StringComparison.OrdinalIgnoreCase) Then + Return path End If End If ' Otherwise, remove all separators at the end. - Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) + Return path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) End Function ''' @@ -127,23 +127,23 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' ''' Normalize the path, but throw exception if the path ends with separator. ''' - ''' The input path. + ''' The input path. ''' The parameter name to include in the exception if one is raised. ''' The normalized path. - Friend Shared Function NormalizeFilePath(Path As String, ParamName As String) As String - CheckFilePathTrailingSeparator(Path, ParamName) - Return NormalizePath(Path) + Friend Shared Function NormalizeFilePath(path As String, ParamName As String) As String + CheckFilePathTrailingSeparator(path, ParamName) + Return NormalizePath(path) End Function ''' ''' Get full path, get long format, and remove any pending separator. ''' - ''' The path to be normalized. + ''' The path to be normalized. ''' The normalized path. ''' See IO.Path.GetFullPath for possible exceptions. ''' Keep this function since we might change the implementation / behavior later. - Friend Shared Function NormalizePath(Path As String) As String - Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) + Friend Shared Function NormalizePath(path As String) As String + Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) End Function End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 691bfc3c2c2..52122970aea 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -7,7 +7,7 @@ Imports System.Text Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class NativeMethods + Friend Module NativeMethods Friend Declare Auto Function _ @@ -26,7 +26,7 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes - Friend Shared Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer + Friend Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes End Function @@ -66,7 +66,7 @@ Namespace Microsoft.VisualBasic.CompilerServices PreserveSig:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)> - Friend Shared Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) + Friend Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) End Sub - Friend Shared Function CreateProcess( + Friend Function CreateProcess( lpApplicationName As String, lpCommandLine As String, lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, @@ -130,14 +130,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Pointer to a MEMORYSTATUSEX structure. ''' True if the function succeeds. Otherwise, False. - Friend Shared Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean + Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean End Function - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - - End Class + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index 7a60d8626ab..f90c91f527d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -7,8 +7,7 @@ Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class _ - SafeNativeMethods + Friend Module SafeNativeMethods Friend Declare Function _ IsWindowEnabled _ @@ -22,11 +21,5 @@ Namespace Microsoft.VisualBasic.CompilerServices GetWindowThreadProcessId _ Lib "user32" (hwnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - - End Class + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index 628b6f045d7..1557d83352f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -6,7 +6,7 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class UnsafeNativeMethods + Friend Module UnsafeNativeMethods ''' ''' Gets the state of the specified key on the keyboard when the function @@ -18,7 +18,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' if the key is toggled on (i.e. for keys like CapsLock) ''' - Friend Shared Function GetKeyState(KeyCode As Integer) As Short + Friend Function GetKeyState(KeyCode As Integer) As Short End Function ''' @@ -26,7 +26,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' by LocalAlloc or LocalReAlloc. ''' - Friend Shared Function LocalFree(LocalHandle As IntPtr) As IntPtr + Friend Function LocalFree(LocalHandle As IntPtr) As IntPtr End Function ''' @@ -38,14 +38,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The amount of free space on the disk. ''' True if function succeeds in getting info otherwise False - Friend Shared Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean + Friend Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean End Function - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - - End Class + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index a8dc2d4a95d..c7421816e65 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -7,6 +7,7 @@ Imports System.Text Imports System.Threading Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -23,11 +24,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(ExceptionUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If NativeMethods.GetStartupInfo(startupInfo) @@ -124,7 +125,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else AppActivateHelper(windowHandle, CStr(ProcessId)) End If @@ -183,13 +184,13 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, Title)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, Title)) Else AppActivateHelper(windowHandle, Title) End If End Sub - Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) + Private Sub AppActivateHelper(hwndApp As IntPtr, processId As String) ' if no window with name (full or truncated) or task id, return an error ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible Dim hwndOwned As IntPtr @@ -210,7 +211,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.ProcessNotFound, ProcessId)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -271,7 +272,7 @@ Namespace Microsoft.VisualBasic End If End Function - Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String + Private Function GetTitleFromAssembly(callingAssembly As Reflection.Assembly) As String Dim title As String @@ -280,9 +281,9 @@ Namespace Microsoft.VisualBasic 'and if it throws we catch the security exception and parse the name 'from the full assembly name Try - title = CallingAssembly.GetName().Name + title = callingAssembly.GetName().Name Catch ex As SecurityException - Dim fullName As String = CallingAssembly.FullName + Dim fullName As String = callingAssembly.FullName 'Find the text up to the first comma. Note, this fails if the assembly has 'a comma in its name @@ -299,9 +300,9 @@ Namespace Microsoft.VisualBasic End Function - Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - box.ShowDialog(ParentWindow) + Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String + Dim box As VBInputBox = New VBInputBox(prompt, title, defaultResponse, xPos, yPos) + box.ShowDialog(parentWindow) InternalInputBox = box.Output box.Dispose() @@ -339,7 +340,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try @@ -350,7 +351,7 @@ Namespace Microsoft.VisualBasic sTitle = vbHost.GetWindowTitle() End If Else - sTitle = CStr(Title) 'allows the title to be an expression, e.g. msgBox(prompt, Title:=1+5) + sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) End If Catch ex As StackOverflowException Throw @@ -359,7 +360,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExceptionUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index de766a83726..f41b5b13709 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -7,6 +7,7 @@ Imports System.IO Imports System.Text Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging @@ -198,7 +199,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As String) If String.IsNullOrEmpty(value) Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) + Throw ExUtils.GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) End If ' Test the file name. This will throw if the name is invalid. @@ -273,7 +274,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < MIN_FILE_SIZE Then - Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") + Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") End If _maxFileSize = value _propertiesSet(MAXFILESIZE_INDEX) = True @@ -296,7 +297,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < 0 Then - Throw ExceptionUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") End If _reserveDiskSpace = value _propertiesSet(RESERVEDISKSPACE_INDEX) = True @@ -341,7 +342,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As Encoding) If value Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(value)) + Throw ExUtils.GetArgumentNullException(NameOf(value)) End If _encoding = value _propertiesSet(ENCODING_INDEX) = True @@ -744,7 +745,7 @@ Namespace Microsoft.VisualBasic.Logging End While 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw ExceptionUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) + Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' @@ -826,14 +827,14 @@ Namespace Microsoft.VisualBasic.Logging If ListenerStream.FileSize + newEntrySize > MaxFileSize Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(Utils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) + Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) End If Return False End If If GetFreeDiskSpace() - newEntrySize < ReserveDiskSpace Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(Utils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) + Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) End If Return False End If @@ -860,7 +861,7 @@ Namespace Microsoft.VisualBasic.Logging End If End If - Throw ExceptionUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) End Function ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 8bdc1d63578..99c0cb98927 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -4,7 +4,7 @@ Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text -Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic.Logging Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String, id As Integer) If ex Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(ex)) + Throw ExUtils.GetArgumentNullException(NameOf(ex)) End If Dim builder As New StringBuilder() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 17dd3b179b0..a0c7ba1592c 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -11,74 +11,65 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' - Partial Public Class ClipboardProxyTests - Private _clipBoardMutex As New Object() + + + Public Class ClipboardProxyTests Public Sub ClipboardProxy_ContainsText() - SyncLock _clipBoardMutex - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim text As String = GetUniqueText() - clipboardProxy.SetText(text) - Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText) - Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText(TextDataFormat.Text)) - Assert.Equal(Clipboard.ContainsData(DataFormats.Text), clipboardProxy.ContainsData(DataFormats.Text)) - Assert.Equal(text, clipboardProxy.GetText()) - text = GetUniqueText() - clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim text As String = GetUniqueText() + clipboardProxy.SetText(text) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText(TextDataFormat.Text)) + Assert.Equal(Clipboard.ContainsData(DataFormats.Text), clipboardProxy.ContainsData(DataFormats.Text)) + Assert.Equal(text, clipboardProxy.GetText()) + text = GetUniqueText() + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) End Sub Public Sub ClipboardProxy_GetAudioStream_InvokeMultipleTimes_Success() - SyncLock _clipBoardMutex - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes As Byte() = {1, 2, 3} - clipboardProxy.SetAudio(audioBytes) - Dim result As Stream = clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) End Sub Public Sub ClipboardProxy_SetAudio_InvokeByteArray_GetReturnsExpected() - SyncLock _clipBoardMutex - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes As Byte() = {1, 2, 3} - clipboardProxy.SetAudio(audioBytes) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) End Sub Public Sub ClipboardProxy_SetAudio_InvokeStream_GetReturnsExpected() - SyncLock _clipBoardMutex - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim audioBytes() As Byte = {1, 2, 3} - Using audioStream As New MemoryStream(audioBytes) - clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - End Using - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes() As Byte = {1, 2, 3} + Using audioStream As New MemoryStream(audioBytes) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using End Sub Public Sub ClipboardProxy_SetFileDropList_Invoke_GetReturnsExpected() - SyncLock _clipBoardMutex - Dim clipboardProxy As New MyServices.ClipboardProxy - Dim filePaths As New StringCollection From - {"filePath", "filePath2"} - clipboardProxy.SetFileDropList(filePaths) - Assert.True(clipboardProxy.ContainsFileDropList()) - Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) - End SyncLock + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim filePaths As New StringCollection From + {"filePath", "filePath2"} + clipboardProxy.SetFileDropList(filePaths) + Assert.True(clipboardProxy.ContainsFileDropList()) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb new file mode 100644 index 00000000000..8d606d6d5ca --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb @@ -0,0 +1,44 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports Microsoft.VisualBasic.ApplicationServices +Imports Microsoft.VisualBasic.CompilerServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class ExceptionTests + + + Public Sub CantStartSingleInstanceExceptionTest() + Dim ex As Exception = New CantStartSingleInstanceException() + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Dim expected As String = ExceptionUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) + Assert.Equal(expected, ex.Message) + ex = New CantStartSingleInstanceException("Test") + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Assert.Equal("Test", ex.Message) + ex = New CantStartSingleInstanceException("Test1", New DirectoryNotFoundException) + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Assert.Equal("Test1", ex.Message) + Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + End Sub + + + Public Sub NoStartupFormExceptionTest() + Dim ex As Exception = New NoStartupFormException() + Assert.IsType(Of NoStartupFormException)(ex) + Dim expected As String = ExceptionUtils.GetResourceString(SR.AppModel_NoStartupForm) + Assert.Equal(expected, ex.Message) + ex = New NoStartupFormException("Test") + Assert.IsType(Of NoStartupFormException)(ex) + Assert.Equal("Test", ex.Message) + ex = New NoStartupFormException("Test1", New DirectoryNotFoundException) + Assert.IsType(Of NoStartupFormException)(ex) + Assert.Equal("Test1", ex.Message) + Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index e5d8870adbd..e2f722fdd99 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -37,11 +37,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub GetIOExceptionTest_Succeed() + Public Sub GetInvalidOperationExceptionTest_Succeed() Dim ex As Exception = ExceptionUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) Assert.IsType(Of InvalidOperationException)(ex) End Sub + + Public Sub GetIOExceptionTest_Succeed() + Dim ex As Exception = ExceptionUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) + Assert.IsType(Of IO.IOException)(ex) + Assert.Equal($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.", ex.Message) + End Sub + Public Sub GetWin32ExceptionTest_Succeed() Dim ex As Exception = ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb new file mode 100644 index 00000000000..8485741fa1a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb @@ -0,0 +1,30 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO.Pipes + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class PipeListener + Private _pipeServer As NamedPipeServerStream + + Public Sub New(pipeName As String, maxNumberOfServerInstances As Integer, transmissionMode As PipeTransmissionMode, options As PipeOptions) + Task.Run( + Sub() + Try + ' Start the listener to begin listening for requests. + _pipeServer = New NamedPipeServerStream( + pipeName, + direction:=PipeDirection.Out, + maxNumberOfServerInstances:=1, + transmissionMode, + options) + + Catch ex As Exception + _pipeServer = Nothing + End Try + End Sub) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb new file mode 100644 index 00000000000..0eec2d2b031 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb @@ -0,0 +1,80 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO.Pipes +Imports System.Runtime.CompilerServices +Imports System.Threading +Imports Microsoft.VisualBasic.ApplicationServices + +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class SingleInstanceHelpersTests + Private _resultArgs As String() + + Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) + If args.Length = 1 Then + _resultArgs = {"Hello"} + End If + End Sub + + + Public Sub TryCreatePipeServerTests() + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + Assert.True(TryCreatePipeServer(pipeName, pipeServer)) + Assert.True(pipeServer.CanRead) + Assert.False(pipeServer.CanSeek) + Assert.False(pipeServer.CanWrite) + Assert.Equal(PipeTransmissionMode.Byte, pipeServer.TransmissionMode) + pipeServer.Close() + pipeServer.Dispose() + End Sub + + + Public Sub TryCreatePipeServerTwiceTests_Fail() + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + Assert.True(TryCreatePipeServer(pipeName, pipeServer)) + Dim pipeServer1 As NamedPipeServerStream = Nothing + Assert.False(TryCreatePipeServer(pipeName, pipeServer1)) + Assert.Null(pipeServer1) + pipeServer.Close() + pipeServer.Dispose() + End Sub + + + Public Sub WaitForClientConnectionsAsyncTests() + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + If TryCreatePipeServer(pipeName, pipeServer) Then + + Using pipeServer + Dim tokenSource As New CancellationTokenSource() +#Disable Warning BC42358 ' Call is not awaited. + WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) +#Enable Warning BC42358 + Dim commandLine As String() = {"Hello"} + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(pipeName, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + awaitable.GetAwaiter().GetResult() + Dim CancelToken As New CancellationToken + Dim buffer As Byte() = New Byte(commandLine.Length) {} + +#Disable Warning CA2012 ' Use ValueTasks correctly + ' NOTE TO REVIEWS: Below needs to be fixed but I don't know how + Dim countTask As ValueTask(Of Integer) = pipeServer.ReadAsync(buffer.AsMemory(0, commandLine.Length)) +#Enable Warning CA2012 ' Use ValueTasks correctly + Do + Thread.Sleep(5) + Loop Until _resultArgs IsNot Nothing AndAlso countTask.IsCompleted + Assert.True(countTask.IsCompletedSuccessfully) + Assert.Equal("Hello", _resultArgs(0)) + tokenSource.Cancel() + End Using + End If + + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb index 440248d96c8..0883ea8f99a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -2,7 +2,6 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports Microsoft.VisualBasic.ApplicationServices - Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -21,6 +20,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests testUser.CurrentPrincipal = userPrincipal Assert.NotNull(testUser.CurrentPrincipal) Assert.Equal(userPrincipal, testUser.CurrentPrincipal) + Assert.Equal("Basic", userPrincipal.Identity.AuthenticationType) End Sub From 693fb49e21398f89cb4c68e78845fc2d86576e85 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 16:05:54 -0700 Subject: [PATCH 182/342] Code Cleanup and merge Master --- .../CompilerServices/ExceptionUtils.vb | 91 ++++++++++--------- .../VisualBasic/Helpers/FileSystemUtils.vb | 4 +- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 51583c544b2..e2ee2f3151e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -14,7 +14,8 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils - Friend Function GetResourceString(resourceKey As String, ParamArray args() As String) As String + Friend Function GetResourceString(resourceKey As String, + ParamArray args() As String) As String Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) End Function @@ -48,104 +49,104 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of ArgumentException. ''' This is the preferred way to construct an argument exception. - Friend Function GetArgumentExceptionWithArgName(ArgumentName As String, - ResourceID As String, - ParamArray PlaceHolders() As String) As ArgumentException + Friend Function GetArgumentExceptionWithArgName(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentException - Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(GetResourceString(resourceID, placeHolders), argumentName) End Function ''' ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." ''' - ''' The name of the argument (parameter). Not localized. + ''' The name of the argument (parameter). Not localized. ''' A new instance of ArgumentNullException. - Friend Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException + Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(argumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' ''' Returns a new instance of ArgumentNullException with the message from resource file. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of ArgumentNullException. - Friend Function GetArgumentNullException(ArgumentName As String, - ResourceID As String, - ParamArray PlaceHolders() As String) As ArgumentNullException + Friend Function GetArgumentNullException(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) + Return New ArgumentNullException(argumentName, GetResourceString(resourceID, placeHolders)) End Function ''' ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.DirectoryNotFoundException. - Friend Function GetDirectoryNotFoundException(ResourceID As String, - ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException + Friend Function GetDirectoryNotFoundException(resourceID As String, + ParamArray placeHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(GetResourceString(resourceID, placeHolders)) End Function ''' ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. ''' - ''' The file name (path) of the not found file. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The file name (path) of the not found file. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.FileNotFoundException. - Friend Function GetFileNotFoundException(FileName As String, - ResourceID As String, - ParamArray PlaceHolders() As String) As IO.FileNotFoundException + Friend Function GetFileNotFoundException(fileName As String, + resourceID As String, + ParamArray placeHolders() As String) As IO.FileNotFoundException - Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) + Return New IO.FileNotFoundException(GetResourceString(resourceID, placeHolders), fileName) End Function ''' ''' Returns a new instance of InvalidOperationException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of InvalidOperationException. - Friend Function GetInvalidOperationException(ResourceID As String, - ParamArray PlaceHolders() As String) As InvalidOperationException + Friend Function GetInvalidOperationException(resourceID As String, + ParamArray placeHolders() As String) As InvalidOperationException - Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(GetResourceString(resourceID, placeHolders)) End Function ''' ''' Returns a new instance of IO.IOException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of IO.IOException. - Friend Function GetIOException(ResourceID As String, - ParamArray PlaceHolders() As String) As IO.IOException + Friend Function GetIOException(resourceID As String, + ParamArray placeHolders() As String) As IO.IOException - Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(GetResourceString(resourceID, placeHolders)) End Function ''' ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Function GetWin32Exception(ResourceID As String, - ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception + Friend Function GetWin32Exception(resourceID As String, + ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 5f0865df473..f4f44477ed6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' ''' Returns the given path in long format (v.s 8.3 format) if the path exists. ''' - ''' The path to resolve to long format. + ''' The path to resolve to long format. ''' The given path in long format if the path exists. ''' ''' GetLongPathName is a PInvoke call and requires unmanaged code permission. @@ -116,7 +116,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) ' Check for argument null If String.IsNullOrEmpty(path) Then - Throw ExceptionUtils.GetArgumentNullException(paramName) + Throw GetArgumentNullException(paramName) End If If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then From 417b11cff5c3c00f899e177c47901cbbc356013c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 16:42:26 -0700 Subject: [PATCH 183/342] Merge --- .../VisualBasic/CompilerServices/ExceptionUtils.vb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index e2ee2f3151e..7d4933186ec 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -19,20 +19,20 @@ Namespace Microsoft.VisualBasic.CompilerServices Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) End Function - Friend Function GetResourceString(ResourceId As Integer) As String - Dim id As String = $"ID{ResourceId}" + Friend Function GetResourceString(resourceId As Integer) As String + Dim id As String = $"ID{resourceId}" ' always return a string Return $"{SR.GetResourceString(id, id)}" End Function - Friend Function VbMakeException(ResourceId As Integer) As Exception + Friend Function VbMakeException(resourceId As Integer) As Exception Dim description As String = "" - If ResourceId > 0 AndAlso ResourceId <= &HFFFFI Then - description = GetResourceString(ResourceId) + If resourceId > 0 AndAlso resourceId <= &HFFFFI Then + description = GetResourceString(resourceId) End If - Select Case ResourceId + Select Case resourceId Case vbErrors.FileNotFound Return New IO.FileNotFoundException(description) From f82e2634c32e2a735ed76f09a444b2ad13c6a0cc Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 16:42:26 -0700 Subject: [PATCH 184/342] Minor formatting fixes --- .../src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 7d4933186ec..351387555e5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -142,7 +142,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Function GetWin32Exception(resourceID As String, ParamArray placeHolders() As String) As ComponentModel.Win32Exception From 53b009ecf9ded1549b629d5916e764c0bf87fde4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 16:42:26 -0700 Subject: [PATCH 185/342] Minor formatting fixes --- .../ApplicationServices/AssemblyInfo.vb | 6 ++--- .../WindowsFormsApplicationBase.vb | 14 +++++++----- .../VisualBasic/Helpers/VBInputBox.vb | 22 +++++++++---------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index f609f0d4710..f6d370d201c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -217,13 +217,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. ''' - ''' The type of the required attribute. + ''' The type of the required attribute. ''' The attribute with the given type gotten from the assembly, or Nothing. - Private Function GetAttribute(AttributeType As Type) As Object + Private Function GetAttribute(attributeType As Type) As Object Debug.Assert(_assembly IsNot Nothing, "Null m_Assembly") - Dim attributes() As Object = _assembly.GetCustomAttributes(AttributeType, inherit:=True) + Dim attributes() As Object = _assembly.GetCustomAttributes(attributeType, inherit:=True) If attributes.Length = 0 Then Return Nothing diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index d15e0ac032e..bb760b80878 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -908,7 +908,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) End Sub - Private Sub OnStartupNextInstanceMarshallingAdaptor(ByVal args As String()) + Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) Dim invoked As Boolean = False @@ -1009,17 +1009,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Generates the name for the remote singleton that we use to channel multiple instances ''' to the same application model thread. ''' - ''' A string unique to the application that should be the same for versions of + ''' + ''' + ''' A string unique to the application that should be the same for versions of ''' the application that have the same Major and Minor Version Number ''' ''' If GUID Attribute does not exist fall back to unique ModuleVersionId - Private Shared Function GetApplicationInstanceID(ByVal Entry As Assembly) As String + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String - Dim guidAttrib As GuidAttribute = Entry.GetCustomAttribute(Of GuidAttribute)() + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() If guidAttrib IsNot Nothing Then - Dim version As Version = Entry.GetName.Version + Dim version As Version = entry.GetName.Version If version IsNot Nothing Then Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" @@ -1028,7 +1030,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If - Return Entry.ManifestModule.ModuleVersionId.ToString() + Return entry.ManifestModule.ModuleVersionId.ToString() End Function End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 41607fafe4f..cee1f961619 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -26,10 +26,10 @@ Namespace Microsoft.VisualBasic.CompilerServices InitializeComponent() End Sub - Friend Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) + Friend Sub New(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer) MyBase.New() InitializeComponent() - InitializeInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + InitializeInputBox(prompt, title, defaultResponse, xPos, yPos) End Sub Protected Overloads Overrides Sub Dispose(disposing As Boolean) @@ -87,16 +87,16 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub 'Initialize labels etc from the args passed in to InputBox() - Private Sub InitializeInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) - Text = Title - Label.Text = Prompt - TextBox.Text = DefaultResponse + Private Sub InitializeInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer) + Text = title + Label.Text = prompt + TextBox.Text = defaultResponse AddHandler OKButton.Click, AddressOf OKButton_Click AddHandler MyCancelButton.Click, AddressOf MyCancelButton_Click 'Re-size the dialog if the prompt is too large Dim labelGraphics As Graphics = Label.CreateGraphics - Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(Prompt, Label.Font, Label.Width) + Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(prompt, Label.Font, Label.Width) labelGraphics.Dispose() If labelSizeNeeded.Height > Label.Height Then 'The current label size is not large enough to accommodate the prompt. We need @@ -108,13 +108,13 @@ Namespace Microsoft.VisualBasic.CompilerServices End If 'Position the form - If (XPos = -1) AndAlso (YPos = -1) Then + If (xPos = -1) AndAlso (yPos = -1) Then StartPosition = FormStartPosition.CenterScreen Else - If (XPos = -1) Then XPos = 600 - If (YPos = -1) Then YPos = 350 + If (xPos = -1) Then xPos = 600 + If (yPos = -1) Then yPos = 350 StartPosition = FormStartPosition.Manual - DesktopLocation = New Point(XPos, YPos) + DesktopLocation = New Point(xPos, yPos) End If End Sub From 59f1ec9c70f2787cb2603e4e4a0794eea8a8056c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Apr 2024 18:53:35 -0700 Subject: [PATCH 186/342] Delete pipeLIstner --- .../System/Windows/Forms/PipeListener.vb | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb deleted file mode 100644 index 8485741fa1a..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb +++ /dev/null @@ -1,30 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.IO.Pipes - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class PipeListener - Private _pipeServer As NamedPipeServerStream - - Public Sub New(pipeName As String, maxNumberOfServerInstances As Integer, transmissionMode As PipeTransmissionMode, options As PipeOptions) - Task.Run( - Sub() - Try - ' Start the listener to begin listening for requests. - _pipeServer = New NamedPipeServerStream( - pipeName, - direction:=PipeDirection.Out, - maxNumberOfServerInstances:=1, - transmissionMode, - options) - - Catch ex As Exception - _pipeServer = Nothing - End Try - End Sub) - End Sub - - End Class -End Namespace From 23c5ee07e35afc7f8a13c487e35e11263ec54682 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Apr 2024 19:52:47 -0700 Subject: [PATCH 187/342] Remove double Microsoft.VisualBasic.Forms.Tests namespace --- .../tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index ee3c2f5310d..a608fbb469d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -7,7 +7,7 @@ true 16.9 WindowsFormsWithCustomSubMain - Microsoft.VisualBasic.Forms.Tests + True Library Off From 3d8af756ede0681790e6e608cd4beeb078e04e19 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 22 Apr 2024 20:07:41 -0700 Subject: [PATCH 188/342] Restore FileSystemUtils function order Remove ByVal in most places --- .../Form1.Designer.vb | 2 +- .../UserControl1.Designer.vb | 2 +- .../WindowsFormsApplicationBase.vb | 1 - .../VisualBasic/Devices/ComputerInfo.vb | 194 +++++++++--------- .../Devices/Network/NetworkUpload.vb | 2 +- .../Devices/Network/NetworkUtilities.vb | 2 +- .../VisualBasic/Helpers/FileSystemUtils.vb | 79 +++---- .../Microsoft/VisualBasic/Helpers/IVbHost.vb | 3 - .../src/Microsoft/VisualBasic/Logging/Log.vb | 2 +- .../VisualBasic/Devices/AudioTests.cs | 2 +- .../VisualBasic/Devices/KeyboardTests.cs | 4 +- .../MyServices/ClipboardProxyTests.cs | 8 +- .../System/Windows/Forms/ClipboardTests.cs | 2 + 13 files changed, 148 insertions(+), 155 deletions(-) diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb index 4ec68a096ba..b7ef7be2e13 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb @@ -4,7 +4,7 @@ Partial Class Form1 'Form overrides dispose to clean up the component list. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Protected Overrides Sub Dispose(disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb index 58d97c2eec7..ac79a72ea7c 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb @@ -4,7 +4,7 @@ Partial Class UserControl1 'UserControl1 overrides dispose to clean up the component list. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Protected Overrides Sub Dispose(disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index bb760b80878..e668587b862 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -130,7 +130,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 42928764707..d45728903a0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -14,9 +14,6 @@ Namespace Microsoft.VisualBasic.Devices ' Keep the debugger proxy current as you change this class - see the nested ComputerInfoDebugView below. - ' Cache our InternalMemoryStatus - Private _internalMemoryStatus As InternalMemoryStatus - ''' ''' Default constructor ''' @@ -24,17 +21,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:=" - ''' - ''' Gets the whole memory information details. + ''' Gets the total size of physical memory on the machine. ''' - ''' An InternalMemoryStatus class. - Private ReadOnly Property MemoryStatus() As InternalMemoryStatus + ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. + ''' If we are unable to obtain the memory status. + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get - If _internalMemoryStatus Is Nothing Then - _internalMemoryStatus = New InternalMemoryStatus - End If - Return _internalMemoryStatus + Return MemoryStatus.TotalPhysicalMemory End Get End Property @@ -50,6 +45,21 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property + ''' + ''' Gets the total size of user potion of virtual address space for calling process. + ''' + ''' + ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, + ''' in bytes. + ''' + ''' If we are unable to obtain the memory status. + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return MemoryStatus.TotalVirtualMemory + End Get + End Property + ''' ''' Gets the total size of free user potion of virtual address space for calling process. ''' @@ -64,6 +74,7 @@ Namespace Microsoft.VisualBasic.Devices Return MemoryStatus.AvailableVirtualMemory End Get End Property +#Enable Warning IDE0049 ' Simplify Names ''' ''' Gets the current UICulture installed on the machine. @@ -107,101 +118,22 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - ''' - ''' Gets the total size of physical memory on the machine. - ''' - ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 - Get - Return MemoryStatus.TotalPhysicalMemory - End Get - End Property - - ''' - ''' Gets the total size of user potion of virtual address space for calling process. - ''' - ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, - ''' in bytes. - ''' - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Return MemoryStatus.TotalVirtualMemory - End Get - End Property - -#Enable Warning IDE0049 ' Simplify Names - - ''' - ''' Calls GlobalMemoryStatusEx and returns the correct value. - ''' - Private NotInheritable Class InternalMemoryStatus - - Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX - - Friend Sub New() - End Sub - -#Disable Warning IDE0049 ' Simplify Names, Justification:= - - Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullAvailPhys - End Get - End Property - - Friend ReadOnly Property AvailableVirtualMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullAvailVirtual - End Get - End Property - - Friend ReadOnly Property TotalPhysicalMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullTotalPhys - End Get - End Property - - Friend ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullTotalVirtual - End Get - End Property - -#Enable Warning IDE0049 ' Simplify Names - - Private Sub Refresh() - _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX - _memoryStatusEx.Init() - If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then - Throw GetWin32Exception(SR.DiagnosticInfo_Memory) - End If - End Sub - - End Class - ''' ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger ''' so we offer a view that doesn't have that field. ''' Friend NotInheritable Class ComputerInfoDebugView - - - Private ReadOnly _instanceBeingWatched As ComputerInfo - Public Sub New(RealClass As ComputerInfo) _instanceBeingWatched = RealClass End Sub #Disable Warning IDE0049 ' Simplify Names, Justification:= + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalPhysicalMemory + End Get + End Property Public ReadOnly Property AvailablePhysicalMemory() As UInt64 @@ -210,12 +142,20 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return _instanceBeingWatched.TotalVirtualMemory + End Get + End Property + Public ReadOnly Property AvailableVirtualMemory() As UInt64 Get Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property +#Enable Warning IDE0049 ' Simplify Names Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -238,21 +178,71 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 + + Private ReadOnly _instanceBeingWatched As ComputerInfo + End Class + + ''' + ''' Gets the whole memory information details. + ''' + ''' An InternalMemoryStatus class. + Private ReadOnly Property MemoryStatus() As InternalMemoryStatus + Get + If _internalMemoryStatus Is Nothing Then + _internalMemoryStatus = New InternalMemoryStatus + End If + Return _internalMemoryStatus + End Get + End Property + + Private _internalMemoryStatus As InternalMemoryStatus ' Cache our InternalMemoryStatus + + ''' + ''' Calls GlobalMemoryStatusEx and returns the correct value. + ''' + Private NotInheritable Class InternalMemoryStatus + Friend Sub New() + End Sub + +#Disable Warning IDE0049 ' Simplify Names, Justification:= + Friend ReadOnly Property TotalPhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalPhysicalMemory + Refresh() + Return _memoryStatusEx.ullTotalPhys End Get End Property - - Public ReadOnly Property TotalVirtualMemory() As UInt64 + Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalVirtualMemory + Refresh() + Return _memoryStatusEx.ullAvailPhys End Get End Property + Friend ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Refresh() + Return _memoryStatusEx.ullTotalVirtual + End Get + End Property + + Friend ReadOnly Property AvailableVirtualMemory() As UInt64 + Get + Refresh() + Return _memoryStatusEx.ullAvailVirtual + End Get + End Property #Enable Warning IDE0049 ' Simplify Names + + Private Sub Refresh() + _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX + _memoryStatusEx.Init() + If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then + Throw GetWin32Exception(SR.DiagnosticInfo_Memory) + End If + End Sub + + Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index bc22199b744..d6a615c3930 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -181,7 +181,7 @@ Namespace Microsoft.VisualBasic.Devices showUI As Boolean, connectionTimeout As Integer, onUserCancel As UICancelOption) - sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, "sourceFileName") + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) 'Make sure the file exists If Not IO.File.Exists(sourceFileName) Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index a413e63874c..079f3ce5147 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -59,7 +59,7 @@ Namespace Microsoft.VisualBasic.Devices Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, ParamName:=NameOf(destinationFileName)) + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, paramName:=NameOf(destinationFileName)) Return New ProgressDialog With { .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index f4f44477ed6..2035931d87d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Security +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.CompilerServices @@ -10,6 +11,46 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Friend NotInheritable Class FileSystemUtils + ''' + ''' Normalize the path, but throw exception if the path ends with separator. + ''' + ''' The input path. + ''' The parameter name to include in the exception if one is raised. + ''' The normalized path. + Friend Shared Function NormalizeFilePath(path As String, + paramName As String) As String + CheckFilePathTrailingSeparator(path, paramName) + Return NormalizePath(path) + End Function + + ''' + ''' Get full path, get long format, and remove any pending separator. + ''' + ''' The path to be normalized. + ''' The normalized path. + ''' See IO.Path.GetFullPath for possible exceptions. + ''' Keep this function since we might change the implementation / behavior later. + Friend Shared Function NormalizePath(path As String) As String + Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) + End Function + + ''' + ''' Throw ArgumentException if the file path ends with a separator. + ''' + ''' The file path. + ''' The parameter name to include in ArgumentException. + Friend Shared Sub CheckFilePathTrailingSeparator(path As String, + paramName As String) + ' Check for argument null + If String.IsNullOrEmpty(path) Then + Throw ExUtils.GetArgumentNullException(paramName) + End If + If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or + path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then + Throw ExUtils.GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) + End If + End Sub + ''' ''' Returns the given path in long format (v.s 8.3 format) if the path exists. ''' @@ -108,43 +149,5 @@ Namespace Microsoft.VisualBasic.CompilerServices Return path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) End Function - ''' - ''' Throw ArgumentException if the file path ends with a separator. - ''' - ''' The file path. - ''' The parameter name to include in ArgumentException. - Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) - ' Check for argument null - If String.IsNullOrEmpty(path) Then - Throw GetArgumentNullException(paramName) - End If - If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or - path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then - Throw GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) - End If - End Sub - - ''' - ''' Normalize the path, but throw exception if the path ends with separator. - ''' - ''' The input path. - ''' The parameter name to include in the exception if one is raised. - ''' The normalized path. - Friend Shared Function NormalizeFilePath(path As String, ParamName As String) As String - CheckFilePathTrailingSeparator(path, ParamName) - Return NormalizePath(path) - End Function - - ''' - ''' Get full path, get long format, and remove any pending separator. - ''' - ''' The path to be normalized. - ''' The normalized path. - ''' See IO.Path.GetFullPath for possible exceptions. - ''' Keep this function since we might change the implementation / behavior later. - Friend Shared Function NormalizePath(path As String) As String - Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) - End Function - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb index 660b6709762..d663cace0fe 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb @@ -7,7 +7,4 @@ Namespace Microsoft.VisualBasic.CompilerServices Function GetParentWindow() As System.Windows.Forms.IWin32Window Function GetWindowTitle() As String End Interface - End Namespace - - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 99c0cb98927..99cdf5f268c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -230,7 +230,7 @@ Namespace Microsoft.VisualBasic.Logging ' Names of TraceSources Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - 'Taken from appConfig + ' Taken from appConfig Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" End Class diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs index 49f252f6094..60d544d8960 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs @@ -14,7 +14,7 @@ public void Play() } // Not tested: - // Public Sub PlaySystemSound(ByVal systemSound As System.Media.SystemSound) + // Public Sub PlaySystemSound(systemSound As System.Media.SystemSound) [Fact] public void Stop() diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs index f4679a0b327..01bb099b55e 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs @@ -18,6 +18,6 @@ public void Properties() } // Not tested: - // Public Sub SendKeys(ByVal keys As String) - // Public Sub SendKeys(ByVal keys As String, ByVal wait As Boolean) + // Public Sub SendKeys(keys As String) + // Public Sub SendKeys(keys As String, wait As Boolean) } diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index e80b001c789..9bb6294428c 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -8,6 +8,8 @@ namespace Microsoft.VisualBasic.MyServices.Tests; +[Collection("Clipboard Tests")] +[CollectionDefinition("Clipboard Tests", DisableParallelization = true)] public class ClipboardProxyTests { [WinFormsFact] @@ -50,8 +52,8 @@ public void Audio() Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); // Not tested: // Public Function GetAudioStream() As Stream - // Public Sub SetAudio(ByVal audioBytes As Byte()) - // Public Sub SetAudio(ByVal audioStream As Stream) + // Public Sub SetAudio(audioBytes As Byte()) + // Public Sub SetAudio(audioStream As Stream) } [WinFormsFact] @@ -61,7 +63,7 @@ public void FileDropList() Assert.Equal(System.Windows.Forms.Clipboard.ContainsFileDropList(), clipboard.ContainsFileDropList()); // Not tested: // Public Function GetFileDropList() As StringCollection - // Public Sub SetFileDropList(ByVal filePaths As StringCollection) + // Public Sub SetFileDropList(filePaths As StringCollection) } [WinFormsFact] diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs index 2a0fe246f24..6139975fe90 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs @@ -12,6 +12,8 @@ namespace System.Windows.Forms.Tests; +[Collection("Clipboard Tests")] +[CollectionDefinition("Clipboard Tests", DisableParallelization = true)] public partial class ClipboardTests { [WinFormsFact] From c4a7762432e1504636c5f6143d74826f8e20674f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 22 Apr 2024 20:43:01 -0700 Subject: [PATCH 189/342] Fix spelling error and revert file reorginize for WebClientCopy --- .../WindowsFormsApplicationBase.vb | 2 +- .../MyServices/Internal/WebClientCopy.vb | 111 +++++++++--------- 2 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index e668587b862..16130f1c04d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -405,7 +405,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash - ''' screen should be displayed for. When not set then the splash screen is hidden + ''' Screen should be displayed for. When not set then the splash screen is hidden ''' as soon as the main form becomes active. ''' ''' The minimum amount of time, in milliseconds, to display the splash screen. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index a2aa8092c0c..a46204f2d8c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -3,6 +3,7 @@ Imports System.IO Imports System.Net +Imports System.Windows.Forms Namespace Microsoft.VisualBasic.MyServices.Internal @@ -11,18 +12,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Friend NotInheritable Class WebClientCopy - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. - Private WithEvents m_ProgressDialog As ProgressDialog - - ' The WebClient performs the downloading or uploading operations for us - Private WithEvents m_WebClient As WebClient - - 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread - Private _exceptionEncounteredDuringFileTransfer As Exception - - ' The percentage of the operation completed - Private _percentage As Integer - ''' ''' Creates an instance of a WebClientCopy, used to download or upload a file ''' @@ -37,23 +26,28 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) - ''' - ''' Posts a message to close the progress dialog + ''' Uploads a file ''' - Private Sub CloseProgressDialog() - ' Don't invoke unless dialog is up and running + ''' The name and path of the source file + ''' The address to which the file is uploaded + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") + + ' If we have a dialog we need to set up an async download If m_ProgressDialog IsNot Nothing Then - m_ProgressDialog.IndicateClosing() + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If - If m_ProgressDialog.IsHandleCreated Then - m_ProgressDialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - m_ProgressDialog.Close() + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer End If End If End Sub @@ -79,17 +73,25 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' Posts a message to close the progress dialog ''' - ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. - ''' - Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running + If m_ProgressDialog IsNot Nothing Then + m_ProgressDialog.IndicateClosing() + + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() + End If + End If End Sub + + ''' ''' Handles the WebClient's UploadFileCompleted event ''' @@ -122,30 +124,31 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Uploads a file + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation ''' - ''' The name and path of the source file - ''' The address to which the file is uploaded - Public Sub UploadFile(sourceFileName As String, address As Uri) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + End Sub - ' If we have a dialog we need to set up an async download - If m_ProgressDialog IsNot Nothing Then - m_WebClient.UploadFileAsync(address, sourceFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.UploadFile(address, sourceFileName) - End If + ' The WebClient performs the downloading or uploading operations for us + Private WithEvents m_WebClient As WebClient - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer - End If - End If - End Sub + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog + + 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread + Private _exceptionEncounteredDuringFileTransfer As Exception + + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + + ' The percentage of the operation completed + Private _percentage As Integer End Class End Namespace From baab8121c8c5735eb6e93854213085e6a99ef8c3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 22 Apr 2024 20:43:01 -0700 Subject: [PATCH 190/342] Fix spelling error and revert file reorginize for WebClientCopy --- .../ApplicationServices/WindowsFormsApplicationBase.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 16130f1c04d..8b998ce269d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -732,7 +732,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Hide the splash screen. The splash screen was created on another thread ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' Splash screen so it doesn't block app startup. We need to invoke the close. ''' This function gets called from the main thread by the app fx. ''' @@ -931,6 +931,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices SynchronizationContext. Send(Sub() handleNextInstance(), Nothing) End If + Catch ex As Exception When Not invoked ' Only catch exceptions thrown when the UI thread is not available, before ' the UI thread has been created or after it has been terminated. Exceptions From b890daba64226aecd507da69b73756e63a8f23b1 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 22 Apr 2024 21:20:47 -0700 Subject: [PATCH 191/342] Fix spacing in InputBoxHandler --- .../src/Microsoft/VisualBasic/InputBoxHandler.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index f607cbae47e..65e912651f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -16,6 +16,7 @@ Namespace Microsoft.VisualBasic Private ReadOnly _yPos As Integer Private _exception As Exception Private _result As String + Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) _prompt = Prompt _title = Title @@ -44,6 +45,7 @@ Namespace Microsoft.VisualBasic _exception = ex End Try End Sub + End Class End Module From 1242432b805d8bd42eee066f1d64f76ddf40be1c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 22 Apr 2024 21:20:47 -0700 Subject: [PATCH 192/342] Fix spacing in InputBoxHandler --- .../src/Microsoft/VisualBasic/InputBoxHandler.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb index 65e912651f8..ade7075bddc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb @@ -47,6 +47,5 @@ Namespace Microsoft.VisualBasic End Sub End Class - End Module End Namespace From 8cf136b5978b9bd255e4d27dd41ab01448914b92 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Apr 2024 20:52:42 -0700 Subject: [PATCH 193/342] Clean up access to ExceptionUtils --- .../Devices/Network/NetworkDownload.vb | 13 ++++++------ .../Devices/Network/NetworkPing.vb | 8 +++---- .../System/Windows/Forms/ExceptionTests.vb | 6 +++--- .../Windows/Forms/ExceptionUtilsTests.vb | 21 ++++++++++--------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 4c25d8c4d86..a031ea9a70f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -5,6 +5,7 @@ Imports System.Net Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices @@ -148,7 +149,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -209,7 +210,7 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean) If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -263,11 +264,11 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -318,7 +319,7 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim dialog As ProgressDialog = Nothing @@ -374,7 +375,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If ' Get network credentials diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index e80121143e1..a274c244bfd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -1,7 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports Microsoft.VisualBasic.CompilerServices +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports NetInfoAlias = System.Net.NetworkInformation Namespace Microsoft.VisualBasic.Devices @@ -53,7 +53,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, DEFAULT_PING_TIMEOUT) End Function @@ -68,7 +68,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure a network is available If Not IsAvailable Then - Throw ExceptionUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) + Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) End If Dim pingMaker As New NetInfoAlias.Ping @@ -89,7 +89,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, timeout) End Function diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb index 8d606d6d5ca..d8428500860 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb @@ -3,8 +3,8 @@ Imports System.IO Imports Microsoft.VisualBasic.ApplicationServices -Imports Microsoft.VisualBasic.CompilerServices Imports Xunit +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests @@ -14,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub CantStartSingleInstanceExceptionTest() Dim ex As Exception = New CantStartSingleInstanceException() Assert.IsType(Of CantStartSingleInstanceException)(ex) - Dim expected As String = ExceptionUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) + Dim expected As String = ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) Assert.Equal(expected, ex.Message) ex = New CantStartSingleInstanceException("Test") Assert.IsType(Of CantStartSingleInstanceException)(ex) @@ -29,7 +29,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub NoStartupFormExceptionTest() Dim ex As Exception = New NoStartupFormException() Assert.IsType(Of NoStartupFormException)(ex) - Dim expected As String = ExceptionUtils.GetResourceString(SR.AppModel_NoStartupForm) + Dim expected As String = ExUtils.GetResourceString(SR.AppModel_NoStartupForm) Assert.Equal(expected, ex.Message) ex = New NoStartupFormException("Test") Assert.IsType(Of NoStartupFormException)(ex) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index e2f722fdd99..fb330e3205a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -3,6 +3,7 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Xunit +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests @@ -13,7 +14,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetArgumentNullExceptionTest_Succeed() - Dim ex As Exception = ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Dim ex As Exception = ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") Assert.IsType(Of ArgumentNullException)(ex) Assert.Equal($"Property MainForm cannot be set to Nothing. (Parameter 'MainForm')", ex.Message) Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) @@ -21,16 +22,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExceptionUtils.GetResourceString(vbErrors.FileNotFound) - Dim ex As Exception = ExceptionUtils.GetDirectoryNotFoundException(resourceString) + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) Assert.IsType(Of IO.DirectoryNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) End Sub Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExceptionUtils.GetResourceString(vbErrors.FileNotFound) - Dim ex As Exception = ExceptionUtils.GetFileNotFoundException("Test", resourceString) + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) Assert.IsType(Of IO.FileNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) @@ -38,20 +39,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetInvalidOperationExceptionTest_Succeed() - Dim ex As Exception = ExceptionUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Dim ex As Exception = ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) Assert.IsType(Of InvalidOperationException)(ex) End Sub Public Sub GetIOExceptionTest_Succeed() - Dim ex As Exception = ExceptionUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) + Dim ex As Exception = ExUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) Assert.IsType(Of IO.IOException)(ex) Assert.Equal($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.", ex.Message) End Sub Public Sub GetWin32ExceptionTest_Succeed() - Dim ex As Exception = ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + Dim ex As Exception = ExUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) Assert.IsType(Of ComponentModel.Win32Exception)(ex) End Sub @@ -60,7 +61,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub VbMakeExceptionInvalidValuesTest_Succeed(BadResourceId As Integer) Dim id As String = $"ID{CStr(BadResourceId)}" - Assert.Equal($"{SR.GetResourceString(id, id)}", ExceptionUtils.VbMakeException(BadResourceId).Message) + Assert.Equal($"{SR.GetResourceString(id, id)}", ExUtils.VbMakeException(BadResourceId).Message) End Sub @@ -69,7 +70,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer, expected As String) Dim id As String = $"ID{CStr(errorCode)}" - Dim message As String = ExceptionUtils.VbMakeException(errorCode).Message + Dim message As String = ExUtils.VbMakeException(errorCode).Message Assert.Equal(expected, message) End Sub From ab897d03cecb62053fd286c1915fb8d806d8c126 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Apr 2024 21:07:45 -0700 Subject: [PATCH 194/342] Fix spacing around Import Aliases --- .../Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb | 1 + .../Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb | 1 + .../ApplicationServices/CantStartSingleInstanceException.vb | 1 + .../VisualBasic/ApplicationServices/NoStartupFormException.vb | 1 + .../ApplicationServices/WindowsFormsApplicationBase.vb | 1 + .../src/Microsoft/VisualBasic/Devices/Audio.vb | 1 + .../src/Microsoft/VisualBasic/Devices/Mouse.vb | 1 + .../src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb | 1 + .../src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb | 1 + .../src/Microsoft/VisualBasic/Interaction.vb | 1 + .../src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb | 1 + .../src/Microsoft/VisualBasic/Logging/Log.vb | 1 + .../tests/UnitTests/System/Windows/Forms/ExceptionTests.vb | 1 + .../tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb | 1 + 14 files changed, 14 insertions(+) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 5a39acf5ece..039c21af560 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Threading + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index f6d370d201c..23172ce7804 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -3,6 +3,7 @@ Imports System.Collections.ObjectModel Imports System.Reflection + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index a56fc81f9c8..f79a4ee9b8f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.ComponentModel + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 31e284c1c92..610fe986470 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.ComponentModel + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 8b998ce269d..044d7148d22 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -10,6 +10,7 @@ Imports System.Runtime.InteropServices Imports System.Security Imports System.Threading Imports System.Windows.Forms + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 302385b8c7a..b1e2e6025a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index 701ab90c1d1..350413c9f3a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index a031ea9a70f..bf7185db698 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -5,6 +5,7 @@ Imports System.Net Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 2035931d87d..46c32e69a4a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Security + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.CompilerServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index c7421816e65..66114906816 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -7,6 +7,7 @@ Imports System.Text Imports System.Threading Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index f41b5b13709..352b56c9111 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -7,6 +7,7 @@ Imports System.IO Imports System.Text Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 99cdf5f268c..9a18fd926f9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -4,6 +4,7 @@ Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb index d8428500860..6be52ebfdfe 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb @@ -4,6 +4,7 @@ Imports System.IO Imports Microsoft.VisualBasic.ApplicationServices Imports Xunit + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index fb330e3205a..531c9e1e571 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -3,6 +3,7 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Xunit + Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests From 4b8f461b4b2f104dc915b3f7f3e1bb8b3cad187b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 5 May 2024 17:31:45 -0700 Subject: [PATCH 195/342] Simplify GetResourceString --- .../Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 351387555e5..89e122f89c0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -22,7 +22,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetResourceString(resourceId As Integer) As String Dim id As String = $"ID{resourceId}" ' always return a string - Return $"{SR.GetResourceString(id, id)}" + Return SR.GetResourceString(id, id) End Function Friend Function VbMakeException(resourceId As Integer) As Exception From b2344e56d0a0bbd13f3a25689f0f7ef343818473 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 5 May 2024 17:58:40 -0700 Subject: [PATCH 196/342] Fix GetResourceString to use vbError instrad of Integer --- .../VisualBasic/CompilerServices/ExceptionUtils.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 89e122f89c0..c732a3bc942 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -19,8 +19,8 @@ Namespace Microsoft.VisualBasic.CompilerServices Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) End Function - Friend Function GetResourceString(resourceId As Integer) As String - Dim id As String = $"ID{resourceId}" + Friend Function GetResourceString(resourceId As vbErrors) As String + Dim id As String = $"ID{CStr(resourceId)}" ' always return a string Return SR.GetResourceString(id, id) End Function @@ -29,7 +29,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dim description As String = "" If resourceId > 0 AndAlso resourceId <= &HFFFFI Then - description = GetResourceString(resourceId) + description = GetResourceString(DirectCast(resourceId, vbErrors)) End If Select Case resourceId From 962cfc226c67ea3b51f19fb20e1d3027a5d2b08d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 5 May 2024 17:58:40 -0700 Subject: [PATCH 197/342] Fix GetResourceString to use vbError instrad of Integer --- .../src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index c732a3bc942..bd71b887d7d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -21,7 +21,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetResourceString(resourceId As vbErrors) As String Dim id As String = $"ID{CStr(resourceId)}" - ' always return a string Return SR.GetResourceString(id, id) End Function From 9dcf4c836430d65eb473eef94396462b51a37e5b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 6 May 2024 20:55:24 -0700 Subject: [PATCH 198/342] Fix Download error messages Add new messages Add additional FileNormalizePath tests --- .../Devices/Network/NetworkDownloadAsync.vb | 15 +- .../MyServices/Internal/HttpClientCopy.vb | 1 - .../src/Resources/xlf/SR.cs.xlf | 8 +- .../System/Windows/Forms/FileIoProxyTests.vb | 14 +- .../Windows/Forms/NetworkDownloadTests.vb | 284 ++++++++++-------- 5 files changed, 187 insertions(+), 135 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb index 101cabf8364..eabd8b7a132 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb @@ -7,6 +7,8 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + Namespace Microsoft.VisualBasic.Devices Partial Public Class Network @@ -122,11 +124,12 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) As Task If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + ' DO NOT USE NameOf(connectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) End If If addressUri Is Nothing Then - Throw GetArgumentNullException(NameOf(addressUri)) + Throw ExUtils.GetArgumentNullException(NameOf(addressUri)) End If Dim client As HttpClient = If(clientHandler Is Nothing, @@ -142,12 +145,12 @@ Namespace Microsoft.VisualBasic.Devices ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(normalizedFilePath) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If 'Throw if the file exists and the user doesn't want to overwrite If Not overwrite AndAlso IO.File.Exists(normalizedFilePath) Then - Throw New IO.IOException(Utils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + Throw New IO.IOException(ExUtils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) End If 'Check to see if the target directory exists. If it doesn't, create it @@ -155,7 +158,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect If String.IsNullOrEmpty(targetDirectory) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If If Not IO.Directory.Exists(targetDirectory) Then @@ -226,7 +229,7 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) As Task If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException(NameOf(address)) + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 71887927ea9..96ea0b31159 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -163,7 +163,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If Case HttpStatusCode.Unauthorized - ' REVIEWER Please check following two web exceptions Throw New WebException(SR.net_webstatus_Unauthorized, WebExceptionStatus.ProtocolError) Case Else Throw New WebException() diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf index 0f1a2be07a6..c9bb697ae75 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf @@ -178,14 +178,14 @@ - The network operation has timed out. - The network operation has timed out. + The operation has timed out. + The operation has timed out. - The network operation is unauthorized. + The remote server returned an error: (401) Unauthorized. - The network operation is unauthorized. + The remote server returned an error: (401) Unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 3bae226e678..64bf1f904f8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -186,11 +186,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub FileNormalizePathTest_Fail() - Assert.Throws(Of ArgumentException)( + Public Sub FileNormalizePathEmptyStringTest_Fail() + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() FileSystemUtils.NormalizePath("") End Sub) + Assert.Equal("The path is empty. (Parameter 'path')", ex.Message) + End Sub + + + Public Sub FileNormalizePathNullTest_Fail() + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + FileSystemUtils.NormalizePath(Nothing) + End Sub) + Assert.Equal("Value cannot be null. (Parameter 'path')", ex.Message) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 3f7a36917ba..8cffb05062d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -17,15 +17,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const TestingConnectionTimeout As Integer = 100000 ''' - ''' Verify that testDirectory exists, that destinationFilename exist and what its length is + ''' Verify that testDirectory exists, that destinationFileName exist and what its length is ''' - ''' The full path and filename of the new file + ''' The full path and filename of the new file ''' ''' The size in bytes of the destination file, this saves the caller from having to ''' do another FileInfo call ''' - Private Shared Function ValidateDownload(destinationFilename As String) As Long - Dim fileInfo As New FileInfo(destinationFilename) + Private Shared Function ValidateDownload(destinationFileName As String) As Long + Dim fileInfo As New FileInfo(destinationFileName) ' This directory should not be systems Temp Directory because it must be created Assert.NotEqual(Path.GetTempPath, fileInfo.DirectoryName) @@ -48,12 +48,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of InvalidOperationException)( + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -66,7 +66,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -77,16 +79,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - $"{destinationFilename}{separator}", + $"{destinationFileName}{separator}", userName:="", password:="", showUI:=False, @@ -95,7 +97,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -106,12 +110,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -124,7 +128,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -135,12 +141,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of InvalidOperationException)( + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), @@ -153,7 +159,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -162,16 +170,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriOnly_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename) + destinationFileName) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -180,16 +188,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, @@ -197,7 +205,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("The ConnectionTimeout must be greater than 0. (Parameter 'connectionTimeOut')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -206,16 +216,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereUriIsNothing_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, @@ -223,7 +233,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -232,16 +244,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereUriIsNothingAllParameters_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, @@ -250,7 +262,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -259,16 +273,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(address:=CType(Nothing, Uri), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, @@ -277,7 +291,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -286,13 +302,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -301,7 +317,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) CleanUp(listener, testDirectory) End Sub @@ -309,13 +325,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -323,7 +339,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) CleanUp(listener, testDirectory) End Sub @@ -331,7 +347,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) @@ -339,13 +355,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, networkCredentials, showUI:=False, TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -354,13 +370,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithNonexistentTargetDirectory_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -369,7 +385,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) CleanUp(listener, testDirectory) End Sub @@ -377,21 +393,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithOverwriteShowUISpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, TestingConnectionTimeout, overwrite:=True) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadLargeFileSize) + Assert.Equal(DownloadLargeFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -400,16 +416,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithUriOnly_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename) + destinationFileName) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -418,43 +434,44 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UriWithUserNamePassword_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try End Sub - Public Sub DownloadFile_UriWithWrongPassword_Throws(password As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( + Dim ex As Exception = Assert.Throws(Of WebException)( Sub() My.Computer.Network _ .DownloadFile(New Uri(webListener.Address), - destinationFilename, + destinationFileName, DefaultUserName, password) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal(SR.net_webstatus_Unauthorized, ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -463,12 +480,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of InvalidOperationException)( + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -481,7 +498,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -492,16 +511,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - $"{destinationFilename}{separator}", + $"{destinationFileName}{separator}", userName:="", password:="", showUI:=False, @@ -510,7 +529,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -521,12 +542,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -539,7 +560,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -550,12 +573,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of InvalidOperationException)( + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -568,7 +591,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -577,16 +602,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlOnly_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename) + destinationFileName) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -597,19 +622,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(address, - destinationFilename) + destinationFileName) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -618,20 +645,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_UrlWhereDestinationFilenameInvalidAddressOnly_Throws(destinationFilename As String) + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidAddressOnly_Throws(destinationFileName As String) Dim testDirectory As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename) + destinationFileName) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -640,12 +669,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFilename As String) + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFileName As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -657,6 +686,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) Finally CleanUp(listener) End Try @@ -665,12 +696,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests - Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFilename As String) + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFileName As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentNullException)( + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, @@ -683,6 +714,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests UICancelOption.DoNothing) End Sub) + + Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) Finally CleanUp(listener) End Try @@ -691,15 +724,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Assert.Throws(Of IOException)( + Dim ex As Exception = Assert.Throws(Of IOException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -708,8 +741,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) + Assert.Equal($"Could not complete operation since a file already exists in this path '{destinationFileName}'.", ex.Message) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), 1) + Assert.Equal(ValidateDownload(destinationFileName), 1) CleanUp(listener, testDirectory) End Sub @@ -717,16 +751,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(InvalidUrlAddress, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -735,7 +769,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal("'invalidURL' is not a valid remote file address. A valid address should include a protocol, a path and a file name. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -744,16 +779,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of ArgumentException)( + Dim ex As Exception = Assert.Throws(Of ArgumentException)( Sub() My.Computer.Network _ .DownloadFile(InvalidUrlAddress, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=True, @@ -761,7 +796,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal("'invalidURL' is not a valid remote file address. A valid address should include a protocol, a path and a file name. (Parameter 'address')", ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -770,21 +807,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, userName:=Nothing, password:="", showUI:=True, TestingConnectionTimeout, overwrite:=False) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -793,13 +830,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -808,7 +845,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests onUserCancel:=UICancelOption.DoNothing) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) CleanUp(listener, testDirectory) End Sub @@ -816,14 +853,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = CreateTempFile(testDirectory, size:=1) + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -831,7 +868,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFilename), DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -840,18 +877,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithPassword_Success() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Try My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, DefaultUserName, DefaultPassword) - Assert.Equal(ValidateDownload(destinationFilename), actual:=DownloadSmallFileSize) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -860,16 +897,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithTimeOut_Throws() Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( + Dim ex As Exception = Assert.Throws(Of WebException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, userName:="", password:="", showUI:=False, @@ -878,7 +915,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.False(File.Exists(destinationFilename)) + Assert.Equal(SR.net_webstatus_Timeout, ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -889,21 +927,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithWrongPassword_Throw(password As String) Dim testDirectory As String = CreateTempDirectory() - Dim destinationFilename As String = GetDestinationFileName(testDirectory) + Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") Dim listener As HttpListener = webListener.ProcessRequests() Try - Assert.Throws(Of WebException)( + Dim ex As Exception = Assert.Throws(Of WebException)( Sub() My.Computer.Network _ .DownloadFile(webListener.Address, - destinationFilename, + destinationFileName, DefaultUserName, password) End Sub) - Assert.False(File.Exists(destinationFilename)) + + Assert.Equal(SR.net_webstatus_Unauthorized, ex.Message) + Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try From 61add98cd576b6ffe4bc006b5743b3bc92d061c0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 6 May 2024 23:03:44 -0700 Subject: [PATCH 199/342] Update Network tests to use SR values Correct SR strings. --- .../src/Resources/xlf/SR.cs.xlf | 10 ++--- .../Windows/Forms/NetworkDownloadTests.vb | 43 +++++++++++-------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf index c9bb697ae75..9b04fd1c94c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/Microsoft.VisualBasic.Forms/src/Resources/xlf/SR.cs.xlf @@ -178,15 +178,13 @@ - The operation has timed out. - The operation has timed out. + The network operation has timed out. + The network operation has timed out. - The remote server returned an error: (401) Unauthorized. - - The remote server returned an error: (401) Unauthorized. - + The network operation is unauthorized. + The network operation is unauthorized. diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 8cffb05062d..91324c0859d 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -67,7 +67,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -98,7 +98,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -129,7 +130,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -160,7 +162,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -206,7 +208,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("The ConnectionTimeout must be greater than 0. (Parameter 'connectionTimeOut')", ex.Message) + Assert.StartsWith(SR.Network_BadConnectionTimeout, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -234,7 +236,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -263,7 +265,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -292,7 +294,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -451,6 +453,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Try End Sub + Public Sub DownloadFile_UriWithWrongPassword_Throws(password As String) @@ -499,7 +502,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -530,7 +533,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -561,7 +565,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("The given file path ends with a directory separator character. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -592,7 +597,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("destinationFileName needs to include a file name.", ex.Message) + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -635,7 +640,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -659,7 +664,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -687,7 +692,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Finally CleanUp(listener) End Try @@ -715,7 +720,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("Argument cannot be Nothing. (Parameter 'destinationFileName')", ex.Message) + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) Finally CleanUp(listener) End Try @@ -741,7 +746,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal($"Could not complete operation since a file already exists in this path '{destinationFileName}'.", ex.Message) + Assert.Equal(SR.IO_FileExists_Path.Replace("{0}", destinationFileName), ex.Message) Assert.True(Directory.Exists(testDirectory)) Assert.Equal(ValidateDownload(destinationFileName), 1) @@ -769,7 +774,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("'invalidURL' is not a valid remote file address. A valid address should include a protocol, a path and a file name. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) @@ -797,7 +802,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub) - Assert.Equal("'invalidURL' is not a valid remote file address. A valid address should include a protocol, a path and a file name. (Parameter 'address')", ex.Message) + Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", InvalidUrlAddress), ex.Message) Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) From d42914d8c9ee7175c402dc1500ab732da0a1d573 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 12 May 2024 18:16:58 -0700 Subject: [PATCH 200/342] Reorginize Control Test without code changes --- .../System/Windows/Forms/ControlTests.vb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index aa570b816b8..6b17c00d00b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -8,6 +8,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class ControlTests + Public Shared Function FaultingFunc(a As Integer) As Integer + Return a \ 0 + End Function + + Public Shared Sub FaultingMethod() + Throw New DivideByZeroException() + End Sub + Public Sub Control_Invoke_Action_calls_correct_method() Using _control As New Control @@ -92,13 +100,5 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Using End Sub - Public Shared Sub FaultingMethod() - Throw New DivideByZeroException() - End Sub - - Public Shared Function FaultingFunc(a As Integer) As Integer - Return a \ 0 - End Function - End Class End Namespace From 9923da11bfe2e6dca77d73bfe3bf94cd675f6ff5 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 12 May 2024 18:42:04 -0700 Subject: [PATCH 201/342] Sort Private Properties and Move to top of Assembly Info --- .../ApplicationServices/AssemblyInfo.vb | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 23172ce7804..29208aadd03 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -18,6 +18,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' reduced to a number of relevant properties. ''' Public Class AssemblyInfo + ' The assembly with the information. + Private ReadOnly _assembly As Assembly + + ' Since these properties will not change during runtime, they're cached. + ' "" is not Nothing so use Nothing to mark an un-accessed property. + ' Cache the assembly's company name. + Private _companyName As String + ' Cache the assembly's copyright. + Private _copyright As String + ' Cache the assembly's description. + Private _description As String + ' Cache the assembly's product name. + Private _productName As String + ' Cache the assembly's title. + Private _title As String + ' Cache the assembly's trademark. + Private _trademark As String ''' ''' Creates an AssemblyInfo from an assembly @@ -233,23 +250,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End Function - ' The assembly with the information. - Private ReadOnly _assembly As Assembly - - ' Since these properties will not change during runtime, they're cached. - ' "" is not Nothing so use Nothing to mark an un-accessed property. - ' Cache the assembly's description. - Private _description As String - ' Cache the assembly's title. - Private _title As String - ' Cache the assembly's product name. - Private _productName As String - ' Cache the assembly's company name. - Private _companyName As String - ' Cache the assembly's trademark. - Private _trademark As String - ' Cache the assembly's copyright. - Private _copyright As String - End Class End Namespace From 9db841bc8684cac3b5deba093a61aa6412fe55d9 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 12 May 2024 18:56:42 -0700 Subject: [PATCH 202/342] Move Private totop of ConsoleApplicationBase --- .../ApplicationServices/ConsoleApplicationBase.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 10e30935252..ffb5c992efa 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -11,6 +11,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Class ConsoleApplicationBase : Inherits ApplicationBase + ' Lazy-initialized and cached collection of command line arguments. + Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) + ''' ''' Constructs the application Shutdown/Startup model object ''' @@ -58,7 +61,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property - ' Lazy-initialized and cached collection of command line arguments. - Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) End Class 'ApplicationBase End Namespace From cf0ae8eabd3a52c231b5a3e2a75d419e47b9f75a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 15 May 2024 15:30:22 -0700 Subject: [PATCH 203/342] Fix XML Comment and spacing --- .../WindowsFormsApplicationBase.WinFormsAppContext.vb | 1 + .../src/Microsoft/VisualBasic/Devices/Clock.vb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 598aa8996b2..e7bf1f2268a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -49,6 +49,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub + End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index 9a0ec54011e..41f9c14cf7f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -9,11 +9,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Clock +#Disable Warning IDE0049 ' Simplify Names, Justification:= + ''' ''' Gets a Date that is the current local date and time on this computer. ''' ''' A Date whose value is the current date and time. -#Disable Warning IDE0049 ' Simplify Names, Justification:= Public ReadOnly Property LocalTime() As DateTime Get Return DateTime.Now @@ -30,6 +31,7 @@ Namespace Microsoft.VisualBasic.Devices Return DateTime.UtcNow End Get End Property + #Enable Warning IDE0049 ' Simplify Names ''' From 9b6d75553cda4bbc13ff32e944bd6e857b5f93b4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 22 May 2024 19:52:47 -0700 Subject: [PATCH 204/342] Add space to Enum --- .../src/Microsoft/VisualBasic/Devices/Audio.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index b1e2e6025a5..720632fbfdd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -11,6 +11,7 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file ''' Public Enum AudioPlayMode + ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous Background = 1 'Asynchronous From f405aa6b53727ce2b36ef9df60364813e747eba3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 22 May 2024 19:56:13 -0700 Subject: [PATCH 205/342] Fix Spacing --- .../src/Microsoft/VisualBasic/Devices/Audio.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 720632fbfdd..b1e2e6025a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -11,7 +11,6 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file ''' Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous Background = 1 'Asynchronous From 9bda02dfd677f1e7d87c223cc5f8717e2add2d8a Mon Sep 17 00:00:00 2001 From: "Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box)" Date: Thu, 23 May 2024 21:45:01 -0300 Subject: [PATCH 206/342] Makes DataGridView row header left border have proper luminosity in RightToLeft mode, both with VisualStyles enabled or disabled --- .../Forms/Controls/DataGridView/DataGridView.cs | 4 ++-- .../Controls/DataGridView/DataGridViewRow.cs | 4 ++-- .../System/Windows/Forms/DataGridViewRowTests.cs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs index 1bd46beaa36..7cc6e1cde49 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs @@ -505,7 +505,7 @@ public virtual DataGridViewAdvancedBorderStyle AdjustedTopLeftHeaderBorderStyle dgvabs = new DataGridViewAdvancedBorderStyle(); if (RightToLeftInternal) { - dgvabs.LeftInternal = DataGridViewAdvancedCellBorderStyle.Outset; + dgvabs.LeftInternal = DataGridViewAdvancedCellBorderStyle.Single; } else { @@ -1250,7 +1250,7 @@ public DataGridViewCellBorderStyle CellBorderStyle break; case DataGridViewCellBorderStyle.Raised: - AdvancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Outset; + AdvancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single; break; case DataGridViewCellBorderStyle.Sunken: diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRow.cs index 703e4f6053b..130498f5fe9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRow.cs @@ -418,7 +418,7 @@ public virtual DataGridViewAdvancedBorderStyle AdjustRowHeaderBorderStyle( if (DataGridView.RightToLeftInternal) { - dataGridViewAdvancedBorderStylePlaceholder.LeftInternal = DataGridViewAdvancedCellBorderStyle.Outset; + dataGridViewAdvancedBorderStylePlaceholder.LeftInternal = DataGridViewAdvancedCellBorderStyle.Single; } else { @@ -522,7 +522,7 @@ public virtual DataGridViewAdvancedBorderStyle AdjustRowHeaderBorderStyle( case DataGridViewAdvancedCellBorderStyle.OutsetPartial: if (DataGridView is not null && DataGridView.RightToLeftInternal) { - dataGridViewAdvancedBorderStylePlaceholder.LeftInternal = DataGridViewAdvancedCellBorderStyle.Outset; + dataGridViewAdvancedBorderStylePlaceholder.LeftInternal = DataGridViewAdvancedCellBorderStyle.Single; dataGridViewAdvancedBorderStylePlaceholder.RightInternal = DataGridViewAdvancedCellBorderStyle.OutsetDouble; } else diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowTests.cs index 540e18efca7..242a5057e65 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowTests.cs @@ -3581,7 +3581,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { true, true, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, isFirstDisplayedRow, isLastVisibleRow, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.None, DataGridViewAdvancedCellBorderStyle.None + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.None, DataGridViewAdvancedCellBorderStyle.None }; } } @@ -3596,7 +3596,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { true, false, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, true, isLastVisibleRow, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.None + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.None }; } @@ -3608,7 +3608,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, true, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, true, true, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.Outset + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.Outset }; yield return new object[] { @@ -3618,7 +3618,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, true, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, true, false, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetPartial + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetPartial }; yield return new object[] { @@ -3628,7 +3628,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, true, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, false, true, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.Outset + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.Outset }; yield return new object[] { @@ -3638,7 +3638,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, true, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, false, false, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.OutsetPartial + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.OutsetPartial }; yield return new object[] { @@ -3648,7 +3648,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, false, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, true, true, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.Outset }; yield return new object[] { @@ -3658,7 +3658,7 @@ public static IEnumerable AdjustRowHeaderBorderStyle_WithDataGridView_ yield return new object[] { false, false, RightToLeft.Yes, DataGridViewAdvancedCellBorderStyle.OutsetPartial, true, true, false, false, - true, DataGridViewAdvancedCellBorderStyle.Outset, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.OutsetPartial + true, DataGridViewAdvancedCellBorderStyle.Single, DataGridViewAdvancedCellBorderStyle.OutsetDouble, DataGridViewAdvancedCellBorderStyle.OutsetPartial, DataGridViewAdvancedCellBorderStyle.OutsetPartial }; // Single. From e1ed8935face4a9e86f3af5b38a1c8118845d95f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 5 Jun 2024 23:48:40 -0700 Subject: [PATCH 207/342] Update Clipboard tests --- .../Windows/Forms/ClipboardProxyTests.vb | 2 +- .../MyServices/ClipboardProxyTests.cs | 2 +- .../ComDisabledTests/ClipboardComTests.cs | 17 +- .../System/Windows/Forms/ClipboardTests.cs | 398 +++++++++--------- 4 files changed, 219 insertions(+), 200 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index a0c7ba1592c..f4ab3976f51 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' - + Public Class ClipboardProxyTests diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 9bb6294428c..21989e239f5 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualBasic.MyServices.Tests; -[Collection("Clipboard Tests")] +[Collection("Sequential")] [CollectionDefinition("Clipboard Tests", DisableParallelization = true)] public class ClipboardProxyTests { diff --git a/src/System.Windows.Forms/tests/ComDisabledTests/ClipboardComTests.cs b/src/System.Windows.Forms/tests/ComDisabledTests/ClipboardComTests.cs index b6d6d11b0d5..c260c3dd771 100644 --- a/src/System.Windows.Forms/tests/ComDisabledTests/ClipboardComTests.cs +++ b/src/System.Windows.Forms/tests/ComDisabledTests/ClipboardComTests.cs @@ -1,26 +1,31 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#nullable enable + using System.Drawing; namespace System.Windows.Forms.Tests; +[Collection("Sequential")] public partial class ClipboardTests { [WinFormsFact] public void Clipboard_SetText_InvokeString_GetReturnsExpected() { Clipboard.SetText("text"); - Assert.Equal("text", Clipboard.GetText()); - Assert.True(Clipboard.ContainsText()); + + Clipboard.GetText().Should().Be("text"); + Clipboard.ContainsText().Should().BeTrue(); } [WinFormsFact] - public void ClipBoard_SetData_CustomFormat_Color() + public void Clipboard_SetData_CustomFormat_Color() { - string format = nameof(ClipBoard_SetData_CustomFormat_Color); + string format = nameof(Clipboard_SetData_CustomFormat_Color); Clipboard.SetData(format, Color.Black); - Assert.True(Clipboard.ContainsData(format)); - Assert.Equal(Color.Black, Clipboard.GetData(format)); + + Clipboard.ContainsData(format).Should().BeTrue(); + Clipboard.GetData(format).Should().Be(Color.Black); } } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs index 6139975fe90..41d71a8be23 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#nullable enable + using System.Collections.Specialized; using System.ComponentModel; using System.Drawing; @@ -12,7 +14,7 @@ namespace System.Windows.Forms.Tests; -[Collection("Clipboard Tests")] +[Collection("Sequential")] [CollectionDefinition("Clipboard Tests", DisableParallelization = true)] public partial class ClipboardTests { @@ -20,31 +22,36 @@ public partial class ClipboardTests public void Clipboard_Clear_InvokeMultipleTimes_Success() { Clipboard.Clear(); - Assert.False(Clipboard.ContainsAudio()); - Assert.False(Clipboard.ContainsData("format")); - Assert.False(Clipboard.ContainsFileDropList()); - Assert.False(Clipboard.ContainsImage()); - Assert.False(Clipboard.ContainsText()); + Clipboard.ContainsAudio().Should().BeFalse(); + Clipboard.ContainsData("format").Should().BeFalse(); + Clipboard.ContainsFileDropList().Should().BeFalse(); + Clipboard.ContainsImage().Should().BeFalse(); + Clipboard.ContainsText().Should().BeFalse(); Clipboard.Clear(); - Assert.False(Clipboard.ContainsAudio()); - Assert.False(Clipboard.ContainsData("format")); - Assert.False(Clipboard.ContainsFileDropList()); - Assert.False(Clipboard.ContainsImage()); - Assert.False(Clipboard.ContainsText()); + Clipboard.ContainsAudio().Should().BeFalse(); + Clipboard.ContainsData("format").Should().BeFalse(); + Clipboard.ContainsFileDropList().Should().BeFalse(); + Clipboard.ContainsImage().Should().BeFalse(); + Clipboard.ContainsText().Should().BeFalse(); } - [Fact] // x-thread - public void Clipboard_Clear_NotSta_ThrowsThreadStateException() + public static TheoryData> ContainsMethodsTheoryData => new() { - Assert.Throws(() => Clipboard.Clear()); - } + Clipboard.ContainsAudio, + Clipboard.ContainsFileDropList, + Clipboard.ContainsImage, + Clipboard.ContainsText + }; - [WinFormsFact] - public void Clipboard_ContainsAudio_InvokeMultipleTimes_Success() + [WinFormsTheory] + [MemberData(nameof(ContainsMethodsTheoryData))] + public void Clipboard_Contains_InvokeMultipleTimes_Success(Func contains) { - bool result = Clipboard.ContainsAudio(); - Assert.Equal(result, Clipboard.ContainsAudio()); + Clipboard.Clear(); + bool result = contains.Invoke(); + contains.Invoke().Should().Be(result); + result.Should().BeFalse(); } [WinFormsTheory] @@ -52,105 +59,87 @@ public void Clipboard_ContainsAudio_InvokeMultipleTimes_Success() public void Clipboard_ContainsData_InvokeMultipleTimes_Success(string format) { bool result = Clipboard.ContainsData(format); - Assert.Equal(result, Clipboard.ContainsData(format)); - Assert.False(result); - } - - [WinFormsFact] - public void Clipboard_ContainsFileDropList_InvokeMultipleTimes_Success() - { - bool result = Clipboard.ContainsFileDropList(); - Assert.Equal(result, Clipboard.ContainsFileDropList()); - } - - [WinFormsFact] - public void Clipboard_ContainsImage_InvokeMultipleTimes_Success() - { - bool result = Clipboard.ContainsImage(); - Assert.Equal(result, Clipboard.ContainsImage()); - } - - [WinFormsFact] - public void Clipboard_ContainsText_InvokeMultipleTimes_Success() - { - bool result = Clipboard.ContainsText(); - Assert.Equal(result, Clipboard.ContainsText()); + Clipboard.ContainsData(format).Should().Be(result); + result.Should().BeFalse(); } [WinFormsTheory] [EnumData] - public void Clipboard_ContainsText_InvokeTextDataFormatMultipleTimes_Success(TextDataFormat format) + public void Clipboard_ContainsText_TextDataFormat_InvokeMultipleTimes_Success(TextDataFormat format) { bool result = Clipboard.ContainsText(format); - Assert.Equal(result, Clipboard.ContainsText(format)); + Clipboard.ContainsText(format).Should().Be(result); } [WinFormsTheory] [InvalidEnumData] public void Clipboard_ContainsText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { - Assert.Throws("format", () => Clipboard.ContainsText(format)); + Action action = () => Clipboard.ContainsText(format); + action.Should().Throw().WithParameterName("format"); } [WinFormsFact] public void Clipboard_GetAudioStream_InvokeMultipleTimes_Success() { - Stream result = Clipboard.GetAudioStream(); - Assert.Equal(result, Clipboard.GetAudioStream()); + Stream? result = Clipboard.GetAudioStream(); + (Clipboard.GetAudioStream() == result).Should().BeTrue(); } [WinFormsTheory] [InlineData(null)] [InlineData("")] [InlineData("\t")] - public void Clipboard_GetData_NullOrEmptyFormat_Returns_Null(string format) + public void Clipboard_GetData_NullOrEmptyFormat_Returns_Null(string? format) { - object result = Clipboard.GetData(format); - Assert.Equal(result, Clipboard.GetData(format)); - Assert.Null(result); + object? result = Clipboard.GetData(format!); + result.Should().BeNull(); + result = Clipboard.GetData(format!); + result.Should().BeNull(); } [WinFormsFact] public void Clipboard_GetDataObject_InvokeMultipleTimes_Success() { - object result = Clipboard.GetDataObject(); - Assert.NotEqual(result, Clipboard.GetDataObject()); + IDataObject? result = Clipboard.GetDataObject(); + (result == Clipboard.GetDataObject()).Should().BeFalse(); } [WinFormsFact] public void Clipboard_GetFileDropList_InvokeMultipleTimes_Success() { - bool result = Clipboard.ContainsFileDropList(); - Assert.Equal(result, Clipboard.ContainsFileDropList()); + StringCollection result = Clipboard.GetFileDropList(); + Clipboard.GetFileDropList().Should().BeEquivalentTo(result); } [WinFormsFact] public void Clipboard_GetImage_InvokeMultipleTimes_Success() { - bool result = Clipboard.ContainsImage(); - Assert.Equal(result, Clipboard.ContainsImage()); + Image? result = Clipboard.GetImage(); + Clipboard.GetImage().Should().BeEquivalentTo(result); } [WinFormsFact] public void Clipboard_GetText_InvokeMultipleTimes_Success() { - bool result = Clipboard.ContainsText(); - Assert.Equal(result, Clipboard.ContainsText()); + string result = Clipboard.GetText(); + Clipboard.GetText().Should().Be(result); } [WinFormsTheory] [EnumData] - public void Clipboard_GetText_InvokeTextDataFormatMultipleTimes_Success(TextDataFormat format) + public void Clipboard_GetText_TextDataFormat_InvokeMultipleTimes_Success(TextDataFormat format) { string result = Clipboard.GetText(format); - Assert.Equal(result, Clipboard.GetText(format)); + Clipboard.GetText(format).Should().Be(result); } [WinFormsTheory] [InvalidEnumData] public void Clipboard_GetText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { - Assert.Throws("format", () => Clipboard.GetText(format)); + Action action = () => Clipboard.GetText(format); + action.Should().Throw().WithParameterName("format"); } [WinFormsFact] @@ -158,10 +147,11 @@ public void Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() { byte[] audioBytes = [1, 2, 3]; Clipboard.SetAudio(audioBytes); - Assert.Equal(audioBytes, Assert.IsType(Clipboard.GetAudioStream()).ToArray()); - Assert.Equal(audioBytes, Assert.IsType(Clipboard.GetData(DataFormats.WaveAudio)).ToArray()); - Assert.True(Clipboard.ContainsAudio()); - Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); + + Clipboard.GetAudioStream().Should().BeOfType().Which.ToArray().Should().Equal(audioBytes); + Clipboard.GetData(DataFormats.WaveAudio).Should().BeOfType().Which.ToArray().Should().Equal(audioBytes); + Clipboard.ContainsAudio().Should().BeTrue(); + Clipboard.ContainsData(DataFormats.WaveAudio).Should().BeTrue(); } [WinFormsFact] @@ -169,16 +159,18 @@ public void Clipboard_SetAudio_InvokeEmptyByteArray_GetReturnsExpected() { byte[] audioBytes = Array.Empty(); Clipboard.SetAudio(audioBytes); - Assert.Null(Clipboard.GetAudioStream()); - Assert.Null(Clipboard.GetData(DataFormats.WaveAudio)); - Assert.True(Clipboard.ContainsAudio()); - Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); + + Clipboard.GetAudioStream().Should().BeNull(); + Clipboard.GetData(DataFormats.WaveAudio).Should().BeNull(); + Clipboard.ContainsAudio().Should().BeTrue(); + Clipboard.ContainsData(DataFormats.WaveAudio).Should().BeTrue(); } [WinFormsFact] public void Clipboard_SetAudio_NullAudioBytes_ThrowsArgumentNullException() { - Assert.Throws("audioBytes", () => Clipboard.SetAudio((byte[])null)); + Action action = () => Clipboard.SetAudio((byte[])null!); + action.Should().Throw().WithParameterName("audioBytes"); } [WinFormsFact] @@ -187,65 +179,58 @@ public void Clipboard_SetAudio_InvokeStream_GetReturnsExpected() byte[] audioBytes = [1, 2, 3]; using MemoryStream audioStream = new(audioBytes); Clipboard.SetAudio(audioStream); - Assert.Equal(audioBytes, Assert.IsType(Clipboard.GetAudioStream()).ToArray()); - Assert.Equal(audioBytes, Assert.IsType(Clipboard.GetData(DataFormats.WaveAudio)).ToArray()); - Assert.True(Clipboard.ContainsAudio()); - Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); + + Clipboard.GetAudioStream().Should().BeOfType().Which.ToArray().Should().Equal(audioBytes); + Clipboard.GetData(DataFormats.WaveAudio).Should().BeOfType().Which.ToArray().Should().Equal(audioBytes); + Clipboard.ContainsAudio().Should().BeTrue(); + Clipboard.ContainsData(DataFormats.WaveAudio).Should().BeTrue(); } [WinFormsFact] public void Clipboard_SetAudio_InvokeEmptyStream_GetReturnsExpected() { - MemoryStream audioStream = new(); + using MemoryStream audioStream = new(); Clipboard.SetAudio(audioStream); - Assert.Null(Clipboard.GetAudioStream()); - Assert.Null(Clipboard.GetData(DataFormats.WaveAudio)); - Assert.True(Clipboard.ContainsAudio()); - Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); + + Clipboard.GetAudioStream().Should().BeNull(); + Clipboard.GetData(DataFormats.WaveAudio).Should().BeNull(); + Clipboard.ContainsAudio().Should().BeTrue(); + Clipboard.ContainsData(DataFormats.WaveAudio).Should().BeTrue(); } [WinFormsFact] public void Clipboard_SetAudio_NullAudioStream_ThrowsArgumentNullException() { - Assert.Throws("audioStream", () => Clipboard.SetAudio((Stream)null)); - } - - [Fact] // x-thread - public void Clipboard_SetAudio_NotSta_ThrowsThreadStateException() - { - Assert.Throws(() => Clipboard.SetAudio(Array.Empty())); - Assert.Throws(() => Clipboard.SetAudio(new MemoryStream())); + Action action = () => Clipboard.SetAudio((Stream)null!); + action.Should().Throw().WithParameterName("audioStream"); } [WinFormsTheory] [InlineData("format", null)] [InlineData("format", 1)] - public void Clipboard_SetData_Invoke_GetReturnsExpected(string format, object data) - { - Clipboard.SetData(format, data); - Assert.Equal(data, Clipboard.GetData(format)); - Assert.True(Clipboard.ContainsData(format)); - } - - [WinFormsFact] - public void Clipboard_SetData_NullFormat_ThrowsArgumentNullException() + public void Clipboard_SetData_Invoke_GetReturnsExpected(string format, object? data) { - Assert.Throws(() => Clipboard.SetData(format: null, data: new object())); + Clipboard.SetData(format, data!); + Clipboard.GetData(format).Should().Be(data); + Clipboard.ContainsData(format).Should().BeTrue(); } [WinFormsTheory] [InlineData("")] [InlineData(" ")] [InlineData("\t")] - public void Clipboard_SetData_EmptyOrWhitespaceFormat_ThrowsArgumentException(string format) + [InlineData(null)] + public void Clipboard_SetData_EmptyOrWhitespaceFormat_ThrowsArgumentException(string? format) { - Assert.Throws(() => Clipboard.SetData(format, data: null)); + Action action = () => Clipboard.SetData(format!, data: null!); + action.Should().Throw().WithParameterName("format"); } - [Fact] // x-thread - public void Clipboard_SetData_NotSta_ThrowsThreadStateException() + [WinFormsFact] + public void Clipboard_SetData_null_Success() { - Assert.Throws(() => Clipboard.SetData("format", data: null)); + Action action = () => Clipboard.SetData("MyData", data: null!); + action.Should().NotThrow(); } [WinFormsTheory] @@ -254,8 +239,11 @@ public void Clipboard_SetData_NotSta_ThrowsThreadStateException() public void Clipboard_SetDataObject_InvokeObjectNotIComDataObject_GetReturnsExpected(object data) { Clipboard.SetDataObject(data); - Assert.Equal(data, Clipboard.GetDataObject().GetData(data.GetType())); - Assert.True(Clipboard.ContainsData(data.GetType().FullName)); + + var dataObject = Clipboard.GetDataObject(); + Assert.NotNull(dataObject); + dataObject.GetData(data.GetType()).Should().Be(data); + Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); } [WinFormsTheory] @@ -265,8 +253,11 @@ public void Clipboard_SetDataObject_InvokeObjectIComDataObject_GetReturnsExpecte { DataObject dataObject = new(data); Clipboard.SetDataObject(dataObject); - Assert.Equal(data, Clipboard.GetDataObject().GetData(data.GetType())); - Assert.True(Clipboard.ContainsData(data.GetType().FullName)); + + var actual = Clipboard.GetDataObject(); + Assert.NotNull(actual); + actual.GetData(data.GetType()).Should().Be(data); + Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); } [WinFormsTheory] @@ -277,8 +268,11 @@ public void Clipboard_SetDataObject_InvokeObjectIComDataObject_GetReturnsExpecte public void Clipboard_SetDataObject_InvokeObjectBoolNotIComDataObject_GetReturnsExpected(object data, bool copy) { Clipboard.SetDataObject(data, copy); - Assert.Equal(data, Clipboard.GetDataObject().GetData(data.GetType())); - Assert.True(Clipboard.ContainsData(data.GetType().FullName)); + + var dataObject = Clipboard.GetDataObject(); + Assert.NotNull(dataObject); + dataObject.GetData(data.GetType()).Should().Be(data); + Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); } [WinFormsTheory] @@ -290,8 +284,10 @@ public void Clipboard_SetDataObject_InvokeObjectBoolIComDataObject_GetReturnsExp { DataObject dataObject = new(data); Clipboard.SetDataObject(dataObject, copy, retryTimes, retryDelay); - Assert.Equal(data, Clipboard.GetDataObject().GetData(data.GetType())); - Assert.True(Clipboard.ContainsData(data.GetType().FullName)); + + DataObject actual = Clipboard.GetDataObject().Should().BeOfType().Which; + actual.GetData(data.GetType()).Should().Be(data); + Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); } [WinFormsTheory] @@ -302,36 +298,73 @@ public void Clipboard_SetDataObject_InvokeObjectBoolIComDataObject_GetReturnsExp public void Clipboard_SetDataObject_InvokeObjectBoolIntIntNotIComDataObject_GetReturnsExpected(object data, bool copy, int retryTimes, int retryDelay) { Clipboard.SetDataObject(data, copy, retryTimes, retryDelay); - Assert.Equal(data, Clipboard.GetDataObject().GetData(data.GetType())); - Assert.True(Clipboard.ContainsData(data.GetType().FullName)); + + DataObject dataObject = Clipboard.GetDataObject().Should().BeOfType().Which; + dataObject.GetData(data.GetType()).Should().Be(data); + Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); } - [WinFormsFact] - public void Clipboard_SetDataObject_NullData_ThrowsArgumentNullException() + public static TheoryData Clipboard_SetDataObject_Null_TheoryData => new() + { + () => Clipboard.SetDataObject(null!), + () => Clipboard.SetDataObject(null!, copy: true), + () => Clipboard.SetDataObject(null!, copy: true, retryTimes: 10, retryDelay: 0) + }; + + [WinFormsTheory] + [MemberData(nameof(Clipboard_SetDataObject_Null_TheoryData))] + public void Clipboard_SetDataObject_NullData_ThrowsArgumentNullException(Action action) { - Assert.Throws("data", () => Clipboard.SetDataObject(null)); - Assert.Throws("data", () => Clipboard.SetDataObject(null, copy: true)); - Assert.Throws("data", () => Clipboard.SetDataObject(null, copy: true, retryTimes: 10, retryDelay: 0)); + action.Should().Throw().WithParameterName("data"); } [WinFormsFact] public void Clipboard_SetDataObject_NegativeRetryTimes_ThrowsArgumentOutOfRangeException() { - Assert.Throws("retryTimes", () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: -1, retryDelay: 0)); + Action action = () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: -1, retryDelay: 0); + action.Should().Throw().WithParameterName("retryTimes"); } [WinFormsFact] public void Clipboard_SetDataObject_NegativeRetryDelay_ThrowsArgumentOutOfRangeException() { - Assert.Throws("retryDelay", () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: 10, retryDelay: -1)); + Action action = () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: 10, retryDelay: -1); + action.Should().Throw().WithParameterName("retryDelay"); + } + + public static TheoryData NotAnStaTheoryData => new() + { + Clipboard.Clear, + () => Clipboard.SetAudio(Array.Empty()), + () => Clipboard.SetAudio(new MemoryStream()), + () => Clipboard.SetData("format", data: null!), + () => Clipboard.SetDataObject(null!), + () => Clipboard.SetDataObject(null!, copy: true), + () => Clipboard.SetDataObject(null!, copy: true, retryTimes: 10, retryDelay: 0), + () => Clipboard.SetFileDropList(new StringCollection { "filePath" }), + () => Clipboard.SetText("text"), + () => Clipboard.SetText("text", TextDataFormat.Text) + }; + + [Theory] // x-thread + [MemberData(nameof(NotAnStaTheoryData))] + public void Clipboard_NotSta_ThrowsThreadStateException(Action action) + { + action.Should().Throw(); } [Fact] // x-thread - public void Clipboard_SetDataObject_NotSta_ThrowsThreadStateException() + public void Clipboard_SetImage_NotSta_ThrowsThreadStateException() { - Assert.Throws(() => Clipboard.SetDataObject(null)); - Assert.Throws(() => Clipboard.SetDataObject(null, copy: true)); - Assert.Throws(() => Clipboard.SetDataObject(null, copy: true, retryTimes: 10, retryDelay: 0)); + using Bitmap bitmap = new(10, 10); + using Metafile metafile = new("bitmaps/telescope_01.wmf"); + using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); + Action action = () => Clipboard.SetImage(bitmap); + action.Should().Throw(); + action = () => Clipboard.SetImage(metafile); + action.Should().Throw(); + action = () => Clipboard.SetImage(enhancedMetafile); + action.Should().Throw(); } [WinFormsFact] @@ -342,23 +375,24 @@ public void Clipboard_SetFileDropList_Invoke_GetReturnsExpected() "filePath", "filePath2" ]; - Clipboard.SetFileDropList(filePaths); - Assert.Equal(filePaths, Clipboard.GetFileDropList()); - Assert.True(Clipboard.ContainsFileDropList()); + + Clipboard.GetFileDropList().Should().BeEquivalentTo(filePaths); + Clipboard.ContainsFileDropList().Should().BeTrue(); } [WinFormsFact] public void Clipboard_SetFileDropList_NullFilePaths_ThrowsArgumentNullException() { - Assert.Throws("filePaths", () => Clipboard.SetFileDropList(null)); + Action action = () => Clipboard.SetFileDropList(null!); + action.Should().Throw().WithParameterName("filePaths"); } [WinFormsFact] public void Clipboard_SetFileDropList_EmptyFilePaths_ThrowsArgumentException() { - StringCollection filePaths = []; - Assert.Throws(() => Clipboard.SetFileDropList(filePaths)); + Action action = static () => Clipboard.SetFileDropList([]); + action.Should().Throw(); } [WinFormsTheory] @@ -370,17 +404,8 @@ public void Clipboard_SetFileDropList_InvalidFileInPaths_ThrowsArgumentException [ filePath ]; - Assert.Throws(() => Clipboard.SetFileDropList(filePaths)); - } - - [Fact] // x-thread - public void Clipboard_SetFileDropList_NotSta_ThrowsThreadStateException() - { - StringCollection filePaths = - [ - "filePath" - ]; - Assert.Throws(() => Clipboard.SetFileDropList(filePaths)); + Action action = () => Clipboard.SetFileDropList(filePaths); + action.Should().Throw(); } [WinFormsFact] @@ -390,9 +415,9 @@ public void Clipboard_SetImage_InvokeBitmap_GetReturnsExpected() bitmap.SetPixel(1, 2, Color.FromArgb(0x01, 0x02, 0x03, 0x04)); Clipboard.SetImage(bitmap); Bitmap result = Assert.IsType(Clipboard.GetImage()); - Assert.Equal(bitmap.Size, result.Size); - Assert.Equal(Color.FromArgb(0xFF, 0xD2, 0xD2, 0xD2), result.GetPixel(1, 2)); - Assert.True(Clipboard.ContainsImage()); + result.Size.Should().Be(bitmap.Size); + result.GetPixel(1, 2).Should().Be(Color.FromArgb(0xFF, 0xD2, 0xD2, 0xD2)); + Clipboard.ContainsImage().Should().BeTrue(); } [WinFormsFact] @@ -400,8 +425,8 @@ public void Clipboard_SetImage_InvokeMetafile_GetReturnsExpected() { using Metafile metafile = new("bitmaps/telescope_01.wmf"); Clipboard.SetImage(metafile); - Assert.Null(Clipboard.GetImage()); - Assert.True(Clipboard.ContainsImage()); + Clipboard.GetImage().Should().BeNull(); + Clipboard.ContainsImage().Should().BeTrue(); } [WinFormsFact] @@ -409,25 +434,15 @@ public void Clipboard_SetImage_InvokeEnhancedMetafile_GetReturnsExpected() { using Metafile metafile = new("bitmaps/milkmateya01.emf"); Clipboard.SetImage(metafile); - Assert.Null(Clipboard.GetImage()); - Assert.True(Clipboard.ContainsImage()); + Clipboard.GetImage().Should().BeNull(); + Clipboard.ContainsImage().Should().BeTrue(); } [WinFormsFact] public void Clipboard_SetImage_NullImage_ThrowsArgumentNullException() { - Assert.Throws("image", () => Clipboard.SetImage(null)); - } - - [Fact] // x-thread - public void Clipboard_SetImage_NotSta_ThrowsThreadStateException() - { - using Bitmap bitmap = new(10, 10); - using Metafile metafile = new("bitmaps/telescope_01.wmf"); - using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); - Assert.Throws(() => Clipboard.SetImage(bitmap)); - Assert.Throws(() => Clipboard.SetImage(metafile)); - Assert.Throws(() => Clipboard.SetImage(enhancedMetafile)); + Action action = () => Clipboard.SetImage(null!); + action.Should().Throw().WithParameterName("image"); } [WinFormsTheory] @@ -435,41 +450,37 @@ public void Clipboard_SetImage_NotSta_ThrowsThreadStateException() public void Clipboard_SetText_InvokeStringTextDataFormat_GetReturnsExpected(TextDataFormat format) { Clipboard.SetText("text", format); - Assert.Equal("text", Clipboard.GetText(format)); - Assert.True(Clipboard.ContainsText(format)); + Clipboard.GetText(format).Should().Be("text"); + Clipboard.ContainsText(format).Should().BeTrue(); } [WinFormsTheory] [NullAndEmptyStringData] public void Clipboard_SetText_NullOrEmptyText_ThrowsArgumentNullException(string text) { - Assert.Throws("text", () => Clipboard.SetText(text)); - Assert.Throws("text", () => Clipboard.SetText(text, TextDataFormat.Text)); + Action action = () => Clipboard.SetText(text); + action.Should().Throw().WithParameterName("text"); + action = () => Clipboard.SetText(text, TextDataFormat.Text); + action.Should().Throw().WithParameterName("text"); } [WinFormsTheory] [InvalidEnumData] public void Clipboard_SetText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { - Assert.Throws("format", () => Clipboard.SetText("text", format)); - } - - [Fact] // x-thread - public void Clipboard_SetText_NotSta_ThrowsThreadStateException() - { - Assert.Throws(() => Clipboard.SetText("text")); - Assert.Throws(() => Clipboard.SetText("text", TextDataFormat.Text)); + Action action = () => Clipboard.SetText("text", format); + action.Should().Throw().WithParameterName("format"); } [WinFormsFact] - public void ClipBoard_SetData_CustomFormat_Color_BinaryFormatterDisabled_SerializesException() + public void Clipboard_SetData_CustomFormat_Color_BinaryFormatterDisabled_SerializesException() { using BinaryFormatterScope scope = new(enable: false); - string format = nameof(ClipBoard_SetData_CustomFormat_Color_BinaryFormatterDisabled_SerializesException); + string format = nameof(Clipboard_SetData_CustomFormat_Color_BinaryFormatterDisabled_SerializesException); // This will fail and NotSupportedException will be put on the Clipboard instead. Clipboard.SetData(format, Color.Black); - Assert.True(Clipboard.ContainsData(format)); + Clipboard.ContainsData(format).Should().BeTrue(); using MemoryStream stream = new(); #pragma warning disable SYSLIB0011 // Type or member is obsolete @@ -488,7 +499,7 @@ public void ClipBoard_SetData_CustomFormat_Color_BinaryFormatterDisabled_Seriali } [WinFormsFact] - public unsafe void ClipBoard_GetClipboard_ReturnsProxy() + public unsafe void Clipboard_GetClipboard_ReturnsProxy() { DataObject data = new(); using var dataScope = ComHelpers.GetComScope(data); @@ -510,27 +521,30 @@ public unsafe void ClipBoard_GetClipboard_ReturnsProxy() } [WinFormsFact] - public void ClipBoard_Set_DoesNotWrapTwice() + public void Clipboard_Set_DoesNotWrapTwice() { string realDataObject = string.Empty; Clipboard.SetDataObject(realDataObject); - IDataObject clipboardDataObject = Clipboard.GetDataObject(); - clipboardDataObject.Should().BeOfType(typeof(DataObject)); - ((DataObject)clipboardDataObject).IsWrappedForClipboard.Should().BeTrue(); - Clipboard.SetDataObject(clipboardDataObject); - IDataObject clipboardDataObject2 = Clipboard.GetDataObject(); + IDataObject? clipboardDataObject = Clipboard.GetDataObject(); + var dataObject = clipboardDataObject.Should().BeOfType().Which; + dataObject.IsWrappedForClipboard.Should().BeTrue(); + + Clipboard.SetDataObject(clipboardDataObject!); + IDataObject? clipboardDataObject2 = Clipboard.GetDataObject(); + clipboardDataObject2.Should().NotBeNull(); clipboardDataObject2.Should().BeSameAs(clipboardDataObject); } [WinFormsFact] - public void ClipBoard_GetSet_RoundTrip_ReturnsExpected() + public void Clipboard_GetSet_RoundTrip_ReturnsExpected() { CustomDataObject realDataObject = new(); Clipboard.SetDataObject(realDataObject); - IDataObject clipboardDataObject = Clipboard.GetDataObject(); + + IDataObject? clipboardDataObject = Clipboard.GetDataObject(); clipboardDataObject.Should().BeSameAs(realDataObject); - clipboardDataObject.GetDataPresent("Foo").Should().BeTrue(); + clipboardDataObject!.GetDataPresent("Foo").Should().BeTrue(); clipboardDataObject.GetData("Foo").Should().Be("Bar"); } @@ -558,9 +572,9 @@ ComTypes.IEnumFORMATETC ComTypes.IDataObject.EnumFormatEtc(ComTypes.DATADIR dire } int ComTypes.IDataObject.GetCanonicalFormatEtc(ref ComTypes.FORMATETC formatIn, out ComTypes.FORMATETC formatOut) => throw new NotImplementedException(); - object IDataObject.GetData(string format, bool autoConvert) => format == "Foo" ? "Bar" : null; - object IDataObject.GetData(string format) => format == "Foo" ? "Bar" : null; - object IDataObject.GetData(Type format) => null; + object IDataObject.GetData(string format, bool autoConvert) => format == "Foo" ? "Bar" : null!; + object IDataObject.GetData(string format) => format == "Foo" ? "Bar" : null!; + object IDataObject.GetData(Type format) => null!; void ComTypes.IDataObject.GetData(ref ComTypes.FORMATETC format, out ComTypes.STGMEDIUM medium) => throw new NotImplementedException(); void ComTypes.IDataObject.GetDataHere(ref ComTypes.FORMATETC format, ref ComTypes.STGMEDIUM medium) => throw new NotImplementedException(); bool IDataObject.GetDataPresent(string format, bool autoConvert) => format == "Foo"; @@ -569,10 +583,10 @@ ComTypes.IEnumFORMATETC ComTypes.IDataObject.EnumFormatEtc(ComTypes.DATADIR dire string[] IDataObject.GetFormats(bool autoConvert) => ["Foo"]; string[] IDataObject.GetFormats() => ["Foo"]; int ComTypes.IDataObject.QueryGetData(ref ComTypes.FORMATETC format) => throw new NotImplementedException(); - void IDataObject.SetData(string format, bool autoConvert, object data) => throw new NotImplementedException(); - void IDataObject.SetData(string format, object data) => throw new NotImplementedException(); - void IDataObject.SetData(Type format, object data) => throw new NotImplementedException(); - void IDataObject.SetData(object data) => throw new NotImplementedException(); + void IDataObject.SetData(string format, bool autoConvert, object? data) => throw new NotImplementedException(); + void IDataObject.SetData(string format, object? data) => throw new NotImplementedException(); + void IDataObject.SetData(Type format, object? data) => throw new NotImplementedException(); + void IDataObject.SetData(object? data) => throw new NotImplementedException(); void ComTypes.IDataObject.SetData(ref ComTypes.FORMATETC formatIn, ref ComTypes.STGMEDIUM medium, bool release) => throw new NotImplementedException(); } } From 6c8082a40f3bd9611c34f5d104aa6106ee046df4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 8 Jun 2024 03:06:54 -0700 Subject: [PATCH 208/342] Change CollectionDefinition name to Sequential --- .../tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb | 2 +- .../Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs | 2 +- .../tests/UnitTests/System/Windows/Forms/ClipboardTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index f4ab3976f51..3c6a4c0f2f1 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -12,7 +12,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere ''' - + Public Class ClipboardProxyTests diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 21989e239f5..9977d6ec803 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [Collection("Sequential")] -[CollectionDefinition("Clipboard Tests", DisableParallelization = true)] +[CollectionDefinition("Sequential", DisableParallelization = true)] public class ClipboardProxyTests { [WinFormsFact] diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs index 4b6138fee89..be6e27ee398 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs @@ -15,7 +15,7 @@ namespace System.Windows.Forms.Tests; [Collection("Sequential")] -[CollectionDefinition("Clipboard Tests", DisableParallelization = true)] +[CollectionDefinition("Sequential", DisableParallelization = true)] public partial class ClipboardTests { [WinFormsFact] From df2daab23d80e6090cb4e60f13660376cebd6084 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 21 Jun 2024 23:17:49 -0700 Subject: [PATCH 209/342] Fix punctuation in XML Comments --- .../src/Microsoft.VisualBasic.Forms.vbproj | 4 +- .../ApplicationServices/AssemblyInfo.vb | 2 +- ...FormsApplicationBase.WinFormsAppContext.vb | 11 +- .../WindowsFormsApplicationBase.vb | 26 +- .../Microsoft/VisualBasic/Devices/Audio.vb | 46 ++-- .../Microsoft/VisualBasic/Devices/Computer.vb | 2 +- .../Devices/Network/NetworkAvailability.vb | 8 +- .../Devices/Network/NetworkDownload.vb | 124 ++++----- .../Devices/Network/NetworkDownloadAsync.vb | 104 ++++---- .../Devices/Network/NetworkPing.vb | 22 +- .../Devices/Network/NetworkUpload.vb | 118 ++++----- .../Devices/Network/NetworkUtilities.vb | 22 +- .../Devices/Network/WebClientExtended.vb | 8 +- .../Helpers/UnsafeNativeMethods.vb | 10 +- .../Logging/FileLogTraceListener.vb | 240 +++++++++--------- .../src/Microsoft/VisualBasic/Logging/Log.vb | 87 ++++--- .../VisualBasic/MyServices/ClipboardProxy.vb | 66 ++--- .../MyServices/Internal/ContextValue.vb | 4 +- .../MyServices/Internal/HttpClientCopy.vb | 18 +- .../MyServices/Internal/ProgressDialog.vb | 34 +-- .../MyServices/Internal/WebClientCopy.vb | 24 +- .../Microsoft.VisualBasic.Forms.Tests.vbproj | 2 + .../Windows/Forms/ClipboardProxyTests.vb | 2 +- .../Windows/Forms/ExceptionUtilsTests.vb | 2 +- .../Windows/Forms/NetworkDownloadTests.vb | 6 +- .../Forms/TempDirectoryFileFunctions.vb | 16 +- .../System/Windows/Forms/WebListener.vb | 16 +- 27 files changed, 518 insertions(+), 506 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index 5375d68c271..a959b5f3a90 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -9,7 +9,7 @@ Microsoft.VisualBasic.Forms true - 16.9 + Latest None true true @@ -50,6 +50,8 @@ AssignProjectConfiguration;$(GetCopyToOutputDirectoryItemsDependsOn) Off + On + On diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 29208aadd03..f8e2ba0e1b3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -167,7 +167,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the version number of the assembly. ''' - ''' A System.Version class containing the version number of the assembly + ''' A System.Version class containing the version number of the assembly. ''' Cannot use AssemblyVersionAttribute since it always return Nothing. Public ReadOnly Property Version() As Version Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index e7bf1f2268a..f2d66e989bc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -24,9 +24,14 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the two types of application shutdown: - ''' 1 - shutdown when the main form closes - ''' 2 - shutdown only after the last form closes + ''' + ''' + ''' shutdown when the main form closes. + ''' + ''' + ''' shutdown only after the last form closes. + ''' + ''' ''' ''' ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 044d7148d22..f76105b9c54 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -285,8 +285,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, ' before the Network object gets created because the network object will be doing a - ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we have - ' to have our principal on the thread before that happens. + ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must + ' have our principal on the thread before that happens. If authenticationMode = AuthenticationMode.Windows Then Try ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) @@ -310,9 +310,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model + ''' Entry point to kick off the VB Startup/Shutdown Application model. ''' - ''' The command line from Main() + ''' The command line from Main(). Public Sub Run(commandLine As String()) @@ -406,7 +406,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash - ''' Screen should be displayed for. When not set then the splash screen is hidden + ''' screen should be displayed for. When not set then the splash screen is hidden ''' as soon as the main form becomes active. ''' ''' The minimum amount of time, in milliseconds, to display the splash screen. @@ -433,7 +433,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' to use the GDI+ render. We read this function in Main() (My template) to ''' determine how to set the text rendering flag on the WinForms application object. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer + ''' True - Use GDI+ renderer. False - use GDI renderer. Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean Get @@ -476,7 +476,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' variants was passed in. ''' ''' - ''' Returning True indicates that we should continue on with the application Startup sequence + ''' Returning True indicates that we should continue on with the application Startup sequence. ''' ''' This extensibility point is exposed for people who want to override ''' the Startup sequence at the earliest possible point to @@ -668,10 +668,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Raises the UnHandled exception event and exits the application if the event handler indicated - ''' that execution shouldn't continue + ''' that execution shouldn't continue. ''' ''' - ''' True indicates the exception event was raised / False it was not + ''' True indicates the exception event was raised / False it was not. Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean @@ -733,7 +733,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Hide the splash screen. The splash screen was created on another thread ''' thread (main thread) than the one it was run on (secondary thread for the - ''' Splash screen so it doesn't block app startup. We need to invoke the close. + ''' splash screen so it doesn't block app startup. We need to invoke the close. ''' This function gets called from the main thread by the app fx. ''' @@ -944,8 +944,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the ''' NetworkAvailabilityChanged event ''' - ''' Contains the Network instance that raised the event - ''' Contains whether the network is available or not + ''' Contains the Network instance that raised the event. + ''' Contains whether the network is available or not. Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) RaiseEvent NetworkAvailabilityChanged(sender, e) End Sub @@ -1015,7 +1015,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' A string unique to the application that should be the same for versions of ''' the application that have the same Major and Minor Version Number ''' - ''' If GUID Attribute does not exist fall back to unique ModuleVersionId + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. Private Shared Function GetApplicationInstanceID(entry As Assembly) As String Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index b1e2e6025a5..5ca6aa33c5c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -8,7 +8,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic ''' - ''' Enum for three ways to play a .wav file + ''' Enum for three ways to play a .wav file. ''' Public Enum AudioPlayMode ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() @@ -20,28 +20,28 @@ Namespace Microsoft.VisualBasic Namespace Devices ''' - ''' An object that makes it easy to play wav files + ''' An object that makes it easy to play wav files. ''' Public Class Audio ''' - ''' Creates a new Audio object + ''' Creates a new Audio object. ''' Public Sub New() End Sub ''' - ''' Plays a .wav file in background mode + ''' Plays a .wav file in background mode. ''' - ''' The name of the file + ''' The name of the file. Public Sub Play(location As String) Play(location, AudioPlayMode.Background) End Sub ''' - ''' Plays a .wav file in the passed in mode + ''' Plays a .wav file in the passed in mode. ''' - ''' The name of the file + ''' The name of the file. ''' ''' An enum value representing the mode, Background (async), ''' WaitToComplete (sync) or BackgroundLoop @@ -54,10 +54,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays a Byte array representation of a .wav file in the passed in mode + ''' Plays a Byte array representation of a .wav file in the passed in mode. ''' - ''' The array representing the .wav file - ''' The mode in which the array should be played + ''' The array representing the .wav file. + ''' The mode in which the array should be played. Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(data)) @@ -70,10 +70,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays a stream representation of a .wav file in the passed in mode + ''' Plays a stream representation of a .wav file in the passed in mode. ''' - ''' The stream representing the .wav file - ''' The mode in which the stream should be played + ''' The stream representing the .wav file. + ''' The mode in which the stream should be played. Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then @@ -86,8 +86,8 @@ Namespace Microsoft.VisualBasic ''' ''' Plays a system messageBeep sound. ''' - ''' The sound to be played - ''' Plays the sound asynchronously + ''' The sound to be played. + ''' Plays the sound asynchronously. Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(systemSound)) @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Stops the play of any playing sound + ''' Stops the play of any playing sound. ''' Public Sub [Stop]() Dim sound As New Media.SoundPlayer() @@ -106,10 +106,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays the passed in SoundPlayer in the passed in mode + ''' Plays the passed in SoundPlayer in the passed in mode. ''' - ''' The SoundPlayer to play - ''' The mode in which to play the sound + ''' The SoundPlayer to play. + ''' The mode in which to play the sound. Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") @@ -134,10 +134,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Gets the full name and path for the file. Throws if unable to get full name and path + ''' Gets the full name and path for the file. Throws if unable to get full name and path. ''' - ''' The filename being tested - ''' A full name and path of the file + ''' The filename being tested. + ''' A full name and path of the file. Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then Throw ExUtils.GetArgumentNullException(NameOf(location)) @@ -147,7 +147,7 @@ Namespace Microsoft.VisualBasic End Function ''' - ''' Validates that the value being passed as an AudioPlayMode enum is a legal value + ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. ''' ''' Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index 5c328b2e90d..05509eb50db 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -38,7 +38,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' A thin wrapper for System.Windows.Forms.Clipboard ''' - ''' An object representing the clipboard + ''' An object representing the clipboard. Public ReadOnly Property Clipboard() As ClipboardProxy Get If s_clipboard Is Nothing Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index 07e39d0f658..f09e321397e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -29,10 +29,10 @@ Namespace Microsoft.VisualBasic.Devices Private _synchronizationContext As SynchronizationContext ''' - ''' Event fired when connected to the network + ''' Event fired when connected to the network. ''' - ''' Has no meaning for this event - ''' Has no meaning for this event + ''' Has no meaning for this event. + ''' Has no meaning for this event. Public Custom Event NetworkAvailabilityChanged As NetworkAvailableEventHandler 'This is a custom event because we want to hook up the NetworkAvailabilityChanged event only if the user writes a handler for it. 'The reason being that it is very expensive to handle and kills our application startup perf. @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Indicates whether or not the local machine is connected to an IP network. ''' - ''' True if connected, otherwise False + ''' True if connected, otherwise False. Public ReadOnly Property IsAvailable() As Boolean Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index bf7185db698..9778b5d0dd0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -13,16 +13,16 @@ Namespace Microsoft.VisualBasic.Devices Partial Public Class Network ''' - ''' Creates class and hooks up events + ''' Creates class and hooks up events. ''' Public Sub New() End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved + ''' Name and path of file where download is saved. Public Sub DownloadFile(address As String, destinationFileName As String) Try DownloadFileAsync(address, @@ -41,11 +41,11 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. ''' The user's password Public Sub DownloadFile(address As String, destinationFileName As String, @@ -68,15 +68,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -128,16 +128,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -194,15 +194,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Calls to all the other overloads will come through here + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Calls to all the other overloads will come through here. Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -246,16 +246,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Calls to all the other overloads will come through here. Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -303,15 +303,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -356,16 +356,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -413,10 +413,10 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved + ''' Uri to the remote file. + ''' Name and path of file where download is saved. Public Sub DownloadFile(address As Uri, destinationFileName As String) Try @@ -437,12 +437,12 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb index eabd8b7a132..4da09ddfc63 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb @@ -15,14 +15,14 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in Uri. - ''' Maps older networkCredentials to HttpClientHandler + ''' Maps older networkCredentials to HttpClientHandler. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' A ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Friend Shared Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, @@ -46,15 +46,15 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' A ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, @@ -74,16 +74,16 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, userName As String, @@ -106,16 +106,16 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' An HttpClientHandler of the user performing the download - ''' Progress Dialog - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here + ''' Name and path of file where download is saved. + ''' An HttpClientHandler of the user performing the download. + ''' Progress Dialog. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Calls to all the other overloads will come through here. Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, clientHandler As HttpClientHandler, @@ -181,15 +181,15 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' A ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, @@ -209,16 +209,16 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' A ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Friend Shared Async Function DownloadFileAsync(address As String, destinationFileName As String, userName As String, @@ -247,16 +247,16 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' A ProgressDialog or Nothing - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' A ProgressDialog or Nothing. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. ''' - ''' Function will Throw on unhandled exceptions + ''' Function will Throw on unhandled exceptions. ''' Friend Shared Async Function DownloadFileAsync(addressUri As Uri, destinationFileName As String, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index a274c244bfd..621fc81c5ba 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -18,9 +18,9 @@ Namespace Microsoft.VisualBasic.Devices Private _pingBuffer() As Byte ''' - ''' A buffer for pinging. This imitates the buffer used by Ping.Exe + ''' A buffer for pinging. This imitates the buffer used by Ping.Exe. ''' - ''' A buffer + ''' A buffer. Private ReadOnly Property PingBuffer() As Byte() Get If _pingBuffer Is Nothing Then @@ -39,7 +39,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Sends and receives a packet to and from the passed in address. ''' ''' - ''' True if ping was successful, otherwise False + ''' True if ping was successful, otherwise False. Public Function Ping(hostNameOrAddress As String) As Boolean Return Ping(hostNameOrAddress, DEFAULT_PING_TIMEOUT) End Function @@ -47,8 +47,8 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host - ''' True if ping was successful, otherwise False + ''' A Uri representing the host. + ''' True if ping was successful, otherwise False. Public Function Ping(address As Uri) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. @@ -61,9 +61,9 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in address. ''' - ''' The name of the host as a Url or IP Address - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False + ''' The name of the host as a Url or IP Address. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. Public Function Ping(hostNameOrAddress As String, timeout As Integer) As Boolean ' Make sure a network is available @@ -82,9 +82,9 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False + ''' A Uri representing the host. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. Public Function Ping(address As Uri, timeout As Integer) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index d6a615c3930..9ddf98c75a4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -11,54 +11,54 @@ Namespace Microsoft.VisualBasic.Devices Partial Public Class Network ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination + ''' The file to be uploaded. + ''' The full name and path of the host destination. Public Sub UploadFile(sourceFileName As String, address As String) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination + ''' The file to be uploaded. + ''' Uri representing the destination. Public Sub UploadFile(sourceFileName As String, address As Uri) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. Public Sub UploadFile(sourceFileName As String, address As String, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -70,15 +70,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -106,14 +106,14 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -125,15 +125,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -150,13 +150,13 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, @@ -167,14 +167,14 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index 079f3ce5147..e0a2cf74415 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -36,11 +36,11 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Gets network credentials from a userName and password + ''' Gets network credentials from a userName and password. ''' - ''' The name of the user - ''' The password of the user - ''' A new NetworkCredentials or Nothing + ''' The name of the user. + ''' The password of the user. + ''' A new NetworkCredentials or Nothing. Friend Function GetNetworkCredentials(userName As String, password As String) As ICredentials Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), @@ -50,12 +50,12 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' Indicates whether or not to show a progress bar - ''' New ProgressDialog + ''' Name and path of file where download is saved. + ''' Indicates whether or not to show a progress bar. + ''' New ProgressDialog. Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path @@ -69,10 +69,10 @@ Namespace Microsoft.VisualBasic.Devices End Function ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address). ''' - ''' The remote file address - ''' A Uri if successful, otherwise it throws an exception + ''' The remote file address. + ''' A Uri if successful, otherwise it throws an exception. Friend Function GetUri(address As String) As Uri Try Return New Uri(address) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb index 406da20d13e..0d01e1f6423 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -9,7 +9,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Temporary class used to provide WebClient with a timeout property. ''' ''' - ''' This class will be deleted when Timeout is added to WebClient + ''' This class will be deleted when Timeout is added to WebClient. ''' Friend NotInheritable Class WebClientExtended Inherits WebClient @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Enables switching the server to non passive mode. ''' - ''' We need this in order for the progress UI on a download to work + ''' We need this in order for the progress UI on a download to work. Public WriteOnly Property UseNonPassiveFtp() As Boolean Set(value As Boolean) _useNonPassiveFtp = value @@ -48,8 +48,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set - ''' to the Timeout value + ''' Makes sure that the timeout value for WebRequests (used for all Download and + ''' Upload methods) is set to the Timeout value. ''' ''' Protected Overrides Function GetWebRequest(address As Uri) As WebRequest diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index 1557d83352f..a87ae3e3aeb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -30,13 +30,13 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Used to determine how much free space is on a disk + ''' Used to determine how much free space is on a disk. ''' - ''' Path including drive we're getting information about - ''' The amount of free space available to the current user - ''' The total amount of space on the disk relative to the current user + ''' Path including drive we're getting information about. + ''' The amount of free space available to the current user. + ''' The total amount of space on the disk relative to the current user. ''' The amount of free space on the disk. - ''' True if function succeeds in getting info otherwise False + ''' True if function succeeds in getting info otherwise False. Friend Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 352b56c9111..d88ba9ef7f3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -13,7 +13,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory + ''' Options for the location of a log's directory. ''' Public Enum LogFileLocation As Integer ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() @@ -25,7 +25,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for the date stamp in the name of a log file + ''' Options for the date stamp in the name of a log file. ''' Public Enum LogFileCreationScheduleOption As Integer None '(default) @@ -34,7 +34,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted + ''' Options for behavior when resources are exhausted. ''' Public Enum DiskSpaceExhaustedOption As Integer ThrowException @@ -42,7 +42,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Class for logging to a text file + ''' Class for logging to a text file. ''' ''' ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). @@ -53,24 +53,24 @@ Namespace Microsoft.VisualBasic.Logging Inherits TraceListener ''' - ''' Creates a FileLogTraceListener with the passed in name + ''' Creates a FileLogTraceListener with the passed in name. ''' - ''' The name of the listener + ''' The name of the listener. Public Sub New(name As String) MyBase.New(name) End Sub ''' - ''' Creates a FileLogTraceListener with default name + ''' Creates a FileLogTraceListener with default name. ''' Public Sub New() Me.New(DEFAULT_NAME) End Sub ''' - ''' Indicates the log's directory + ''' Indicates the log's directory. ''' - ''' An enum which can indicate one of several logical locations for the log + ''' An enum which can indicate one of several logical locations for the log. Public Property Location() As LogFileLocation Get If Not _propertiesSet(LOCATION_INDEX) Then @@ -94,9 +94,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the stream should be flushed after every write + ''' Indicates whether or not the stream should be flushed after every write. ''' - ''' True if the stream should be flushed after every write, otherwise False + ''' True if the stream should be flushed after every write, otherwise False. Public Property AutoFlush() As Boolean Get If Not _propertiesSet(AUTOFLUSH_INDEX) Then @@ -118,7 +118,7 @@ Namespace Microsoft.VisualBasic.Logging ''' Indicates whether or not the host name of the logging machine should ''' be included in the output. ''' - ''' True if the HostId should be included, otherwise False + ''' True if the HostId should be included, otherwise False. Public Property IncludeHostName() As Boolean Get If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then @@ -136,9 +136,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten + ''' Indicates whether or not the file should be appended to or overwritten. ''' - ''' True if the file should be appended to, otherwise False + ''' True if the file should be appended to, otherwise False. Public Property Append() As Boolean Get If Not _propertiesSet(APPEND_INDEX) Then @@ -164,9 +164,9 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user + ''' or the ReserveDiskSpace set by the user. ''' - ''' An enum indicating the desired behavior (do nothing, throw) + ''' An enum indicating the desired behavior (do nothing, throw). Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption Get If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then @@ -186,9 +186,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The name of the log file not including DateStamp, file number, Path or extension + ''' The name of the log file not including DateStamp, file number, Path or extension. ''' - ''' The name of the log file + ''' The name of the log file. Public Property BaseFileName() As String Get If Not _propertiesSet(BASEFILENAME_INDEX) Then @@ -216,10 +216,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number + ''' The full name and path of the actual log file including DateStamp and file number. ''' - ''' The full name and path - ''' Calling this method will open the log file if it's not already open + ''' The full name and path. + ''' Calling this method will open the log file if it's not already open. Public ReadOnly Property FullLogFileName() As String Get ' The only way to reliably know the file name is to open the file. If we @@ -234,9 +234,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day) + ''' Indicates what Date to stamp the log file with (none, first day of week, day). ''' - ''' An enum indicating how to stamp the file + ''' An enum indicating how to stamp the file. Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption Get If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then @@ -260,9 +260,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The maximum size in bytes the log file is allowed to grow to + ''' The maximum size in bytes the log file is allowed to grow to. ''' - ''' The maximum size + ''' The maximum size. Public Property MaxFileSize() As Long Get If Not _propertiesSet(MAXFILESIZE_INDEX) Then @@ -283,9 +283,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The amount of disk space, in bytes, that must be available after a write + ''' The amount of disk space, in bytes, that must be available after a write. ''' - ''' The reserved disk space + ''' The reserved disk space. Public Property ReserveDiskSpace() As Long Get If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then @@ -306,9 +306,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The delimiter to be used to delimit fields in a line of output + ''' The delimiter to be used to delimit fields in a line of output. ''' - ''' The delimiter + ''' The delimiter. Public Property Delimiter() As String Get If Not _propertiesSet(DELIMITER_INDEX) Then @@ -327,10 +327,10 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' The encoding to try when opening a file. ''' - ''' The encoding + ''' The encoding. ''' - ''' If Append is true then this value will be trumped by the actual encoding value - ''' of the file + ''' If Append is true then this value will be trumped by the actual + ''' encoding value of the file. ''' Public Property Encoding() As Encoding Get @@ -351,10 +351,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom + ''' The directory to be used if Location is set to Custom. ''' - ''' The name of the directory - ''' This will throw if the path cannot be resolved + ''' The name of the directory. + ''' This will throw if the path cannot be resolved. Public Property CustomLocation() As String Get If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then @@ -391,9 +391,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Writes the message to the log + ''' Writes the message to the log. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub Write(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -417,9 +417,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes the message to the log as a line + ''' Writes the message to the log as a line. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub WriteLine(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -442,13 +442,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' The message + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' The message. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) If Filter IsNot Nothing Then @@ -513,14 +513,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A string with placeholders that serves as a format for the message - ''' The values for the placeholders in format + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A string with placeholders that serves as a format for the message. + ''' The values for the placeholders in format. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) ' Create the message @@ -535,13 +535,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' An object containing the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' An object containing the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) Dim message As String = "" @@ -553,13 +553,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A list of objects making up the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A list of objects making up the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) Dim messageBuilder As New StringBuilder() @@ -577,14 +577,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the underlying stream + ''' Flushes the underlying stream. ''' Public Overrides Sub Flush() _stream?.Flush() End Sub ''' - ''' Closes the underlying stream + ''' Closes the underlying stream. ''' Public Overrides Sub Close() Dispose(True) @@ -592,15 +592,15 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception + ''' in a config file will cause a configuration exception. ''' - ''' An array of attribute names + ''' An array of attribute names. Protected Overrides Function GetSupportedAttributes() As String() Return _supportedAttributes End Function ''' - ''' Makes sure stream is flushed + ''' Makes sure stream is flushed. ''' ''' Protected Overrides Sub Dispose(disposing As Boolean) @@ -612,7 +612,7 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' Gets the log file name under the current configuration. ''' - ''' The log file name + ''' The log file name. ''' ''' Includes the full path and the DateStamp, but does not include the ''' file number or the extension. @@ -663,9 +663,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets the stream to use for writing to the log + ''' Gets the stream to use for writing to the log. ''' - ''' The stream + ''' The stream. Private ReadOnly Property ListenerStream() As ReferencedStream Get EnsureStreamIsOpen() @@ -676,9 +676,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets or creates the stream used for writing to the log + ''' Gets or creates the stream used for writing to the log. ''' - ''' The stream + ''' The stream. Private Function GetStream() As ReferencedStream ' Check the hash table to see if this file is already opened by another @@ -750,7 +750,7 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Makes sure we have an open stream + ''' Makes sure we have an open stream. ''' Private Sub EnsureStreamIsOpen() If _stream Is Nothing Then @@ -761,7 +761,7 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' Closes the stream. ''' - ''' This method should be safe to call whether or not there is a stream + ''' This method should be safe to call whether or not there is a stream. Private Sub CloseCurrentStream() If _stream IsNot Nothing Then SyncLock s_streams @@ -775,31 +775,31 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the current date has changed to new day + ''' Indicates whether or not the current date has changed to new day. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function DayChanged() As Boolean Return _day.Date <> Now.Date End Function ''' - ''' Indicates whether or not the date has changed to a new week + ''' Indicates whether or not the date has changed to a new week. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function WeekChanged() As Boolean Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) End Function ''' - ''' Utility to get the date of the first day of the week from the passed in date + ''' Utility to get the date of the first day of the week from the passed in date. ''' - ''' The date being checked + ''' The date being checked. Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date Return checkDate.AddDays(-checkDate.DayOfWeek).Date End Function ''' - ''' Checks for date changes and carries out appropriate actions + ''' Checks for date changes and carries out appropriate actions. ''' ''' ''' If the user has selected a DateStamp option then a change of @@ -818,12 +818,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Checks the size of the current log plus the new entry and the free disk space against - ''' the user's limits. + ''' Checks the size of the current log plus the new entry and + ''' the free disk space against the user's limits. ''' - ''' The size of what's about to be written to the file - ''' True if the limits aren't trespassed, otherwise False - ''' This method is not 100% accurate if AutoFlush is False + ''' The size of what's about to be written to the file. + ''' True if the limits aren't trespassed, otherwise False. + ''' This method is not 100% accurate if AutoFlush is False. Private Function ResourcesAvailable(newEntrySize As Long) As Boolean If ListenerStream.FileSize + newEntrySize > MaxFileSize Then @@ -844,10 +844,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user + ''' Returns the total amount of free disk space available to the current user. ''' - ''' The total amount, in bytes, of free disk space available to the current user - ''' Throws an exception if API fails + ''' The total amount, in bytes, of free disk space available to the current user. + ''' Throws an exception if API fails. Private Function GetFreeDiskSpace() As Long Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) @@ -866,9 +866,9 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Opens a file and attempts to determine the file's encoding + ''' Opens a file and attempts to determine the file's encoding. ''' - ''' The encoding or Nothing + ''' The encoding or Nothing. Private Function GetFileEncoding(fileName As String) As Encoding If File.Exists(fileName) Then @@ -894,10 +894,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Gets the host name + ''' Gets the host name. ''' - ''' The host name - ''' We use the machine name because we can get that even if not hooked up to a network + ''' The host name. + ''' We use the machine name because we can get that even if not hooked up to a network. Private ReadOnly Property HostName() As String Get If String.IsNullOrEmpty(_hostName) Then @@ -912,7 +912,7 @@ Namespace Microsoft.VisualBasic.Logging ''' Demands a FileIO write permission. ''' ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS + ''' This ensures these API cannot be used to circumvent CAS. ''' Private Sub DemandWritePermission() Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") @@ -920,7 +920,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value + ''' Validates that the value being passed as an LogFileLocation enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) @@ -930,7 +930,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. ''' ''' Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) @@ -940,7 +940,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) @@ -950,10 +950,10 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Convert a stack into a string + ''' Convert a stack into a string. ''' ''' - ''' Returns the stack as a .csv string + ''' Returns the stack as a .csv string. Private Shared Function StackToString(stack As Stack) As String Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") @@ -1125,17 +1125,17 @@ Namespace Microsoft.VisualBasic.Logging Implements IDisposable ''' - ''' Creates a new referenced stream + ''' Creates a new referenced stream. ''' - ''' The stream that does the actual writing + ''' The stream that does the actual writing. Friend Sub New(stream As StreamWriter) _stream = stream End Sub ''' - ''' Writes a message to the stream + ''' Writes a message to the stream. ''' - ''' The message to write + ''' The message to write. Friend Sub Write(message As String) SyncLock _syncObject _stream.Write(message) @@ -1143,9 +1143,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes a message to the stream as a line + ''' Writes a message to the stream as a line. ''' - ''' The message to write + ''' The message to write. Friend Sub WriteLine(message As String) SyncLock _syncObject _stream.WriteLine(message) @@ -1153,7 +1153,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Increments the reference count for the stream + ''' Increments the reference count for the stream. ''' Friend Sub AddReference() SyncLock _syncObject @@ -1162,7 +1162,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the stream + ''' Flushes the stream. ''' Friend Sub Flush() SyncLock _syncObject @@ -1171,8 +1171,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Decrements the reference count to the stream and closes the stream if the reference count - ''' is zero + ''' Decrements the reference count to the stream and closes + ''' the stream if the reference count is zero. ''' Friend Sub CloseStream() SyncLock _syncObject @@ -1190,9 +1190,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the stream is still in use by a FileLogTraceListener + ''' Indicates whether or not the stream is still in use by a FileLogTraceListener. ''' - ''' True if the stream is being used, otherwise False + ''' True if the stream is being used, otherwise False. Friend ReadOnly Property IsInUse() As Boolean Get Return _stream IsNot Nothing @@ -1200,9 +1200,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The size of the log file + ''' The size of the log file. ''' - ''' The size + ''' The size. Friend ReadOnly Property FileSize() As Long Get Return _stream.BaseStream.Length @@ -1210,9 +1210,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Ensures the stream is closed (flushed) no matter how we are closed + ''' Ensures the stream is closed (flushed) no matter how we are closed. ''' - ''' Indicates who called dispose + ''' Indicates who called dispose. Private Overloads Sub Dispose(disposing As Boolean) If disposing Then If Not _disposed Then @@ -1223,7 +1223,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Standard implementation of IDisposable + ''' Standard implementation of IDisposable. ''' Public Overloads Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. @@ -1232,7 +1232,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Ensures stream is closed at GC + ''' Ensures stream is closed at GC. ''' Protected Overrides Sub Finalize() ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 9a18fd926f9..c73286ec0b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -15,9 +15,9 @@ Namespace Microsoft.VisualBasic.Logging Public Class Log ''' - ''' Creates a Log and the underlying TraceSource based on the platform + ''' Creates a Log and the underlying TraceSource based on the platform. ''' - ''' Right now we only support WinApp as an application platform + ''' Right now we only support WinApp as an application platform. Public Sub New() ' Set trace source for platform. Right now we only support WinApp _traceSource = New DefaultTraceSource(WINAPP_SOURCE_NAME) @@ -29,9 +29,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Creates a Log and the underlying TraceSource based on the passed in name + ''' Creates a Log and the underlying TraceSource based on the passed in name. ''' - ''' The name of the TraceSource to be created + ''' The name of the TraceSource to be created. Public Sub New(name As String) _traceSource = New DefaultTraceSource(name) If Not _traceSource.HasBeenConfigured Then @@ -40,28 +40,28 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged + ''' The message to be logged. Public Sub WriteEntry(message As String) WriteEntry(message, TraceEventType.Information, TraceEventTypeToId(TraceEventType.Information)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged - ''' The type of message (error, info, etc...) + ''' The message to be logged. + ''' The type of message (error, info, etc...). Public Sub WriteEntry(message As String, severity As TraceEventType) WriteEntry(message, severity, TraceEventTypeToId(severity)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged - ''' The type of message (error, info, etc...) - ''' An id for the message (used for correlation) + ''' The message to be logged. + ''' The type of message (error, info, etc...). + ''' An id for the message (used for correlation). Public Sub WriteEntry(message As String, severity As TraceEventType, id As Integer) If message Is Nothing Then message = "" @@ -70,32 +70,33 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message + ''' Has the TraceSource fire a TraceEvent for all listeners using information + ''' in an exception to form the message. ''' - ''' The exception being logged + ''' The exception being logged. Public Sub WriteException(ex As Exception) WriteException(ex, TraceEventType.Error, "", TraceEventTypeToId(TraceEventType.Error)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information + ''' in an exception to form the message and appending additional info. ''' - ''' The exception being logged - ''' The type of message (error, info, etc...) - ''' Extra information to append to the message + ''' The exception being logged. + ''' The type of message (error, info, etc...). + ''' Extra information to append to the message. Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String) WriteException(ex, severity, additionalInfo, TraceEventTypeToId(severity)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information in + ''' an exception to form the message and appending additional info. ''' - ''' The exception being logged - ''' The type of message (error, info, etc...) - ''' Extra information to append to the message - ''' An id for the message (used for correlation) + ''' The exception being logged. + ''' The type of message (error, info, etc...). + ''' Extra information to append to the message. + ''' An id for the message (used for correlation). Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String, id As Integer) If ex Is Nothing Then @@ -115,20 +116,21 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gives access to the log's underlying TraceSource + ''' Gives access to the log's underlying TraceSource. ''' - ''' The log's underlying TraceSource + ''' The log's underlying TraceSource. Public ReadOnly Property TraceSource() As TraceSource Get - Return _traceSource 'Note, this is a downcast from the DefaultTraceSource class we are using + 'Note, this is a downcast from the DefaultTraceSource class we are using + Return _traceSource End Get End Property ''' - ''' Returns the file log trace listener we create for the Log + ''' Returns the file log trace listener we create for the Log. ''' - ''' The file log trace listener + ''' The file log trace listener. Public ReadOnly Property DefaultFileLogWriter() As FileLogTraceListener Get Return CType(TraceSource.Listeners(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME), FileLogTraceListener) @@ -136,14 +138,15 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that it knows if it was initialized - ''' using a config file or not. + ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that + ''' it knows if it was initialized using a config file or not. ''' Friend NotInheritable Class DefaultTraceSource Inherits TraceSource ''' - ''' TraceSource has other constructors, this is the only one we care about for this internal class + ''' TraceSource has other constructors, this is the only one we care about + ''' for this internal class. ''' ''' Public Sub New(name As String) @@ -151,9 +154,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Tells us whether this TraceSource found a config file to configure itself from + ''' Tells us whether this TraceSource found a config file to configure itself from. ''' - ''' True - The TraceSource was configured from a config file + ''' True - The TraceSource was configured from a config file. Public ReadOnly Property HasBeenConfigured() As Boolean Get ' This forces initialization of the attributes list @@ -172,7 +175,7 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' When there is no config file to configure the trace source, this function is called in order to - ''' configure the trace source according to the defaults they would have had in a default AppConfig + ''' configure the trace source according to the defaults they would have had in a default AppConfig. ''' Protected Friend Overridable Sub InitializeWithDefaultsSinceNoConfigExists() 'By default, you get a file log listener that picks everything from level Information on up. @@ -181,7 +184,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Make sure we flush the log on exit + ''' Make sure we flush the log on exit. ''' Private Sub CloseOnProcessExit(sender As Object, e As EventArgs) RemoveHandler AppDomain.CurrentDomain.ProcessExit, AddressOf CloseOnProcessExit @@ -189,9 +192,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Adds the default id values + ''' Adds the default id values. ''' - ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline + ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline. Private Shared Function InitializeIDHash() As Dictionary(Of TraceEventType, Integer) Dim result As New Dictionary(Of TraceEventType, Integer)(10) @@ -213,10 +216,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Converts a TraceEventType to an Id + ''' Converts a TraceEventType to an Id. ''' ''' - ''' The Id + ''' The Id. Private Shared Function TraceEventTypeToId(traceEventValue As TraceEventType) As Integer Dim id As Integer = 0 s_idHash.TryGetValue(traceEventValue, id) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index 1eb96fc2c19..223af82c538 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -25,7 +25,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets text from the clipboard ''' - ''' The text as a String + ''' The text as a String. Public Function GetText() As String Return Clipboard.GetText() End Function @@ -33,8 +33,8 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets text from the clipboard saved in the passed in format ''' - ''' The type of text to get - ''' The text as a String + ''' The type of text to get. + ''' The text as a String. Public Function GetText(format As TextDataFormat) As String Return Clipboard.GetText(format) End Function @@ -42,7 +42,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Indicates whether or not text is available on the clipboard ''' - ''' True if text is available, otherwise False + ''' True if text is available, otherwise False. Public Function ContainsText() As Boolean Return Clipboard.ContainsText End Function @@ -51,8 +51,8 @@ Namespace Microsoft.VisualBasic.MyServices ''' Indicates whether or not text is available on the clipboard in ''' the passed in format ''' - ''' The type of text being checked for - ''' True if text is available, otherwise False + ''' The type of text being checked for. + ''' True if text is available, otherwise False. Public Function ContainsText(format As TextDataFormat) As Boolean Return Clipboard.ContainsText(format) End Function @@ -60,7 +60,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in String to the clipboard ''' - ''' The String to save + ''' The String to save. Public Sub SetText(text As String) Clipboard.SetText(text) End Sub @@ -68,8 +68,8 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in String to the clipboard in the passed in format ''' - ''' The String to save - ''' The format in which to save the String + ''' The String to save. + ''' The format in which to save the String. Public Sub SetText(text As String, format As TextDataFormat) Clipboard.SetText(text, format) End Sub @@ -77,7 +77,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets an Image from the clipboard ''' - ''' The image + ''' The image. Public Function GetImage() As Image Return Clipboard.GetImage() End Function @@ -85,7 +85,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Indicate whether or not an image has been saved to the clipboard ''' - ''' True if an image is available, otherwise False + ''' True if an image is available, otherwise False. Public Function ContainsImage() As Boolean Return Clipboard.ContainsImage() End Function @@ -93,7 +93,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in image to the clipboard ''' - ''' The image to be saved + ''' The image to be saved. Public Sub SetImage(image As Image) Clipboard.SetImage(image) End Sub @@ -101,7 +101,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets an audio stream from the clipboard ''' - ''' The audio stream as a Stream + ''' The audio stream as a Stream. Public Function GetAudioStream() As Stream Return Clipboard.GetAudioStream() End Function @@ -109,7 +109,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Indicates whether or not there's an audio stream saved to the clipboard ''' - ''' True if an audio stream is available, otherwise False + ''' True if an audio stream is available, otherwise False. Public Function ContainsAudio() As Boolean Return Clipboard.ContainsAudio() End Function @@ -117,7 +117,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in audio byte array to the clipboard ''' - ''' The byte array to be saved + ''' The byte array to be saved. Public Sub SetAudio(audioBytes As Byte()) Clipboard.SetAudio(audioBytes) End Sub @@ -125,7 +125,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in audio stream to the clipboard ''' - ''' The stream to be saved + ''' The stream to be saved. Public Sub SetAudio(audioStream As Stream) Clipboard.SetAudio(audioStream) End Sub @@ -133,7 +133,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets a file drop list from the clipboard ''' - ''' The list of file paths as a StringCollection + ''' The list of file paths as a StringCollection. Public Function GetFileDropList() As StringCollection Return Clipboard.GetFileDropList() End Function @@ -141,7 +141,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Indicates whether or not a file drop list has been saved to the clipboard ''' - ''' True if a file drop list is available, otherwise False + ''' True if a file drop list is available, otherwise False. Public Function ContainsFileDropList() As Boolean Return Clipboard.ContainsFileDropList() End Function @@ -149,7 +149,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in file drop list to the clipboard ''' - ''' The file drop list as a StringCollection + ''' The file drop list as a StringCollection. Public Sub SetFileDropList(filePaths As StringCollection) Clipboard.SetFileDropList(filePaths) End Sub @@ -157,52 +157,52 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets data from the clipboard that's been saved in the passed in format. ''' - ''' The type of data being sought - ''' The data + ''' The type of data being sought. + ''' The data. Public Function GetData(format As String) As Object Return Clipboard.GetData(format) End Function ''' - ''' Indicates whether or not there is data on the clipboard in the passed in format + ''' Indicates whether or not there is data on the clipboard in the passed in format. ''' ''' - ''' True if there's data in the passed in format, otherwise False + ''' True if there's data in the passed in format, otherwise False. Public Function ContainsData(format As String) As Boolean Return Clipboard.ContainsData(format) End Function ''' - ''' Saves the passed in data to the clipboard in the passed in format + ''' Saves the passed in data to the clipboard in the passed in format. ''' - ''' The format in which to save the data - ''' The data to be saved + ''' The format in which to save the data. + ''' The data to be saved. Public Sub SetData(format As String, data As Object) Clipboard.SetData(format, data) End Sub ''' - ''' Removes everything from the clipboard + ''' Removes everything from the clipboard. ''' Public Sub Clear() Clipboard.Clear() End Sub ''' - ''' Gets a Data Object from the clipboard. + ''' Gets a from the clipboard. ''' - ''' The data object - ''' This gives the ability to save an object in multiple formats + ''' The data object. + ''' This gives the ability to save an object in multiple formats. Public Function GetDataObject() As IDataObject Return Clipboard.GetDataObject() End Function ''' - ''' Saves a DataObject to the clipboard + ''' Saves a to the clipboard. ''' - ''' The data object to be saved - ''' This gives the ability to save an object in multiple formats + ''' The data object to be saved. + ''' This gives the ability to save an object in multiple formats. Public Sub SetDataObject(data As DataObject) Clipboard.SetDataObject(data) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index da2c89db6f8..833f0475505 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -7,7 +7,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Stores an object in a context appropriate for the environment we are - ''' running in (web/windows) + ''' running in (web/windows). ''' ''' ''' @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Get the object from the correct thread-appropriate location + ''' Get the object from the correct thread-appropriate location. ''' Public Property Value() As T 'No SyncLocks required because we are operating upon instance data and the object is not shared across threads Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 96ea0b31159..6d549e70a22 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -28,10 +28,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private _percentage As Integer ''' - ''' Creates an instance of a HttpClientCopy, used to download or upload a file + ''' Creates an instance of a HttpClientCopy, used to download or upload a file. ''' - ''' The HttpClient used to do the downloading or uploading - ''' UI for indicating progress + ''' The HttpClient used to do the downloading or uploading. + ''' UI for indicating progress. Public Sub New(client As HttpClient, dialog As ProgressDialog) Debug.Assert(client IsNot Nothing, "No HttpClient") @@ -66,9 +66,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Notifies the progress dialog to increment the progress bar + ''' Notifies the progress dialog to increment the progress bar. ''' - ''' The percentage of bytes read + ''' The percentage of bytes read. Private Sub InvokeIncrement(progressPercentage As Integer) ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then @@ -87,7 +87,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' the current async file transfer operation. ''' ''' ''' Note that we don't want to close the progress dialog here. Wait until @@ -102,10 +102,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Downloads a file + ''' Downloads a file. ''' - ''' The source for the file - ''' The path and name where the file is to be saved + ''' The source for the file. + ''' The path and name where the file is to be saved. Friend Async Function DownloadFileWorkerAsync(addressUri As Uri, normalizedFilePath As String) As Task Debug.Assert(_httpClient IsNot Nothing, "No HttpClient") Debug.Assert(addressUri IsNot Nothing, "No address") diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 8e95c640b6d..8eadd3edea5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -15,7 +15,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Inherits Form ''' - ''' Event raised when user cancels the dialog or closes it before the operation is completed + ''' Event raised when user cancels the dialog or closes it before the operation is completed. ''' Public Event UserHitCancel() @@ -28,9 +28,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Increments the progress bar by the passed in amount + ''' Increments the progress bar by the passed in amount. ''' - ''' The amount to increment the bar + ''' The amount to increment the bar. ''' ''' This method should never be called directly. It should be called with ''' an InvokeBegin by a secondary thread. @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Closes the Progress Dialog + ''' Closes the Progress Dialog. ''' ''' ''' This method should never be called directly. It should be called with @@ -54,7 +54,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Displays the progress dialog modally ''' - ''' This method should be called on the main thread after the worker thread has been started + ''' This method should be called on the main thread after the worker thread has been started. Public Sub ShowProgressDialog() Try If Not _closing Then @@ -66,10 +66,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Sets the text of the label (usually something like Copying x to y) + ''' Sets the text of the label (usually something like Copying x to y). ''' - ''' The value to set the label to - ''' This should only be called on the main thread before showing the dialog + ''' The value to set the label to. + ''' This should only be called on the main thread before showing the dialog. Public Property LabelText() As String Get Return LabelInfo.Text @@ -83,7 +83,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Used to set or get the semaphore which signals when the dialog ''' is in a closable state. ''' - ''' The ManualResetEvent + ''' The ManualResetEvent. Public ReadOnly Property FormClosableSemaphore() As ManualResetEvent Get Return _formClosableSemaphore @@ -91,21 +91,21 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' Inform the dialog that CloseDialog will soon be called + ''' Inform the dialog that CloseDialog will soon be called. ''' ''' ''' This method should be called directly from the secondary thread. We want ''' to indicate we're closing as soon as we can so w don't show the dialog when we - ''' don't need to (when the work is finished before we can show the dialog) + ''' don't need to (when the work is finished before we can show the dialog). ''' Public Sub IndicateClosing() _closing = True End Sub ''' - ''' Indicated if the user has clicked the cancel button + ''' Indicated if the user has clicked the cancel button. ''' - ''' True if the user has canceled, otherwise False + ''' True if the user has canceled, otherwise False. ''' ''' The secondary thread checks this property directly. If it's True, the thread ''' breaks out of its loop. @@ -130,8 +130,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Handles user clicking Cancel. Sets a flag read by secondary thread. ''' - ''' The cancel button - ''' Arguments + ''' The cancel button. + ''' Arguments. Private Sub ButtonCloseDialog_Click(sender As Object, e As EventArgs) Handles ButtonCloseDialog.Click ButtonCloseDialog.Enabled = False _canceled = True @@ -145,7 +145,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' ''' We listen for this event since we want to make closing the dialog before it's - ''' finished behave the same as a cancel + ''' finished behave the same as a cancel. ''' Private Sub ProgressDialog_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing If e.CloseReason = CloseReason.UserClosing And Not _closeDialogInvoked Then @@ -177,7 +177,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Exits the monitor when we're activated + ''' Exits the monitor when we're activated. ''' ''' Dialog ''' Arguments diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index a46204f2d8c..ef3d225ff6a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -13,10 +13,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Friend NotInheritable Class WebClientCopy ''' - ''' Creates an instance of a WebClientCopy, used to download or upload a file + ''' Creates an instance of a WebClientCopy, used to download or upload a file. ''' - ''' The WebClient used to do the downloading or uploading - ''' UI for indicating progress + ''' The WebClient used to do the downloading or uploading. + ''' UI for indicating progress. Public Sub New(client As WebClient, dialog As ProgressDialog) Debug.Assert(client IsNot Nothing, "No WebClient") @@ -27,10 +27,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Uploads a file + ''' Uploads a file. ''' - ''' The name and path of the source file - ''' The address to which the file is uploaded + ''' The name and path of the source file. + ''' The address to which the file is uploaded. Public Sub UploadFile(sourceFileName As String, address As Uri) Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") Debug.Assert(address IsNot Nothing, "No address") @@ -53,9 +53,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Notifies the progress dialog to increment the progress bar + ''' Notifies the progress dialog to increment the progress bar. ''' - ''' The percentage of bytes read + ''' The percentage of bytes read. Private Sub InvokeIncrement(progressPercentage As Integer) ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then @@ -73,7 +73,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Posts a message to close the progress dialog + ''' Posts a message to close the progress dialog. ''' Private Sub CloseProgressDialog() ' Don't invoke unless dialog is up and running @@ -93,7 +93,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' - ''' Handles the WebClient's UploadFileCompleted event + ''' Handles the WebClient's UploadFileCompleted event. ''' ''' ''' @@ -114,7 +114,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles event WebClient fires whenever progress of upload changes + ''' Handles event WebClient fires whenever progress of upload changes. ''' ''' ''' @@ -125,7 +125,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' the current async file transfer operation. ''' ''' ''' Note that we don't want to close the progress dialog here. Wait until diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index a608fbb469d..7ac08cb6243 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -10,7 +10,9 @@ True Library + On Off + On diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 3c6a4c0f2f1..509ab1a861c 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -9,7 +9,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere. ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 531c9e1e571..74e8bd6c3ba 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -9,7 +9,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere + ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere. ''' Partial Public Class ExceptionUtilsTests diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 91324c0859d..03e2a2333c3 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -17,12 +17,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const TestingConnectionTimeout As Integer = 100000 ''' - ''' Verify that testDirectory exists, that destinationFileName exist and what its length is + ''' Verify that testDirectory exists, that destinationFileName exist and what its length is. ''' - ''' The full path and filename of the new file + ''' The full path and filename of the new file. ''' ''' The size in bytes of the destination file, this saves the caller from having to - ''' do another FileInfo call + ''' do another FileInfo call. ''' Private Shared Function ValidateDownload(destinationFileName As String) As Long Dim fileInfo As New FileInfo(destinationFileName) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb index d66959e8947..67944cf4a68 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb @@ -14,11 +14,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' ''' Creates or returns a directory based on the name of the function that ''' call it. The base directory is described above. - ''' Even if directory exists this call will success and just return it + ''' Even if directory exists this call will success and just return it. ''' ''' - ''' If >1 use line number as part of name - ''' + ''' If >1 use line number as part of name. + ''' The name of a directory that is safe to write to and is verified to exist. Friend Function CreateTempDirectory( Optional memberName As String = Nothing, Optional lineNumber As Integer = -1) As String Dim folder As String If lineNumber > 1 Then @@ -32,14 +32,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Function ''' - ''' If size >= 0 then create the file with size length + ''' If size >= 0 then create the file with size length. ''' - ''' Full path to working directory + ''' Full path to working directory. ''' - ''' File size to be created + ''' Size in bytes of the file to be created. ''' - ''' The full path and file name of the created file - ''' If size = -1 no file is create but the full path is returned + ''' The full path and file name of the created file. + ''' If size = -1 no file is create but the full path is returned. ''' Friend Function CreateTempFile(tmpFilePath As String, Optional optionalFilename As String = "Testing.Text", Optional size As Integer = -1) As String Dim filename As String = GetDestinationFileName(tmpFilePath, optionalFilename) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb index fe4c5c87f8b..cd35c68bc46 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -15,10 +15,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private _userName As String ''' - ''' The name of the function that creates the server is uses to establish the file to be downloaded + ''' The name of the function that creates the server is uses to establish the file to be downloaded. ''' - ''' Is used to create the file name and the size of download - ''' Used to establish the file path to be downloaded + ''' Is used to create the file name and the size of download. + ''' Used to establish the file path to be downloaded. Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) _fileSize = fileSize _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" @@ -26,12 +26,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub ''' - ''' Used for authenticated download + ''' Used for authenticated download. ''' - ''' Passed to Me.New - ''' Name to match for authorization - ''' Password to match for authorization - ''' Passed to Me.New + ''' Passed to Me.New. + ''' Name to match for authorization. + ''' Password to match for authorization. + ''' Passed to Me.New. Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) Me.New(fileSize, memberName) _userName = userName From ffeb0a2085ddc5eb982b7fa12acbe19cbf312d23 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 21 Jun 2024 23:38:09 -0700 Subject: [PATCH 210/342] Fix case of latest --- .../UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index 7ac08cb6243..1afddd99752 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -5,14 +5,15 @@ $(TargetFramework)-windows7.0 true true - 16.9 - WindowsFormsWithCustomSubMain - True - Library + latest + true On Off On + WindowsFormsWithCustomSubMain + True + Library From 40a8ae49a51771822144d54629cd1b96dde55982 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 21 Jun 2024 23:47:19 -0700 Subject: [PATCH 211/342] Remove duplicate line in project file --- .../src/Microsoft.VisualBasic.Forms.vbproj | 8 ++++---- .../UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index a959b5f3a90..8dd8816196b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -8,8 +8,11 @@ Microsoft.VisualBasic.Forms true + On + Off + On - Latest + latest None true true @@ -49,9 +52,6 @@ AssignProjectConfiguration;$(GetCopyToOutputDirectoryItemsDependsOn) - Off - On - On diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index 1afddd99752..0d55b71147f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -7,7 +7,6 @@ true latest - true On Off On From 3c218f28eb08b0cd211cf107ee92e6348e0e6e02 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 16:10:50 -0700 Subject: [PATCH 212/342] Fix defination of IDE0049 in comment --- .../src/Microsoft/VisualBasic/Devices/Clock.vb | 4 ++-- .../Microsoft/VisualBasic/Devices/ComputerInfo.vb | 12 ++++++------ .../Microsoft/VisualBasic/Helpers/NativeMethods.vb | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index 41f9c14cf7f..ee2d35811f1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -9,7 +9,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Clock -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= ''' ''' Gets a Date that is the current local date and time on this computer. @@ -32,7 +32,7 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' This property wraps the Environment.TickCount property to get the diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index d45728903a0..1e07f853d44 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -20,7 +20,7 @@ Namespace Microsoft.VisualBasic.Devices Public Sub New() End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:=" +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:=" ''' ''' Gets the total size of physical memory on the machine. ''' @@ -74,7 +74,7 @@ Namespace Microsoft.VisualBasic.Devices Return MemoryStatus.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' Gets the current UICulture installed on the machine. @@ -127,7 +127,7 @@ Namespace Microsoft.VisualBasic.Devices _instanceBeingWatched = RealClass End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get @@ -155,7 +155,7 @@ Namespace Microsoft.VisualBasic.Devices Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -204,7 +204,7 @@ Namespace Microsoft.VisualBasic.Devices Friend Sub New() End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= Friend ReadOnly Property TotalPhysicalMemory() As UInt64 Get Refresh() @@ -232,7 +232,7 @@ Namespace Microsoft.VisualBasic.Devices Return _memoryStatusEx.ullAvailVirtual End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references Private Sub Refresh() _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 52122970aea..771b72fbe48 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -88,7 +88,7 @@ Namespace Microsoft.VisualBasic.CompilerServices lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer End Function -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= ''' ''' Contains information about the current state of both physical and virtual memory, including extended memory. @@ -122,7 +122,7 @@ Namespace Microsoft.VisualBasic.CompilerServices dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub End Structure -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' Obtains information about the system's current usage of both physical and virtual memory. From 961aff8ad4fe64cf6dd3687b6e63061ce24fcb19 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 16:23:57 -0700 Subject: [PATCH 213/342] Remove 2 spaces after period --- .../ApplicationServices/ApplicationBase.vb | 2 +- .../ConsoleApplicationBase.vb | 8 ++-- ...FormsApplicationBase.WinFormsAppContext.vb | 10 ++--- .../WindowsFormsApplicationBase.vb | 44 +++++++++---------- .../Microsoft/VisualBasic/Devices/Computer.vb | 10 ++--- .../VisualBasic/Devices/ComputerInfo.vb | 2 +- .../Devices/Network/NetworkAvailability.vb | 8 ++-- .../VisualBasic/Devices/ServerComputer.vb | 6 +-- .../VisualBasic/Helpers/NativeTypes.vb | 8 ++-- .../VisualBasic/Helpers/VBInputBox.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 10 ++--- .../Logging/FileLogTraceListener.vb | 6 +-- .../MyServices/Internal/HttpClientCopy.vb | 6 +-- .../MyServices/Internal/WebClientCopy.vb | 6 +-- 14 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 039c21af560..4e491b56a94 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -53,7 +53,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the info about the application. If we are executing in a DLL, we still return the info + ''' Returns the info about the application. If we are executing in a DLL, we still return the info ''' about the application, not the DLL. ''' Public ReadOnly Property Info() As AssemblyInfo diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index ffb5c992efa..cffbdce0bb0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -19,7 +19,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' ''' We have to have a parameterless constructor because the platform specific Application - ''' object derives from this one and it doesn't define a constructor. The partial class generated by the + ''' object derives from this one and it doesn't define a constructor. The partial class generated by the ''' designer defines the constructor in order to configure the application. ''' Public Sub New() @@ -36,9 +36,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public ReadOnly Property CommandLineArgs() As ObjectModel.ReadOnlyCollection(Of String) Get If _commandLineArgs Is Nothing Then - 'Get rid of Arg(0) which is the path of the executing program. Main(args() as string) doesn't report the name of the app and neither will we + 'Get rid of Arg(0) which is the path of the executing program. Main(args() as string) doesn't report the name of the app and neither will we Dim envArgs As String() = Environment.GetCommandLineArgs - If envArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments + If envArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments Dim newArgs(envArgs.GetLength(0) - 2) As String 'dimming z(0) gives a z() of 1 element. Array.Copy(envArgs, 1, newArgs, 0, envArgs.GetLength(0) - 1) 'copy everything but the 0th element (the path of the executing program) _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(newArgs) @@ -51,7 +51,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this + ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this ''' for instance because we snag the command line from Main(). ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index f2d66e989bc..b3e509ead58 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -9,8 +9,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices Partial Public Class WindowsFormsApplicationBase ''' - ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we - ''' offer in the application model. This derivation of the ApplicationContext listens for when + ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we + ''' offer in the application model. This derivation of the ApplicationContext listens for when ''' the main form closes and provides for shutting down when the main form closes or the ''' last form closes, depending on the mode this application is running in. ''' @@ -43,10 +43,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim forms As FormCollection = Application.OpenForms If forms.Count > 0 Then - 'Note: Initially I used Process::MainWindowHandle to obtain an open form. But that is bad for two reasons: - '1 - It appears to be broken and returns NULL sometimes even when there is still a window around. WinForms people are looking at that issue. + 'Note: Initially I used Process::MainWindowHandle to obtain an open form. But that is bad for two reasons: + '1 - It appears to be broken and returns NULL sometimes even when there is still a window around. WinForms people are looking at that issue. '2 - It returns the first window it hits from enum thread windows, which is not necessarily a windows forms form, so that doesn't help us even if it did work - 'all the time. So I'll use one of our open forms. We may not necessarily get a visible form here but that's OK. Some apps may run on an invisible window + 'all the time. So I'll use one of our open forms. We may not necessarily get a visible form here but that's OK. Some apps may run on an invisible window 'and we need to keep them going until all windows close. MainForm = forms(0) Else diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index f76105b9c54..b43a537d362 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -129,7 +129,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _formLoadWaiter As AutoResetEvent Private _splashScreen As Form - ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext @@ -161,7 +161,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices _turnOnNetworkListener = True ' But the user may be doing an AddHandler of their own in which case we need - ' to make sure to honor the request. If we aren't past OnInitialize() yet + ' to make sure to honor the request. If we aren't past OnInitialize() yet ' we shouldn't do it but the flag above catches that case. If _networkObject Is Nothing AndAlso _finishedOnInitialize Then _networkObject = New Devices.Network @@ -216,7 +216,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Custom Event UnhandledException As UnhandledExceptionEventHandler ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' only if the user writes a handler for this event. We only want to hook the ThreadException event ' if the user is handling this event because the act of listening to Application.ThreadException ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that ' the user wrote their own handler to deal with the error instead. @@ -283,9 +283,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ValidateAuthenticationModeEnumValue(authenticationMode, NameOf(authenticationMode)) - ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, + ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, ' before the Network object gets created because the network object will be doing a - ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must + ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must ' have our principal on the thread before that happens. If authenticationMode = AuthenticationMode.Windows Then Try @@ -302,7 +302,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' We need to set the WindowsFormsSynchronizationContext because the network object is going to ' get created after this ctor runs (network gets created during event hookup) and we need the - ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise + ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise ' get created until OnCreateMainForm() when the startup form is created and by then it is too late. ' When the startup form gets created, WinForms is going to push our context into the previous context ' and then restore it when Application.Run() exits. @@ -358,7 +358,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the collection of forms that are open. We no longer have thread + ''' Returns the collection of forms that are open. We no longer have thread ''' affinity meaning that this is the WinForms collection that contains Forms that may ''' have been opened on another thread then the one we are calling in on right now. ''' @@ -430,10 +430,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Use GDI for the text rendering engine by default. ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' to use the GDI+ render. We read this function in Main() (My template) to ''' determine how to set the text rendering flag on the WinForms application object. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer. + ''' True - Use GDI+ renderer. False - use GDI renderer. Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean Get @@ -471,7 +471,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its ''' variants was passed in. ''' @@ -558,11 +558,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' It is important not to create the network object until the ExecutionContext has everything on it. ' By now the principal will be on the thread so we can create the network object. ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() ' which makes a copy of the executionContext. That execution context shows up on your thread during ' the callback so I delay creating the network object (and consequently the capturing of the execution context) ' until the principal has been set on the thread. This avoids the problem where My.User isn't set - ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future + ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future ' callback that involved the asyncOperationsManager so this is where we need to create objects that ' have a asyncOperationsContext in them. If _turnOnNetworkListener And _networkObject Is Nothing Then @@ -615,8 +615,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to - ' block the main form from painting. To do that I let the form get past the Load() event and hold it until - ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of + ' block the main form from painting. To do that I let the form get past the Load() event and hold it until + ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. AddHandler MainForm.Load, AddressOf MainFormLoadingDone End If @@ -630,7 +630,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Finally ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) - ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it + ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it ' can't fire any events in response to changing network availability conditions through a dead context. If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() @@ -731,7 +731,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Hide the splash screen. The splash screen was created on another thread + ''' Hide the splash screen. The splash screen was created on another thread ''' thread (main thread) than the one it was run on (secondary thread for the ''' splash screen so it doesn't block app startup. We need to invoke the close. ''' This function gets called from the main thread by the app fx. @@ -740,7 +740,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Protected Sub HideSplashScreen() - 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. + 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. SyncLock _splashLock ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling @@ -826,8 +826,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so ''' it doesn't freeze up while the main form is getting it together. ''' Private Sub DisplaySplash() @@ -845,9 +845,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. + ''' we should close the splash screen. If the main form has activated then we close it. ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. + ''' associated with any form. Don't touch forms from this function. ''' Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) @@ -862,7 +862,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The Load() event happens before the Shown and Paint events. When we get called here + ''' The Load() event happens before the Shown and Paint events. When we get called here ''' we know that the form load event is done and that the form is about to paint ''' itself for the first time. ''' We can now hide the splash screen. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index 05509eb50db..59507783f17 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -17,10 +17,10 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Computer : Inherits ServerComputer - 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. + 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. 'Since My.Computer creates the instance of Computer in a thread-safe way, access to the Computer will necessarily be thread-safe. 'There is nothing to prevent a user from passing our computer object across threads or creating their own instance and then getting into trouble. - ' But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. + ' But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. ' If you dim them up yourself, you are responsible for managing the threading. ''' @@ -81,8 +81,8 @@ Namespace Microsoft.VisualBasic.Devices ''' A System.Windows.Forms.Screen object as the primary screen. Public ReadOnly Property Screen() As Screen Get - 'Don't cache this. The Screen class responds to display resolution changes by nulling out AllScreens, which - 'PrimaryScreen relies on to find the primary. So we always need to access the latest PrimaryScreen so we + 'Don't cache this. The Screen class responds to display resolution changes by nulling out AllScreens, which + 'PrimaryScreen relies on to find the primary. So we always need to access the latest PrimaryScreen so we 'will get the current resolution reported. Return Screen.PrimaryScreen End Get @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.Devices Private _audio As Audio 'Lazy initialized cache for the Audio class. Private Shared s_clipboard As ClipboardProxy 'Lazy initialized cache for the clipboard class. (proxies can be shared - they have no state) Private Shared s_mouse As Mouse 'Lazy initialized cache for the Mouse class. SHARED because Mouse behaves as a ReadOnly singleton class - Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class + Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class End Class 'Computer End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 1e07f853d44..afaa7acdf99 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -119,7 +119,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger + ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger ''' so we offer a view that doesn't have that field. ''' Friend NotInheritable Class ComputerInfoDebugView diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index f09e321397e..8f36a01def9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -46,7 +46,7 @@ Namespace Microsoft.VisualBasic.Devices Catch ex As PlatformNotSupportedException Return End Try - SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. + SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) End If @@ -113,9 +113,9 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event from the OS which comes in on an arbitrary thread Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure - 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was - 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original + 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that + 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) End SyncLock diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 6a69169188c..9f81e9d6b14 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -12,10 +12,10 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class ServerComputer - 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. + 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. 'Since My.Computer creates the instance of Computer in a thread-safe way, access to the Computer will necessarily be thread-safe. 'There is nothing to prevent a user from passing our computer object across threads or creating their own instance and then getting into trouble. - 'But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. + 'But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. 'If you dim them up yourself, you are responsible for managing the threading. ''' @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic.Devices Private _fileIO As FileSystemProxy 'Lazy initialized cache for the FileSystem. Private _network As Network 'Lazy initialized cache for the Network class. Private _registryInstance As RegistryProxy 'Lazy initialized cache for the Registry class - Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class + Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class End Class 'MyServerComputer End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index f967c0bb01d..06a61d141d2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -82,9 +82,9 @@ Namespace Microsoft.VisualBasic.CompilerServices End Class ''' - ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead - ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() - ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would + ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead + ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() + ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would ''' and we got memory corruption problems detectable while running AppVerifier. ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. ''' as String so that the memory will get cleaned up. @@ -153,7 +153,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ' This code correctly implements the disposable pattern. Friend Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index cee1f961619..86fe04b8603 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -99,7 +99,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(prompt, Label.Font, Label.Width) labelGraphics.Dispose() If labelSizeNeeded.Height > Label.Height Then - 'The current label size is not large enough to accommodate the prompt. We need + 'The current label size is not large enough to accommodate the prompt. We need ' to expand the label and the dialog, and move the textbox to make room. Dim dialogHeightChange As Integer = CInt(labelSizeNeeded.Height) - Label.Height Label.Height += dialogHeightChange diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 66114906816..cb932d73cbd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, startupInfo, processInfo) @@ -95,8 +95,8 @@ Namespace Microsoft.VisualBasic 'As an optimization, we will only check the UI permission once we actually know we found the app to activate - we'll do that in AppActivateHelper Dim processIdOwningWindow As Integer - 'Note, a process can have multiple windows. What we want to do is dig through to find one - 'that we can actually activate. So first ignore all the ones that are not visible and don't support mouse + 'Note, a process can have multiple windows. What we want to do is dig through to find one + 'that we can actually activate. So first ignore all the ones that are not visible and don't support mouse 'or keyboard input Dim windowHandle As IntPtr = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) @@ -221,7 +221,7 @@ Namespace Microsoft.VisualBasic ' SetActiveWindow on Win32 only activates the Window - it does ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' the current thread. NativeMethods.SetForegroundWindow() activates the ' window, moves it to the foreground, and bumps the priority ' of the thread which owns the window. @@ -242,7 +242,7 @@ Namespace Microsoft.VisualBasic Dim parentWindow As IWin32Window = Nothing vbHost = HostServices.VBHost - If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. + If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. parentWindow = vbHost.GetParentWindow() End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index d88ba9ef7f3..8721ec8979d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -744,7 +744,7 @@ Namespace Microsoft.VisualBasic.Logging i += 1 End SyncLock End While - 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system + 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function @@ -1226,7 +1226,7 @@ Namespace Microsoft.VisualBasic.Logging ''' Standard implementation of IDisposable. ''' Public Overloads Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub @@ -1235,7 +1235,7 @@ Namespace Microsoft.VisualBasic.Logging ''' Ensures stream is closed at GC. ''' Protected Overrides Sub Finalize() - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(False) MyBase.Finalize() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index 6d549e70a22..c6eed7ab397 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Friend NotInheritable Class HttpClientCopy - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. Private WithEvents m_ProgressDialog As ProgressDialog ' The WebClient performs the downloading or uploading operations for us @@ -90,11 +90,11 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' the current async file transfer operation. ''' ''' - ''' Note that we don't want to close the progress dialog here. Wait until + ''' Note that we don't want to close the progress dialog here. Wait until ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserHitCancel() - 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the HttpClient cancels the xfer. + 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the HttpClient cancels the xfer. _cancelTokenSourceGet.Cancel() _cancelTokenSourceRead.Cancel() _cancelTokenSourceReadStream.Cancel() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index ef3d225ff6a..73cf87c32da 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -128,17 +128,17 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' the current async file transfer operation. ''' ''' - ''' Note that we don't want to close the progress dialog here. Wait until + ''' Note that we don't want to close the progress dialog here. Wait until ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. End Sub ' The WebClient performs the downloading or uploading operations for us Private WithEvents m_WebClient As WebClient - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. Private WithEvents m_ProgressDialog As ProgressDialog 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread From e9cc15df8cacb35d09dd035e0ca9686b9329c04c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 17:59:22 -0700 Subject: [PATCH 214/342] Rename InputBoxHandler.vb to Interaction.InputBoxHandler.vb --- .../{InputBoxHandler.vb => Interaction.InputBoxHandler.vb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/{InputBoxHandler.vb => Interaction.InputBoxHandler.vb} (100%) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/InputBoxHandler.vb rename to src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb From 3c20702a99300e86a7989b0a9cc88635d3ec084d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 18:25:40 -0700 Subject: [PATCH 215/342] Fix XML Comments Add [CollectionDefinition("Sequential",DisableParallelization =true)] which prevents Clipboard tests from funning in parrallel with ANY othe collections. --- .../VisualBasic/CompilerServices/ExceptionUtils.vb | 8 ++++---- .../src/Microsoft/VisualBasic/Devices/ServerComputer.vb | 4 ++-- .../src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb | 2 +- .../VisualBasic/MyServices/ClipboardProxyTests.cs | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index d38b023913a..5b93b23f44e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -69,12 +69,12 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentException. + ''' A new instance of . ''' This is the preferred way to construct an argument exception. Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException @@ -83,10 +83,10 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." + ''' Returns a new instance of with message: "Argument cannot be Nothing." ''' ''' The name of the argument (parameter). Not localized. - ''' A new instance of ArgumentNullException. + ''' A new instance of . Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 757cd880b0a..3b2987f99df 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' A RAD object representing the server 'computer' for the web/Windows Services ''' that serves as a discovery mechanism for finding principle abstractions in - ''' the system that you can code against + ''' the system that you can code against. ''' Public Class ServerComputer @@ -74,7 +74,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property wraps the System.Environment.MachineName property + ''' This property wraps the property ''' in the .NET framework to return the name of the computer. ''' ''' A string containing the name of the computer. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 10357a7ae66..24526de1005 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -38,7 +38,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Throw ArgumentException if the file path ends with a separator. + ''' Throw if the file path ends with a separator. ''' ''' The file path. ''' The parameter name to include in ArgumentException. diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 4df06e1ba30..621e067d229 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -9,6 +9,7 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [Collection("Sequential")] +[CollectionDefinition("Sequential",DisableParallelization =true)] public class ClipboardProxyTests { [WinFormsFact] From 1f19129b470359fbaaef3113240c60c354e33588 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 18:43:18 -0700 Subject: [PATCH 216/342] Split ReferenceStram to separate file --- .../FileLogTraceListener.ReferencedStream.vb | 143 ++++++++++++++++++ .../Logging/FileLogTraceListener.vb | 142 +---------------- 2 files changed, 148 insertions(+), 137 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb new file mode 100644 index 00000000000..c52dc5ce65e --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb @@ -0,0 +1,143 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO + +Namespace Microsoft.VisualBasic.Logging + + Partial Public Class FileLogTraceListener + + Friend NotInheritable Class ReferencedStream + Implements IDisposable + + ' Used for synchronizing writing and reference counting + Private ReadOnly _syncObject As Object = New Object + + ' Indicates whether or not the object has been disposed + Private _disposed As Boolean + + ' The number of FileLogTraceListeners using the stream + Private _referenceCount As Integer + + ' The stream that does the writing + Private _stream As StreamWriter + + ''' + ''' Creates a new referenced stream. + ''' + ''' The stream that does the actual writing. + Friend Sub New(stream As StreamWriter) + _stream = stream + End Sub + + ''' + ''' Ensures stream is closed at GC. + ''' + Protected Overrides Sub Finalize() + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(False) + MyBase.Finalize() + End Sub + + ''' + ''' The size of the log file. + ''' + ''' The size. + Friend ReadOnly Property FileSize() As Long + Get + Return _stream.BaseStream.Length + End Get + End Property + + ''' + ''' Indicates whether or not the stream is still in use by a FileLogTraceListener. + ''' + ''' True if the stream is being used, otherwise False. + Friend ReadOnly Property IsInUse() As Boolean + Get + Return _stream IsNot Nothing + End Get + End Property + + ''' + ''' Ensures the stream is closed (flushed) no matter how we are closed. + ''' + ''' Indicates who called dispose. + Private Overloads Sub Dispose(disposing As Boolean) + If disposing Then + If Not _disposed Then + _stream?.Close() + _disposed = True + End If + End If + End Sub + + ''' + ''' Increments the reference count for the stream. + ''' + Friend Sub AddReference() + SyncLock _syncObject + _referenceCount += 1 + End SyncLock + End Sub + + ''' + ''' Decrements the reference count to the stream and closes + ''' the stream if the reference count is zero. + ''' + Friend Sub CloseStream() + SyncLock _syncObject + Try + _referenceCount -= 1 + _stream.Flush() + Debug.Assert(_referenceCount >= 0, "Ref count is below 0") + Finally + If _referenceCount <= 0 Then + _stream.Close() + _stream = Nothing + End If + End Try + End SyncLock + End Sub + + ''' + ''' Flushes the stream. + ''' + Friend Sub Flush() + SyncLock _syncObject + _stream.Flush() + End SyncLock + End Sub + + ''' + ''' Writes a message to the stream. + ''' + ''' The message to write. + Friend Sub Write(message As String) + SyncLock _syncObject + _stream.Write(message) + End SyncLock + End Sub + + ''' + ''' Writes a message to the stream as a line. + ''' + ''' The message to write. + Friend Sub WriteLine(message As String) + SyncLock _syncObject + _stream.WriteLine(message) + End SyncLock + End Sub + + ''' + ''' Standard implementation of IDisposable. + ''' + Public Overloads Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + + End Class 'ReferencedStream + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 8721ec8979d..3f670f3a250 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -16,8 +16,10 @@ Namespace Microsoft.VisualBasic.Logging ''' Options for the location of a log's directory. ''' Public Enum LogFileLocation As Integer + ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory + LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory @@ -49,7 +51,7 @@ Namespace Microsoft.VisualBasic.Logging ''' Therefore, mark FileLogTraceListener as ComVisible(False). ''' - Public Class FileLogTraceListener + Partial Public Class FileLogTraceListener Inherits TraceListener ''' @@ -1044,6 +1046,7 @@ Namespace Microsoft.VisualBasic.Logging ' Identifies properties in the BitArray Private Const PROPERTY_COUNT As Integer = 12 + Private Const APPEND_INDEX As Integer = 0 Private Const AUTOFLUSH_INDEX As Integer = 1 Private Const BASEFILENAME_INDEX As Integer = 2 @@ -1069,6 +1072,7 @@ Namespace Microsoft.VisualBasic.Logging ' Attribute keys used to access properties set in the config file Private Const KEY_APPEND As String = "append" + Private Const KEY_APPEND_PASCAL As String = "Append" Private Const KEY_AUTOFLUSH As String = "autoflush" @@ -1117,141 +1121,5 @@ Namespace Microsoft.VisualBasic.Logging ' Delimiter used when converting a stack to a string Private Const STACK_DELIMITER As String = ", " - ''' - ''' Wraps a StreamWriter and keeps a reference count. This enables multiple - ''' FileLogTraceListeners on multiple threads to access the same file. - ''' - Friend NotInheritable Class ReferencedStream - Implements IDisposable - - ''' - ''' Creates a new referenced stream. - ''' - ''' The stream that does the actual writing. - Friend Sub New(stream As StreamWriter) - _stream = stream - End Sub - - ''' - ''' Writes a message to the stream. - ''' - ''' The message to write. - Friend Sub Write(message As String) - SyncLock _syncObject - _stream.Write(message) - End SyncLock - End Sub - - ''' - ''' Writes a message to the stream as a line. - ''' - ''' The message to write. - Friend Sub WriteLine(message As String) - SyncLock _syncObject - _stream.WriteLine(message) - End SyncLock - End Sub - - ''' - ''' Increments the reference count for the stream. - ''' - Friend Sub AddReference() - SyncLock _syncObject - _referenceCount += 1 - End SyncLock - End Sub - - ''' - ''' Flushes the stream. - ''' - Friend Sub Flush() - SyncLock _syncObject - _stream.Flush() - End SyncLock - End Sub - - ''' - ''' Decrements the reference count to the stream and closes - ''' the stream if the reference count is zero. - ''' - Friend Sub CloseStream() - SyncLock _syncObject - Try - _referenceCount -= 1 - _stream.Flush() - Debug.Assert(_referenceCount >= 0, "Ref count is below 0") - Finally - If _referenceCount <= 0 Then - _stream.Close() - _stream = Nothing - End If - End Try - End SyncLock - End Sub - - ''' - ''' Indicates whether or not the stream is still in use by a FileLogTraceListener. - ''' - ''' True if the stream is being used, otherwise False. - Friend ReadOnly Property IsInUse() As Boolean - Get - Return _stream IsNot Nothing - End Get - End Property - - ''' - ''' The size of the log file. - ''' - ''' The size. - Friend ReadOnly Property FileSize() As Long - Get - Return _stream.BaseStream.Length - End Get - End Property - - ''' - ''' Ensures the stream is closed (flushed) no matter how we are closed. - ''' - ''' Indicates who called dispose. - Private Overloads Sub Dispose(disposing As Boolean) - If disposing Then - If Not _disposed Then - _stream?.Close() - _disposed = True - End If - End If - End Sub - - ''' - ''' Standard implementation of IDisposable. - ''' - Public Overloads Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(True) - GC.SuppressFinalize(Me) - End Sub - - ''' - ''' Ensures stream is closed at GC. - ''' - Protected Overrides Sub Finalize() - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(False) - MyBase.Finalize() - End Sub - - ' The stream that does the writing - Private _stream As StreamWriter - - ' The number of FileLogTraceListeners using the stream - Private _referenceCount As Integer - - ' Used for synchronizing writing and reference counting - Private ReadOnly _syncObject As Object = New Object - - ' Indicates whether or not the object has been disposed - Private _disposed As Boolean - - End Class 'ReferencedStream End Class 'FileLogTraceListener End Namespace From 99aad63df954a348e6491961d66b22a1565bd50e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 22 Jun 2024 18:57:32 -0700 Subject: [PATCH 217/342] Minor cleanup of XML comments --- .../WindowsFormsApplicationBase.vb | 16 ++++----- .../FileLogTraceListener.ReferencedStream.vb | 4 +-- .../VisualBasic/MyServices/ClipboardProxy.vb | 34 +++++++++---------- .../MyServices/Internal/ProgressDialog.vb | 2 +- .../Windows/Forms/ClipboardProxyTests.vb | 2 +- .../Forms/ComputerInfoDebugViewTests.vb | 4 +-- .../Windows/Forms/ExceptionUtilsTests.vb | 2 +- .../Forms/SingleInstanceHelpersTests.vb | 21 +++++------- 8 files changed, 40 insertions(+), 45 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index b43a537d362..d0d9a310c63 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -211,7 +211,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Event ''' - ''' Occurs when the application encounters an unhandled exception. + ''' Occurs when the application encounters an . ''' Public Custom Event UnhandledException As UnhandledExceptionEventHandler @@ -248,15 +248,15 @@ Namespace Microsoft.VisualBasic.ApplicationServices RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) If _unhandledExceptionHandlers IsNot Nothing Then - ' In the case that we throw from the unhandled exception handler, we don't want to - ' run the unhandled exception handler again. + ' In the case that we throw from the handler, we don't want to + ' run the handler again. _processingUnhandledExceptionEvent = True For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers handler?.Invoke(sender, e) Next - ' Now that we are out of the unhandled exception handler, treat exceptions normally again. + ' Now that we are out of the handler, treat exceptions normally again. _processingUnhandledExceptionEvent = False End If End RaiseEvent @@ -667,7 +667,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Raises the UnHandled exception event and exits the application if the event handler indicated + ''' Raises the event and exits the application if the event handler indicated ''' that execution shouldn't continue. ''' ''' @@ -897,12 +897,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event + ''' exception event. ''' ''' ''' ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' unhandled exception event so we do the translation here before raising our event. + ''' event so we do the translation here before raising our event. ''' Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) @@ -1013,7 +1013,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' ''' A string unique to the application that should be the same for versions of - ''' the application that have the same Major and Minor Version Number + ''' the application that have the same Major and Minor Version Number. ''' ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. Private Shared Function GetApplicationInstanceID(entry As Assembly) As String diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb index c52dc5ce65e..eeb859cad7e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb @@ -5,7 +5,7 @@ Imports System.IO Namespace Microsoft.VisualBasic.Logging - Partial Public Class FileLogTraceListener + Public Class FileLogTraceListener Friend NotInheritable Class ReferencedStream Implements IDisposable @@ -139,5 +139,5 @@ Namespace Microsoft.VisualBasic.Logging End Sub End Class 'ReferencedStream - End Class + End Class 'FileLogTraceListener End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index 223af82c538..4e62ce9122e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -17,13 +17,13 @@ Namespace Microsoft.VisualBasic.MyServices Public Class ClipboardProxy ''' - ''' Only Allows instantiation of the class + ''' Only allows instantiation of the class ''' Friend Sub New() End Sub ''' - ''' Gets text from the clipboard + ''' Gets text from the clipboard. ''' ''' The text as a String. Public Function GetText() As String @@ -31,7 +31,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Gets text from the clipboard saved in the passed in format + ''' Gets text from the clipboard saved in the passed in format. ''' ''' The type of text to get. ''' The text as a String. @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard + ''' Indicates whether or not text is available on the clipboard. ''' ''' True if text is available, otherwise False. Public Function ContainsText() As Boolean @@ -49,7 +49,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Indicates whether or not text is available on the clipboard in - ''' the passed in format + ''' the passed in format. ''' ''' The type of text being checked for. ''' True if text is available, otherwise False. @@ -58,7 +58,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in String to the clipboard + ''' Saves the passed in String to the clipboard. ''' ''' The String to save. Public Sub SetText(text As String) @@ -66,7 +66,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Saves the passed in String to the clipboard in the passed in format + ''' Saves the passed in String to the clipboard in the passed in format. ''' ''' The String to save. ''' The format in which to save the String. @@ -75,7 +75,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets an Image from the clipboard + ''' Gets an Image from the clipboard. ''' ''' The image. Public Function GetImage() As Image @@ -83,7 +83,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicate whether or not an image has been saved to the clipboard + ''' Indicate whether or not an image has been saved to the clipboard. ''' ''' True if an image is available, otherwise False. Public Function ContainsImage() As Boolean @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in image to the clipboard + ''' Saves the passed in image to the clipboard. ''' ''' The image to be saved. Public Sub SetImage(image As Image) @@ -99,7 +99,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets an audio stream from the clipboard + ''' Gets an audio stream from the clipboard. ''' ''' The audio stream as a Stream. Public Function GetAudioStream() As Stream @@ -107,7 +107,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not there's an audio stream saved to the clipboard + ''' Indicates whether or not there's an audio stream saved to the clipboard. ''' ''' True if an audio stream is available, otherwise False. Public Function ContainsAudio() As Boolean @@ -115,7 +115,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in audio byte array to the clipboard + ''' Saves the passed in audio byte array to the clipboard. ''' ''' The byte array to be saved. Public Sub SetAudio(audioBytes As Byte()) @@ -123,7 +123,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Saves the passed in audio stream to the clipboard + ''' Saves the passed in audio stream to the clipboard. ''' ''' The stream to be saved. Public Sub SetAudio(audioStream As Stream) @@ -131,7 +131,7 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets a file drop list from the clipboard + ''' Gets a file drop list from the clipboard. ''' ''' The list of file paths as a StringCollection. Public Function GetFileDropList() As StringCollection @@ -139,7 +139,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not a file drop list has been saved to the clipboard + ''' Indicates whether or not a file drop list has been saved to the clipboard. ''' ''' True if a file drop list is available, otherwise False. Public Function ContainsFileDropList() As Boolean @@ -147,7 +147,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in file drop list to the clipboard + ''' Saves the passed in file drop list to the clipboard. ''' ''' The file drop list as a StringCollection. Public Sub SetFileDropList(filePaths As StringCollection) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 8eadd3edea5..af6629a7d86 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -163,7 +163,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Ensure the label resizes with the dialog + ''' Ensure the label resizes with the dialog. ''' ''' ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 509ab1a861c..c55ae82c194 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -9,7 +9,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere. + ''' These are just checking the Proxy functions, the underlying functions are tested elsewhere. ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb index 2aecae290c8..37d2497ebb0 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb @@ -9,7 +9,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Class ComputerInfoDebugViewTests - + Public Sub Memory() Dim info As New ComputerInfoDebugView(New ComputerInfo) If PlatformDetection.IsWindows Then @@ -20,7 +20,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub - + Public Sub Properties() Dim info As New ComputerInfoDebugView(New ComputerInfo) Assert.Equal(Globalization.CultureInfo.InstalledUICulture, info.InstalledUICulture) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 74e8bd6c3ba..0e335d3f24f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -9,7 +9,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Forms.Tests ''' - ''' These are just checking the Proxy functions, the underlaying functions are tested elsewhere. + ''' These are just checking the Proxy functions, the underlying functions are tested elsewhere. ''' Partial Public Class ExceptionUtilsTests diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb index 0eec2d2b031..5eb7060e355 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb @@ -45,36 +45,31 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - Public Sub WaitForClientConnectionsAsyncTests() + Public Async Function WaitForClientConnectionsAsyncTests() As Task Dim pipeName As String = GetUniqueText() Dim pipeServer As NamedPipeServerStream = Nothing If TryCreatePipeServer(pipeName, pipeServer) Then Using pipeServer Dim tokenSource As New CancellationTokenSource() -#Disable Warning BC42358 ' Call is not awaited. - WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) -#Enable Warning BC42358 + Dim clientConnection As Task = WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) Dim commandLine As String() = {"Hello"} Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(pipeName, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) awaitable.GetAwaiter().GetResult() Dim CancelToken As New CancellationToken Dim buffer As Byte() = New Byte(commandLine.Length) {} -#Disable Warning CA2012 ' Use ValueTasks correctly - ' NOTE TO REVIEWS: Below needs to be fixed but I don't know how - Dim countTask As ValueTask(Of Integer) = pipeServer.ReadAsync(buffer.AsMemory(0, commandLine.Length)) -#Enable Warning CA2012 ' Use ValueTasks correctly + Dim count As Integer = Await pipeServer.ReadAsync(buffer.AsMemory(0, commandLine.Length)) + ' Ensure the result is set Do - Thread.Sleep(5) - Loop Until _resultArgs IsNot Nothing AndAlso countTask.IsCompleted - Assert.True(countTask.IsCompletedSuccessfully) + Await Task.Delay(5) + Loop Until _resultArgs IsNot Nothing Assert.Equal("Hello", _resultArgs(0)) - tokenSource.Cancel() + Await tokenSource.CancelAsync() End Using End If - End Sub + End Function End Class End Namespace From e6573b5596dd2b4b829e4046d53f1c787359cd09 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 23 Jun 2024 00:09:29 -0700 Subject: [PATCH 218/342] Revert "Fix XML Comments" This reverts commit 3c20702a99300e86a7989b0a9cc88635d3ec084d. --- .../VisualBasic/CompilerServices/ExceptionUtils.vb | 8 ++++---- .../src/Microsoft/VisualBasic/Devices/ServerComputer.vb | 4 ++-- .../src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb | 2 +- .../VisualBasic/MyServices/ClipboardProxyTests.cs | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 5b93b23f44e..d38b023913a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -69,12 +69,12 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . + ''' A new instance of ArgumentException. ''' This is the preferred way to construct an argument exception. Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException @@ -83,10 +83,10 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of with message: "Argument cannot be Nothing." + ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." ''' ''' The name of the argument (parameter). Not localized. - ''' A new instance of . + ''' A new instance of ArgumentNullException. Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 3b2987f99df..757cd880b0a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' A RAD object representing the server 'computer' for the web/Windows Services ''' that serves as a discovery mechanism for finding principle abstractions in - ''' the system that you can code against. + ''' the system that you can code against ''' Public Class ServerComputer @@ -74,7 +74,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property wraps the property + ''' This property wraps the System.Environment.MachineName property ''' in the .NET framework to return the name of the computer. ''' ''' A string containing the name of the computer. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 24526de1005..10357a7ae66 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -38,7 +38,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Throw if the file path ends with a separator. + ''' Throw ArgumentException if the file path ends with a separator. ''' ''' The file path. ''' The parameter name to include in ArgumentException. diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 621e067d229..4df06e1ba30 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -9,7 +9,6 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [Collection("Sequential")] -[CollectionDefinition("Sequential",DisableParallelization =true)] public class ClipboardProxyTests { [WinFormsFact] From 382fdd68f3411cbecbd7eb6853f28e07c54667bd Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 23 Jun 2024 00:16:27 -0700 Subject: [PATCH 219/342] Revert "[main] Update dependencies from dotnet/runtime (#11576)" This reverts commit a1e4949a8b292cf81aea00d82e7c760f5991e442. --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 130da9652e4..8997d2e1d6c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab - + https://github.com/dotnet/runtime - 2b5c5422b8359716fc0d5766487ea1a6527d7472 + 7bc92926b36617f7a0646a8d936782bc4c3264ab diff --git a/eng/Versions.props b/eng/Versions.props index 6b6b944234b..b560e43119f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,36 +13,36 @@ - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 5.0.0-preview.7.20320.5 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 6.0.0 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 - 9.0.0-preview.6.24321.10 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 + 9.0.0-preview.6.24320.8 diff --git a/global.json b/global.json index b8ee3631fe2..7747cf633ce 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24321.4", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24321.4", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.6.24321.10" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.6.24320.8" }, "native-tools": { "cmake": "latest" From c66ff1120be795447a7f41590d28ae99eefae5b4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 23 Jun 2024 00:28:09 -0700 Subject: [PATCH 220/342] Add some cref entries --- .../CompilerServices/ExceptionUtils.vb | 32 +++++++++---------- .../VisualBasic/Devices/ServerComputer.vb | 4 +-- .../VisualBasic/Helpers/FileSystemUtils.vb | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index bd71b887d7d..51a4d71bd6d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -46,12 +46,12 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentException. + ''' A new instance of . ''' This is the preferred way to construct an argument exception. Friend Function GetArgumentExceptionWithArgName(argumentName As String, resourceID As String, @@ -61,22 +61,22 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." + ''' Returns a new instance of with message: "Argument cannot be Nothing." ''' ''' The name of the argument (parameter). Not localized. - ''' A new instance of ArgumentNullException. + ''' A new instance of . Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException Return New ArgumentNullException(argumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' - ''' Returns a new instance of ArgumentNullException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' ''' The name of the argument (parameter). Not localized. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentNullException. + ''' A new instance of . Friend Function GetArgumentNullException(argumentName As String, resourceID As String, ParamArray placeHolders() As String) As ArgumentNullException @@ -85,11 +85,11 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.DirectoryNotFoundException. + ''' A new instance of . Friend Function GetDirectoryNotFoundException(resourceID As String, ParamArray placeHolders() As String) As IO.DirectoryNotFoundException @@ -97,12 +97,12 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' ''' The file name (path) of the not found file. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.FileNotFoundException. + ''' A new instance of . Friend Function GetFileNotFoundException(fileName As String, resourceID As String, ParamArray placeHolders() As String) As IO.FileNotFoundException @@ -111,11 +111,11 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of InvalidOperationException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of InvalidOperationException. + ''' A new instance of . Friend Function GetInvalidOperationException(resourceID As String, ParamArray placeHolders() As String) As InvalidOperationException @@ -123,11 +123,11 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of IO.IOException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.IOException. + ''' A new instance of . Friend Function GetIOException(resourceID As String, ParamArray placeHolders() As String) As IO.IOException @@ -135,11 +135,11 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. + ''' Returns a new instance of with the message from resource file and the last Win32 error. ''' ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of Win32Exception. + ''' A new instance of . ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. Friend Function GetWin32Exception(resourceID As String, ParamArray placeHolders() As String) As ComponentModel.Win32Exception diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 9f81e9d6b14..6a806f24b60 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -8,7 +8,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' A RAD object representing the server 'computer' for the web/Windows Services ''' that serves as a discovery mechanism for finding principle abstractions in - ''' the system that you can code against + ''' the system that you can code against. ''' Public Class ServerComputer @@ -71,7 +71,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property wraps the System.Environment.MachineName property + ''' This property wraps the property ''' in the .NET framework to return the name of the computer. ''' ''' A string containing the name of the computer. diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 46c32e69a4a..883ceb42d85 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -36,10 +36,10 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Throw ArgumentException if the file path ends with a separator. + ''' Throw if the file path ends with a separator. ''' ''' The file path. - ''' The parameter name to include in ArgumentException. + ''' The parameter name to include in . Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) ' Check for argument null From 0fe1ae115ef79af49a47c8d8539f74d865f2b545 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 23 Jun 2024 00:31:49 -0700 Subject: [PATCH 221/342] Inmprove XML comments in FileSystem.Utils --- .../src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 883ceb42d85..c1c848a9580 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports System.IO Imports System.Security Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils @@ -59,7 +60,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The given path in long format if the path exists. ''' ''' GetLongPathName is a PInvoke call and requires unmanaged code permission. - ''' Use DirectoryInfo.GetFiles and GetDirectories (which call FindFirstFile) so that we always have permission. + ''' Use and (which call FindFirstFile) so that we always have permission. ''' Private Shared Function GetLongPath(fullPath As String) As String Debug.Assert(Not String.IsNullOrEmpty(fullPath) AndAlso IO.Path.IsPathRooted(fullPath), "Must be full path") From fc29609a208fd468a2e246fbd282ad2480be467a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 23 Jun 2024 00:39:57 -0700 Subject: [PATCH 222/342] Add missing period --- .../ApplicationServices/WindowsFormsApplicationBase.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index d0d9a310c63..34d1de1ee0d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -942,7 +942,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event + ''' NetworkAvailabilityChanged event. ''' ''' Contains the Network instance that raised the event. ''' Contains whether the network is available or not. From 741b8716238ef89a38101a7f73281b6afaa3fe2b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 24 Jun 2024 15:56:20 -0700 Subject: [PATCH 223/342] Remove extra space in VbMakeException --- .../Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 51a4d71bd6d..76844282735 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -51,7 +51,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The name of the argument (parameter). Not localized. ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . + ''' A new instance of . ''' This is the preferred way to construct an argument exception. Friend Function GetArgumentExceptionWithArgName(argumentName As String, resourceID As String, @@ -61,7 +61,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Returns a new instance of with message: "Argument cannot be Nothing." + ''' Returns a new instance of with message: "Argument cannot be Nothing." ''' ''' The name of the argument (parameter). Not localized. ''' A new instance of . From be795a1407541d7aff373d664cdcb8bf25437c4f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 24 Jun 2024 18:37:32 -0700 Subject: [PATCH 224/342] Remove "Partial" from Test Classes --- .../System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb | 2 +- .../tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb | 2 +- .../UnitTests/System/Windows/Forms/NetworkDownloadTests.vb | 2 +- .../tests/UnitTests/System/Windows/Forms/TimeTests.vb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index d073fea6f40..421eaa6e0ff 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -6,7 +6,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests - Partial Public Class AssemblyPublicKeyIsAsExpectedTest + Public Class AssemblyPublicKeyIsAsExpectedTest Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 0e335d3f24f..5dea00d249f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' ''' These are just checking the Proxy functions, the underlying functions are tested elsewhere. ''' - Partial Public Class ExceptionUtilsTests + Public Class ExceptionUtilsTests Public Sub GetArgumentNullExceptionTest_Succeed() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 03e2a2333c3..80c4aedc2b6 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -8,7 +8,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests - Partial Public Class NetworkTests + Public Class NetworkTests Private Const DefaultPassword As String = "TBD" Private Const DefaultUserName As String = "TBD" Private Const DownloadLargeFileSize As Integer = 104857600 diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index db0283b9434..e13e5bec731 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -5,7 +5,7 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests - Partial Public Class TimeTests + Public Class TimeTests Private Const PrecisionTickLimit As Integer = 1000 Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean From 60c62ba6559adf40a158fd29f12bc78bbc6c341f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 10 Jul 2024 17:41:55 -0700 Subject: [PATCH 225/342] Update TextBoxBaseTests from Master --- .../tests/UnitTests/TextBoxBaseTests.cs | 236 +++++++++++++++++- 1 file changed, 235 insertions(+), 1 deletion(-) diff --git a/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs b/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs index a5d4a0937e9..a286fdc57c9 100644 --- a/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs @@ -778,7 +778,7 @@ public void TextBoxBase_RecreateControl_DoesntClearTextProvider() provider = control.AccessibilityObject.TestAccessor().Dynamic._textProvider; // The control's accessible object and its providers shouldn't be cleaned when recreating of the control - // because this object and all its providers will continue to be used. + // because this object and all its providers will continue to be used. Assert.IsType(provider); } @@ -4131,6 +4131,136 @@ public void TextBoxBase_ClearUndo_InvokeWithHandle_Success() Assert.Equal(0, createdCallCount); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/11497")] + [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/11497")] + public void TextBoxBase_ClearUndo_CanUndo_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + control.Copy(); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + + control.ClearUndo(); + control.Undo(); + Assert.Equal("bcxt", control.Text); + } + + [WinFormsFact] + public void TextBoxBase_Copy_PasteEmpty_Success() + { + using SubTextBox control = new(); + control.Copy(); + Assert.Empty(control.Text); + Assert.True(control.IsHandleCreated); + + control.Text = "text"; + control.SelectionLength = 2; + Assert.Equal("text", control.Text); + Assert.True(control.IsHandleCreated); + } + + [ActiveIssue("https://github.com/dotnet/winforms/issues/11558")] + [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/11558")] + public void TextBoxBase_Copy_PasteNotEmpty_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + control.Copy(); + Assert.Equal("abc", control.Text); + Assert.True(control.IsHandleCreated); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + Assert.True(control.CanUndo); + Assert.True(control.Modified); + Assert.True(control.IsHandleCreated); + } + + [WinFormsFact] + public void TextBoxBase_Copy_PasteEmptyWithHandle_Success() + { + using SubTextBox control = new(); + Assert.NotEqual(IntPtr.Zero, control.Handle); + int invalidatedCallCount = 0; + control.Invalidated += (sender, e) => invalidatedCallCount++; + int styleChangedCallCount = 0; + control.StyleChanged += (sender, e) => styleChangedCallCount++; + int createdCallCount = 0; + control.HandleCreated += (sender, e) => createdCallCount++; + + control.Copy(); + Assert.Empty(control.Text); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + + control.Text = "text"; + control.SelectionLength = 2; + Assert.Equal("text", control.Text); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + } + + [ActiveIssue("https://github.com/dotnet/winforms/issues/11498")] + [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/11498")] + public void TextBoxBase_Copy_PasteNotEmptyWithHandle_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + Assert.NotEqual(IntPtr.Zero, control.Handle); + int invalidatedCallCount = 0; + control.Invalidated += (sender, e) => invalidatedCallCount++; + int styleChangedCallCount = 0; + control.StyleChanged += (sender, e) => styleChangedCallCount++; + int createdCallCount = 0; + control.HandleCreated += (sender, e) => createdCallCount++; + + control.Copy(); + Assert.Equal("abc", control.Text); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + Assert.True(control.CanUndo); + Assert.True(control.Modified); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + } + [WinFormsFact] public void TextBoxBase_CreateHandle_Invoke_Success() { @@ -4179,6 +4309,28 @@ public void TextBoxBase_Cut_PasteEmpty_Success() Assert.True(control.IsHandleCreated); } + [WinFormsFact] + public void TextBoxBase_Cut_PasteNotEmpty_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + control.Cut(); + Assert.Equal("a", control.Text); + Assert.True(control.IsHandleCreated); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + Assert.True(control.CanUndo); + Assert.True(control.Modified); + Assert.True(control.IsHandleCreated); + } + [WinFormsFact] public void TextBoxBase_Cut_PasteEmptyWithHandle_Success() { @@ -4207,6 +4359,42 @@ public void TextBoxBase_Cut_PasteEmptyWithHandle_Success() Assert.Equal(0, createdCallCount); } + [WinFormsFact] + public void TextBoxBase_Cut_PasteNotEmptyWithHandle_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + Assert.NotEqual(IntPtr.Zero, control.Handle); + int invalidatedCallCount = 0; + control.Invalidated += (sender, e) => invalidatedCallCount++; + int styleChangedCallCount = 0; + control.StyleChanged += (sender, e) => styleChangedCallCount++; + int createdCallCount = 0; + control.HandleCreated += (sender, e) => createdCallCount++; + + control.Cut(); + Assert.Equal("a", control.Text); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + Assert.True(control.CanUndo); + Assert.True(control.Modified); + Assert.True(control.IsHandleCreated); + Assert.Equal(0, invalidatedCallCount); + Assert.Equal(0, styleChangedCallCount); + Assert.Equal(0, createdCallCount); + } + [WinFormsFact] public void TextBoxBase_DeselectAll_InvokeEmpty_Success() { @@ -5799,6 +5987,29 @@ public void TextBoxBase_OnTextChanged_Invoke_CallsTextChanged(EventArgs eventArg Assert.False(control.IsHandleCreated); } + [WinFormsFact] + public void TextBoxBase_Paste_InvokeEmpty_Success() + { + using SubTextBox control = new(); + control.Paste(); + Assert.NotNull(control.Text); + Assert.True(control.IsHandleCreated); + } + + [WinFormsFact] + public void TextBoxBase_Paste_InvokeNotEmpty_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + control.Paste(); + Assert.Equal("abc", control.Text); + Assert.True(control.IsHandleCreated); + } + public static IEnumerable ProcessCmdKey_TestData() { foreach (bool shortcutsEnabled in new bool[] { true, false }) @@ -6927,6 +7138,29 @@ public void TextBoxBase_Undo_InvokeNotEmptyWithHandle_Success() Assert.Equal(0, createdCallCount); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/11559")] + [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/11559")] + public void TextBoxBase_Undo_CanUndo_Success() + { + using SubTextBox control = new() + { + Text = "abc", + SelectionStart = 1, + SelectionLength = 2 + }; + control.Copy(); + + control.Text = "text"; + control.SelectionLength = 2; + control.Paste(); + Assert.Equal("bcxt", control.Text); + + control.Undo(); + Assert.Equal("text", control.Text); + } + public static IEnumerable WndProc_ContextMenuWithoutContextMenuStrip_TestData() { foreach (bool shortcutsEnabled in new bool[] { true, false }) From d3dcc5de67e11149e524e84f2bbf84d0a8e05ea6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 10 Jul 2024 21:39:06 -0700 Subject: [PATCH 226/342] Fix editorConfig for VB # IDE0001: severity = silent # IDE0002: severity = silent --- .editorconfig | 8 +++++++- .../WinFormsApplication-VisualBasic/Form1.Designer.vb | 2 +- .../UserControl1.Designer.vb | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index a5b52c7ebe2..d12cb10f1e8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -494,7 +494,7 @@ dotnet_diagnostic.CA1070.severity = error # CA2016: Forward the CancellationToken parameter to methods that take one dotnet_diagnostic.CA2016.severity = warning -# CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr +# CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr dotnet_diagnostic.CA2020.severity = warning # .NET diagnostic @@ -595,6 +595,12 @@ visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public dotnet_separate_import_directive_groups = false:warning +# IDE0001: Simplify Names +dotnet_diagnostic.IDE0001.severity = silent + +# IDE0002: Simplify Member Access +dotnet_diagnostic.IDE0002.severity = silent + # IDE0079: Remove unnecessary suppression dotnet_diagnostic.IDE0079.severity = none diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb index 4ec68a096ba..b7ef7be2e13 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/Form1.Designer.vb @@ -4,7 +4,7 @@ Partial Class Form1 'Form overrides dispose to clean up the component list. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Protected Overrides Sub Dispose(disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb index 58d97c2eec7..ac79a72ea7c 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsControlLibrary-VisualBasic/UserControl1.Designer.vb @@ -4,7 +4,7 @@ Partial Class UserControl1 'UserControl1 overrides dispose to clean up the component list. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Protected Overrides Sub Dispose(disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() From 970122a10710beb1c4a69437dca03cee0ab0af9b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 10 Jul 2024 22:48:10 -0700 Subject: [PATCH 227/342] Add Tests --- .../AssemblyPublicKeyIsAsExpectedTest.vb | 28 + .../Windows/Forms/ClipboardProxyTests.vb | 76 ++ .../Forms/ComputerInfoDebugViewTests.vb | 32 + .../System/Windows/Forms/ControlTests.vb | 26 +- .../System/Windows/Forms/ExceptionTests.vb | 45 + .../Windows/Forms/ExceptionUtilsTests.vb | 79 ++ .../System/Windows/Forms/FileIoProxyTests.vb | 429 ++++++++ .../System/Windows/Forms/HostServicesTests.vb | 55 + .../Windows/Forms/NetworkDownloadTests.vb | 958 ++++++++++++++++++ .../System/Windows/Forms/PipeListener.vb | 30 + .../Forms/SingleInstanceHelpersTests.vb | 75 ++ .../Forms/TempDirectoryFileFunctions.vb | 62 ++ .../System/Windows/Forms/TestUtilities.vb | 19 + .../System/Windows/Forms/TimeTests.vb | 42 + .../Windows/Forms/UserTests.UserIdentity.vb | 42 + .../Windows/Forms/UserTests.UserPrincipal.vb | 34 + .../System/Windows/Forms/UserTests.vb | 64 ++ .../System/Windows/Forms/WebListener.vb | 84 ++ .../System/Windows/Properties/AssemblyInfo.vb | 6 + .../ApplicationServices/AssemblyInfoTests.cs | 2 +- .../VisualBasic/Devices/AudioTests.cs | 2 +- .../VisualBasic/Devices/KeyboardTests.cs | 4 +- .../VisualBasic/Devices/NetworkTests.cs | 49 + .../MyServices/ClipboardProxyTests.cs | 7 +- .../SpecialDirectoriesProxyTests.cs | 18 +- .../System/Windows/Forms/ClipboardTests.cs | 3 +- 26 files changed, 2240 insertions(+), 31 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb new file mode 100644 index 00000000000..421eaa6e0ff --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -0,0 +1,28 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Text +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class AssemblyPublicKeyIsAsExpectedTest + Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" + + ''' + ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. + ''' + + Public Sub AssemblyPublicKeyIsAsExpected() + Dim publicKey() As Byte = GetType(ControlTests).Assembly.GetName().GetPublicKey() + Dim sb As New StringBuilder + For Each [byte] As Byte In publicKey + sb.AppendFormat("{0:x2}", [byte]) + Next [byte] + + ' Set breakpoint here to find out what's in sb + Assert.Equal(AssemblyPK, sb.ToString()) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb new file mode 100644 index 00000000000..c55ae82c194 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -0,0 +1,76 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.Specialized +Imports System.IO +Imports System.Windows.Forms +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + ''' + ''' These are just checking the Proxy functions, the underlying functions are tested elsewhere. + ''' + + + Public Class ClipboardProxyTests + + + Public Sub ClipboardProxy_ContainsText() + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim text As String = GetUniqueText() + clipboardProxy.SetText(text) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText) + Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText(TextDataFormat.Text)) + Assert.Equal(Clipboard.ContainsData(DataFormats.Text), clipboardProxy.ContainsData(DataFormats.Text)) + Assert.Equal(text, clipboardProxy.GetText()) + text = GetUniqueText() + clipboardProxy.SetText(text, TextDataFormat.Text) + Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + End Sub + + + Public Sub ClipboardProxy_GetAudioStream_InvokeMultipleTimes_Success() + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Dim result As Stream = clipboardProxy.GetAudioStream() + Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + End Sub + + + Public Sub ClipboardProxy_SetAudio_InvokeByteArray_GetReturnsExpected() + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes As Byte() = {1, 2, 3} + clipboardProxy.SetAudio(audioBytes) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) + Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + End Sub + + + Public Sub ClipboardProxy_SetAudio_InvokeStream_GetReturnsExpected() + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim audioBytes() As Byte = {1, 2, 3} + Using audioStream As New MemoryStream(audioBytes) + clipboardProxy.SetAudio(audioStream) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) + Assert.True(clipboardProxy.ContainsAudio()) + Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + End Using + End Sub + + + Public Sub ClipboardProxy_SetFileDropList_Invoke_GetReturnsExpected() + Dim clipboardProxy As New MyServices.ClipboardProxy + Dim filePaths As New StringCollection From + {"filePath", "filePath2"} + clipboardProxy.SetFileDropList(filePaths) + Assert.True(clipboardProxy.ContainsFileDropList()) + Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb new file mode 100644 index 00000000000..37d2497ebb0 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb @@ -0,0 +1,32 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.VisualBasic.Devices +Imports Microsoft.VisualBasic.Devices.ComputerInfo +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class ComputerInfoDebugViewTests + + + Public Sub Memory() + Dim info As New ComputerInfoDebugView(New ComputerInfo) + If PlatformDetection.IsWindows Then + Assert.NotEqual(0UI, info.AvailablePhysicalMemory) + Assert.NotEqual(0UI, info.AvailableVirtualMemory) + Assert.NotEqual(0UI, info.TotalPhysicalMemory) + Assert.NotEqual(0UI, info.TotalVirtualMemory) + End If + End Sub + + + Public Sub Properties() + Dim info As New ComputerInfoDebugView(New ComputerInfo) + Assert.Equal(Globalization.CultureInfo.InstalledUICulture, info.InstalledUICulture) + Assert.Equal(Environment.OSVersion.Platform.ToString(), info.OSPlatform) + Assert.Equal(Environment.OSVersion.Version.ToString(), info.OSVersion) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index ee002f22a79..4a044fa8114 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -7,13 +7,21 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Partial Public Class ControlTests + Public Shared Function FaultingFunc(a As Integer) As Integer + Return a \ 0 + End Function + + Public Shared Sub FaultingMethod() + Throw New DivideByZeroException() + End Sub + Public Sub Control_Invoke_Action_calls_correct_method() Using _control As New Control _control.CreateControl() Dim invoker As Action = AddressOf FaultingMethod - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() _control.Invoke(invoker)) ' Expecting something Like the following. @@ -41,7 +49,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As New MethodInvoker(AddressOf FaultingMethod) - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() _control.Invoke(invoker)) ' Expecting something Like the following. @@ -69,9 +77,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc - Dim exception = Assert.Throws(Of DivideByZeroException)( + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( Sub() - Dim result = _control.Invoke(Function() invoker(19)) + Dim result As Integer = _control.Invoke(Function() invoker(19)) End Sub) ' Expecting something Like the following. @@ -91,15 +99,5 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Using End Sub - Public Shared Sub FaultingMethod() - Throw New DivideByZeroException() - End Sub - - Public Shared Function FaultingFunc(a As Integer) As Integer - Return a \ 0 - End Function - End Class - End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb new file mode 100644 index 00000000000..6be52ebfdfe --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb @@ -0,0 +1,45 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports Microsoft.VisualBasic.ApplicationServices +Imports Xunit + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class ExceptionTests + + + Public Sub CantStartSingleInstanceExceptionTest() + Dim ex As Exception = New CantStartSingleInstanceException() + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Dim expected As String = ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) + Assert.Equal(expected, ex.Message) + ex = New CantStartSingleInstanceException("Test") + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Assert.Equal("Test", ex.Message) + ex = New CantStartSingleInstanceException("Test1", New DirectoryNotFoundException) + Assert.IsType(Of CantStartSingleInstanceException)(ex) + Assert.Equal("Test1", ex.Message) + Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + End Sub + + + Public Sub NoStartupFormExceptionTest() + Dim ex As Exception = New NoStartupFormException() + Assert.IsType(Of NoStartupFormException)(ex) + Dim expected As String = ExUtils.GetResourceString(SR.AppModel_NoStartupForm) + Assert.Equal(expected, ex.Message) + ex = New NoStartupFormException("Test") + Assert.IsType(Of NoStartupFormException)(ex) + Assert.Equal("Test", ex.Message) + ex = New NoStartupFormException("Test1", New DirectoryNotFoundException) + Assert.IsType(Of NoStartupFormException)(ex) + Assert.Equal("Test1", ex.Message) + Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb new file mode 100644 index 00000000000..5dea00d249f --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -0,0 +1,79 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.VisualBasic.CompilerServices +Imports Xunit + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Namespace Microsoft.VisualBasic.Forms.Tests + + ''' + ''' These are just checking the Proxy functions, the underlying functions are tested elsewhere. + ''' + Public Class ExceptionUtilsTests + + + Public Sub GetArgumentNullExceptionTest_Succeed() + Dim ex As Exception = ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Assert.IsType(Of ArgumentNullException)(ex) + Assert.Equal($"Property MainForm cannot be set to Nothing. (Parameter 'MainForm')", ex.Message) + Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) + End Sub + + + Public Sub GetDirectoryNotFoundExceptionTest_Succeed() + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) + Assert.IsType(Of IO.DirectoryNotFoundException)(ex) + Assert.Equal("File not found.", ex.Message) + End Sub + + + Public Sub GetFileNotFoundExceptionTest_Succeed() + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) + Assert.IsType(Of IO.FileNotFoundException)(ex) + Assert.Equal("File not found.", ex.Message) + Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) + End Sub + + + Public Sub GetInvalidOperationExceptionTest_Succeed() + Dim ex As Exception = ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Assert.IsType(Of InvalidOperationException)(ex) + End Sub + + + Public Sub GetIOExceptionTest_Succeed() + Dim ex As Exception = ExUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) + Assert.IsType(Of IO.IOException)(ex) + Assert.Equal($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.", ex.Message) + End Sub + + + Public Sub GetWin32ExceptionTest_Succeed() + Dim ex As Exception = ExUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + Assert.IsType(Of ComponentModel.Win32Exception)(ex) + End Sub + + + + + Public Sub VbMakeExceptionInvalidValuesTest_Succeed(BadResourceId As Integer) + Dim id As String = $"ID{CStr(BadResourceId)}" + Assert.Equal($"{SR.GetResourceString(id, id)}", ExUtils.VbMakeException(BadResourceId).Message) + End Sub + + + + + + Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer, expected As String) + Dim id As String = $"ID{CStr(errorCode)}" + Dim message As String = ExUtils.VbMakeException(errorCode).Message + Assert.Equal(expected, message) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb new file mode 100644 index 00000000000..64bf1f904f8 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -0,0 +1,429 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.ObjectModel +Imports System.Text +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class FileIoProxyTests + + Private ReadOnly _csvSampleData As String = + "Index,Customer Id,First Name,Last Name,Company,City,Country +1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile" + + Private ReadOnly _fileSystem As FileSystemProxy = New Devices.ServerComputer().FileSystem + + Private ReadOnly _fixedSampleData As String = + "IndexFirstLastCompanyCityCountry +4321;1234;321;654321;123;1234567" + + + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyDirectoryWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + Assert.True(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithOverwriteProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2), size:=1) + _fileSystem.CopyFile(file1, file2, overwrite:=True) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub CopyFileWithShowUIWithCancelOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.CopyFile(file1, file2, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub DeleteDirectoryRecycleWithUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.Directory.Exists(testDirectory)) + End Sub + + + Public Sub DeleteDirectoryWithUIProxyRecycleTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.Directory.Exists(testDirectory)) + End Sub + + + Public Sub DeleteFileProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub DeleteFileWithRecycleOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub DeleteFileWithUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + Assert.True(IO.File.Exists(file1)) + + _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) + Assert.False(IO.File.Exists(file1)) + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub DriveProxyTest() + Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) + End Sub + + + Public Sub FileNormalizePathEmptyStringTest_Fail() + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + FileSystemUtils.NormalizePath("") + End Sub) + Assert.Equal("The path is empty. (Parameter 'path')", ex.Message) + End Sub + + + Public Sub FileNormalizePathNullTest_Fail() + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + FileSystemUtils.NormalizePath(Nothing) + End Sub) + Assert.Equal("Value cannot be null. (Parameter 'path')", ex.Message) + End Sub + + + Public Sub FileNormalizePathTest_Success() + FileSystemUtils.NormalizePath(IO.Path.GetTempPath) + End Sub + + + Public Sub FindInFilesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim fileB As String = CreateTempFile(testDirectory, NameOf(fileB), size:=1) + Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) + _fileSystem.WriteAllText(fileC, "C", append:=False) + Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) + Assert.Equal(filenames.Count, 1) + Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) + filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") + Assert.Equal(filenames.Count, 0) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveDirectoryWithShowUICancelOptionsProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Assert.False(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveDirectoryWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) + _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) + Assert.False(IO.Directory.Exists(testDirectory)) + Assert.True(IO.Directory.Exists(destinationDirectory)) + Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveFileWithShowUIProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.False(IO.File.Exists(file1)) + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub MoveFileWithShowUIWithCancelOptionProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(file1, byteArray, append:=False) + + Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) + _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) + Assert.False(IO.File.Exists(file1)) + Assert.True(IO.File.Exists(file2)) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenEncodedTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False, Encoding.ASCII) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + + + Public Sub OpenTextFieldParserProxyTest(delimiter As String) + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _csvSampleData, append:=False) + Dim reader As TextFieldParser + If delimiter Is Nothing Then + reader = _fileSystem.OpenTextFieldParser(fileCSV) + reader.TextFieldType = FieldType.Delimited + reader.Delimiters = {","} + Else + reader = _fileSystem.OpenTextFieldParser(fileCSV, delimiter) + End If + Dim currentRow As String() + Dim totalRows As Integer = 0 + While Not reader.EndOfData + totalRows += 1 + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + totalFields += 1 + Next + Assert.Equal(7, totalFields) + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFileWriterProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileWriter As IO.StreamWriter = _fileSystem.OpenTextFileWriter(fileA, append:=False) + fileWriter.WriteLine("A") + End Using + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextFixedFieldParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileCSV As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileCSV, _fixedSampleData, append:=False) + Dim reader As TextFieldParser = _fileSystem.OpenTextFieldParser(fileCSV, 5, 5, 4, 7, 4, 7) + Dim currentRow As String() + Dim totalRows As Integer = 0 + Dim splitData As String() = _fixedSampleData.Split(vbCrLf)(1).Split(";") + While Not reader.EndOfData + currentRow = reader.ReadFields() + Dim currentField As String + Dim totalFields As Integer = 0 + For Each currentField In currentRow + If totalRows = 1 Then + Assert.Equal(splitData(totalFields), currentField.TrimEnd(";"c)) + End If + totalFields += 1 + Next + Assert.Equal(6, totalFields) + totalRows += 1 + End While + Assert.Equal(2, totalRows) + reader.Close() + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub OpenTextStreamParserProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA) + Dim text As String = fileReader.ReadLine() + Assert.Equal(text, "A") + End Using + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllBytesProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + Dim byteArray As Byte() = {4} + _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) + + Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) + Assert.Equal(bytes.Length, 1) + Assert.Equal(bytes(0), 4) + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False) + Dim text As String = _fileSystem.ReadAllText(fileA) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + + Public Sub ReadAllTextWithEncodingProxyTest() + Dim testDirectory As String = CreateTempDirectory() + Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) + _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) + Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) + Assert.Equal(text, "A") + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb new file mode 100644 index 00000000000..f98ac773aab --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb @@ -0,0 +1,55 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Windows.Forms +Imports Microsoft.VisualBasic.CompilerServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class HostServicesTests + Private Shared ReadOnly s_control As New Control() + Private Shared ReadOnly s_title As String = GetUniqueText() + + + Public Sub GetUniqueIntegerTests_Success() + Assert.True(GetUniqueInteger(positiveOnly:=True) >= 0) + Assert.NotEqual(GetUniqueInteger(positiveOnly:=False), GetUniqueInteger(positiveOnly:=False)) + End Sub + + + Public Sub InputHandlerTests_Success() + Dim prompt As String = GetUniqueText() + Dim title As String = GetUniqueText() + Dim defaultResponse As String = GetUniqueText() + Dim xPos As Integer = -1 + Dim yPos As Integer = -1 + Dim parentWindow As IWin32Window = Nothing + Dim vbHost As IVbHost = HostServices.VBHost + Dim inputHandler As New InputBoxHandler(prompt, title, defaultResponse, xPos, yPos, parentWindow) + Assert.Equal(Nothing, vbHost) + Assert.Equal(Nothing, inputHandler.Exception) + Assert.Equal(Nothing, inputHandler.Result) + End Sub + + + Public Sub VbHostTests_Success() + Dim vbHost As IVbHost = New TestVbHost + Assert.Equal(s_control, vbHost.GetParentWindow) + Assert.Equal(s_title, vbHost.GetWindowTitle) + End Sub + + Private NotInheritable Class TestVbHost + Implements IVbHost + + Public Function GetParentWindow() As IWin32Window Implements IVbHost.GetParentWindow + Return s_control + End Function + + Public Function GetWindowTitle() As String Implements IVbHost.GetWindowTitle + Return s_title + End Function + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb new file mode 100644 index 00000000000..78964e033ca --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -0,0 +1,958 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Net +Imports Microsoft.VisualBasic.FileIO +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class NetworkTests + Private Const DefaultPassword As String = "TBD" + Private Const DefaultUserName As String = "TBD" + Private Const DownloadLargeFileSize As Integer = 104857600 + Private Const DownloadSmallFileSize As Integer = 18135 + Private Const InvalidUrlAddress As String = "invalidURL" + Private Const TestingConnectionTimeout As Integer = 100000 + + ''' + ''' Verify that testDirectory exists, that destinationFileName exist and what its length is. + ''' + ''' The full path and filename of the new file. + ''' + ''' The size in bytes of the destination file, this saves the caller from having to + ''' do another FileInfo call. + ''' + Private Shared Function ValidateDownload(destinationFileName As String) As Long + Dim fileInfo As New FileInfo(destinationFileName) + + ' This directory should not be systems Temp Directory because it must be created + Assert.NotEqual(Path.GetTempPath, fileInfo.DirectoryName) + Assert.True(Directory.Exists(fileInfo.DirectoryName)) + Assert.True(fileInfo.Exists) + + Return fileInfo.Length + End Function + + Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) + Debug.Assert(Path.GetTempPath <> testDirectory) + listener.Stop() + listener.Close() + If Not String.IsNullOrWhiteSpace(testDirectory) Then + Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + Directory.Delete(testDirectory, recursive:=True) + End If + End Sub + + + Public Sub DownloadFile_UriCheckDestinationIsDirectory_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=testDirectory, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UriCheckFilePathTrailingSeparators_Throw(separator As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + $"{destinationFileName}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UriCheckRootDirectoryTrailingSeparator_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UriCheckRootDirectoryValidation_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWhereTimeoutNegative_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + userName:="", + password:="", + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) + + End Sub) + + Assert.StartsWith(SR.Network_BadConnectionTimeout, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWhereUriIsNothing_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address:=CType(Nothing, Uri), + destinationFileName, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWhereUriIsNothingAllParameters_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address:=CType(Nothing, Uri), + destinationFileName, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWhereUriIsNothingSpecifyOnUserCancel_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address:=CType(Nothing, Uri), + destinationFileName, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithAllOptionsSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UriWithAllOptionsSpecifiedExceptUserCancel_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UriWithICredentialsShowUiTimeOutOverwriteSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + networkCredentials, + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithNonexistentTargetDirectory_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Directory.Delete(testDirectory, recursive:=True) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + UICancelOption.DoNothing) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UriWithOverwriteShowUISpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=True) + + Assert.Equal(DownloadLargeFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithUriOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UriWithUserNamePassword_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + DefaultUserName, + DefaultPassword) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UriWithWrongPassword_Throws(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(New Uri(webListener.Address), + destinationFileName, + DefaultUserName, + password) + + End Sub) + + Assert.Equal("The remote server returned an error: (401) Unauthorized.", ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlCheckDestinationIsDirectory_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=testDirectory, ' This is a Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlCheckFilePathTrailingSeparators_Throw(separator As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + $"{destinationFileName}{separator}", + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlCheckRootDirectoryTrailingSeparator_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.IO_FilePathException, ex.Message) + Assert.Contains(NameOf(destinationFileName), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlCheckRootDirectoryValidation_Throw(root As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub) + + Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlOnly_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereAddressInvalid_Throws(address As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(address, + destinationFileName) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidAddressOnly_Throws(destinationFileName As String) + Dim testDirectory As String = CreateTempDirectory() + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFileName As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Finally + CleanUp(listener) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFileName As String) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName:=Nothing, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False, + UICancelOption.DoNothing) + + End Sub) + + Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + Finally + CleanUp(listener) + End Try + End Sub + + + Public Sub DownloadFile_UrlWhereFileExistsNoOverwrite_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Dim ex As Exception = Assert.Throws(Of IOException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.Equal(SR.IO_FileExists_Path.Replace("{0}", destinationFileName), ex.Message) + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(ValidateDownload(destinationFileName), 1) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UrlWhereInvalidUrlDoNotShowUI_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWhereUrlInvalid_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Sub() + My.Computer.Network _ + .DownloadFile(InvalidUrlAddress, + destinationFileName, + userName:="", + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + End Sub) + + Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", InvalidUrlAddress), ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWhereUsernameIsNothing_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + userName:=Nothing, + password:="", + showUI:=True, + TestingConnectionTimeout, + overwrite:=False) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWithAllOptionsSpecified_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + + CleanUp(listener, testDirectory) + End Sub + + + Public Sub DownloadFile_UrlWithOverwriteWhereDestinationFileExists_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) + Dim webListener As New WebListener(DownloadSmallFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + userName:="", + password:="", + showUI:=False, + TestingConnectionTimeout, + overwrite:=True) + + Assert.True(Directory.Exists(testDirectory)) + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWithPassword_Success() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + DefaultUserName, + DefaultPassword) + + Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + Public Sub DownloadFile_UrlWithTimeOut_Throws() + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadLargeFileSize) + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + userName:="", + password:="", + showUI:=False, + connectionTimeout:=1, + overwrite:=True) + + End Sub) + + Assert.Equal("The operation has timed out.", ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + + + + Public Sub DownloadFile_UrlWithWrongPassword_Throw(password As String) + Dim testDirectory As String = CreateTempDirectory() + Dim destinationFileName As String = GetDestinationFileName(testDirectory) + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim listener As HttpListener = webListener.ProcessRequests() + + Try + Dim ex As Exception = Assert.Throws(Of WebException)( + Sub() + My.Computer.Network _ + .DownloadFile(webListener.Address, + destinationFileName, + DefaultUserName, + password) + + End Sub) + + Assert.Equal("The remote server returned an error: (401) Unauthorized.", ex.Message) + Assert.False(File.Exists(destinationFileName)) + Finally + CleanUp(listener, testDirectory) + End Try + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb new file mode 100644 index 00000000000..d6b457b6d20 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb @@ -0,0 +1,30 @@ +Imports System.IO +Imports System.IO.Pipes +Imports System.Net +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class PipeListener + Private _pipeServer As NamedPipeServerStream + + Public Sub New(pipeName As String, maxNumberOfServerInstances As Integer, transmissionMode As PipeTransmissionMode, options As PipeOptions) + Task.Run( + Sub() + Try + ' Start the listener to begin listening for requests. + _pipeServer = New NamedPipeServerStream( + pipeName, + direction:=PipeDirection.Out, + maxNumberOfServerInstances:=1, + transmissionMode, + options) + + Catch ex As Exception + _pipeServer = Nothing + End Try + End Sub) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb new file mode 100644 index 00000000000..5eb7060e355 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb @@ -0,0 +1,75 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO.Pipes +Imports System.Runtime.CompilerServices +Imports System.Threading +Imports Microsoft.VisualBasic.ApplicationServices + +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class SingleInstanceHelpersTests + Private _resultArgs As String() + + Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) + If args.Length = 1 Then + _resultArgs = {"Hello"} + End If + End Sub + + + Public Sub TryCreatePipeServerTests() + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + Assert.True(TryCreatePipeServer(pipeName, pipeServer)) + Assert.True(pipeServer.CanRead) + Assert.False(pipeServer.CanSeek) + Assert.False(pipeServer.CanWrite) + Assert.Equal(PipeTransmissionMode.Byte, pipeServer.TransmissionMode) + pipeServer.Close() + pipeServer.Dispose() + End Sub + + + Public Sub TryCreatePipeServerTwiceTests_Fail() + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + Assert.True(TryCreatePipeServer(pipeName, pipeServer)) + Dim pipeServer1 As NamedPipeServerStream = Nothing + Assert.False(TryCreatePipeServer(pipeName, pipeServer1)) + Assert.Null(pipeServer1) + pipeServer.Close() + pipeServer.Dispose() + End Sub + + + Public Async Function WaitForClientConnectionsAsyncTests() As Task + Dim pipeName As String = GetUniqueText() + Dim pipeServer As NamedPipeServerStream = Nothing + If TryCreatePipeServer(pipeName, pipeServer) Then + + Using pipeServer + Dim tokenSource As New CancellationTokenSource() + Dim clientConnection As Task = WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) + Dim commandLine As String() = {"Hello"} + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(pipeName, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + awaitable.GetAwaiter().GetResult() + Dim CancelToken As New CancellationToken + Dim buffer As Byte() = New Byte(commandLine.Length) {} + + Dim count As Integer = Await pipeServer.ReadAsync(buffer.AsMemory(0, commandLine.Length)) + ' Ensure the result is set + Do + Await Task.Delay(5) + Loop Until _resultArgs IsNot Nothing + Assert.Equal("Hello", _resultArgs(0)) + Await tokenSource.CancelAsync() + End Using + End If + + End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb new file mode 100644 index 00000000000..67944cf4a68 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb @@ -0,0 +1,62 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Runtime.CompilerServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Module TempDirectoryFileFunctions + + ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName + Friend ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") + + ''' + ''' Creates or returns a directory based on the name of the function that + ''' call it. The base directory is described above. + ''' Even if directory exists this call will success and just return it. + ''' + ''' + ''' If >1 use line number as part of name. + ''' The name of a directory that is safe to write to and is verified to exist. + Friend Function CreateTempDirectory( Optional memberName As String = Nothing, Optional lineNumber As Integer = -1) As String + Dim folder As String + If lineNumber > 1 Then + folder = Path.Combine(s_baseTempPath, $"{memberName}{lineNumber}") + Else + folder = Path.Combine(s_baseTempPath, memberName) + End If + + Directory.CreateDirectory(folder) + Return folder + End Function + + ''' + ''' If size >= 0 then create the file with size length. + ''' + ''' Full path to working directory. + ''' + ''' Size in bytes of the file to be created. + ''' + ''' The full path and file name of the created file. + ''' If size = -1 no file is create but the full path is returned. + ''' + Friend Function CreateTempFile(tmpFilePath As String, Optional optionalFilename As String = "Testing.Text", Optional size As Integer = -1) As String + Dim filename As String = GetDestinationFileName(tmpFilePath, optionalFilename) + + If size >= 0 Then + Using destinationStream As FileStream = File.Create(filename) + destinationStream.Write(New Byte(size - 1) {}) + destinationStream.Flush() + destinationStream.Close() + End Using + End If + Return filename + End Function + + Friend Function GetDestinationFileName(tmpFilePath As String, Optional filename As String = "testing.txt") As String + Return Path.Combine(tmpFilePath, filename) + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb new file mode 100644 index 00000000000..8fc64d6bb12 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb @@ -0,0 +1,19 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.Forms.Tests + Friend Module TestUtilities + + Friend Function GetUniqueInteger(positiveOnly As Boolean) As Integer + If positiveOnly Then + Return Math.Abs(Guid.NewGuid().GetHashCode()) + End If + Return Guid.NewGuid().GetHashCode() + End Function + + Friend Function GetUniqueText() As String + Return Guid.NewGuid().ToString("D") + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb new file mode 100644 index 00000000000..e13e5bec731 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -0,0 +1,42 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class TimeTests + Private Const PrecisionTickLimit As Integer = 1000 + + Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean + Dim diff As TimeSpan = systemLocalTime - vbLocalTime + Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks + End Function + + + Public Sub SystemTimeNotNew() + Assert.True(Date.Now > New Date) + End Sub + + + Public Sub VbGmtTimeCloseToDateUtcNow() + Assert.True(timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit)) + End Sub + + + Public Sub VbLocalTimeCloseToDateNow() + Assert.True(timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit)) + End Sub + + + Public Sub VbTickCountCloseToEnvironmentTickCount() + Assert.True(Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit) + End Sub + + + Public Sub VbTimeNotNew() + Assert.True(My.Computer.Clock.LocalTime > New Date) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb new file mode 100644 index 00000000000..a086c0709d1 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb @@ -0,0 +1,42 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Public Class UserIdentity + Implements IIdentity + + Private ReadOnly _authenticationType As String + Private ReadOnly _name As String + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean) + _authenticationType = authenticationType + _name = name + End Sub + + Public ReadOnly Property AuthenticationType As String Implements IIdentity.AuthenticationType + Get + Return _authenticationType + End Get + End Property + + Public ReadOnly Property IsAuthenticated As Boolean Implements IIdentity.IsAuthenticated + Get + Return True + End Get + End Property + + Public ReadOnly Property Name As String Implements IIdentity.Name + Get + Return _name + End Get + End Property + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb new file mode 100644 index 00000000000..c38fa0e7363 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb @@ -0,0 +1,34 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Private NotInheritable Class UserPrincipal + Implements IPrincipal + + Private _role As String + Private _userIdentity As IIdentity + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) + _userIdentity = New UserIdentity(authenticationType, name, isAuthenticated) + _role = role + End Sub + + Public ReadOnly Property Identity As IIdentity Implements IPrincipal.Identity + Get + Return _userIdentity + End Get + End Property + + Public Function IsInRole(role As String) As Boolean Implements IPrincipal.IsInRole + Return role = _role + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb new file mode 100644 index 00000000000..0883ea8f99a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -0,0 +1,64 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.VisualBasic.ApplicationServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + + Public Sub UserBaseTest() + Dim testUser As New User + Assert.Null(testUser.CurrentPrincipal) + Dim userPrincipal As UserPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + testUser.CurrentPrincipal = userPrincipal + Assert.NotNull(testUser.CurrentPrincipal) + Assert.Equal(userPrincipal, testUser.CurrentPrincipal) + Assert.Equal("Basic", userPrincipal.Identity.AuthenticationType) + End Sub + + + Public Sub UserGetNameTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + Assert.Equal("Test", testUser.Name) + End Sub + + + Public Sub UserIsAuthenticatedTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + Assert.Equal(True, testUser.IsAuthenticated) + End Sub + + + Public Sub UserIsInRoleTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + Assert.True(testUser.IsInRole("Guest")) + Assert.False(testUser.IsInRole("Basic")) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb new file mode 100644 index 00000000000..cd35c68bc46 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb @@ -0,0 +1,84 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Net +Imports System.Runtime.CompilerServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class WebListener + Private ReadOnly _downloadFileUrlPrefix As String + Private ReadOnly _fileSize As Integer + + Private _password As String + Private _userName As String + + ''' + ''' The name of the function that creates the server is uses to establish the file to be downloaded. + ''' + ''' Is used to create the file name and the size of download. + ''' Used to establish the file path to be downloaded. + Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) + _fileSize = fileSize + _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" + Address = $"{_downloadFileUrlPrefix}T{fileSize}" + End Sub + + ''' + ''' Used for authenticated download. + ''' + ''' Passed to Me.New. + ''' Name to match for authorization. + ''' Password to match for authorization. + ''' Passed to Me.New. + Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) + Me.New(fileSize, memberName) + _userName = userName + _password = password + End Sub + + Public ReadOnly Property Address As String + + Friend Function ProcessRequests() As HttpListener + ' Create a listener and add the prefixes. + Dim listener As New HttpListener() + + listener.Prefixes.Add(_downloadFileUrlPrefix) + If _userName IsNot Nothing OrElse _password IsNot Nothing Then + listener.AuthenticationSchemes = AuthenticationSchemes.Basic + End If + listener.Start() + Task.Run( + Sub() + ' Start the listener to begin listening for requests. + Dim response As HttpListenerResponse = Nothing + + Try + ' Note: GetContext blocks while waiting for a request. + Dim context As HttpListenerContext = listener.GetContext() + ' Create the response. + response = context.Response + Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) + If context.User?.Identity.IsAuthenticated Then + If String.IsNullOrWhiteSpace(identity.Name) OrElse identity.Name <> _userName OrElse String.IsNullOrWhiteSpace(identity.Password) OrElse identity.Password <> _password Then + response.StatusCode = HttpStatusCode.Unauthorized + Exit Try + End If + End If + Dim responseString As String = Strings.StrDup(_fileSize, "A") + ' Simulate network traffic + Threading.Thread.Sleep(20) + Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) + response.ContentLength64 = buffer.Length + Dim output As Stream = response.OutputStream + output.Write(buffer, 0, buffer.Length) + Finally + response?.Close() + End Try + End Sub) + Return listener + End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb new file mode 100644 index 00000000000..c236c65fd73 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb @@ -0,0 +1,6 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.CompilerServices + + diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs index d05068c54d5..9a1c061e8cb 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/ApplicationServices/AssemblyInfoTests.cs @@ -20,7 +20,7 @@ public void AssemblyProperties(Assembly assembly) AssemblyInfo assemblyInfo = new(assembly); var assemblyName = assembly.GetName(); Assert.Equal(assemblyName.Name, assemblyInfo.AssemblyName); - Assert.Equal(System.IO.Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); + Assert.Equal(Path.GetDirectoryName(assembly.Location), assemblyInfo.DirectoryPath); Assert.Equal(GetAttributeValue(assembly, attr => attr.Company), assemblyInfo.CompanyName); Assert.Equal(GetAttributeValue(assembly, attr => attr.Copyright), assemblyInfo.Copyright); Assert.Equal(GetAttributeValue(assembly, attr => attr.Description), assemblyInfo.Description); diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs index 49f252f6094..60d544d8960 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs @@ -14,7 +14,7 @@ public void Play() } // Not tested: - // Public Sub PlaySystemSound(ByVal systemSound As System.Media.SystemSound) + // Public Sub PlaySystemSound(systemSound As System.Media.SystemSound) [Fact] public void Stop() diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs index f4679a0b327..01bb099b55e 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/KeyboardTests.cs @@ -18,6 +18,6 @@ public void Properties() } // Not tested: - // Public Sub SendKeys(ByVal keys As String) - // Public Sub SendKeys(ByVal keys As String, ByVal wait As Boolean) + // Public Sub SendKeys(keys As String) + // Public Sub SendKeys(keys As String, wait As Boolean) } diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index f61ca5b9988..7e5b6df91dd 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -19,6 +19,55 @@ public void Ping() Assert.True(network.Ping("127.0.0.1")); } + [Fact] + public void Ping_ShortTimeout_Success() + { + Network network = new(); + Assert.True(network.Ping("127.0.0.1", 1)); + } + + [Fact] + public void Ping_Success() + { + Network network = new(); + Assert.True(network.Ping("127.0.0.1")); + } + + [Fact] + public void Ping_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((string)null)); + } + + [Fact] + public void PingUri_ShortTimeout_Success() + { + Network network = new(); + Assert.True(network.Ping(new Uri("http://127.0.0.1"), 1)); + } + + [Fact] + public void PingUri_Success() + { + Network network = new(); + Assert.True(network.Ping(new Uri("http://127.0.0.1"))); + } + + [Fact] + public void PingUri_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((Uri)null)); + } + + [Fact] + public void PingUriTimeout_Throw() + { + Network network = new(); + Assert.Throws(() => network.Ping((Uri)null, 1)); + } + // Not tested: // Public Sub DownloadFile(...) [multiple overloads] // Public Sub UploadFile(...) [multiple overloads] diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 4df06e1ba30..9977d6ec803 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -9,6 +9,7 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [Collection("Sequential")] +[CollectionDefinition("Sequential", DisableParallelization = true)] public class ClipboardProxyTests { [WinFormsFact] @@ -51,8 +52,8 @@ public void Audio() Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); // Not tested: // Public Function GetAudioStream() As Stream - // Public Sub SetAudio(ByVal audioBytes As Byte()) - // Public Sub SetAudio(ByVal audioStream As Stream) + // Public Sub SetAudio(audioBytes As Byte()) + // Public Sub SetAudio(audioStream As Stream) } [WinFormsFact] @@ -62,7 +63,7 @@ public void FileDropList() Assert.Equal(System.Windows.Forms.Clipboard.ContainsFileDropList(), clipboard.ContainsFileDropList()); // Not tested: // Public Function GetFileDropList() As StringCollection - // Public Sub SetFileDropList(ByVal filePaths As StringCollection) + // Public Sub SetFileDropList(filePaths As StringCollection) } [WinFormsFact] diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs index 5868f530c06..4cba3f91b99 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxyTests.cs @@ -11,15 +11,15 @@ public class SpecialDirectoriesProxyTests public void Properties() { SpecialDirectoriesProxy specialDirectories = new ServerComputer().FileSystem.SpecialDirectories; - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.AllUsersApplicationData, () => specialDirectories.AllUsersApplicationData); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.CurrentUserApplicationData, () => specialDirectories.CurrentUserApplicationData); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Desktop, () => specialDirectories.Desktop); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyDocuments, () => specialDirectories.MyDocuments); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyMusic, () => specialDirectories.MyMusic); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.MyPictures, () => specialDirectories.MyPictures); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Programs, () => specialDirectories.Programs); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.ProgramFiles, () => specialDirectories.ProgramFiles); - VerifySpecialDirectory(() => Microsoft.VisualBasic.FileIO.SpecialDirectories.Temp, () => specialDirectories.Temp); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.AllUsersApplicationData, () => specialDirectories.AllUsersApplicationData); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.CurrentUserApplicationData, () => specialDirectories.CurrentUserApplicationData); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Desktop, () => specialDirectories.Desktop); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyDocuments, () => specialDirectories.MyDocuments); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyMusic, () => specialDirectories.MyMusic); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.MyPictures, () => specialDirectories.MyPictures); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Programs, () => specialDirectories.Programs); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.ProgramFiles, () => specialDirectories.ProgramFiles); + VerifySpecialDirectory(() => FileIO.SpecialDirectories.Temp, () => specialDirectories.Temp); } private static void VerifySpecialDirectory(Func getExpected, Func getActual) diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs index 869e8e6175d..4fbf8e76066 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs @@ -15,6 +15,7 @@ namespace System.Windows.Forms.Tests; [Collection("Sequential")] +[CollectionDefinition("Sequential", DisableParallelization = true)] public partial class ClipboardTests { [WinFormsFact] @@ -313,7 +314,7 @@ public void Clipboard_SetDataObject_InvokeObjectBoolIntIntNotIComDataObject_GetR [WinFormsTheory] [MemberData(nameof(Clipboard_SetDataObject_Null_TheoryData))] public void Clipboard_SetDataObject_NullData_ThrowsArgumentNullException(Action action) - { + { action.Should().Throw().WithParameterName("data"); } From 90a3e3727e84024841d4c5b4d1850682a1919364 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 10 Jul 2024 23:52:12 -0700 Subject: [PATCH 228/342] Clean up tests, some tests deleted becuase of dependencies not in this PR. --- .../Properties/AssemblyInfo.vb | 0 .../Microsoft.VisualBasic.Forms.Tests.vbproj | 10 +++- .../System/Windows/Forms/ExceptionTests.vb | 45 --------------- .../Windows/Forms/ExceptionUtilsTests.vb | 17 ------ .../System/Windows/Forms/HostServicesTests.vb | 55 ------------------- .../System/Windows/Forms/PipeListener.vb | 30 ---------- 6 files changed, 8 insertions(+), 149 deletions(-) rename src/Microsoft.VisualBasic.Forms/{tests/UnitTests/System/Windows => src}/Properties/AssemblyInfo.vb (100%) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Properties/AssemblyInfo.vb rename to src/Microsoft.VisualBasic.Forms/src/Properties/AssemblyInfo.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index e711e903745..1781f140963 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -4,11 +4,17 @@ $(TargetFramework) $(TargetFramework)-windows7.0 true - Microsoft.VisualBasic.Forms.Tests + latest true + On + Off + On + WindowsFormsWithCustomSubMain + True + Library - + diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb deleted file mode 100644 index 6be52ebfdfe..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb +++ /dev/null @@ -1,45 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.IO -Imports Microsoft.VisualBasic.ApplicationServices -Imports Xunit - -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class ExceptionTests - - - Public Sub CantStartSingleInstanceExceptionTest() - Dim ex As Exception = New CantStartSingleInstanceException() - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Dim expected As String = ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) - Assert.Equal(expected, ex.Message) - ex = New CantStartSingleInstanceException("Test") - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Assert.Equal("Test", ex.Message) - ex = New CantStartSingleInstanceException("Test1", New DirectoryNotFoundException) - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Assert.Equal("Test1", ex.Message) - Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) - End Sub - - - Public Sub NoStartupFormExceptionTest() - Dim ex As Exception = New NoStartupFormException() - Assert.IsType(Of NoStartupFormException)(ex) - Dim expected As String = ExUtils.GetResourceString(SR.AppModel_NoStartupForm) - Assert.Equal(expected, ex.Message) - ex = New NoStartupFormException("Test") - Assert.IsType(Of NoStartupFormException)(ex) - Assert.Equal("Test", ex.Message) - ex = New NoStartupFormException("Test1", New DirectoryNotFoundException) - Assert.IsType(Of NoStartupFormException)(ex) - Assert.Equal("Test1", ex.Message) - Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) - End Sub - - End Class -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 5dea00d249f..fcd281cb4e9 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -21,23 +21,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) End Sub - - Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) - Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) - Assert.IsType(Of IO.DirectoryNotFoundException)(ex) - Assert.Equal("File not found.", ex.Message) - End Sub - - - Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) - Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) - Assert.IsType(Of IO.FileNotFoundException)(ex) - Assert.Equal("File not found.", ex.Message) - Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) - End Sub - Public Sub GetInvalidOperationExceptionTest_Succeed() Dim ex As Exception = ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb deleted file mode 100644 index f98ac773aab..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb +++ /dev/null @@ -1,55 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Windows.Forms -Imports Microsoft.VisualBasic.CompilerServices -Imports Xunit - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class HostServicesTests - Private Shared ReadOnly s_control As New Control() - Private Shared ReadOnly s_title As String = GetUniqueText() - - - Public Sub GetUniqueIntegerTests_Success() - Assert.True(GetUniqueInteger(positiveOnly:=True) >= 0) - Assert.NotEqual(GetUniqueInteger(positiveOnly:=False), GetUniqueInteger(positiveOnly:=False)) - End Sub - - - Public Sub InputHandlerTests_Success() - Dim prompt As String = GetUniqueText() - Dim title As String = GetUniqueText() - Dim defaultResponse As String = GetUniqueText() - Dim xPos As Integer = -1 - Dim yPos As Integer = -1 - Dim parentWindow As IWin32Window = Nothing - Dim vbHost As IVbHost = HostServices.VBHost - Dim inputHandler As New InputBoxHandler(prompt, title, defaultResponse, xPos, yPos, parentWindow) - Assert.Equal(Nothing, vbHost) - Assert.Equal(Nothing, inputHandler.Exception) - Assert.Equal(Nothing, inputHandler.Result) - End Sub - - - Public Sub VbHostTests_Success() - Dim vbHost As IVbHost = New TestVbHost - Assert.Equal(s_control, vbHost.GetParentWindow) - Assert.Equal(s_title, vbHost.GetWindowTitle) - End Sub - - Private NotInheritable Class TestVbHost - Implements IVbHost - - Public Function GetParentWindow() As IWin32Window Implements IVbHost.GetParentWindow - Return s_control - End Function - - Public Function GetWindowTitle() As String Implements IVbHost.GetWindowTitle - Return s_title - End Function - - End Class - End Class -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb deleted file mode 100644 index d6b457b6d20..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/PipeListener.vb +++ /dev/null @@ -1,30 +0,0 @@ -Imports System.IO -Imports System.IO.Pipes -Imports System.Net -Imports Xunit - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class PipeListener - Private _pipeServer As NamedPipeServerStream - - Public Sub New(pipeName As String, maxNumberOfServerInstances As Integer, transmissionMode As PipeTransmissionMode, options As PipeOptions) - Task.Run( - Sub() - Try - ' Start the listener to begin listening for requests. - _pipeServer = New NamedPipeServerStream( - pipeName, - direction:=PipeDirection.Out, - maxNumberOfServerInstances:=1, - transmissionMode, - options) - - Catch ex As Exception - _pipeServer = Nothing - End Try - End Sub) - End Sub - - End Class -End Namespace From 2276478fd7717f91aac6a32735c61b807981a030 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 11 Jul 2024 00:40:36 -0700 Subject: [PATCH 229/342] Fix up some failing test. Utils will be going away and ExceptionUtils and Network will be completely rewritten as part of code Cleanup PR --- .../CompilerServices/ExceptionUtils.vb | 19 ++++++++++--------- .../VisualBasic/CompilerServices/Utils.vb | 2 +- .../Microsoft/VisualBasic/Devices/Network.vb | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index d38b023913a..6913c88b4f0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -24,7 +24,8 @@ Namespace Microsoft.VisualBasic.CompilerServices Dim sMsg As String If hr > 0 AndAlso hr <= &HFFFFI Then - sMsg = GetResourceString(CType(hr, vbErrors)) + Dim hr1 As vbErrors = CType(hr, vbErrors) + sMsg = Utils1.GetResourceString(hr1) Else sMsg = "" End If @@ -79,7 +80,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException - Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(Utils1.GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function ''' @@ -89,7 +90,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of ArgumentNullException. Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(ArgumentName, Utils1.GetResourceString(SR.General_ArgumentNullException)) End Function ''' @@ -102,7 +103,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetArgumentNullException(ArgumentName As String, ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) + Return New ArgumentNullException(ArgumentName, Utils1.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -114,7 +115,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetDirectoryNotFoundException( ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(Utils1.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -127,7 +128,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetFileNotFoundException(FileName As String, ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException - Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) + Return New IO.FileNotFoundException(Utils1.GetResourceString(ResourceID, PlaceHolders), FileName) End Function ''' @@ -139,7 +140,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetInvalidOperationException( ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException - Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(Utils1.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -150,7 +151,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of IO.IOException. Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException - Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(Utils1.GetResourceString(ResourceID, PlaceHolders)) End Function ''' @@ -164,7 +165,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Shared Function GetWin32Exception( ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), Utils1.GetResourceString(ResourceID, PlaceHolders)) End Function End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb index f20925ab2b9..97d81bdfcdc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -6,7 +6,7 @@ Imports System.Globalization Namespace Microsoft.VisualBasic.CompilerServices ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils + Friend NotInheritable Class Utils1 Friend Shared Function GetResourceString(ResourceId As vbErrors) As String Dim id As String = "ID" & CStr(ResourceId) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index c5df94656e3..a98a4687531 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -376,7 +376,7 @@ Namespace Microsoft.VisualBasic.Devices 'Throw if the file exists and the user doesn't want to overwrite If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + Throw New IO.IOException(Utils1.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) End If ' Set credentials if we have any From a8c14fafc75ea39d3c35a46f62e1260cbb99f41d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 11 Jul 2024 20:20:10 -0700 Subject: [PATCH 230/342] Use FluentAssertions; in C# Tests --- .../Microsoft/VisualBasic/Devices/NetworkTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 7e5b6df91dd..4464389d433 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using FluentAssertions; + namespace Microsoft.VisualBasic.Devices.Tests; public class NetworkTests @@ -23,14 +25,14 @@ public void Ping() public void Ping_ShortTimeout_Success() { Network network = new(); - Assert.True(network.Ping("127.0.0.1", 1)); + network.Ping("127.0.0.1", 1).Should().BeTrue(); } [Fact] public void Ping_Success() { Network network = new(); - Assert.True(network.Ping("127.0.0.1")); + network.Ping("127.0.0.1").Should().BeTrue(); } [Fact] @@ -44,14 +46,14 @@ public void Ping_Throw() public void PingUri_ShortTimeout_Success() { Network network = new(); - Assert.True(network.Ping(new Uri("http://127.0.0.1"), 1)); + network.Ping(new Uri("http://127.0.0.1"), 1).Should().BeTrue(); } [Fact] public void PingUri_Success() { Network network = new(); - Assert.True(network.Ping(new Uri("http://127.0.0.1"))); + network.Ping(new Uri("http://127.0.0.1")).Should().BeTrue(); } [Fact] From 504b608a5c70b55e92201416e952c5834d3f1803 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 11 Jul 2024 22:27:26 -0700 Subject: [PATCH 231/342] Add additional tests and make changes required to fix errors --- .../CompilerServices/ExceptionUtils.vb | 179 ++++---- .../VisualBasic/CompilerServices/Utils.vb | 27 -- .../Microsoft/VisualBasic/Devices/Network.vb | 386 ++++++++-------- .../Interaction.InputBoxHandler.vb | 51 +++ .../src/Microsoft/VisualBasic/Interaction.vb | 252 +++++----- .../FileLogTraceListener.ReferencedStream.vb | 143 ++++++ .../Logging/FileLogTraceListener.vb | 433 ++++++------------ .../MyServices/SpecialDirectoriesProxy.vb | 5 +- .../Windows/Forms/ExceptionUtilsTests.vb | 17 + .../VisualBasic/Devices/NetworkTests.cs | 7 - 10 files changed, 750 insertions(+), 750 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 6913c88b4f0..9e4ca8377ae 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,9 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On - -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -14,28 +12,31 @@ Namespace Microsoft.VisualBasic.CompilerServices End Enum ' Implements error utilities for Basic - Friend NotInheritable Class ExceptionUtils + Friend Module ExceptionUtils + + Friend Function GetResourceString(resourceKey As String, + ParamArray args() As String) As String + Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) + End Function - ' Prevent creation. - Private Sub New() - End Sub + Friend Function GetResourceString(resourceId As vbErrors) As String + Dim id As String = $"ID{CStr(resourceId)}" + Return SR.GetResourceString(id, id) + End Function - Friend Shared Function VbMakeException(hr As Integer) As Exception - Dim sMsg As String + Friend Function VbMakeException(resourceId As Integer) As Exception + Dim description As String = "" - If hr > 0 AndAlso hr <= &HFFFFI Then - Dim hr1 As vbErrors = CType(hr, vbErrors) - sMsg = Utils1.GetResourceString(hr1) - Else - sMsg = "" + If resourceId > 0 AndAlso resourceId <= &HFFFFI Then + description = GetResourceString(DirectCast(resourceId, vbErrors)) End If - VbMakeException = VbMakeExceptionEx(hr, sMsg) + VbMakeException = VbMakeExceptionEx(resourceId, description) End Function - Friend Shared Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception + Friend Function VbMakeExceptionEx(resourceId As Integer, description As String) As Exception Dim vBDefinedError As Boolean - VbMakeExceptionEx = BuildException(number, sMsg, vBDefinedError) + VbMakeExceptionEx = BuildException(resourceId, description, vBDefinedError) If vBDefinedError Then ' .NET Framework implementation calls: @@ -44,130 +45,134 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function - Friend Shared Function BuildException(Number As Integer, Description As String, ByRef VBDefinedError As Boolean) As Exception + Friend Function BuildException(resourceId As Integer, + description As String, + ByRef vbDefinedError As Boolean) As Exception - VBDefinedError = True + vbDefinedError = True - Select Case Number + Select Case resourceId Case vbErrors.None Case vbErrors.FileNotFound - Return New IO.FileNotFoundException(Description) + Return New IO.FileNotFoundException(description) Case vbErrors.PermissionDenied - Return New IO.IOException(Description) + Return New IO.IOException(description) Case Else 'Fall below to default - VBDefinedError = False - Return New Exception(Description) + vbDefinedError = False + Return New Exception(description) End Select - VBDefinedError = False - Return New Exception(Description) + vbDefinedError = False + Return New Exception(description) End Function ''' - ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentException. + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . ''' This is the preferred way to construct an argument exception. - Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException + Friend Function GetArgumentExceptionWithArgName(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentException - Return New ArgumentException(Utils1.GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(GetResourceString(resourceID, placeHolders), argumentName) End Function ''' - ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." + ''' Returns a new instance of with message: "Argument cannot be Nothing." ''' - ''' The name of the argument (parameter). Not localized. - ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException + ''' The name of the argument (parameter). Not localized. + ''' A new instance of . + Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, Utils1.GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(argumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' - ''' Returns a new instance of ArgumentNullException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException - - Return New ArgumentNullException(ArgumentName, Utils1.GetResourceString(ResourceID, PlaceHolders)) + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetArgumentNullException(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentNullException + + Return New ArgumentNullException(argumentName, GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.DirectoryNotFoundException. - Friend Shared Function GetDirectoryNotFoundException( - ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetDirectoryNotFoundException(resourceID As String, + ParamArray placeHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(Utils1.GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The file name (path) of the not found file. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.FileNotFoundException. - Friend Shared Function GetFileNotFoundException(FileName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException - - Return New IO.FileNotFoundException(Utils1.GetResourceString(ResourceID, PlaceHolders), FileName) + ''' The file name (path) of the not found file. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetFileNotFoundException(fileName As String, + resourceID As String, + ParamArray placeHolders() As String) As IO.FileNotFoundException + + Return New IO.FileNotFoundException(GetResourceString(resourceID, placeHolders), fileName) End Function ''' - ''' Returns a new instance of InvalidOperationException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of InvalidOperationException. - Friend Shared Function GetInvalidOperationException( - ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetInvalidOperationException(resourceID As String, + ParamArray placeHolders() As String) As InvalidOperationException - Return New InvalidOperationException(Utils1.GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.IOException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.IOException. - Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetIOException(resourceID As String, + ParamArray placeHolders() As String) As IO.IOException - Return New IO.IOException(Utils1.GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. + ''' Returns a new instance of with the message from resource file and the last Win32 error. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of Win32Exception. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. + Friend Function GetWin32Exception(resourceID As String, + ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Friend Shared Function GetWin32Exception( - ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception - - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), Utils1.GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function - End Class - + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb deleted file mode 100644 index 97d81bdfcdc..00000000000 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ /dev/null @@ -1,27 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Globalization - -Namespace Microsoft.VisualBasic.CompilerServices - - ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils1 - - Friend Shared Function GetResourceString(ResourceId As vbErrors) As String - Dim id As String = "ID" & CStr(ResourceId) - Return SR.GetResourceString(id, id) - End Function - - Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String - Return String.Format(GetCultureInfo(), resourceKey, args) - End Function - - Friend Shared Function GetCultureInfo() As CultureInfo - Return Threading.Thread.CurrentThread.CurrentCulture - End Function - - End Class - -End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index a98a4687531..774c095c883 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -1,17 +1,15 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On Imports System.ComponentModel Imports System.Net Imports System.Security Imports System.Threading Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports NetInfoAlias = System.Net.NetworkInformation Namespace Microsoft.VisualBasic.Devices @@ -39,8 +37,8 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Event fired when connected to the network ''' - ''' Has no meaning for this event - ''' Has no meaning for this event + ''' Has no meaning for this event. + ''' Has no meaning for this event. Public Custom Event NetworkAvailabilityChanged As NetworkAvailableEventHandler 'This is a custom event because we want to hook up the NetworkAvailabilityChanged event only if the user writes a handler for it. 'The reason being that it is very expensive to handle and kills our application startup perf. @@ -54,7 +52,7 @@ Namespace Microsoft.VisualBasic.Devices Catch ex As PlatformNotSupportedException Return End Try - SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. + SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) _networkAvailabilityEventHandlers.Add(handler) @@ -102,7 +100,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Indicates whether or not the local machine is connected to an IP network. ''' - ''' True if connected, otherwise False + ''' True if connected, otherwise False. Public ReadOnly Property IsAvailable() As Boolean Get @@ -112,24 +110,24 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Sends and receives a packet to and from the passed in address. + ''' Sends and receives a packet to and from the passed in address. ''' ''' - ''' True if ping was successful, otherwise False + ''' True if ping was successful, otherwise False. Public Function Ping(hostNameOrAddress As String) As Boolean Return Ping(hostNameOrAddress, DEFAULT_PING_TIMEOUT) End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host - ''' True if ping was successful, otherwise False + ''' A Uri representing the host. + ''' True if ping was successful, otherwise False. Public Function Ping(address As Uri) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, DEFAULT_PING_TIMEOUT) End Function @@ -137,89 +135,89 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in address. ''' - ''' The name of the host as a Url or IP Address - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False + ''' The name of the host as a Url or IP Address. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. Public Function Ping(hostNameOrAddress As String, timeout As Integer) As Boolean ' Make sure a network is available If Not IsAvailable Then - Throw GetInvalidOperationException(SR.Network_NetworkNotAvailable) + Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) End If - Dim PingMaker As New NetInfoAlias.Ping - Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - If Reply.Status = NetInfoAlias.IPStatus.Success Then + Dim pingMaker As New NetInfoAlias.Ping + Dim reply As NetInfoAlias.PingReply = pingMaker.Send(hostNameOrAddress, timeout, PingBuffer) + If reply.Status = NetInfoAlias.IPStatus.Success Then Return True End If Return False End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False + ''' A Uri representing the host. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. Public Function Ping(address As Uri, timeout As Integer) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Return Ping(address.Host, timeout) End Function ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved + ''' Name and path of file where download is saved. Public Sub DownloadFile(address As String, destinationFileName As String) DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved + ''' Uri to the remote file. + ''' Name and path of file where download is saved. Public Sub DownloadFile(address As Uri, destinationFileName As String) DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, password As String) DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String) DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -232,16 +230,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -254,7 +252,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -266,15 +264,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -287,16 +285,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -313,15 +311,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Calls to all the other overloads will come through here + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Calls to all the other overloads will come through here. Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -334,16 +332,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Calls to all the other overloads will come through here. Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -352,11 +350,12 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + ' DO NOT USE NameOf(connectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Using client As New WebClientExtended @@ -366,17 +365,17 @@ Namespace Microsoft.VisualBasic.Devices client.UseNonPassiveFtp = showUI 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(fullFilename) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If 'Throw if the file exists and the user doesn't want to overwrite If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(Utils1.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + Throw New IO.IOException(ExUtils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) End If ' Set credentials if we have any @@ -387,8 +386,8 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then dialog = New ProgressDialog With { - .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) + .Text = ExUtils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), + .LabelText = ExUtils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) } End If @@ -397,7 +396,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect If String.IsNullOrEmpty(targetDirectory) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If If Not IO.Directory.Exists(targetDirectory) Then @@ -422,54 +421,54 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination + ''' The file to be uploaded. + ''' The full name and path of the host destination. Public Sub UploadFile(sourceFileName As String, address As String) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination + ''' The file to be uploaded. + ''' Uri representing the destination. Public Sub UploadFile(sourceFileName As String, address As Uri) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. Public Sub UploadFile(sourceFileName As String, address As String, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -481,15 +480,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -501,7 +500,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). ' However, it is good practice to verify address before calling address.Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If ' Getting a uri will validate the form of the host address @@ -509,7 +508,7 @@ Namespace Microsoft.VisualBasic.Devices ' For uploads, we need to make sure the address includes the filename If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then - Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) End If UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) @@ -517,14 +516,14 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -536,15 +535,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -561,13 +560,13 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, @@ -578,33 +577,33 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host + ''' Uploads a file from the local machine to the specified host. ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, showUI As Boolean, connectionTimeout As Integer, onUserCancel As UICancelOption) - sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, "sourceFileName") + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) 'Make sure the file exists If Not IO.File.Exists(sourceFileName) Then - Throw New IO.FileNotFoundException(GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) + Throw New IO.FileNotFoundException(ExUtils.GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) End If If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Using client As New WebClientExtended() @@ -615,23 +614,23 @@ Namespace Microsoft.VisualBasic.Devices client.Credentials = networkCredentials End If - Dim Dialog As ProgressDialog = Nothing + Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then - Dialog = New ProgressDialog With { - .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), - .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) + dialog = New ProgressDialog With { + .Text = ExUtils.GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), + .LabelText = ExUtils.GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) } End If 'Create the copier - Dim copier As New WebClientCopy(client, Dialog) + Dim copier As New WebClientCopy(client, dialog) 'Download the file copier.UploadFile(sourceFileName, address) 'Handle a dialog cancel If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then + If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then Throw New OperationCanceledException() End If End If @@ -646,9 +645,9 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event from the OS which comes in on an arbitrary thread Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure - 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSyncronizationContext is thread static. Since we are getting called on some random thread, the context that was - 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original + 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that + 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) End SyncLock @@ -656,18 +655,18 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) Private Sub NetworkAvailabilityChangedHandler(state As Object) - Dim Connected As Boolean = IsAvailable + Dim connected As Boolean = IsAvailable ' Fire an event only if the connected state has changed - If _connected <> Connected Then - _connected = Connected - RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(Connected)) + If _connected <> connected Then + _connected = connected + RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(connected)) End If End Sub ''' - ''' A buffer for pinging. This imitates the buffer used by Ping.Exe + ''' A buffer for pinging. This imitates the buffer used by Ping.Exe. ''' - ''' A buffer + ''' A buffer. Private ReadOnly Property PingBuffer() As Byte() Get If _pingBuffer Is Nothing Then @@ -683,25 +682,25 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address). ''' - ''' The remote file address - ''' A Uri if successful, otherwise it throws an exception + ''' The remote file address. + ''' A Uri if successful, otherwise it throws an exception. Private Shared Function GetUri(address As String) As Uri Try Return New Uri(address) Catch ex As UriFormatException 'Throw an exception with an error message more appropriate to our API - Throw GetArgumentExceptionWithArgName("address", SR.Network_InvalidUriString, address) + Throw ExUtils.GetArgumentExceptionWithArgName("address", SR.Network_InvalidUriString, address) End Try End Function ''' - ''' Gets network credentials from a userName and password + ''' Gets network credentials from a userName and password. ''' - ''' The name of the user - ''' The password of the user - ''' A NetworkCredentials + ''' The name of the user. + ''' The password of the user. + ''' A NetworkCredentials. Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials ' Make sure all nulls are empty strings @@ -751,14 +750,14 @@ Namespace Microsoft.VisualBasic.Devices End Class ''' - ''' Temporary class used to provide WebClient with a timeout property. + ''' Temporary class used to provide WebClient with a timeout property. ''' - ''' This class will be deleted when Timeout is added to WebClient + ''' This class will be deleted when Timeout is added to WebClient. Friend NotInheritable Class WebClientExtended Inherits WebClient ''' - ''' Sets or indicates the timeout used by WebRequest used by WebClient + ''' Sets or indicates the timeout used by WebRequest used by WebClient ''' Public WriteOnly Property Timeout() As Integer Set(value As Integer) @@ -768,9 +767,9 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Enables switching the server to non passive mode. + ''' Enables switching the server to non passive mode. ''' - ''' We need this in order for the progress UI on a download to work + ''' We need this in order for the progress UI on a download to work. Public WriteOnly Property UseNonPassiveFtp() As Boolean Set(value As Boolean) _useNonPassiveFtp = value @@ -778,8 +777,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set - ''' to the Timeout value + ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set + ''' to the Timeout value ''' ''' Protected Overrides Function GetWebRequest(address As Uri) As WebRequest @@ -816,5 +815,4 @@ Namespace Microsoft.VisualBasic.Devices ' Flag used to indicate whether or not we should use passive mode when ftp downloading Private _useNonPassiveFtp As Boolean End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb new file mode 100644 index 00000000000..ade7075bddc --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.InputBoxHandler.vb @@ -0,0 +1,51 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Windows.Forms + +Namespace Microsoft.VisualBasic + + Partial Friend Module _Interaction + + Friend NotInheritable Class InputBoxHandler + Private ReadOnly _defaultResponse As String + Private ReadOnly _parentWindow As IWin32Window + Private ReadOnly _prompt As String + Private ReadOnly _title As String + Private ReadOnly _xPos As Integer + Private ReadOnly _yPos As Integer + Private _exception As Exception + Private _result As String + + Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) + _prompt = Prompt + _title = Title + _defaultResponse = DefaultResponse + _xPos = XPos + _yPos = YPos + _parentWindow = ParentWindow + End Sub + + Friend ReadOnly Property Exception As Exception + Get + Return _exception + End Get + End Property + + Public ReadOnly Property Result() As String + Get + Return _result + End Get + End Property + + Public Sub StartHere() + Try + _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) + Catch ex As Exception + _exception = ex + End Try + End Sub + + End Class + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index fa8e2231587..cb932d73cbd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -7,51 +7,51 @@ Imports System.Text Imports System.Threading Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic - ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. + ' Helper methods invoked through reflection from Microsoft.VisualBasic.Interaction in Microsoft.VisualBasic.Core.dll. ' Do not change this API without also updating that dependent module. Friend Module _Interaction Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer - Dim StartupInfo As New NativeTypes.STARTUPINFO - Dim ProcessInfo As New NativeTypes.PROCESS_INFORMATION + Dim startupInfo As New NativeTypes.STARTUPINFO + Dim processInfo As New NativeTypes.PROCESS_INFORMATION Dim ok As Integer Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim ErrorCode As Integer = 0 + Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If - NativeMethods.GetStartupInfo(StartupInfo) + NativeMethods.GetStartupInfo(startupInfo) Try - StartupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. - StartupInfo.wShowWindow = Style + startupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + startupInfo.wShowWindow = Style 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. - ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, StartupInfo, ProcessInfo) + ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, startupInfo, processInfo) If ok = 0 Then - ErrorCode = Marshal.GetLastWin32Error() + errorCode = Marshal.GetLastWin32Error() End If - If ProcessInfo.hProcess <> IntPtr.Zero AndAlso ProcessInfo.hProcess <> NativeTypes.s_invalidHandle Then - safeProcessHandle.InitialSetHandle(ProcessInfo.hProcess) + If processInfo.hProcess <> IntPtr.Zero AndAlso processInfo.hProcess <> NativeTypes.s_invalidHandle Then + safeProcessHandle.InitialSetHandle(processInfo.hProcess) End If - If ProcessInfo.hThread <> IntPtr.Zero AndAlso ProcessInfo.hThread <> NativeTypes.s_invalidHandle Then - safeThreadHandle.InitialSetHandle(ProcessInfo.hThread) + If processInfo.hThread <> IntPtr.Zero AndAlso processInfo.hThread <> NativeTypes.s_invalidHandle Then + safeThreadHandle.InitialSetHandle(processInfo.hThread) End If Try @@ -66,17 +66,17 @@ Namespace Microsoft.VisualBasic Shell = 0 Else 'Wait timed out - Shell = ProcessInfo.dwProcessId + Shell = processInfo.dwProcessId End If Else NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Shell = ProcessInfo.dwProcessId + Shell = processInfo.dwProcessId End If Else 'Check for a win32 error access denied. If it is, make and throw the exception. 'If not, throw FileNotFound Const ERROR_ACCESS_DENIED As Integer = 5 - If ErrorCode = ERROR_ACCESS_DENIED Then + If errorCode = ERROR_ACCESS_DENIED Then Throw VbMakeException(vbErrors.PermissionDenied) End If @@ -87,111 +87,111 @@ Namespace Microsoft.VisualBasic safeThreadHandle.Close() End Try Finally - StartupInfo.Dispose() + startupInfo.Dispose() End Try End Function Public Sub AppActivateByProcessId(ProcessId As Integer) 'As an optimization, we will only check the UI permission once we actually know we found the app to activate - we'll do that in AppActivateHelper - Dim ProcessIdOwningWindow As Integer - 'Note, a process can have multiple windows. What we want to do is dig through to find one - 'that we can actually activate. So first ignore all the ones that are not visible and don't support mouse + Dim processIdOwningWindow As Integer + 'Note, a process can have multiple windows. What we want to do is dig through to find one + 'that we can actually activate. So first ignore all the ones that are not visible and don't support mouse 'or keyboard input - Dim WindowHandle As IntPtr = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + Dim windowHandle As IntPtr = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While (IntPtr.op_Inequality(WindowHandle, IntPtr.Zero)) - SafeNativeMethods.GetWindowThreadProcessId(WindowHandle, ProcessIdOwningWindow) - If (ProcessIdOwningWindow = ProcessId) AndAlso SafeNativeMethods.IsWindowEnabled(WindowHandle) AndAlso SafeNativeMethods.IsWindowVisible(WindowHandle) Then + Do While (IntPtr.op_Inequality(windowHandle, IntPtr.Zero)) + SafeNativeMethods.GetWindowThreadProcessId(windowHandle, processIdOwningWindow) + If (processIdOwningWindow = ProcessId) AndAlso SafeNativeMethods.IsWindowEnabled(windowHandle) AndAlso SafeNativeMethods.IsWindowVisible(windowHandle) Then Exit Do 'We found a window belonging to the desired process that we can actually activate and will support user input End If 'keep rummaging through windows looking for one that belongs to the process we are after - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop 'If we didn't find a window during the pass above, try the less desirable route of finding any window that belongs to the process - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) - SafeNativeMethods.GetWindowThreadProcessId(WindowHandle, ProcessIdOwningWindow) - If (ProcessIdOwningWindow = ProcessId) Then + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) + SafeNativeMethods.GetWindowThreadProcessId(windowHandle, processIdOwningWindow) + If (processIdOwningWindow = ProcessId) Then Exit Do End If 'keep rummaging through windows looking for one that belongs to the process we are after - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop End If - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else - AppActivateHelper(WindowHandle, CStr(ProcessId)) + AppActivateHelper(windowHandle, CStr(ProcessId)) End If End Sub Public Sub AppActivateByTitle(Title As String) 'As an optimization, we will only check the UI permission once we actually know we found the app to activate - we'll do that in AppActivateHelper - Dim WindowHandle As IntPtr = NativeMethods.FindWindow(Nothing, Title) 'see if we can find the window using an exact match on the title + Dim windowHandle As IntPtr = NativeMethods.FindWindow(Nothing, Title) 'see if we can find the window using an exact match on the title Const MAX_TITLE_LENGTH As Integer = 511 ' if no match, search through all parent windows - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then - Dim AppTitle As String + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then + Dim appTitle As String ' Old implementation uses MAX_TITLE_LENGTH characters, INCLUDING NULL character. ' Interop code will extend string builder to handle NULL character. - Dim AppTitleBuilder As New StringBuilder(MAX_TITLE_LENGTH) - Dim AppTitleLength As Integer - Dim TitleLength As Integer = Len(Title) + Dim appTitleBuilder As New StringBuilder(MAX_TITLE_LENGTH) + Dim appTitleLength As Integer + Dim titleLength As Integer = Len(Title) 'Loop through all children of the desktop - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) ' get the window caption and test for a left-aligned substring - AppTitleLength = NativeMethods.GetWindowText(WindowHandle, AppTitleBuilder, AppTitleBuilder.Capacity) - AppTitle = AppTitleBuilder.ToString() + appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity) + appTitle = appTitleBuilder.ToString() - If AppTitleLength >= TitleLength Then - If String.Compare(AppTitle, 0, Title, 0, TitleLength, StringComparison.OrdinalIgnoreCase) = 0 Then + If appTitleLength >= titleLength Then + If String.Compare(appTitle, 0, Title, 0, titleLength, StringComparison.OrdinalIgnoreCase) = 0 Then Exit Do 'found one End If End If 'keep looking - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then ' We didn't find it so try right aligned - WindowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) + windowHandle = NativeMethods.GetWindow(NativeMethods.GetDesktopWindow(), NativeTypes.GW_CHILD) - Do While IntPtr.op_Inequality(WindowHandle, IntPtr.Zero) + Do While IntPtr.op_Inequality(windowHandle, IntPtr.Zero) ' get the window caption and test for a right-aligned substring - AppTitleLength = NativeMethods.GetWindowText(WindowHandle, AppTitleBuilder, AppTitleBuilder.Capacity) - AppTitle = AppTitleBuilder.ToString() + appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity) + appTitle = appTitleBuilder.ToString() - If AppTitleLength >= TitleLength Then - If String.Compare(Right(AppTitle, TitleLength), 0, Title, 0, TitleLength, StringComparison.OrdinalIgnoreCase) = 0 Then + If appTitleLength >= titleLength Then + If String.Compare(Right(appTitle, titleLength), 0, Title, 0, titleLength, StringComparison.OrdinalIgnoreCase) = 0 Then Exit Do 'found a match End If End If 'keep looking - WindowHandle = NativeMethods.GetWindow(WindowHandle, NativeTypes.GW_HWNDNEXT) + windowHandle = NativeMethods.GetWindow(windowHandle, NativeTypes.GW_HWNDNEXT) Loop End If End If - If IntPtr.op_Equality(WindowHandle, IntPtr.Zero) Then 'no match - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, Title)) + If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, Title)) Else - AppActivateHelper(WindowHandle, Title) + AppActivateHelper(windowHandle, Title) End If End Sub - Private Sub AppActivateHelper(hwndApp As IntPtr, ProcessId As String) + Private Sub AppActivateHelper(hwndApp As IntPtr, processId As String) ' if no window with name (full or truncated) or task id, return an error ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible Dim hwndOwned As IntPtr @@ -212,7 +212,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, ProcessId)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -221,7 +221,7 @@ Namespace Microsoft.VisualBasic ' SetActiveWindow on Win32 only activates the Window - it does ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' the current thread. NativeMethods.SetForegroundWindow() activates the ' window, moves it to the foreground, and bumps the priority ' of the thread which owns the window. @@ -237,60 +237,20 @@ Namespace Microsoft.VisualBasic NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) End Sub - Private NotInheritable Class InputBoxHandler - Private ReadOnly _prompt As String - Private ReadOnly _title As String - Private ReadOnly _defaultResponse As String - Private ReadOnly _xPos As Integer - Private ReadOnly _yPos As Integer - Private _result As String - Private ReadOnly _parentWindow As IWin32Window - Private _exception As Exception - - Public Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) - _prompt = Prompt - _title = Title - _defaultResponse = DefaultResponse - _xPos = XPos - _yPos = YPos - _parentWindow = ParentWindow - End Sub - - Public Sub StartHere() - Try - _result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow) - Catch ex As Exception - _exception = ex - End Try - End Sub - - Public ReadOnly Property Result() As String - Get - Return _result - End Get - End Property - - Friend ReadOnly Property Exception As Exception - Get - Return _exception - End Get - End Property - End Class - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String - Dim vbhost As IVbHost - Dim ParentWindow As IWin32Window = Nothing + Dim vbHost As IVbHost + Dim parentWindow As IWin32Window = Nothing - vbhost = HostServices.VBHost - If vbhost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. - ParentWindow = vbhost.GetParentWindow() + vbHost = HostServices.VBHost + If vbHost IsNot Nothing Then 'If we are hosted then we want to use the host as the parent window. If no parent window that's fine. + parentWindow = vbHost.GetParentWindow() End If If String.IsNullOrEmpty(Title) Then - If vbhost Is Nothing Then + If vbHost Is Nothing Then Title = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - Title = vbhost.GetWindowTitle() + Title = vbHost.GetWindowTitle() End If End If @@ -298,66 +258,66 @@ Namespace Microsoft.VisualBasic 'but set to STA and check if it isn't STA, then we need to start another thread 'to display the InputBox If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then - Dim InputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) - Dim thread As New Thread(New ThreadStart(AddressOf InputHandler.StartHere)) + Dim inputHandler As New InputBoxHandler(Prompt, Title, DefaultResponse, XPos, YPos, parentWindow) + Dim thread As New Thread(New ThreadStart(AddressOf inputHandler.StartHere)) thread.Start() thread.Join() - If InputHandler.Exception IsNot Nothing Then - Throw InputHandler.Exception + If inputHandler.Exception IsNot Nothing Then + Throw inputHandler.Exception End If - Return InputHandler.Result + Return inputHandler.Result Else - Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, ParentWindow) + Return InternalInputBox(Prompt, Title, DefaultResponse, XPos, YPos, parentWindow) End If End Function - Private Function GetTitleFromAssembly(CallingAssembly As Reflection.Assembly) As String + Private Function GetTitleFromAssembly(callingAssembly As Reflection.Assembly) As String - Dim Title As String + Dim title As String - 'Get the Assembly name of the calling assembly + 'Get the Assembly name of the calling assembly 'Assembly.GetName requires PathDiscovery permission so we try this first 'and if it throws we catch the security exception and parse the name 'from the full assembly name Try - Title = CallingAssembly.GetName().Name + title = callingAssembly.GetName().Name Catch ex As SecurityException - Dim FullName As String = CallingAssembly.FullName + Dim fullName As String = callingAssembly.FullName 'Find the text up to the first comma. Note, this fails if the assembly has 'a comma in its name - Dim FirstCommaLocation As Integer = FullName.IndexOf(","c) - If FirstCommaLocation >= 0 Then - Title = FullName.Substring(0, FirstCommaLocation) + Dim firstCommaLocation As Integer = fullName.IndexOf(","c) + If firstCommaLocation >= 0 Then + title = fullName.Substring(0, firstCommaLocation) Else 'The name is not in the format we're expecting so return an empty string - Title = "" + title = "" End If End Try - Return Title + Return title End Function - Private Function InternalInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer, ParentWindow As IWin32Window) As String - Dim Box As VBInputBox = New VBInputBox(Prompt, Title, DefaultResponse, XPos, YPos) - Box.ShowDialog(ParentWindow) + Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String + Dim box As VBInputBox = New VBInputBox(prompt, title, defaultResponse, xPos, yPos) + box.ShowDialog(parentWindow) - InternalInputBox = Box.Output - Box.Dispose() + InternalInputBox = box.Output + box.Dispose() End Function Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String - Dim vbhost As IVbHost - Dim ParentWindow As IWin32Window = Nothing + Dim vbHost As IVbHost + Dim parentWindow As IWin32Window = Nothing - vbhost = HostServices.VBHost - If vbhost IsNot Nothing Then - ParentWindow = vbhost.GetParentWindow() + vbHost = HostServices.VBHost + If vbHost IsNot Nothing Then + parentWindow = vbHost.GetParentWindow() End If 'Only allow legal button combinations to be set, one choice from each group @@ -381,18 +341,18 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try If Title Is Nothing Then - If vbhost Is Nothing Then + If vbHost Is Nothing Then sTitle = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - sTitle = vbhost.GetWindowTitle() + sTitle = vbHost.GetWindowTitle() End If Else - sTitle = CStr(Title) 'allows the title to be an expression, e.g. msgbox(prompt, Title:=1+5) + sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) End If Catch ex As StackOverflowException Throw @@ -401,10 +361,10 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try - Return CType(MessageBox.Show(ParentWindow, sPrompt, sTitle, + Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, CType(Buttons And &HF, MessageBoxButtons), CType(Buttons And &HF0, MessageBoxIcon), CType(Buttons And &HF00, MessageBoxDefaultButton), @@ -413,6 +373,4 @@ Namespace Microsoft.VisualBasic End Function End Module - End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb new file mode 100644 index 00000000000..eeb859cad7e --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb @@ -0,0 +1,143 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO + +Namespace Microsoft.VisualBasic.Logging + + Public Class FileLogTraceListener + + Friend NotInheritable Class ReferencedStream + Implements IDisposable + + ' Used for synchronizing writing and reference counting + Private ReadOnly _syncObject As Object = New Object + + ' Indicates whether or not the object has been disposed + Private _disposed As Boolean + + ' The number of FileLogTraceListeners using the stream + Private _referenceCount As Integer + + ' The stream that does the writing + Private _stream As StreamWriter + + ''' + ''' Creates a new referenced stream. + ''' + ''' The stream that does the actual writing. + Friend Sub New(stream As StreamWriter) + _stream = stream + End Sub + + ''' + ''' Ensures stream is closed at GC. + ''' + Protected Overrides Sub Finalize() + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(False) + MyBase.Finalize() + End Sub + + ''' + ''' The size of the log file. + ''' + ''' The size. + Friend ReadOnly Property FileSize() As Long + Get + Return _stream.BaseStream.Length + End Get + End Property + + ''' + ''' Indicates whether or not the stream is still in use by a FileLogTraceListener. + ''' + ''' True if the stream is being used, otherwise False. + Friend ReadOnly Property IsInUse() As Boolean + Get + Return _stream IsNot Nothing + End Get + End Property + + ''' + ''' Ensures the stream is closed (flushed) no matter how we are closed. + ''' + ''' Indicates who called dispose. + Private Overloads Sub Dispose(disposing As Boolean) + If disposing Then + If Not _disposed Then + _stream?.Close() + _disposed = True + End If + End If + End Sub + + ''' + ''' Increments the reference count for the stream. + ''' + Friend Sub AddReference() + SyncLock _syncObject + _referenceCount += 1 + End SyncLock + End Sub + + ''' + ''' Decrements the reference count to the stream and closes + ''' the stream if the reference count is zero. + ''' + Friend Sub CloseStream() + SyncLock _syncObject + Try + _referenceCount -= 1 + _stream.Flush() + Debug.Assert(_referenceCount >= 0, "Ref count is below 0") + Finally + If _referenceCount <= 0 Then + _stream.Close() + _stream = Nothing + End If + End Try + End SyncLock + End Sub + + ''' + ''' Flushes the stream. + ''' + Friend Sub Flush() + SyncLock _syncObject + _stream.Flush() + End SyncLock + End Sub + + ''' + ''' Writes a message to the stream. + ''' + ''' The message to write. + Friend Sub Write(message As String) + SyncLock _syncObject + _stream.Write(message) + End SyncLock + End Sub + + ''' + ''' Writes a message to the stream as a line. + ''' + ''' The message to write. + Friend Sub WriteLine(message As String) + SyncLock _syncObject + _stream.WriteLine(message) + End SyncLock + End Sub + + ''' + ''' Standard implementation of IDisposable. + ''' + Public Overloads Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + + End Class 'ReferencedStream + End Class 'FileLogTraceListener +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index f014dc8fca7..3f670f3a250 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -1,26 +1,25 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.ComponentModel Imports System.Globalization Imports System.IO Imports System.Text Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory + ''' Options for the location of a log's directory. ''' Public Enum LogFileLocation As Integer + ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory + LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory @@ -28,7 +27,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for the date stamp in the name of a log file + ''' Options for the date stamp in the name of a log file. ''' Public Enum LogFileCreationScheduleOption As Integer None '(default) @@ -37,7 +36,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted + ''' Options for behavior when resources are exhausted. ''' Public Enum DiskSpaceExhaustedOption As Integer ThrowException @@ -45,35 +44,35 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Class for logging to a text file + ''' Class for logging to a text file. ''' ''' - ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). - ''' Therefore, mark FileLogTraceListener as ComVisible(False). + ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). + ''' Therefore, mark FileLogTraceListener as ComVisible(False). ''' - Public Class FileLogTraceListener + Partial Public Class FileLogTraceListener Inherits TraceListener ''' - ''' Creates a FileLogTraceListener with the passed in name + ''' Creates a FileLogTraceListener with the passed in name. ''' - ''' The name of the listener + ''' The name of the listener. Public Sub New(name As String) MyBase.New(name) End Sub ''' - ''' Creates a FileLogTraceListener with default name + ''' Creates a FileLogTraceListener with default name. ''' Public Sub New() Me.New(DEFAULT_NAME) End Sub ''' - ''' Indicates the log's directory + ''' Indicates the log's directory. ''' - ''' An enum which can indicate one of several logical locations for the log + ''' An enum which can indicate one of several logical locations for the log. Public Property Location() As LogFileLocation Get If Not _propertiesSet(LOCATION_INDEX) Then @@ -97,9 +96,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the stream should be flushed after every write + ''' Indicates whether or not the stream should be flushed after every write. ''' - ''' True if the stream should be flushed after every write, otherwise False + ''' True if the stream should be flushed after every write, otherwise False. Public Property AutoFlush() As Boolean Get If Not _propertiesSet(AUTOFLUSH_INDEX) Then @@ -118,10 +117,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' - ''' True if the HostId should be included, otherwise False + ''' True if the HostId should be included, otherwise False. Public Property IncludeHostName() As Boolean Get If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then @@ -139,9 +138,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten + ''' Indicates whether or not the file should be appended to or overwritten. ''' - ''' True if the file should be appended to, otherwise False + ''' True if the file should be appended to, otherwise False. Public Property Append() As Boolean Get If Not _propertiesSet(APPEND_INDEX) Then @@ -166,10 +165,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user. ''' - ''' An enum indicating the desired behavior (do nothing, throw) + ''' An enum indicating the desired behavior (do nothing, throw). Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption Get If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then @@ -189,9 +188,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The name of the log file not including DateStamp, file number, Path or extension + ''' The name of the log file not including DateStamp, file number, Path or extension. ''' - ''' The name of the log file + ''' The name of the log file. Public Property BaseFileName() As String Get If Not _propertiesSet(BASEFILENAME_INDEX) Then @@ -203,7 +202,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As String) If String.IsNullOrEmpty(value) Then - Throw GetArgumentNullException("value", SR.ApplicationLogBaseNameNull) + Throw ExUtils.GetArgumentNullException(NameOf(value), SR.ApplicationLogBaseNameNull) End If ' Test the file name. This will throw if the name is invalid. @@ -219,10 +218,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number + ''' The full name and path of the actual log file including DateStamp and file number. ''' - ''' The full name and path - ''' Calling this method will open the log file if it's not already open + ''' The full name and path. + ''' Calling this method will open the log file if it's not already open. Public ReadOnly Property FullLogFileName() As String Get ' The only way to reliably know the file name is to open the file. If we @@ -237,9 +236,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day) + ''' Indicates what Date to stamp the log file with (none, first day of week, day). ''' - ''' An enum indicating how to stamp the file + ''' An enum indicating how to stamp the file. Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption Get If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then @@ -263,9 +262,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The maximum size in bytes the log file is allowed to grow to + ''' The maximum size in bytes the log file is allowed to grow to. ''' - ''' The maximum size + ''' The maximum size. Public Property MaxFileSize() As Long Get If Not _propertiesSet(MAXFILESIZE_INDEX) Then @@ -278,7 +277,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < MIN_FILE_SIZE Then - Throw GetArgumentExceptionWithArgName("value", SR.ApplicationLogNumberTooSmall, "MaxFileSize") + Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") End If _maxFileSize = value _propertiesSet(MAXFILESIZE_INDEX) = True @@ -286,9 +285,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The amount of disk space, in bytes, that must be available after a write + ''' The amount of disk space, in bytes, that must be available after a write. ''' - ''' The reserved disk space + ''' The reserved disk space. Public Property ReserveDiskSpace() As Long Get If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then @@ -301,7 +300,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < 0 Then - Throw GetArgumentExceptionWithArgName("value", SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") End If _reserveDiskSpace = value _propertiesSet(RESERVEDISKSPACE_INDEX) = True @@ -309,9 +308,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The delimiter to be used to delimit fields in a line of output + ''' The delimiter to be used to delimit fields in a line of output. ''' - ''' The delimiter + ''' The delimiter. Public Property Delimiter() As String Get If Not _propertiesSet(DELIMITER_INDEX) Then @@ -328,12 +327,12 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The encoding to try when opening a file. + ''' The encoding to try when opening a file. ''' - ''' The encoding + ''' The encoding. ''' - ''' If Append is true then this value will be trumped by the actual encoding value - ''' of the file + ''' If Append is true then this value will be trumped by the actual + ''' encoding value of the file. ''' Public Property Encoding() As Encoding Get @@ -346,7 +345,7 @@ Namespace Microsoft.VisualBasic.Logging End Get Set(value As Encoding) If value Is Nothing Then - Throw GetArgumentNullException("value") + Throw ExUtils.GetArgumentNullException(NameOf(value)) End If _encoding = value _propertiesSet(ENCODING_INDEX) = True @@ -354,10 +353,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom + ''' The directory to be used if Location is set to Custom. ''' - ''' The name of the directory - ''' This will throw if the path cannot be resolved + ''' The name of the directory. + ''' This will throw if the path cannot be resolved. Public Property CustomLocation() As String Get If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then @@ -394,9 +393,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Writes the message to the log + ''' Writes the message to the log. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub Write(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -404,9 +403,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message) + Dim newEntrySize As Long = Encoding.GetByteCount(message) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.Write(message) If AutoFlush Then ListenerStream.Flush() @@ -420,9 +419,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes the message to the log as a line + ''' Writes the message to the log as a line. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub WriteLine(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -430,9 +429,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) + Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.WriteLine(message) If AutoFlush Then ListenerStream.Flush() @@ -445,13 +444,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' The message + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' The message. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) If Filter IsNot Nothing Then @@ -516,14 +515,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A string with placeholders that serves as a format for the message - ''' The values for the placeholders in format + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A string with placeholders that serves as a format for the message. + ''' The values for the placeholders in format. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) ' Create the message @@ -538,13 +537,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' An object containing the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' An object containing the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) Dim message As String = "" @@ -556,13 +555,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A list of objects making up the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A list of objects making up the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) Dim messageBuilder As New StringBuilder() @@ -580,30 +579,30 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the underlying stream + ''' Flushes the underlying stream. ''' Public Overrides Sub Flush() _stream?.Flush() End Sub ''' - ''' Closes the underlying stream + ''' Closes the underlying stream. ''' Public Overrides Sub Close() Dispose(True) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception. ''' - ''' An array of attribute names + ''' An array of attribute names. Protected Overrides Function GetSupportedAttributes() As String() Return _supportedAttributes End Function ''' - ''' Makes sure stream is flushed + ''' Makes sure stream is flushed. ''' ''' Protected Overrides Sub Dispose(disposing As Boolean) @@ -613,12 +612,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Gets the log file name under the current configuration. ''' - ''' The log file name + ''' The log file name. ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. ''' Private ReadOnly Property LogFileName() As String Get @@ -666,9 +665,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets the stream to use for writing to the log + ''' Gets the stream to use for writing to the log. ''' - ''' The stream + ''' The stream. Private ReadOnly Property ListenerStream() As ReferencedStream Get EnsureStreamIsOpen() @@ -679,16 +678,16 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets or creates the stream used for writing to the log + ''' Gets or creates the stream used for writing to the log. ''' - ''' The stream + ''' The stream. Private Function GetStream() As ReferencedStream ' Check the hash table to see if this file is already opened by another ' FileLogTraceListener in the same process Dim i As Integer = 0 Dim refStream As ReferencedStream = Nothing - Dim BaseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) + Dim baseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) While refStream Is Nothing AndAlso i < MAX_OPEN_ATTEMPTS ' This should only be true if processes outside our process have @@ -747,13 +746,13 @@ Namespace Microsoft.VisualBasic.Logging i += 1 End SyncLock End While - 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system + 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, BaseStreamName) + Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' - ''' Makes sure we have an open stream + ''' Makes sure we have an open stream. ''' Private Sub EnsureStreamIsOpen() If _stream Is Nothing Then @@ -762,9 +761,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Closes the stream. + ''' Closes the stream. ''' - ''' This method should be safe to call whether or not there is a stream + ''' This method should be safe to call whether or not there is a stream. Private Sub CloseCurrentStream() If _stream IsNot Nothing Then SyncLock s_streams @@ -778,35 +777,35 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the current date has changed to new day + ''' Indicates whether or not the current date has changed to new day. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function DayChanged() As Boolean Return _day.Date <> Now.Date End Function ''' - ''' Indicates whether or not the date has changed to a new week + ''' Indicates whether or not the date has changed to a new week. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function WeekChanged() As Boolean Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) End Function ''' - ''' Utility to get the date of the first day of the week from the passed in date + ''' Utility to get the date of the first day of the week from the passed in date. ''' - ''' The date being checked + ''' The date being checked. Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date Return checkDate.AddDays(-checkDate.DayOfWeek).Date End Function ''' - ''' Checks for date changes and carries out appropriate actions + ''' Checks for date changes and carries out appropriate actions. ''' ''' - ''' If the user has selected a DateStamp option then a change of - ''' date means we need to open a new file. + ''' If the user has selected a DateStamp option then a change of + ''' date means we need to open a new file. ''' Private Sub HandleDateChange() If LogFileCreationSchedule = LogFileCreationScheduleOption.Daily Then @@ -821,12 +820,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Checks the size of the current log plus the new entry and the free disk space against - ''' the user's limits. + ''' Checks the size of the current log plus the new entry and + ''' the free disk space against the user's limits. ''' - ''' The size of what's about to be written to the file - ''' True if the limits aren't trespassed, otherwise False - ''' This method is not 100% accurate if AutoFlush is False + ''' The size of what's about to be written to the file. + ''' True if the limits aren't trespassed, otherwise False. + ''' This method is not 100% accurate if AutoFlush is False. Private Function ResourcesAvailable(newEntrySize As Long) As Boolean If ListenerStream.FileSize + newEntrySize > MaxFileSize Then @@ -847,49 +846,49 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user + ''' Returns the total amount of free disk space available to the current user. ''' - ''' The total amount, in bytes, of free disk space available to the current user - ''' Throws an exception if API fails + ''' The total amount, in bytes, of free disk space available to the current user. + ''' Throws an exception if API fails. Private Function GetFreeDiskSpace() As Long - Dim PathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) + Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim FreeUserSpace As Long = -1 - Dim TotalUserSpace As Long - Dim TotalFreeSpace As Long + Dim freeUserSpace As Long = -1 + Dim totalUserSpace As Long + Dim totalFreeSpace As Long - If UnsafeNativeMethods.GetDiskFreeSpaceEx(PathName, FreeUserSpace, TotalUserSpace, TotalFreeSpace) Then - If FreeUserSpace > -1 Then - Return FreeUserSpace + If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then + If freeUserSpace > -1 Then + Return freeUserSpace End If End If - Throw GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) End Function ''' - ''' Opens a file and attempts to determine the file's encoding + ''' Opens a file and attempts to determine the file's encoding. ''' - ''' The encoding or Nothing + ''' The encoding or Nothing. Private Function GetFileEncoding(fileName As String) As Encoding If File.Exists(fileName) Then - Dim Reader As StreamReader = Nothing + Dim reader As StreamReader = Nothing Try 'Attempt to determine the encoding of the file. The call to Reader.ReadLine 'will change the current encoding of Reader to that of the file. - Reader = New StreamReader(fileName, Encoding, True) + reader = New StreamReader(fileName, Encoding, True) 'Ignore 0 length file - If Reader.BaseStream.Length > 0 Then - Reader.ReadLine() + If reader.BaseStream.Length > 0 Then + reader.ReadLine() - Return Reader.CurrentEncoding + Return reader.CurrentEncoding End If Finally - Reader?.Close() + reader?.Close() End Try End If @@ -897,10 +896,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Gets the host name + ''' Gets the host name. ''' - ''' The host name - ''' We use the machine name because we can get that even if not hooked up to a network + ''' The host name. + ''' We use the machine name because we can get that even if not hooked up to a network. Private ReadOnly Property HostName() As String Get If String.IsNullOrEmpty(_hostName) Then @@ -912,10 +911,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Demands a FileIO write permission. + ''' Demands a FileIO write permission. ''' ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS + ''' This ensures these API cannot be used to circumvent CAS. ''' Private Sub DemandWritePermission() Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") @@ -923,7 +922,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value + ''' Validates that the value being passed as an LogFileLocation enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) @@ -933,7 +932,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. ''' ''' Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) @@ -943,7 +942,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) @@ -953,10 +952,10 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Convert a stack into a string + ''' Convert a stack into a string. ''' ''' - ''' Returns the stack as a .csv string + ''' Returns the stack as a .csv string. Private Shared Function StackToString(stack As Stack) As String Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") @@ -1047,6 +1046,7 @@ Namespace Microsoft.VisualBasic.Logging ' Identifies properties in the BitArray Private Const PROPERTY_COUNT As Integer = 12 + Private Const APPEND_INDEX As Integer = 0 Private Const AUTOFLUSH_INDEX As Integer = 1 Private Const BASEFILENAME_INDEX As Integer = 2 @@ -1072,6 +1072,7 @@ Namespace Microsoft.VisualBasic.Logging ' Attribute keys used to access properties set in the config file Private Const KEY_APPEND As String = "append" + Private Const KEY_APPEND_PASCAL As String = "Append" Private Const KEY_AUTOFLUSH As String = "autoflush" @@ -1120,143 +1121,5 @@ Namespace Microsoft.VisualBasic.Logging ' Delimiter used when converting a stack to a string Private Const STACK_DELIMITER As String = ", " - ''' - ''' Wraps a StreamWriter and keeps a reference count. This enables multiple - ''' FileLogTraceListeners on multiple threads to access the same file. - ''' - Friend NotInheritable Class ReferencedStream - Implements IDisposable - - ''' - ''' Creates a new referenced stream - ''' - ''' The stream that does the actual writing - Friend Sub New(stream As StreamWriter) - _stream = stream - End Sub - - ''' - ''' Writes a message to the stream - ''' - ''' The message to write - Friend Sub Write(message As String) - SyncLock _syncObject - _stream.Write(message) - End SyncLock - End Sub - - ''' - ''' Writes a message to the stream as a line - ''' - ''' The message to write - Friend Sub WriteLine(message As String) - SyncLock _syncObject - _stream.WriteLine(message) - End SyncLock - End Sub - - ''' - ''' Increments the reference count for the stream - ''' - Friend Sub AddReference() - SyncLock _syncObject - _referenceCount += 1 - End SyncLock - End Sub - - ''' - ''' Flushes the stream - ''' - Friend Sub Flush() - SyncLock _syncObject - _stream.Flush() - End SyncLock - End Sub - - ''' - ''' Decrements the reference count to the stream and closes the stream if the reference count - ''' is zero - ''' - Friend Sub CloseStream() - SyncLock _syncObject - Try - _referenceCount -= 1 - _stream.Flush() - Debug.Assert(_referenceCount >= 0, "Ref count is below 0") - Finally - If _referenceCount <= 0 Then - _stream.Close() - _stream = Nothing - End If - End Try - End SyncLock - End Sub - - ''' - ''' Indicates whether or not the stream is still in use by a FileLogTraceListener - ''' - ''' True if the stream is being used, otherwise False - Friend ReadOnly Property IsInUse() As Boolean - Get - Return _stream IsNot Nothing - End Get - End Property - - ''' - ''' The size of the log file - ''' - ''' The size - Friend ReadOnly Property FileSize() As Long - Get - Return _stream.BaseStream.Length - End Get - End Property - - ''' - ''' Ensures the stream is closed (flushed) no matter how we are closed - ''' - ''' Indicates who called dispose - Private Overloads Sub Dispose(disposing As Boolean) - If disposing Then - If Not _disposed Then - _stream?.Close() - _disposed = True - End If - End If - End Sub - - ''' - ''' Standard implementation of IDisposable - ''' - Public Overloads Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(True) - GC.SuppressFinalize(Me) - End Sub - - ''' - ''' Ensures stream is closed at GC - ''' - Protected Overrides Sub Finalize() - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(False) - MyBase.Finalize() - End Sub - - ' The stream that does the writing - Private _stream As StreamWriter - - ' The number of FileLogTraceListeners using the stream - Private _referenceCount As Integer - - ' Used for synchronizing writing and reference counting - Private ReadOnly _syncObject As Object = New Object - - ' Indicates whether or not the object has been disposed - Private _disposed As Boolean - - End Class 'ReferencedStream - End Class 'FileLogTraceListener - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb index a28c07a16b3..4fad8e379de 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb @@ -7,7 +7,7 @@ Imports Microsoft.VisualBasic.FileIO Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.SpecialDirectories to expose the type through My. + ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.SpecialDirectories to expose the type through My. ''' Public Class SpecialDirectoriesProxy @@ -67,11 +67,10 @@ Namespace Microsoft.VisualBasic.MyServices End Property ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index fcd281cb4e9..5dea00d249f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -21,6 +21,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) End Sub + + Public Sub GetDirectoryNotFoundExceptionTest_Succeed() + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) + Assert.IsType(Of IO.DirectoryNotFoundException)(ex) + Assert.Equal("File not found.", ex.Message) + End Sub + + + Public Sub GetFileNotFoundExceptionTest_Succeed() + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) + Assert.IsType(Of IO.FileNotFoundException)(ex) + Assert.Equal("File not found.", ex.Message) + Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) + End Sub + Public Sub GetInvalidOperationExceptionTest_Succeed() Dim ex As Exception = ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 4464389d433..3265ca4189b 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -14,13 +14,6 @@ public void IsAvailable() Assert.Equal(System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(), network.IsAvailable); } - [Fact] - public void Ping() - { - Network network = new(); - Assert.True(network.Ping("127.0.0.1")); - } - [Fact] public void Ping_ShortTimeout_Success() { From f8d58337b63e669f40ca3660991a80e85de5f28e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 15:06:15 -0700 Subject: [PATCH 232/342] Sync with Fix Editor Config PR --- .../ApplicationServices/ApplicationBase.vb | 72 ++-- .../ApplyApplicationDefaultsEventArgs.vb | 4 - .../ApplicationServices/AssemblyInfo.vb | 54 +-- .../CantStartSingleInstanceException.vb | 20 +- .../ConsoleApplicationBase.vb | 43 +- .../NoStartupFormException.vb | 8 +- .../SingleInstanceHelpers.vb | 16 +- .../ApplicationServices/StartupEventArgs.vb | 11 +- .../StartupNextInstanceEventArgs.vb | 21 +- .../UnhandledExceptionEventArgs.vb | 9 +- .../VisualBasic/ApplicationServices/User.vb | 30 +- .../WindowsFormsApplicationBase.vb | 288 ++++++------- .../CompilerServices/ExceptionUtils.vb | 178 ++++---- .../Microsoft/VisualBasic/Devices/Audio.vb | 15 +- .../Microsoft/VisualBasic/Devices/Clock.vb | 10 +- .../Microsoft/VisualBasic/Devices/Computer.vb | 5 +- .../VisualBasic/Devices/ComputerInfo.vb | 25 +- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 3 - .../Microsoft/VisualBasic/Devices/Network.vb | 388 +++++++++--------- .../VisualBasic/Helpers/FileSystemUtils.vb | 3 - .../VisualBasic/Helpers/NativeMethods.vb | 30 +- .../VisualBasic/Helpers/NativeTypes.vb | 42 +- .../VisualBasic/Helpers/SafeNativeMethods.vb | 12 +- .../Helpers/UnsafeNativeMethods.vb | 39 +- .../VisualBasic/Helpers/VBInputBox.vb | 42 +- .../src/Microsoft/VisualBasic/Interaction.vb | 21 +- .../Logging/FileLogTraceListener.vb | 283 ++++++------- 27 files changed, 817 insertions(+), 855 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index b0abe371b2c..4e491b56a94 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -1,16 +1,15 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On +Imports System.Threading Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Abstract class that defines the application Startup/Shutdown model for VB - ''' Windows Applications such as console, WinForms, dll, service. + ''' Abstract class that defines the application Startup/Shutdown model for VB + ''' Windows Applications such as console, WinForms, dll, service. ''' Public Class ApplicationBase @@ -18,7 +17,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the value of the specified environment variable. + ''' Returns the value of the specified environment variable. ''' ''' A String containing the name of the environment variable. ''' A string containing the value of the environment variable. @@ -27,21 +26,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Function GetEnvironmentVariable(name As String) As String ' Framework returns Null if not found. - Dim VariableValue As String = Environment.GetEnvironmentVariable(name) + Dim variableValue As String = Environment.GetEnvironmentVariable(name) ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If VariableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName("name", SR.EnvVarNotFound_Name, name) + If variableValue Is Nothing Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) End If - Return VariableValue + Return variableValue End Function ''' - ''' Provides access to logging capability. + ''' Provides access to logging capability. ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' Public ReadOnly Property Log() As Logging.Log Get If _log Is Nothing Then @@ -52,66 +53,69 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the info about the application. If we are executing in a DLL, we still return the info - ''' about the application, not the DLL. + ''' Returns the info about the application. If we are executing in a DLL, we still return the info + ''' about the application, not the DLL. ''' Public ReadOnly Property Info() As AssemblyInfo Get If _info Is Nothing Then - Dim Assembly As Reflection.Assembly = If(Reflection.Assembly.GetEntryAssembly(), Reflection.Assembly.GetCallingAssembly()) - _info = New AssemblyInfo(Assembly) + Dim assembly As Reflection.Assembly = If(Reflection.Assembly.GetEntryAssembly(), Reflection.Assembly.GetCallingAssembly()) + _info = New AssemblyInfo(assembly) End If Return _info End Get End Property ''' - ''' Gets the information about the current culture used by the current thread. + ''' Gets the information about the current culture used by the current thread. ''' Public ReadOnly Property Culture() As Globalization.CultureInfo Get - Return Threading.Thread.CurrentThread.CurrentCulture + Return Thread.CurrentThread.CurrentCulture End Get End Property ''' - ''' Gets the information about the current culture used by the Resource - ''' Manager to look up culture-specific resource at run time. + ''' Gets the information about the current culture used by the Resource + ''' Manager to look up culture-specific resource at run time. ''' ''' - ''' The CultureInfo object that represents the culture used by the - ''' Resource Manager to look up culture-specific resources at run time. + ''' The CultureInfo object that represents the culture used by the + ''' Resource Manager to look up culture-specific resources at run time. ''' Public ReadOnly Property UICulture() As Globalization.CultureInfo Get - Return Threading.Thread.CurrentThread.CurrentUICulture + Return Thread.CurrentThread.CurrentUICulture End Get End Property ''' - ''' Changes the culture currently in used by the current thread. + ''' Changes the culture currently in used by the current thread. ''' ''' - ''' CultureInfo constructor will throw exceptions if cultureName is Nothing - ''' or an invalid CultureInfo ID. We are not catching those exceptions. + ''' CultureInfo constructor will throw exceptions if cultureName is Nothing + ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeCulture(cultureName As String) - Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) + Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) End Sub ''' - ''' Changes the culture currently used by the Resource Manager to look - ''' up culture-specific resource at runtime. + ''' Changes the culture currently used by the Resource Manager to look + ''' up culture-specific resource at runtime. ''' ''' - ''' CultureInfo constructor will throw exceptions if cultureName is Nothing - ''' or an invalid CultureInfo ID. We are not catching those exceptions. + ''' CultureInfo constructor will throw exceptions if cultureName is Nothing + ''' or an invalid CultureInfo ID. We are not catching those exceptions. ''' Public Sub ChangeUICulture(cultureName As String) - Threading.Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) + Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - Private _log As Logging.Log 'Lazy-initialized and cached log object. - Private _info As AssemblyInfo ' The executing application (the EntryAssembly) + 'Lazy-initialized and cached log object. + Private _log As Logging.Log + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo + End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index cb198ad556f..206bbaf0344 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports System.Drawing Imports System.Runtime.InteropServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index faa2a2ed6c2..7297c951cb8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -1,12 +1,10 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Collections.ObjectModel Imports System.Reflection -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -15,9 +13,28 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' specified using the assembly attributes (contained in AssemblyInfo.vb file in case of ''' a VB project in Visual Studio .NET). ''' - ''' This class is based on the FileVersionInfo class of the framework, but - ''' reduced to a number of relevant properties. + ''' + ''' This class is based on the class of the framework, but + ''' reduced to a number of relevant properties. + ''' Public Class AssemblyInfo + ' The assembly with the information. + Private ReadOnly _assembly As Assembly + + ' Since these properties will not change during runtime, they're cached. + ' String.Empty is not Nothing so use Nothing to mark an un-accessed property. + ' Cache the assembly's company name. + Private _companyName As String + ' Cache the assembly's copyright. + Private _copyright As String + ' Cache the assembly's description. + Private _description As String + ' Cache the assembly's product name. + Private _productName As String + ' Cache the assembly's title. + Private _title As String + ' Cache the assembly's trademark. + Private _trademark As String ''' ''' Creates an AssemblyInfo from an assembly @@ -25,7 +42,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then - Throw GetArgumentNullException("CurrentAssembly") + Throw ExUtils.GetArgumentNullException(NameOf(currentAssembly)) End If _assembly = currentAssembly End Sub @@ -41,7 +58,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim Attribute As AssemblyDescriptionAttribute = CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) If Attribute Is Nothing Then - _description = "" + _description = String.Empty Else _description = Attribute.Description End If @@ -61,7 +78,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim Attribute As AssemblyCompanyAttribute = CType(GetAttribute(GetType(AssemblyCompanyAttribute)), AssemblyCompanyAttribute) If Attribute Is Nothing Then - _companyName = "" + _companyName = String.Empty Else _companyName = Attribute.Company End If @@ -81,7 +98,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim Attribute As AssemblyTitleAttribute = CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) If Attribute Is Nothing Then - _title = "" + _title = String.Empty Else _title = Attribute.Title End If @@ -100,7 +117,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _copyright Is Nothing Then Dim Attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) If Attribute Is Nothing Then - _copyright = "" + _copyright = String.Empty Else _copyright = Attribute.Copyright End If @@ -119,7 +136,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _trademark Is Nothing Then Dim Attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) If Attribute Is Nothing Then - _trademark = "" + _trademark = String.Empty Else _trademark = Attribute.Trademark End If @@ -138,7 +155,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _productName Is Nothing Then Dim Attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) If Attribute Is Nothing Then - _productName = "" + _productName = String.Empty Else _productName = Attribute.Product End If @@ -233,16 +250,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End Function - ' Private fields. - Private ReadOnly _assembly As Assembly ' The assembly with the information. - - ' Since these properties will not change during runtime, they're cached. - ' "" is not Nothing so use Nothing to mark an un-accessed property. - Private _description As String ' Cache the assembly's description. - Private _title As String ' Cache the assembly's title. - Private _productName As String ' Cache the assembly's product name. - Private _companyName As String ' Cache the assembly's company name. - Private _trademark As String ' Cache the assembly's trademark. - Private _copyright As String ' Cache the assembly's copyright. End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index f6a9d71e011..056992d019d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -1,18 +1,15 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel -Imports Microsoft.VisualBasic.CompilerServices.Utils + +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when we launch a single-instance application and it can't connect with the - ''' original instance. + ''' Exception for when we launch a single-instance application and it can't connect with the + ''' original instance. ''' @@ -22,22 +19,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(GetResourceString(SR.AppModel_SingleInstanceCantConnect)) + MyBase.New(VbUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) End Sub - Public Sub New(ByVal message As String) + Public Sub New(message As String) MyBase.New(message) End Sub - Public Sub New(ByVal message As String, ByVal inner As Exception) + Public Sub New(message As String, inner As Exception) MyBase.New(message, inner) End Sub ' Deserialization constructor must be defined since we are serializable - Protected Sub New(ByVal info As Runtime.Serialization.SerializationInfo, ByVal context As Runtime.Serialization.StreamingContext) + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index d0ac12a047d..029cbd64537 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -1,25 +1,27 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.ComponentModel Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Abstract class that defines the application Startup/Shutdown model for VB - ''' Windows Applications such as console, winforms, dll, service. + ''' Abstract class that defines the application Startup/Shutdown model for VB + ''' Windows Applications such as console, winforms, dll, service. ''' Public Class ConsoleApplicationBase : Inherits ApplicationBase + ' Lazy-initialized and cached collection of command line arguments. + Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) + ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' - ''' We have to have a parameterless constructor because the platform specific Application - ''' object derives from this one and it doesn't define a constructor. The partial class generated by the - ''' designer defines the constructor in order to configure the application. + ''' + ''' We have to have a parameterless constructor because the platform specific Application + ''' object derives from this one and it doesn't define a constructor. The partial class generated by the + ''' designer defines the constructor in order to configure the application. + ''' Public Sub New() MyBase.New() End Sub @@ -27,17 +29,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Returns the command line arguments for the current application. ''' - ''' This function differs from System.Environment.GetCommandLineArgs in that the - ''' path of the executing file (the 0th entry) is omitted from the returned collection + ''' + ''' This function differs from in that the + ''' path of the executing file (the 0th entry) is omitted from the returned collection + ''' Public ReadOnly Property CommandLineArgs() As ObjectModel.ReadOnlyCollection(Of String) Get If _commandLineArgs Is Nothing Then - 'Get rid of Arg(0) which is the path of the executing program. Main(args() as string) doesn't report the name of the app and neither will we - Dim EnvArgs As String() = Environment.GetCommandLineArgs - If EnvArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments - Dim NewArgs(EnvArgs.GetLength(0) - 2) As String 'dimming z(0) gives a z() of 1 element. - Array.Copy(EnvArgs, 1, NewArgs, 0, EnvArgs.GetLength(0) - 1) 'copy everything but the 0th element (the path of the executing program) - _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(NewArgs) + 'Get rid of Arg(0) which is the path of the executing program. Main(args() as string) doesn't report the name of the app and neither will we + Dim envArgs As String() = Environment.GetCommandLineArgs + If envArgs.GetLength(0) >= 2 Then '1 element means no args, just the executing program. >= 2 means executing program + one or more command line arguments + Dim newArgs(envArgs.GetLength(0) - 2) As String 'dimming z(0) gives a z() of 1 element. + Array.Copy(envArgs, 1, newArgs, 0, envArgs.GetLength(0) - 1) 'copy everything but the 0th element (the path of the executing program) + _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(newArgs) Else _commandLineArgs = New ObjectModel.ReadOnlyCollection(Of String)(Array.Empty(Of String)()) 'provide the empty set End If @@ -47,8 +51,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this - ''' for instance because we snag the command line from Main(). + ''' Allows derived classes to set what the command line should look like. calls this + ''' for instance because we snag the command line from Main(). ''' Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) @@ -57,6 +61,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property - Private _commandLineArgs As ObjectModel.ReadOnlyCollection(Of String) ' Lazy-initialized and cached collection of command line arguments. End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 967c9c805c7..0102e2ed1b9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -1,17 +1,14 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel + Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when the WinForms VB application model isn't supplied with a startup form + ''' Exception for when the WinForms VB application model isn't supplied with a startup form ''' @@ -38,5 +35,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb index 1743d92d977..b48d061c571 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.IO Imports System.IO.Pipes Imports System.Runtime.InteropServices @@ -35,7 +32,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices cancellationToken.ThrowIfCancellationRequested() Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) Try - Dim args = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) + Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) If args IsNot Nothing Then callback(args) End If @@ -57,18 +54,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function Private Async Function ReadArgsAsync(pipeServer As NamedPipeServerStream, cancellationToken As CancellationToken) As Task(Of String()) - Const bufferLength = 1024 - Dim buffer = New Byte(bufferLength - 1) {} + Const bufferLength As Integer = 1024 + Dim buffer As Byte() = New Byte(bufferLength - 1) {} Using stream As New MemoryStream While True - Dim bytesRead = Await pipeServer.ReadAsync(buffer.AsMemory(0, bufferLength), cancellationToken).ConfigureAwait(False) + Dim bytesRead As Integer = Await pipeServer.ReadAsync(buffer.AsMemory(0, bufferLength), cancellationToken).ConfigureAwait(False) If bytesRead = 0 Then Exit While End If stream.Write(buffer, 0, bytesRead) End While stream.Seek(0, SeekOrigin.Begin) - Dim serializer = New DataContractSerializer(GetType(String())) + Dim serializer As New DataContractSerializer(GetType(String())) Try Return DirectCast(serializer.ReadObject(stream), String()) Catch ex As Exception @@ -80,7 +77,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private Async Function WriteArgsAsync(pipeClient As NamedPipeClientStream, args As String(), cancellationToken As CancellationToken) As Task Dim content As Byte() Using stream As New MemoryStream - Dim serializer = New DataContractSerializer(GetType(String())) + Dim serializer As New DataContractSerializer(GetType(String())) serializer.WriteObject(stream, args) content = stream.ToArray() End Using @@ -88,5 +85,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function End Module - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index 1520b75763e..f99c8d63713 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.Runtime.InteropServices @@ -12,14 +8,14 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the Startup event. + ''' Provides context for the Startup event. ''' Public Class StartupEventArgs Inherits CancelEventArgs ''' - ''' Creates a new instance of the StartupEventArgs. + ''' Creates a new instance of the StartupEventArgs. ''' Public Sub New(args As ReadOnlyCollection(Of String)) If args Is Nothing Then @@ -30,8 +26,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the command line sent to this application + ''' Returns the command line sent to this application ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb index fc1f473fb1d..12f1526872e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupNextInstanceEventArgs.vb @@ -1,24 +1,20 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the StartupNextInstance event. + ''' Provides context for the StartupNextInstance event. ''' Public Class StartupNextInstanceEventArgs Inherits EventArgs ''' - ''' Creates a new instance of the StartupNextInstanceEventArgs. + ''' Creates a new instance of the StartupNextInstanceEventArgs. ''' Public Sub New(args As ReadOnlyCollection(Of String), bringToForegroundFlag As Boolean) If args Is Nothing Then @@ -30,16 +26,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Indicates whether we will bring the application to the foreground when processing the - ''' StartupNextInstance event. + ''' Indicates whether we will bring the application to the foreground when processing the + ''' StartupNextInstance event. ''' Public Property BringToForeground() As Boolean ''' - ''' Returns the command line sent to this application + ''' Returns the command line sent to this application ''' - ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they - ''' always return the same values + ''' + ''' I'm using Me.CommandLine so that it is consistent with my.net and to assure they + ''' always return the same values + ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb index d6ab2e428d5..627c2568d09 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/UnhandledExceptionEventArgs.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.ComponentModel Imports System.Runtime.InteropServices Imports System.Threading @@ -12,7 +8,7 @@ Imports System.Threading Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides the exception encountered along with a flag on whether to abort the program + ''' Provides the exception encountered along with a flag on whether to abort the program ''' Public Class UnhandledExceptionEventArgs @@ -24,8 +20,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Indicates whether the application should exit upon exiting the exception handler + ''' Indicates whether the application should exit upon exiting the exception handler ''' Public Property ExitApplication() As Boolean + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index 2b4f3e7614b..134272fc87d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -1,27 +1,25 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.ComponentModel Imports System.Security.Principal +Imports System.Threading Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Class abstracting the computer user + ''' Class abstracting the computer user ''' Public Class User ''' - ''' Creates an instance of User + ''' Creates an instance of User ''' Public Sub New() End Sub ''' - ''' The name of the current user + ''' The name of the current user ''' Public ReadOnly Property Name() As String Get @@ -30,7 +28,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' The current IPrincipal which represents the current user + ''' The current which represents the current user. ''' ''' An IPrincipal representing the current user @@ -44,7 +42,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Indicates whether or not the current user has been authenticated. + ''' Indicates whether or not the current user has been authenticated. ''' Public ReadOnly Property IsAuthenticated() As Boolean Get @@ -53,7 +51,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Indicates whether or not the current user is a member of the passed in role + ''' Indicates whether or not the current user is a member of the passed in role ''' ''' The name of the role ''' True if the user is a member of the role otherwise False @@ -62,23 +60,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' The principal representing the current user. + ''' The principal representing the current user. ''' ''' An IPrincipal representing the current user - ''' - ''' This should be overridden by derived classes that don't get the current - ''' user from the current thread + ''' + ''' This should be overridden by derived classes that don't get the current + ''' user from the current thread ''' Protected Overridable Property InternalPrincipal() As IPrincipal Get - Return Threading.Thread.CurrentPrincipal + Return Thread.CurrentPrincipal End Get Set(value As IPrincipal) - Threading.Thread.CurrentPrincipal = value + Thread.CurrentPrincipal = value End Set End Property End Class 'User - End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index f03e1f494e7..8de33f6b462 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -1,20 +1,18 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On -Option Infer On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.IO.Pipes Imports System.Reflection +Imports System.Runtime.CompilerServices Imports System.Runtime.InteropServices Imports System.Security Imports System.Threading Imports System.Windows.Forms -Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.Utils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices @@ -31,58 +29,58 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Enum ''' - ''' Signature for the ApplyApplicationDefaults event handler. + ''' Signature for the ApplyApplicationDefaults event handler. ''' Public Delegate Sub ApplyApplicationDefaultsEventHandler(sender As Object, e As ApplyApplicationDefaultsEventArgs) ''' - ''' Signature for the Startup event handler. + ''' Signature for the Startup event handler. ''' Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) ''' - ''' Signature for the StartupNextInstance event handler. + ''' Signature for the StartupNextInstance event handler. ''' Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) ''' - ''' Signature for the Shutdown event handler. + ''' Signature for the Shutdown event handler. ''' Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) ''' - ''' Signature for the UnhandledException event handler. + ''' Signature for the UnhandledException event handler. ''' Public Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As UnhandledExceptionEventArgs) ''' - ''' Provides the infrastructure for the VB Windows Forms application model. + ''' Provides the infrastructure for the VB Windows Forms application model. ''' ''' Don't put access on this definition. Partial Public Class WindowsFormsApplicationBase : Inherits ConsoleApplicationBase ''' - ''' Occurs when the application is ready to accept default values for various application areas. + ''' Occurs when the application is ready to accept default values for various application areas. ''' Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler ''' - ''' Occurs when the application starts. + ''' Occurs when the application starts. ''' Public Event Startup As StartupEventHandler ''' - ''' Occurs when attempting to start a single-instance application and the application is already active. + ''' Occurs when attempting to start a single-instance application and the application is already active. ''' Public Event StartupNextInstance As StartupNextInstanceEventHandler ''' - ''' Occurs when the application shuts down. + ''' Occurs when the application shuts down. ''' Public Event Shutdown As ShutdownEventHandler @@ -91,6 +89,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' How long a subsequent instance will wait for the original instance to get on its feet. Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. + Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. Private ReadOnly _splashLock As New Object @@ -107,11 +106,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Whether we have made it through the processing of OnInitialize. Private _finishedOnInitialize As Boolean + Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) Private _networkObject As Devices.Network -#Disable Warning IDE0032 ' Use auto property, Justification:= - ' Whether this app runs using Word like instancing behavior. Private _isSingleInstance As Boolean @@ -128,10 +126,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' For splash screens with a minimum display time, this let's us know when that time ' has expired and it is OK to close the splash screen. Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) + Private _formLoadWaiter As AutoResetEvent Private _splashScreen As Form - ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext @@ -142,10 +141,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware -#Enable Warning IDE0032 ' Use auto property - ''' - ''' Occurs when the network availability changes. + ''' Occurs when the network availability changes. ''' Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only @@ -165,7 +162,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices _turnOnNetworkListener = True ' But the user may be doing an AddHandler of their own in which case we need - ' to make sure to honor the request. If we aren't past OnInitialize() yet + ' to make sure to honor the request. If we aren't past OnInitialize() yet ' we shouldn't do it but the flag above catches that case. If _networkObject Is Nothing AndAlso _finishedOnInitialize Then _networkObject = New Devices.Network @@ -215,12 +212,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Event ''' - ''' Occurs when the application encounters an unhandled exception. + ''' Occurs when the application encounters an . ''' Public Custom Event UnhandledException As UnhandledExceptionEventHandler ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' only if the user writes a handler for this event. We only want to hook the ThreadException event ' if the user is handling this event because the act of listening to Application.ThreadException ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that ' the user wrote their own handler to deal with the error instead. @@ -252,33 +249,34 @@ Namespace Microsoft.VisualBasic.ApplicationServices RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) If _unhandledExceptionHandlers IsNot Nothing Then - ' In the case that we throw from the unhandled exception handler, we don't want to - ' run the unhandled exception handler again. + ' In the case that we throw from the handler, we don't want to + ' run the handler again. _processingUnhandledExceptionEvent = True For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers handler?.Invoke(sender, e) Next - ' Now that we are out of the unhandled exception handler, treat exceptions normally again. + ' Now that we are out of the handler, treat exceptions normally again. _processingUnhandledExceptionEvent = False End If End RaiseEvent End Event ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' ''' - ''' We have to have a parameterless ctor because the platform specific Application object - ''' derives from this one and it doesn't define a ctor because the partial class generated by the - ''' designer does that to configure the application. + ''' We have to have a parameterless ctor because the platform specific Application object + ''' derives from this one and it doesn't define a ctor because the partial class generated by the + ''' designer does that to configure the application. + ''' Public Sub New() Me.New(AuthenticationMode.Windows) End Sub ''' - ''' Constructs the application Shutdown/Startup model object + ''' Constructs the application Shutdown/Startup model object ''' Public Sub New(authenticationMode As AuthenticationMode) @@ -286,10 +284,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices ValidateAuthenticationModeEnumValue(authenticationMode, NameOf(authenticationMode)) - ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, + ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, ' before the Network object gets created because the network object will be doing a - ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we have - ' to have our principal on the thread before that happens. + ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must + ' have our principal on the thread before that happens. If authenticationMode = AuthenticationMode.Windows Then Try ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) @@ -305,7 +303,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' We need to set the WindowsFormsSynchronizationContext because the network object is going to ' get created after this ctor runs (network gets created during event hookup) and we need the - ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise + ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise ' get created until OnCreateMainForm() when the startup form is created and by then it is too late. ' When the startup form gets created, WinForms is going to push our context into the previous context ' and then restore it when Application.Run() exits. @@ -313,9 +311,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model + ''' Entry point to kick off the VB Startup/Shutdown Application model. ''' - ''' The command line from Main() + ''' The command line from Main(). Public Sub Run(commandLine As String()) @@ -330,15 +328,15 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Note: Must pass the calling assembly from here so we can get the running app. ' Otherwise, can break single instance. - Dim ApplicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) + Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) Dim pipeServer As NamedPipeServerStream = Nothing - If TryCreatePipeServer(ApplicationInstanceID, pipeServer) Then + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then ' --- This is the first instance of a single-instance application to run. ' This is the instance that subsequent instances will attach to. Using pipeServer - Dim tokenSource = New CancellationTokenSource() + Dim tokenSource As New CancellationTokenSource() #Disable Warning BC42358 ' Call is not awaited. WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) #Enable Warning BC42358 @@ -348,10 +346,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Else ' --- We are launching a subsequent instance. - Dim tokenSource = New CancellationTokenSource() + Dim tokenSource As New CancellationTokenSource() tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) Try - Dim awaitable = SendSecondInstanceArgsAsync(ApplicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) awaitable.GetAwaiter().GetResult() Catch ex As Exception Throw New CantStartSingleInstanceException() @@ -361,9 +359,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. + ''' Returns the collection of forms that are open. We no longer have thread + ''' affinity meaning that this is the WinForms collection that contains Forms that may + ''' have been opened on another thread then the one we are calling in on right now. ''' Public ReadOnly Property OpenForms() As FormCollection Get @@ -372,7 +370,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides access to the main form for this application + ''' Provides access to the main form for this application ''' Protected Property MainForm() As Form Get @@ -380,17 +378,17 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get Set(value As Form) If value Is Nothing Then - Throw ExceptionUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then - Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _appContext.MainForm = value End Set End Property ''' - ''' Provides access to the splash screen for this application + ''' Provides access to the splash screen for this application ''' Public Property SplashScreen() As Form Get @@ -400,7 +398,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Allow for the case where they set splash screen = nothing and mainForm is currently nothing. If value IsNot Nothing AndAlso value Is _appContext.MainForm Then - Throw New ArgumentException(GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _splashScreen = value @@ -408,17 +406,17 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' The splash screen timeout specifies whether there is a minimum time that the splash - ''' screen should be displayed for. When not set then the splash screen is hidden - ''' as soon as the main form becomes active. + ''' The splash screen timeout specifies whether there is a minimum time that the splash + ''' screen should be displayed for. When not set then the splash screen is hidden + ''' as soon as the main form becomes active. ''' ''' The minimum amount of time, in milliseconds, to display the splash screen. ''' - ''' This property, although public, used to be set in an `Overrides Function OnInitialize` _before_ - ''' calling `MyBase.OnInitialize`. We want to phase this out, and with the introduction of the - ''' ApplyApplicationDefaults events have it handled in that event, rather than as awkwardly - ''' as it is currently suggested to be used in the docs. - ''' First step for that is to make it hidden in IntelliSense. + ''' This property, although public, used to be set in an `Overrides Function OnInitialize` _before_ + ''' calling `MyBase.OnInitialize`. We want to phase this out, and with the introduction of the + ''' ApplyApplicationDefaults events have it handled in that event, rather than as awkwardly + ''' as it is currently suggested to be used in the docs. + ''' First step for that is to make it hidden in IntelliSense. ''' Public Property MinimumSplashScreenDisplayTime() As Integer @@ -431,12 +429,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Use GDI for the text rendering engine by default. - ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to - ''' determine how to set the text rendering flag on the WinForms application object. + ''' Use GDI for the text rendering engine by default. + ''' The user can shadow this function to return True if they want their app + ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' determine how to set the text rendering flag on the WinForms application object. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer + ''' True - Use GDI+ renderer. False - use GDI renderer. Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean Get @@ -445,7 +443,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides the WinForms application context that we are running on + ''' Provides the WinForms application context that we are running on ''' Public ReadOnly Property ApplicationContext() As ApplicationContext @@ -455,7 +453,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Informs My.Settings whether to save the settings on exit or not + ''' Informs My.Settings whether to save the settings on exit or not ''' Public Property SaveMySettingsOnExit() As Boolean Get @@ -474,18 +472,20 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows - ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its - ''' variants was passed in. + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its + ''' variants was passed in. ''' ''' - ''' Returning True indicates that we should continue on with the application Startup sequence - ''' This extensibility point is exposed for people who want to override the Startup sequence at the earliest possible point - ''' to + ''' Returning True indicates that we should continue on with the application Startup sequence. + ''' + ''' This extensibility point is exposed for people who want to override + ''' the Startup sequence at the earliest possible point to + ''' Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean - ' Rationale for how we process the default values and how we let the user modify + ' Rationale for how we process the default values and how we let the user modify ' them on demand via the ApplyApplicationDefaults event. ' =========================================================================================== ' a) Users used to be able to set MinimumSplashScreenDisplayTime _only_ by overriding OnInitialize @@ -500,7 +500,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Once all this is done, we give the User another chance to change the value by code through ' the ApplyDefaults event. ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! - Dim applicationDefaultsEventArgs = New ApplyApplicationDefaultsEventArgs( + Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( MinimumSplashScreenDisplayTime, HighDpiMode) With { @@ -522,7 +522,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices _highDpiMode = applicationDefaultsEventArgs.HighDpiMode ' Then, it's applying what we got back as HighDpiMode. - Dim dpiSetResult = Application.SetHighDpiMode(_highDpiMode) + Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) If dpiSetResult Then _highDpiMode = Application.HighDpiMode End If @@ -548,7 +548,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Extensibility point which raises the Startup event + ''' Extensibility point which raises the Startup event ''' ''' @@ -559,11 +559,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' It is important not to create the network object until the ExecutionContext has everything on it. ' By now the principal will be on the thread so we can create the network object. ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() ' which makes a copy of the executionContext. That execution context shows up on your thread during ' the callback so I delay creating the network object (and consequently the capturing of the execution context) ' until the principal has been set on the thread. This avoids the problem where My.User isn't set - ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future + ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future ' callback that involved the asyncOperationsManager so this is where we need to create objects that ' have a asyncOperationsContext in them. If _turnOnNetworkListener And _networkObject Is Nothing Then @@ -579,7 +579,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Extensibility point which raises the StartupNextInstance + ''' Extensibility point which raises the StartupNextInstance ''' ''' @@ -599,8 +599,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' At this point, the command line args should have been processed and the application will create the - ''' main form and enter the message loop. + ''' At this point, the command line args should have been processed and the application will create the + ''' main form and enter the message loop. ''' @@ -616,8 +616,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to - ' block the main form from painting. To do that I let the form get past the Load() event and hold it until - ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of + ' block the main form from painting. To do that I let the form get past the Load() event and hold it until + ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. AddHandler MainForm.Load, AddressOf MainFormLoadingDone End If @@ -631,7 +631,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Finally ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) - ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it + ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it ' can't fire any events in response to changing network availability conditions through a dead context. If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() @@ -642,23 +642,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' A designer will override this method and provide a splash screen if this application has one. + ''' A designer will override this method and provide a splash screen if this application has one. ''' - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + ''' For instance, a designer would override this method and emit: Me.Splash = new Splash + ''' where Splash was designated in the application designer as being the splash screen for this app + ''' Protected Overridable Sub OnCreateSplashScreen() End Sub ''' - ''' Provides a hook that designers will override to set the main form. + ''' Provides a hook that designers will override to set the main form. ''' Protected Overridable Sub OnCreateMainForm() End Sub ''' - ''' The last in a series of extensibility points for the Shutdown process + ''' The last in a series of extensibility points for the Shutdown process ''' Protected Overridable Sub OnShutdown() @@ -666,11 +668,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Raises the UnHandled exception event and exits the application if the event handler indicated - ''' that execution shouldn't continue + ''' Raises the event and exits the application if the event handler indicated + ''' that execution shouldn't continue. ''' ''' - ''' True indicates the exception event was raised / False it was not + ''' True indicates the exception event was raised / False it was not. Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean @@ -691,8 +693,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, - ''' displays it. + ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, + ''' displays it. ''' Protected Sub ShowSplashScreen() @@ -730,16 +732,16 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Hide the splash screen. The splash screen was created on another thread - ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. - ''' This function gets called from the main thread by the app fx. + ''' Hide the splash screen. The splash screen was created on another thread + ''' thread (main thread) than the one it was run on (secondary thread for the + ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' This function gets called from the main thread by the app fx. ''' Protected Sub HideSplashScreen() - 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. + 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. SyncLock _splashLock ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling @@ -770,7 +772,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. + ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. ''' Protected Property EnableVisualStyles() As Boolean Get @@ -782,7 +784,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets or sets the HighDpiMode for the Application. + ''' Gets or sets the HighDpiMode for the Application. ''' Protected Property HighDpiMode() As HighDpiMode @@ -805,7 +807,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Validates that the value being passed as an AuthenticationMode enum is a legal value + ''' Validates that the value being passed as an AuthenticationMode enum is a legal value ''' ''' Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) @@ -815,7 +817,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Validates that the value being passed as an ShutdownMode enum is a legal value + ''' Validates that the value being passed as an ShutdownMode enum is a legal value ''' ''' Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) @@ -825,9 +827,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' it doesn't freeze up while the main form is getting it together. ''' Private Sub DisplaySplash() Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") @@ -843,10 +845,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. - ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. + ''' If a splash screen has a minimum time out, then once that is up we check to see whether + ''' we should close the splash screen. If the main form has activated then we close it. + ''' Note that we are getting called on a secondary thread here which isn't necessarily + ''' associated with any form. Don't touch forms from this function. ''' Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) @@ -861,12 +863,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The Load() event happens before the Shown and Paint events. When we get called here - ''' we know that the form load event is done and that the form is about to paint - ''' itself for the first time. - ''' We can now hide the splash screen. - ''' Note that this function gets called from the main thread - the same thread - ''' that creates the startup form. + ''' The Load() event happens before the Shown and Paint events. When we get called here + ''' we know that the form load event is done and that the form is about to paint + ''' itself for the first time. + ''' We can now hide the splash screen. + ''' Note that this function gets called from the main thread - the same thread + ''' that creates the startup form. ''' ''' ''' @@ -876,7 +878,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices RemoveHandler MainForm.Load, AddressOf MainFormLoadingDone ' Now, we don't want to eat up a complete Processor Core just for waiting on the main form, - ' since this is eating up a LOT of enegery and workload, espacially on Notebooks and tablets. + ' since this is eating up a LOT of energy and workload, especially on Notebooks and tablets. If _splashScreenCompletionSource IsNot Nothing Then _formLoadWaiter = New AutoResetEvent(False) @@ -895,20 +897,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event. ''' ''' - ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' unhandled exception event so we do the translation here before raising our event. + ''' + ''' Our UnHandledException event has a different signature then the Windows.Forms.Application + ''' event so we do the translation here before raising our event. ''' Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) End Sub - Private Sub OnStartupNextInstanceMarshallingAdaptor(ByVal args As String()) + Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) - Dim invoked = False + Dim invoked As Boolean = False Try Dim handleNextInstance As New Action( @@ -939,21 +942,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event + ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the + ''' NetworkAvailabilityChanged event. ''' - ''' Contains the Network instance that raised the event - ''' Contains whether the network is available or not + ''' Contains the Network instance that raised the event. + ''' Contains whether the network is available or not. Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) RaiseEvent NetworkAvailabilityChanged(sender, e) End Sub ''' - ''' Runs the user's program through the VB Startup/Shutdown application model + ''' Runs the user's program through the VB Startup/Shutdown application model ''' Private Sub DoApplicationModel() - Dim EventArgs As New StartupEventArgs(CommandLineArgs) + Dim eventArgs As New StartupEventArgs(CommandLineArgs) ' Only do the try/catch if we aren't running under the debugger. ' If we do try/catch under the debugger the debugger never gets @@ -965,7 +968,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' need to be mirrored in the ELSE debugger attached clause below. Try If OnInitialize(CommandLineArgs) Then - If OnStartup(EventArgs) Then + If OnStartup(eventArgs) Then OnRun() OnShutdown() End If @@ -996,7 +999,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' We also don't hook up the Application.ThreadException event because WinForms ignores it ' when we are running under the debugger. If OnInitialize(CommandLineArgs) Then - If OnStartup(EventArgs) Then + If OnStartup(eventArgs) Then OnRun() OnShutdown() End If @@ -1005,20 +1008,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. ''' - ''' A string unique to the application that should be the same for versions of - ''' the application that have the same Major and Minor Version Number + ''' + ''' + ''' A string unique to the application that should be the same for versions of + ''' the application that have the same Major and Minor Version Number. ''' - ''' If GUID Attribute does not exist fall back to unique ModuleVersionId - Private Shared Function GetApplicationInstanceID(ByVal Entry As Assembly) As String + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String - Dim guidAttrib As GuidAttribute = Entry.GetCustomAttribute(Of GuidAttribute)() + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() If guidAttrib IsNot Nothing Then - Dim version As Version = Entry.GetName.Version + Dim version As Version = entry.GetName.Version If version IsNot Nothing Then Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" @@ -1027,7 +1032,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If - Return Entry.ManifestModule.ModuleVersionId.ToString() + Return entry.ManifestModule.ModuleVersionId.ToString() End Function + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 9e4ca8377ae..29c91d3633c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,7 +1,9 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Threading +Option Strict On + +Imports Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.CompilerServices @@ -12,31 +14,27 @@ Namespace Microsoft.VisualBasic.CompilerServices End Enum ' Implements error utilities for Basic - Friend Module ExceptionUtils - - Friend Function GetResourceString(resourceKey As String, - ParamArray args() As String) As String - Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) - End Function + Friend NotInheritable Class ExceptionUtils - Friend Function GetResourceString(resourceId As vbErrors) As String - Dim id As String = $"ID{CStr(resourceId)}" - Return SR.GetResourceString(id, id) - End Function + ' Prevent creation. + Private Sub New() + End Sub - Friend Function VbMakeException(resourceId As Integer) As Exception - Dim description As String = "" + Friend Shared Function VbMakeException(hr As Integer) As Exception + Dim sMsg As String - If resourceId > 0 AndAlso resourceId <= &HFFFFI Then - description = GetResourceString(DirectCast(resourceId, vbErrors)) + If hr > 0 AndAlso hr <= &HFFFFI Then + sMsg = GetResourceString(CType(hr, vbErrors)) + Else + sMsg = String.Empty End If - VbMakeException = VbMakeExceptionEx(resourceId, description) + VbMakeException = VbMakeExceptionEx(hr, sMsg) End Function - Friend Function VbMakeExceptionEx(resourceId As Integer, description As String) As Exception + Friend Shared Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception Dim vBDefinedError As Boolean - VbMakeExceptionEx = BuildException(resourceId, description, vBDefinedError) + VbMakeExceptionEx = BuildException(number, sMsg, vBDefinedError) If vBDefinedError Then ' .NET Framework implementation calls: @@ -45,134 +43,130 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function - Friend Function BuildException(resourceId As Integer, - description As String, - ByRef vbDefinedError As Boolean) As Exception + Friend Shared Function BuildException(Number As Integer, Description As String, ByRef VBDefinedError As Boolean) As Exception - vbDefinedError = True + VBDefinedError = True - Select Case resourceId + Select Case Number Case vbErrors.None Case vbErrors.FileNotFound - Return New IO.FileNotFoundException(description) + Return New IO.FileNotFoundException(Description) Case vbErrors.PermissionDenied - Return New IO.IOException(description) + Return New IO.IOException(Description) Case Else 'Fall below to default - vbDefinedError = False - Return New Exception(description) + VBDefinedError = False + Return New Exception(Description) End Select - vbDefinedError = False - Return New Exception(description) + VBDefinedError = False + Return New Exception(Description) End Function ''' - ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of ArgumentException. ''' This is the preferred way to construct an argument exception. - Friend Function GetArgumentExceptionWithArgName(argumentName As String, - resourceID As String, - ParamArray placeHolders() As String) As ArgumentException + Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, + ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException - Return New ArgumentException(GetResourceString(resourceID, placeHolders), argumentName) + Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) End Function ''' - ''' Returns a new instance of with message: "Argument cannot be Nothing." + ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." ''' - ''' The name of the argument (parameter). Not localized. - ''' A new instance of . - Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException + ''' The name of the argument (parameter). Not localized. + ''' A new instance of ArgumentNullException. + Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException - Return New ArgumentNullException(argumentName, GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' - ''' Returns a new instance of with the message from resource file. + ''' Returns a new instance of ArgumentNullException with the message from resource file. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . - Friend Function GetArgumentNullException(argumentName As String, - resourceID As String, - ParamArray placeHolders() As String) As ArgumentNullException - - Return New ArgumentNullException(argumentName, GetResourceString(resourceID, placeHolders)) + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of ArgumentNullException. + Friend Shared Function GetArgumentNullException(ArgumentName As String, + ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException + + Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) End Function ''' - ''' Returns a new instance of with the message from resource file. + ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . - Friend Function GetDirectoryNotFoundException(resourceID As String, - ParamArray placeHolders() As String) As IO.DirectoryNotFoundException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of IO.DirectoryNotFoundException. + Friend Shared Function GetDirectoryNotFoundException( + ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(GetResourceString(resourceID, placeHolders)) + Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' - ''' Returns a new instance of with the message from resource file. + ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. ''' - ''' The file name (path) of the not found file. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . - Friend Function GetFileNotFoundException(fileName As String, - resourceID As String, - ParamArray placeHolders() As String) As IO.FileNotFoundException - - Return New IO.FileNotFoundException(GetResourceString(resourceID, placeHolders), fileName) + ''' The file name (path) of the not found file. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of IO.FileNotFoundException. + Friend Shared Function GetFileNotFoundException(FileName As String, + ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException + + Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) End Function ''' - ''' Returns a new instance of with the message from resource file. + ''' Returns a new instance of InvalidOperationException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . - Friend Function GetInvalidOperationException(resourceID As String, - ParamArray placeHolders() As String) As InvalidOperationException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of InvalidOperationException. + Friend Shared Function GetInvalidOperationException( + ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException - Return New InvalidOperationException(GetResourceString(resourceID, placeHolders)) + Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' - ''' Returns a new instance of with the message from resource file. + ''' Returns a new instance of IO.IOException with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . - Friend Function GetIOException(resourceID As String, - ParamArray placeHolders() As String) As IO.IOException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of IO.IOException. + Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException - Return New IO.IOException(GetResourceString(resourceID, placeHolders)) + Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) End Function ''' - ''' Returns a new instance of with the message from resource file and the last Win32 error. + ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of . + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of Win32Exception. ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Function GetWin32Exception(resourceID As String, - ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) + Friend Shared Function GetWin32Exception( + ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception + + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) End Function - End Module + End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index c193cc41cd9..0e7defb51cc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -1,10 +1,9 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On Imports System.IO -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic @@ -44,7 +43,7 @@ Namespace Microsoft.VisualBasic ''' ''' The name of the file ''' - ''' An enum value representing the mode, Background (async), + ''' An enum value representing the mode, Background (async), ''' WaitToComplete (sync) or BackgroundLoop ''' Public Sub Play(location As String, playMode As AudioPlayMode) @@ -61,7 +60,7 @@ Namespace Microsoft.VisualBasic ''' The mode in which the array should be played Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then - Throw GetArgumentNullException("data") + Throw ExUtils.GetArgumentNullException(NameOf(data)) End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) @@ -78,7 +77,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then - Throw GetArgumentNullException("stream") + Throw ExUtils.GetArgumentNullException(NameOf(stream)) End If Play(New Media.SoundPlayer(stream), playMode) @@ -91,7 +90,7 @@ Namespace Microsoft.VisualBasic ''' Plays the sound asynchronously Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then - Throw GetArgumentNullException("systemSound") + Throw ExUtils.GetArgumentNullException(NameOf(systemSound)) End If systemSound.Play() @@ -141,7 +140,7 @@ Namespace Microsoft.VisualBasic ''' A full name and path of the file Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then - Throw GetArgumentNullException("location") + Throw ExUtils.GetArgumentNullException(NameOf(location)) End If Return location diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index c7ea5c6fb79..858837821f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -1,10 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - - Namespace Microsoft.VisualBasic.Devices ''' @@ -13,11 +9,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Clock +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= + ''' ''' Gets a Date that is the current local date and time on this computer. ''' ''' A Date whose value is the current date and time. -#Disable Warning IDE0049 ' Simplify Names, Justification:= Public ReadOnly Property LocalTime() As DateTime Get Return DateTime.Now @@ -34,7 +31,8 @@ Namespace Microsoft.VisualBasic.Devices Return DateTime.UtcNow End Get End Property -#Enable Warning IDE0049 ' Simplify Names + +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' This property wraps the Environment.TickCount property to get the diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index f4098d32bad..fdad391c89b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -1,11 +1,8 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - -Imports Microsoft.VisualBasic.MyServices Imports System.Windows.Forms +Imports Microsoft.VisualBasic.MyServices Namespace Microsoft.VisualBasic.Devices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index e289774039a..c4e026fa938 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -20,7 +20,7 @@ Namespace Microsoft.VisualBasic.Devices Public Sub New() End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:=" +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:=" ''' ''' Gets the total size of physical memory on the machine. ''' @@ -48,8 +48,10 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the total size of user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, - ''' in bytes. + ''' + ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, + ''' in bytes. + ''' ''' If we are unable to obtain the memory status. Public ReadOnly Property TotalVirtualMemory() As UInt64 @@ -61,8 +63,10 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the total size of free user potion of virtual address space for calling process. ''' - ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, - ''' in bytes. + ''' + ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, + ''' in bytes. + ''' ''' If we are unable to obtain the memory status. Public ReadOnly Property AvailableVirtualMemory() As UInt64 @@ -70,7 +74,7 @@ Namespace Microsoft.VisualBasic.Devices Return MemoryStatus.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' Gets the current UICulture installed on the machine. @@ -123,7 +127,7 @@ Namespace Microsoft.VisualBasic.Devices _instanceBeingWatched = RealClass End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get @@ -151,7 +155,7 @@ Namespace Microsoft.VisualBasic.Devices Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -200,7 +204,7 @@ Namespace Microsoft.VisualBasic.Devices Friend Sub New() End Sub -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= Friend ReadOnly Property TotalPhysicalMemory() As UInt64 Get Refresh() @@ -228,7 +232,7 @@ Namespace Microsoft.VisualBasic.Devices Return _memoryStatusEx.ullAvailVirtual End Get End Property -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references Private Sub Refresh() _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX @@ -241,5 +245,4 @@ Namespace Microsoft.VisualBasic.Devices Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX End Class End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index bb5d1689ba5..14ff9561c05 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index 774c095c883..565a1be63f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -6,10 +6,10 @@ Imports System.Net Imports System.Security Imports System.Threading Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports Microsoft.VisualBasic.CompilerServices.Utils Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal - -Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports NetInfoAlias = System.Net.NetworkInformation Namespace Microsoft.VisualBasic.Devices @@ -37,8 +37,8 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Event fired when connected to the network ''' - ''' Has no meaning for this event. - ''' Has no meaning for this event. + ''' Has no meaning for this event + ''' Has no meaning for this event Public Custom Event NetworkAvailabilityChanged As NetworkAvailableEventHandler 'This is a custom event because we want to hook up the NetworkAvailabilityChanged event only if the user writes a handler for it. 'The reason being that it is very expensive to handle and kills our application startup perf. @@ -52,7 +52,7 @@ Namespace Microsoft.VisualBasic.Devices Catch ex As PlatformNotSupportedException Return End Try - SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. + SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) _networkAvailabilityEventHandlers.Add(handler) @@ -100,7 +100,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Indicates whether or not the local machine is connected to an IP network. ''' - ''' True if connected, otherwise False. + ''' True if connected, otherwise False Public ReadOnly Property IsAvailable() As Boolean Get @@ -110,24 +110,24 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Sends and receives a packet to and from the passed in address. + ''' Sends and receives a packet to and from the passed in address. ''' ''' - ''' True if ping was successful, otherwise False. + ''' True if ping was successful, otherwise False Public Function Ping(hostNameOrAddress As String) As Boolean Return Ping(hostNameOrAddress, DEFAULT_PING_TIMEOUT) End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host. - ''' True if ping was successful, otherwise False. + ''' A Uri representing the host + ''' True if ping was successful, otherwise False Public Function Ping(address As Uri) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Return Ping(address.Host, DEFAULT_PING_TIMEOUT) End Function @@ -135,89 +135,89 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Sends and receives a packet to and from the passed in address. ''' - ''' The name of the host as a Url or IP Address. - ''' Time to wait before aborting ping. - ''' True if ping was successful, otherwise False. + ''' The name of the host as a Url or IP Address + ''' Time to wait before aborting ping + ''' True if ping was successful, otherwise False Public Function Ping(hostNameOrAddress As String, timeout As Integer) As Boolean ' Make sure a network is available If Not IsAvailable Then - Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) + Throw GetInvalidOperationException(SR.Network_NetworkNotAvailable) End If - Dim pingMaker As New NetInfoAlias.Ping - Dim reply As NetInfoAlias.PingReply = pingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - If reply.Status = NetInfoAlias.IPStatus.Success Then + Dim PingMaker As New NetInfoAlias.Ping + Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) + If Reply.Status = NetInfoAlias.IPStatus.Success Then Return True End If Return False End Function ''' - ''' Sends and receives a packet to and from the passed in Uri. + ''' Sends and receives a packet to and from the passed in Uri. ''' - ''' A Uri representing the host. - ''' Time to wait before aborting ping. - ''' True if ping was successful, otherwise False. + ''' A Uri representing the host + ''' Time to wait before aborting ping + ''' True if ping was successful, otherwise False Public Function Ping(address As Uri, timeout As Integer) As Boolean ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). ' However, it is good practice to verify address before calling address.Host. If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Return Ping(address.Host, timeout) End Function ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved. + ''' Name and path of file where download is saved Public Sub DownloadFile(address As String, destinationFileName As String) DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. + ''' Uri to the remote file + ''' Name and path of file where download is saved Public Sub DownloadFile(address As Uri, destinationFileName As String) DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, password As String) DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String) DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -230,16 +230,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, @@ -252,7 +252,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -264,15 +264,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -285,16 +285,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. - ''' The name of the user performing the download. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The name of the user performing the download + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, @@ -311,15 +311,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. - ''' The credentials of the user performing the download. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. - ''' Calls to all the other overloads will come through here. + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -332,16 +332,16 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Downloads a file from the network to the specified path. + ''' Downloads a file from the network to the specified path ''' - ''' Uri to the remote file. - ''' Name and path of file where download is saved. - ''' The credentials of the user performing the download. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). - ''' Calls to all the other overloads will come through here. + ''' Uri to the remote file + ''' Name and path of file where download is saved + ''' The credentials of the user performing the download + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' Indicates what to do if user cancels dialog (either throw or do nothing) + ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, destinationFileName As String, networkCredentials As ICredentials, @@ -350,12 +350,11 @@ Namespace Microsoft.VisualBasic.Devices overwrite As Boolean, onUserCancel As UICancelOption) If connectionTimeout <= 0 Then - ' DO NOT USE NameOf(connectionTimeout) - Throw ExUtils.GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Using client As New WebClientExtended @@ -365,17 +364,17 @@ Namespace Microsoft.VisualBasic.Devices client.UseNonPassiveFtp = showUI 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(fullFilename) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If 'Throw if the file exists and the user doesn't want to overwrite If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(ExUtils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) End If ' Set credentials if we have any @@ -386,8 +385,8 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then dialog = New ProgressDialog With { - .Text = ExUtils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = ExUtils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) + .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), + .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) } End If @@ -396,7 +395,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect If String.IsNullOrEmpty(targetDirectory) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If If Not IO.Directory.Exists(targetDirectory) Then @@ -421,54 +420,54 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' The full name and path of the host destination. + ''' The file to be uploaded + ''' The full name and path of the host destination Public Sub UploadFile(sourceFileName As String, address As String) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. + ''' The file to be uploaded + ''' Uri representing the destination Public Sub UploadFile(sourceFileName As String, address As Uri) UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' The full name and path of the host destination. - ''' The name of the user performing the upload. - ''' The user's password. + ''' The file to be uploaded + ''' The full name and path of the host destination + ''' The name of the user performing the upload + ''' The user's password Public Sub UploadFile(sourceFileName As String, address As String, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. - ''' The name of the user performing the upload. - ''' The user's password. + ''' The file to be uploaded + ''' Uri representing the destination + ''' The name of the user performing the upload + ''' The user's password Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, password As String) UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' The full name and path of the host destination. - ''' The name of the user performing the upload. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. + ''' The file to be uploaded + ''' The full name and path of the host destination + ''' The name of the user performing the upload + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -480,15 +479,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' The full name and path of the host destination. - ''' The name of the user performing the upload. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' The file to be uploaded + ''' The full name and path of the host destination + ''' The name of the user performing the upload + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -500,7 +499,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). ' However, it is good practice to verify address before calling address.Trim. If String.IsNullOrWhiteSpace(address) Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If ' Getting a uri will validate the form of the host address @@ -508,7 +507,7 @@ Namespace Microsoft.VisualBasic.Devices ' For uploads, we need to make sure the address includes the filename If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then - Throw ExUtils.GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) + Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) End If UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) @@ -516,14 +515,14 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. - ''' The name of the user performing the upload. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. + ''' The file to be uploaded + ''' Uri representing the destination + ''' The name of the user performing the upload + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -535,15 +534,15 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. - ''' The name of the user performing the upload. - ''' The user's password. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' The file to be uploaded + ''' Uri representing the destination + ''' The name of the user performing the upload + ''' The user's password + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -560,13 +559,13 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. - ''' The credentials of the user performing the upload. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. + ''' The file to be uploaded + ''' Uri representing the destination + ''' The credentials of the user performing the upload + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, @@ -577,33 +576,33 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Uploads a file from the local machine to the specified host. + ''' Uploads a file from the local machine to the specified host ''' - ''' The file to be uploaded. - ''' Uri representing the destination. - ''' The credentials of the user performing the upload. - ''' Indicates whether or not to show a progress bar. - ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' The file to be uploaded + ''' Uri representing the destination + ''' The credentials of the user performing the upload + ''' Indicates whether or not to show a progress bar + ''' Time alloted before giving up on a connection + ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, showUI As Boolean, connectionTimeout As Integer, onUserCancel As UICancelOption) - sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, "sourceFileName") 'Make sure the file exists If Not IO.File.Exists(sourceFileName) Then - Throw New IO.FileNotFoundException(ExUtils.GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) + Throw New IO.FileNotFoundException(GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) End If If connectionTimeout <= 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw ExUtils.GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Using client As New WebClientExtended() @@ -614,23 +613,23 @@ Namespace Microsoft.VisualBasic.Devices client.Credentials = networkCredentials End If - Dim dialog As ProgressDialog = Nothing + Dim Dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then - dialog = New ProgressDialog With { - .Text = ExUtils.GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), - .LabelText = ExUtils.GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) + Dialog = New ProgressDialog With { + .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), + .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) } End If 'Create the copier - Dim copier As New WebClientCopy(client, dialog) + Dim copier As New WebClientCopy(client, Dialog) 'Download the file copier.UploadFile(sourceFileName, address) 'Handle a dialog cancel If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then + If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then Throw New OperationCanceledException() End If End If @@ -645,9 +644,9 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event from the OS which comes in on an arbitrary thread Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure - 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was - 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original + 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that + 'the OperationSyncronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) End SyncLock @@ -655,18 +654,18 @@ Namespace Microsoft.VisualBasic.Devices 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) Private Sub NetworkAvailabilityChangedHandler(state As Object) - Dim connected As Boolean = IsAvailable + Dim Connected As Boolean = IsAvailable ' Fire an event only if the connected state has changed - If _connected <> connected Then - _connected = connected - RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(connected)) + If _connected <> Connected Then + _connected = Connected + RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(Connected)) End If End Sub ''' - ''' A buffer for pinging. This imitates the buffer used by Ping.Exe. + ''' A buffer for pinging. This imitates the buffer used by Ping.Exe ''' - ''' A buffer. + ''' A buffer Private ReadOnly Property PingBuffer() As Byte() Get If _pingBuffer Is Nothing Then @@ -682,34 +681,34 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address). + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) ''' - ''' The remote file address. - ''' A Uri if successful, otherwise it throws an exception. + ''' The remote file address + ''' A Uri if successful, otherwise it throws an exception Private Shared Function GetUri(address As String) As Uri Try Return New Uri(address) Catch ex As UriFormatException 'Throw an exception with an error message more appropriate to our API - Throw ExUtils.GetArgumentExceptionWithArgName("address", SR.Network_InvalidUriString, address) + Throw GetArgumentExceptionWithArgName("address", SR.Network_InvalidUriString, address) End Try End Function ''' - ''' Gets network credentials from a userName and password. + ''' Gets network credentials from a userName and password ''' - ''' The name of the user. - ''' The password of the user. - ''' A NetworkCredentials. + ''' The name of the user + ''' The password of the user + ''' A NetworkCredentials Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials ' Make sure all nulls are empty strings If userName Is Nothing Then - userName = "" + userName = String.Empty End If If password Is Nothing Then - password = "" + password = String.Empty End If If userName.Length = 0 And password.Length = 0 Then @@ -750,14 +749,14 @@ Namespace Microsoft.VisualBasic.Devices End Class ''' - ''' Temporary class used to provide WebClient with a timeout property. + ''' Temporary class used to provide WebClient with a timeout property. ''' - ''' This class will be deleted when Timeout is added to WebClient. + ''' This class will be deleted when Timeout is added to WebClient Friend NotInheritable Class WebClientExtended Inherits WebClient ''' - ''' Sets or indicates the timeout used by WebRequest used by WebClient + ''' Sets or indicates the timeout used by WebRequest used by WebClient ''' Public WriteOnly Property Timeout() As Integer Set(value As Integer) @@ -767,9 +766,9 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Enables switching the server to non passive mode. + ''' Enables switching the server to non passive mode. ''' - ''' We need this in order for the progress UI on a download to work. + ''' We need this in order for the progress UI on a download to work Public WriteOnly Property UseNonPassiveFtp() As Boolean Set(value As Boolean) _useNonPassiveFtp = value @@ -777,8 +776,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set - ''' to the Timeout value + ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set + ''' to the Timeout value ''' ''' Protected Overrides Function GetWebRequest(address As Uri) As WebRequest @@ -815,4 +814,5 @@ Namespace Microsoft.VisualBasic.Devices ' Flag used to indicate whether or not we should use passive mode when ftp downloading Private _useNonPassiveFtp As Boolean End Class + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 10357a7ae66..0ae0c807c1c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Security Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 7c9780356c0..771b72fbe48 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -1,16 +1,13 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Runtime.InteropServices Imports System.Text Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class NativeMethods + Friend Module NativeMethods Friend Declare Auto Function _ @@ -29,7 +26,7 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes - Friend Shared Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer + Friend Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes End Function @@ -69,7 +66,7 @@ Namespace Microsoft.VisualBasic.CompilerServices PreserveSig:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)> - Friend Shared Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) + Friend Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) End Sub - Friend Shared Function CreateProcess( + Friend Function CreateProcess( lpApplicationName As String, lpCommandLine As String, lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, @@ -91,10 +88,10 @@ Namespace Microsoft.VisualBasic.CompilerServices lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer End Function -#Disable Warning IDE0049 ' Simplify Names, Justification:= +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= ''' - ''' Contains information about the current state of both physical and virtual memory, including extended memory. + ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' Friend Structure MEMORYSTATUSEX @@ -125,23 +122,16 @@ Namespace Microsoft.VisualBasic.CompilerServices dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub End Structure -#Enable Warning IDE0049 ' Simplify Names +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' - ''' Obtains information about the system's current usage of both physical and virtual memory. + ''' Obtains information about the system's current usage of both physical and virtual memory. ''' ''' Pointer to a MEMORYSTATUSEX structure. ''' True if the function succeeds. Otherwise, False. - Friend Shared Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean + Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean End Function - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - - End Class - + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index b9eb086fd9e..698afb2de47 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Runtime.InteropServices Imports Microsoft.Win32.SafeHandles @@ -38,11 +35,12 @@ Namespace Microsoft.VisualBasic.CompilerServices Dispose() MyBase.Finalize() End Sub + End Class ''' - ''' Inherits SafeHandleZeroOrMinusOneIsInvalid, with additional InitialSetHandle method. - ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. + ''' Inherits , with additional InitialSetHandle method. + ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. ''' Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid Inherits SafeHandleZeroOrMinusOneIsInvalid @@ -59,16 +57,17 @@ Namespace Microsoft.VisualBasic.CompilerServices Protected Overrides Function ReleaseHandle() As Boolean Return NativeMethods.CloseHandle(handle) <> 0 End Function + End Class ''' - ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. + ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. ''' ''' - ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. - ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. - ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class - ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. + ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. + ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. + ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class + ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. ''' Friend NotInheritable Class PROCESS_INFORMATION @@ -79,15 +78,16 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub + End Class ''' - ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead - ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() - ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would - ''' and we got memory corruption problems detectable while running AppVerifier. - ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. - ''' as String so that the memory will get cleaned up. + ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead + ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() + ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would + ''' and we got memory corruption problems detectable while running AppVerifier. + ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. + ''' as String so that the memory will get cleaned up. ''' Friend NotInheritable Class STARTUPINFO @@ -115,7 +115,8 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub New() End Sub - Private _hasBeenDisposed As Boolean ' To detect redundant calls. Default initialize = False. + ' To detect redundant calls. Default initialize = False. + Private _hasBeenDisposed As Boolean Protected Overrides Sub Finalize() Dispose(False) @@ -127,7 +128,8 @@ Namespace Microsoft.VisualBasic.CompilerServices If disposing Then _hasBeenDisposed = True - Const STARTF_USESTDHANDLES As Integer = 256 'Defined in windows.h + ' 256 Defined in windows.h + Const STARTF_USESTDHANDLES As Integer = 256 If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then NativeMethods.CloseHandle(hStdInput) @@ -151,10 +153,11 @@ Namespace Microsoft.VisualBasic.CompilerServices ' This code correctly implements the disposable pattern. Friend Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub + End Class ' Handle Values @@ -174,5 +177,4 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index e9445f00f5e..f90c91f527d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -7,8 +7,7 @@ Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class _ - SafeNativeMethods + Friend Module SafeNativeMethods Friend Declare Function _ IsWindowEnabled _ @@ -22,12 +21,5 @@ Namespace Microsoft.VisualBasic.CompilerServices GetWindowThreadProcessId _ Lib "user32" (hwnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - End Class - + End Module End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index c1eee7c5e2f..a87ae3e3aeb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -6,45 +6,40 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class UnsafeNativeMethods + Friend Module UnsafeNativeMethods ''' - ''' Gets the state of the specified key on the keyboard when the function - ''' is called. + ''' Gets the state of the specified key on the keyboard when the function + ''' is called. ''' ''' Integer representing the key in question. ''' - ''' The high order byte is 1 if the key is down. The low order byte is one - ''' if the key is toggled on (i.e. for keys like CapsLock) + ''' The high order byte is 1 if the key is down. The low order byte is one + ''' if the key is toggled on (i.e. for keys like CapsLock) ''' - Friend Shared Function GetKeyState(KeyCode As Integer) As Short + Friend Function GetKeyState(KeyCode As Integer) As Short End Function ''' - ''' Frees memory allocated from the local heap. i.e. frees memory allocated - ''' by LocalAlloc or LocalReAlloc. + ''' Frees memory allocated from the local heap. i.e. frees memory allocated + ''' by LocalAlloc or LocalReAlloc. ''' - Friend Shared Function LocalFree(LocalHandle As IntPtr) As IntPtr + Friend Function LocalFree(LocalHandle As IntPtr) As IntPtr End Function ''' - ''' Used to determine how much free space is on a disk + ''' Used to determine how much free space is on a disk. ''' - ''' Path including drive we're getting information about - ''' The amount of free space available to the current user - ''' The total amount of space on the disk relative to the current user - ''' The amount of free spave on the disk. - ''' True if function succeeds in getting info otherwise False + ''' Path including drive we're getting information about. + ''' The amount of free space available to the current user. + ''' The total amount of space on the disk relative to the current user. + ''' The amount of free space on the disk. + ''' True if function succeeds in getting info otherwise False. - Friend Shared Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean + Friend Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean End Function - ''' - ''' Adding a private constructor to prevent the compiler from generating a default constructor. - ''' - Private Sub New() - End Sub - End Class + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 034e6c5deca..1cf59377f70 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -18,7 +18,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Private OKButton As Button Private MyCancelButton As Button #Enable Warning IDE1006 ' Naming Styles - Public Output As String = "" + Public Output As String = String.Empty 'This constructor needed to be able to show the designer at design-time. Friend Sub New() @@ -26,10 +26,10 @@ Namespace Microsoft.VisualBasic.CompilerServices InitializeComponent() End Sub - Friend Sub New(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) + Friend Sub New(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer) MyBase.New() InitializeComponent() - InitializeInputBox(Prompt, Title, DefaultResponse, XPos, YPos) + InitializeInputBox(prompt, title, defaultResponse, xPos, yPos) End Sub Protected Overloads Overrides Sub Dispose(disposing As Boolean) @@ -87,34 +87,34 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub 'Initialize labels etc from the args passed in to InputBox() - Private Sub InitializeInputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) - Text = Title - Label.Text = Prompt - TextBox.Text = DefaultResponse + Private Sub InitializeInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer) + Text = title + Label.Text = prompt + TextBox.Text = defaultResponse AddHandler OKButton.Click, AddressOf OKButton_Click AddHandler MyCancelButton.Click, AddressOf MyCancelButton_Click 'Re-size the dialog if the prompt is too large - Dim LabelGraphics As Graphics = Label.CreateGraphics - Dim LabelSizeNeeded As SizeF = LabelGraphics.MeasureString(Prompt, Label.Font, Label.Width) - LabelGraphics.Dispose() - If LabelSizeNeeded.Height > Label.Height Then - 'The current label size is not large enough to accommodate the prompt. We need + Dim labelGraphics As Graphics = Label.CreateGraphics + Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(prompt, Label.Font, Label.Width) + labelGraphics.Dispose() + If labelSizeNeeded.Height > Label.Height Then + 'The current label size is not large enough to accommodate the prompt. We need ' to expand the label and the dialog, and move the textbox to make room. - Dim DialogHeightChange As Integer = CInt(LabelSizeNeeded.Height) - Label.Height - Label.Height += DialogHeightChange - TextBox.Top += DialogHeightChange - Height += DialogHeightChange + Dim dialogHeightChange As Integer = CInt(labelSizeNeeded.Height) - Label.Height + Label.Height += dialogHeightChange + TextBox.Top += dialogHeightChange + Height += dialogHeightChange End If 'Position the form - If (XPos = -1) AndAlso (YPos = -1) Then + If (xPos = -1) AndAlso (yPos = -1) Then StartPosition = FormStartPosition.CenterScreen Else - If (XPos = -1) Then XPos = 600 - If (YPos = -1) Then YPos = 350 + If (xPos = -1) Then xPos = 600 + If (yPos = -1) Then yPos = 350 StartPosition = FormStartPosition.Manual - DesktopLocation = New Point(XPos, YPos) + DesktopLocation = New Point(xPos, yPos) End If End Sub @@ -126,6 +126,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Private Sub MyCancelButton_Click(sender As Object, e As EventArgs) Close() End Sub - End Class + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index cb932d73cbd..6aa828c617b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -9,6 +9,7 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic @@ -25,11 +26,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(VbUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If NativeMethods.GetStartupInfo(startupInfo) @@ -77,10 +78,10 @@ Namespace Microsoft.VisualBasic 'If not, throw FileNotFound Const ERROR_ACCESS_DENIED As Integer = 5 If errorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) + Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) End If - Throw VbMakeException(vbErrors.FileNotFound) + Throw ExUtils.VbMakeException(vbErrors.FileNotFound) End If Finally safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. @@ -126,7 +127,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process - Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) + Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else AppActivateHelper(windowHandle, CStr(ProcessId)) End If @@ -185,7 +186,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match - Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, Title)) + Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, Title)) Else AppActivateHelper(windowHandle, Title) End If @@ -212,7 +213,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) + Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -293,7 +294,7 @@ Namespace Microsoft.VisualBasic title = fullName.Substring(0, firstCommaLocation) Else 'The name is not in the format we're expecting so return an empty string - title = "" + title = String.Empty End If End Try @@ -341,7 +342,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try @@ -361,7 +362,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 3f670f3a250..b3d4b6df0a0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -9,11 +9,12 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory. + ''' Options for the location of a log's directory ''' Public Enum LogFileLocation As Integer @@ -27,7 +28,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for the date stamp in the name of a log file. + ''' Options for the date stamp in the name of a log file ''' Public Enum LogFileCreationScheduleOption As Integer None '(default) @@ -36,7 +37,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted. + ''' Options for behavior when resources are exhausted ''' Public Enum DiskSpaceExhaustedOption As Integer ThrowException @@ -44,35 +45,35 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Class for logging to a text file. + ''' Class for logging to a text file ''' ''' - ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). - ''' Therefore, mark FileLogTraceListener as ComVisible(False). + ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). + ''' Therefore, mark FileLogTraceListener as ComVisible(False). ''' Partial Public Class FileLogTraceListener Inherits TraceListener ''' - ''' Creates a FileLogTraceListener with the passed in name. + ''' Creates a FileLogTraceListener with the passed in name ''' - ''' The name of the listener. + ''' The name of the listener Public Sub New(name As String) MyBase.New(name) End Sub ''' - ''' Creates a FileLogTraceListener with default name. + ''' Creates a FileLogTraceListener with default name ''' Public Sub New() Me.New(DEFAULT_NAME) End Sub ''' - ''' Indicates the log's directory. + ''' Indicates the log's directory ''' - ''' An enum which can indicate one of several logical locations for the log. + ''' An enum which can indicate one of several logical locations for the log Public Property Location() As LogFileLocation Get If Not _propertiesSet(LOCATION_INDEX) Then @@ -96,9 +97,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the stream should be flushed after every write. + ''' Indicates whether or not the stream should be flushed after every write ''' - ''' True if the stream should be flushed after every write, otherwise False. + ''' True if the stream should be flushed after every write, otherwise False Public Property AutoFlush() As Boolean Get If Not _propertiesSet(AUTOFLUSH_INDEX) Then @@ -117,10 +118,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' - ''' True if the HostId should be included, otherwise False. + ''' True if the HostId should be included, otherwise False Public Property IncludeHostName() As Boolean Get If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then @@ -138,9 +139,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten. + ''' Indicates whether or not the file should be appended to or overwritten ''' - ''' True if the file should be appended to, otherwise False. + ''' True if the file should be appended to, otherwise False Public Property Append() As Boolean Get If Not _propertiesSet(APPEND_INDEX) Then @@ -165,10 +166,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user. + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user ''' - ''' An enum indicating the desired behavior (do nothing, throw). + ''' An enum indicating the desired behavior (do nothing, throw) Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption Get If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then @@ -188,9 +189,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The name of the log file not including DateStamp, file number, Path or extension. + ''' The name of the log file not including DateStamp, file number, Path or extension ''' - ''' The name of the log file. + ''' The name of the log file Public Property BaseFileName() As String Get If Not _propertiesSet(BASEFILENAME_INDEX) Then @@ -218,10 +219,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number. + ''' The full name and path of the actual log file including DateStamp and file number ''' - ''' The full name and path. - ''' Calling this method will open the log file if it's not already open. + ''' The full name and path + ''' Calling this method will open the log file if it's not already open Public ReadOnly Property FullLogFileName() As String Get ' The only way to reliably know the file name is to open the file. If we @@ -236,9 +237,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day). + ''' Indicates what Date to stamp the log file with (none, first day of week, day) ''' - ''' An enum indicating how to stamp the file. + ''' An enum indicating how to stamp the file Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption Get If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then @@ -262,9 +263,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The maximum size in bytes the log file is allowed to grow to. + ''' The maximum size in bytes the log file is allowed to grow to ''' - ''' The maximum size. + ''' The maximum size Public Property MaxFileSize() As Long Get If Not _propertiesSet(MAXFILESIZE_INDEX) Then @@ -277,7 +278,7 @@ Namespace Microsoft.VisualBasic.Logging Set(value As Long) DemandWritePermission() If value < MIN_FILE_SIZE Then - Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") End If _maxFileSize = value _propertiesSet(MAXFILESIZE_INDEX) = True @@ -285,9 +286,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The amount of disk space, in bytes, that must be available after a write. + ''' The amount of disk space, in bytes, that must be available after a write ''' - ''' The reserved disk space. + ''' The reserved disk space Public Property ReserveDiskSpace() As Long Get If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then @@ -308,9 +309,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The delimiter to be used to delimit fields in a line of output. + ''' The delimiter to be used to delimit fields in a line of output ''' - ''' The delimiter. + ''' The delimiter Public Property Delimiter() As String Get If Not _propertiesSet(DELIMITER_INDEX) Then @@ -327,12 +328,12 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The encoding to try when opening a file. + ''' The encoding to try when opening a file. ''' - ''' The encoding. + ''' The encoding ''' - ''' If Append is true then this value will be trumped by the actual - ''' encoding value of the file. + ''' If Append is true then this value will be trumped by the actual encoding value + ''' of the file ''' Public Property Encoding() As Encoding Get @@ -353,10 +354,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom. + ''' The directory to be used if Location is set to Custom ''' - ''' The name of the directory. - ''' This will throw if the path cannot be resolved. + ''' The name of the directory + ''' This will throw if the path cannot be resolved Public Property CustomLocation() As String Get If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then @@ -393,9 +394,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Writes the message to the log. + ''' Writes the message to the log ''' - ''' The message to be written. + ''' The message to be written Public Overloads Overrides Sub Write(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -403,9 +404,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message) + Dim NewEntrySize As Long = Encoding.GetByteCount(message) - If ResourcesAvailable(newEntrySize) Then + If ResourcesAvailable(NewEntrySize) Then ListenerStream.Write(message) If AutoFlush Then ListenerStream.Flush() @@ -419,9 +420,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes the message to the log as a line. + ''' Writes the message to the log as a line ''' - ''' The message to be written. + ''' The message to be written Public Overloads Overrides Sub WriteLine(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -429,9 +430,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) + Dim NewEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - If ResourcesAvailable(newEntrySize) Then + If ResourcesAvailable(NewEntrySize) Then ListenerStream.WriteLine(message) If AutoFlush Then ListenerStream.Flush() @@ -444,13 +445,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' Event fired by TraceSourceListener resulting in writing to the log ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' The message. + ''' Cache of information + ''' The name of the TraceSourceListener + ''' The eventType of the message + ''' The id of the message + ''' The message Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) If Filter IsNot Nothing Then @@ -515,14 +516,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' Event fired by TraceSourceListener resulting in writing to the log ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A string with placeholders that serves as a format for the message. - ''' The values for the placeholders in format. + ''' Cache of information + ''' The name of the TraceSourceListener + ''' The eventType of the message + ''' The id of the message + ''' A string with placeholders that serves as a format for the message + ''' The values for the placeholders in format Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) ' Create the message @@ -537,16 +538,16 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Method of the base class we override to keep message format consistent ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' An object containing the message to be logged. + ''' Cache of information + ''' The name of the TraceSourceListener + ''' The eventType of the message + ''' The id of the message + ''' An object containing the message to be logged Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - Dim message As String = "" + Dim message As String = String.Empty If data IsNot Nothing Then message = data.ToString() End If @@ -555,13 +556,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Method of the base class we override to keep message format consistent ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A list of objects making up the message to be logged. + ''' Cache of information + ''' The name of the TraceSourceListener + ''' The eventType of the message + ''' The id of the message + ''' A list of objects making up the message to be logged Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) Dim messageBuilder As New StringBuilder() @@ -579,30 +580,30 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the underlying stream. + ''' Flushes the underlying stream ''' Public Overrides Sub Flush() _stream?.Flush() End Sub ''' - ''' Closes the underlying stream. + ''' Closes the underlying stream ''' Public Overrides Sub Close() Dispose(True) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception. + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception ''' - ''' An array of attribute names. + ''' An array of attribute names Protected Overrides Function GetSupportedAttributes() As String() Return _supportedAttributes End Function ''' - ''' Makes sure stream is flushed. + ''' Makes sure stream is flushed ''' ''' Protected Overrides Sub Dispose(disposing As Boolean) @@ -612,12 +613,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Gets the log file name under the current configuration. ''' - ''' The log file name. + ''' The log file name ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. ''' Private ReadOnly Property LogFileName() As String Get @@ -665,9 +666,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets the stream to use for writing to the log. + ''' Gets the stream to use for writing to the log ''' - ''' The stream. + ''' The stream Private ReadOnly Property ListenerStream() As ReferencedStream Get EnsureStreamIsOpen() @@ -678,16 +679,16 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets or creates the stream used for writing to the log. + ''' Gets or creates the stream used for writing to the log ''' - ''' The stream. + ''' The stream Private Function GetStream() As ReferencedStream ' Check the hash table to see if this file is already opened by another ' FileLogTraceListener in the same process Dim i As Integer = 0 Dim refStream As ReferencedStream = Nothing - Dim baseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) + Dim BaseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) While refStream Is Nothing AndAlso i < MAX_OPEN_ATTEMPTS ' This should only be true if processes outside our process have @@ -746,13 +747,13 @@ Namespace Microsoft.VisualBasic.Logging i += 1 End SyncLock End While - 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system + 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) + Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, BaseStreamName) End Function ''' - ''' Makes sure we have an open stream. + ''' Makes sure we have an open stream ''' Private Sub EnsureStreamIsOpen() If _stream Is Nothing Then @@ -761,9 +762,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Closes the stream. + ''' Closes the stream. ''' - ''' This method should be safe to call whether or not there is a stream. + ''' This method should be safe to call whether or not there is a stream Private Sub CloseCurrentStream() If _stream IsNot Nothing Then SyncLock s_streams @@ -777,35 +778,35 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the current date has changed to new day. + ''' Indicates whether or not the current date has changed to new day ''' - ''' True if the date has changed, otherwise False. + ''' True if the date has changed, otherwise False Private Function DayChanged() As Boolean Return _day.Date <> Now.Date End Function ''' - ''' Indicates whether or not the date has changed to a new week. + ''' Indicates whether or not the date has changed to a new week ''' - ''' True if the date has changed, otherwise False. + ''' True if the date has changed, otherwise False Private Function WeekChanged() As Boolean Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) End Function ''' - ''' Utility to get the date of the first day of the week from the passed in date. + ''' Utility to get the date of the first day of the week from the passed in date ''' - ''' The date being checked. + ''' The date being checked Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date Return checkDate.AddDays(-checkDate.DayOfWeek).Date End Function ''' - ''' Checks for date changes and carries out appropriate actions. + ''' Checks for date changes and carries out appropriate actions ''' ''' - ''' If the user has selected a DateStamp option then a change of - ''' date means we need to open a new file. + ''' If the user has selected a DateStamp option then a change of + ''' date means we need to open a new file. ''' Private Sub HandleDateChange() If LogFileCreationSchedule = LogFileCreationScheduleOption.Daily Then @@ -820,24 +821,24 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Checks the size of the current log plus the new entry and - ''' the free disk space against the user's limits. + ''' Checks the size of the current log plus the new entry and the free disk space against + ''' the user's limits. ''' - ''' The size of what's about to be written to the file. - ''' True if the limits aren't trespassed, otherwise False. - ''' This method is not 100% accurate if AutoFlush is False. + ''' The size of what's about to be written to the file + ''' True if the limits aren't trespassed, otherwise False + ''' This method is not 100% accurate if AutoFlush is False Private Function ResourcesAvailable(newEntrySize As Long) As Boolean If ListenerStream.FileSize + newEntrySize > MaxFileSize Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) + Throw New InvalidOperationException(VbUtils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) End If Return False End If If GetFreeDiskSpace() - newEntrySize < ReserveDiskSpace Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) + Throw New InvalidOperationException(VbUtils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) End If Return False End If @@ -846,21 +847,21 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user. + ''' Returns the total amount of free disk space available to the current user ''' - ''' The total amount, in bytes, of free disk space available to the current user. - ''' Throws an exception if API fails. + ''' The total amount, in bytes, of free disk space available to the current user + ''' Throws an exception if API fails Private Function GetFreeDiskSpace() As Long - Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) + Dim PathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim freeUserSpace As Long = -1 - Dim totalUserSpace As Long - Dim totalFreeSpace As Long + Dim FreeUserSpace As Long = -1 + Dim TotalUserSpace As Long + Dim TotalFreeSpace As Long - If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then - If freeUserSpace > -1 Then - Return freeUserSpace + If UnsafeNativeMethods.GetDiskFreeSpaceEx(PathName, FreeUserSpace, TotalUserSpace, TotalFreeSpace) Then + If FreeUserSpace > -1 Then + Return FreeUserSpace End If End If @@ -868,27 +869,27 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Opens a file and attempts to determine the file's encoding. + ''' Opens a file and attempts to determine the file's encoding ''' - ''' The encoding or Nothing. + ''' The encoding or Nothing Private Function GetFileEncoding(fileName As String) As Encoding If File.Exists(fileName) Then - Dim reader As StreamReader = Nothing + Dim Reader As StreamReader = Nothing Try 'Attempt to determine the encoding of the file. The call to Reader.ReadLine 'will change the current encoding of Reader to that of the file. - reader = New StreamReader(fileName, Encoding, True) + Reader = New StreamReader(fileName, Encoding, True) 'Ignore 0 length file - If reader.BaseStream.Length > 0 Then - reader.ReadLine() + If Reader.BaseStream.Length > 0 Then + Reader.ReadLine() - Return reader.CurrentEncoding + Return Reader.CurrentEncoding End If Finally - reader?.Close() + Reader?.Close() End Try End If @@ -896,10 +897,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Gets the host name. + ''' Gets the host name ''' - ''' The host name. - ''' We use the machine name because we can get that even if not hooked up to a network. + ''' The host name + ''' We use the machine name because we can get that even if not hooked up to a network Private ReadOnly Property HostName() As String Get If String.IsNullOrEmpty(_hostName) Then @@ -911,10 +912,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Demands a FileIO write permission. + ''' Demands a FileIO write permission. ''' ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS. + ''' This ensures these API cannot be used to circumvent CAS ''' Private Sub DemandWritePermission() Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") @@ -922,7 +923,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value. + ''' Validates that the value being passed as an LogFileLocation enum is a legal value ''' ''' Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) @@ -932,7 +933,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value ''' ''' Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) @@ -942,7 +943,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value ''' ''' Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) @@ -952,10 +953,10 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Convert a stack into a string. + ''' Convert a stack into a string ''' ''' - ''' Returns the stack as a .csv string. + ''' Returns the stack as a .csv string Private Shared Function StackToString(stack As Stack) As String Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") @@ -974,7 +975,7 @@ Namespace Microsoft.VisualBasic.Logging sb.Remove(sb.Length - length, length) End If - Return """" & sb.ToString() & """" + Return $"""{sb}""" End Function From 61589c2077926ddd563de2b2e964a44ebc6e73f4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 15:22:34 -0700 Subject: [PATCH 233/342] Fix more merge issues --- .../VisualBasic/CompilerServices/Utils.vb | 27 ++++ .../Microsoft/VisualBasic/Devices/Network.vb | 26 ++-- .../Microsoft/VisualBasic/Helpers/Hosting.vb | 11 -- .../Microsoft/VisualBasic/Helpers/IVbHost.vb | 10 ++ .../Logging/FileLogTraceListener.vb | 4 +- .../src/Microsoft/VisualBasic/Logging/Log.vb | 115 +++++++++--------- .../VisualBasic/MyServices/ClipboardProxy.vb | 28 ++--- .../VisualBasic/MyServices/FileSystemProxy.vb | 7 +- .../MyServices/Internal/ContextValue.vb | 9 +- .../VisualBasic/MyServices/RegistryProxy.vb | 5 +- .../Windows/Forms/ExceptionUtilsTests.vb | 5 +- 11 files changed, 133 insertions(+), 114 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb new file mode 100644 index 00000000000..f20925ab2b9 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb @@ -0,0 +1,27 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Globalization + +Namespace Microsoft.VisualBasic.CompilerServices + + ' Purpose: various helpers for the vb runtime functions + Friend NotInheritable Class Utils + + Friend Shared Function GetResourceString(ResourceId As vbErrors) As String + Dim id As String = "ID" & CStr(ResourceId) + Return SR.GetResourceString(id, id) + End Function + + Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String + Return String.Format(GetCultureInfo(), resourceKey, args) + End Function + + Friend Shared Function GetCultureInfo() As CultureInfo + Return Threading.Thread.CurrentThread.CurrentCulture + End Function + + End Class + +End Namespace + diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index 565a1be63f8..68aacc4f3ef 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -216,7 +216,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As String, destinationFileName As String, @@ -237,7 +237,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As String, @@ -271,7 +271,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists Public Sub DownloadFile(address As Uri, destinationFileName As String, @@ -292,7 +292,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the download ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub DownloadFile(address As Uri, @@ -317,7 +317,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Calls to all the other overloads will come through here Public Sub DownloadFile(address As Uri, @@ -338,7 +338,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved ''' The credentials of the user performing the download ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates whether or not the file should be overwritten if local file already exists ''' Indicates what to do if user cancels dialog (either throw or do nothing) ''' Calls to all the other overloads will come through here @@ -467,7 +467,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As String, userName As String, @@ -486,7 +486,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As String, @@ -522,7 +522,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, @@ -541,7 +541,7 @@ Namespace Microsoft.VisualBasic.Devices ''' The name of the user performing the upload ''' The user's password ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, @@ -565,7 +565,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri representing the destination ''' The credentials of the user performing the upload ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection Public Sub UploadFile(sourceFileName As String, address As Uri, networkCredentials As ICredentials, @@ -582,7 +582,7 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri representing the destination ''' The credentials of the user performing the upload ''' Indicates whether or not to show a progress bar - ''' Time alloted before giving up on a connection + ''' Time allotted before giving up on a connection ''' Indicates what to do if user cancels dialog (either throw or do nothing) Public Sub UploadFile(sourceFileName As String, address As Uri, @@ -645,7 +645,7 @@ Namespace Microsoft.VisualBasic.Devices Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSyncronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb index 50af821b5cd..279f65886b8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb @@ -3,18 +3,10 @@ Namespace Microsoft.VisualBasic.CompilerServices - - Public Interface IVbHost - Function GetParentWindow() As System.Windows.Forms.IWin32Window - Function GetWindowTitle() As String - End Interface - Public NotInheritable Class HostServices -#Disable Warning IDE0032 ' Use auto property, Justification:= Private Shared s_host As IVbHost -#Enable Warning IDE0032 ' Use auto property Public Shared Property VBHost() As IVbHost Get @@ -27,7 +19,4 @@ Namespace Microsoft.VisualBasic.CompilerServices End Property End Class - End Namespace - - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb new file mode 100644 index 00000000000..d663cace0fe --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb @@ -0,0 +1,10 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.CompilerServices + + Public Interface IVbHost + Function GetParentWindow() As System.Windows.Forms.IWin32Window + Function GetWindowTitle() As String + End Interface +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index b3d4b6df0a0..ba59d879c6b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -688,7 +688,7 @@ Namespace Microsoft.VisualBasic.Logging ' FileLogTraceListener in the same process Dim i As Integer = 0 Dim refStream As ReferencedStream = Nothing - Dim BaseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) + Dim baseStreamName As String = Path.GetFullPath(LogFileName & FILE_EXTENSION) While refStream Is Nothing AndAlso i < MAX_OPEN_ATTEMPTS ' This should only be true if processes outside our process have @@ -749,7 +749,7 @@ Namespace Microsoft.VisualBasic.Logging End While 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. - Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, BaseStreamName) + Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 389d7c8b39f..9863624b4f0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -1,25 +1,23 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Enables logging to configured TraceListeners + ''' Enables logging to configured TraceListeners ''' Public Class Log ''' - ''' Creates a Log and the underlying TraceSource based on the platform + ''' Creates a Log and the underlying TraceSource based on the platform. ''' - ''' Right now we only support WinApp as an application platform + ''' Right now we only support WinApp as an application platform. Public Sub New() ' Set trace source for platform. Right now we only support WinApp _traceSource = New DefaultTraceSource(WINAPP_SOURCE_NAME) @@ -31,9 +29,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Creates a Log and the underlying TraceSource based on the passed in name + ''' Creates a Log and the underlying TraceSource based on the passed in name. ''' - ''' The name of the TraceSource to be created + ''' The name of the TraceSource to be created. Public Sub New(name As String) _traceSource = New DefaultTraceSource(name) If Not _traceSource.HasBeenConfigured Then @@ -42,66 +40,67 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged + ''' The message to be logged. Public Sub WriteEntry(message As String) WriteEntry(message, TraceEventType.Information, TraceEventTypeToId(TraceEventType.Information)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged - ''' The type of message (error, info, etc...) + ''' The message to be logged. + ''' The type of message (error, info, etc...). Public Sub WriteEntry(message As String, severity As TraceEventType) WriteEntry(message, severity, TraceEventTypeToId(severity)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all of its listeners + ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' - ''' The message to be logged - ''' The type of message (error, info, etc...) - ''' An id for the message (used for correlation) + ''' The message to be logged. + ''' The type of message (error, info, etc...). + ''' An id for the message (used for correlation). Public Sub WriteEntry(message As String, severity As TraceEventType, id As Integer) If message Is Nothing Then - message = "" + message = String.Empty End If _traceSource.TraceEvent(severity, id, message) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message + ''' Has the TraceSource fire a TraceEvent for all listeners using information + ''' in an exception to form the message. ''' - ''' The exception being logged + ''' The exception being logged. Public Sub WriteException(ex As Exception) - WriteException(ex, TraceEventType.Error, "", TraceEventTypeToId(TraceEventType.Error)) + WriteException(ex, TraceEventType.Error, String.Empty, TraceEventTypeToId(TraceEventType.Error)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information + ''' in an exception to form the message and appending additional info. ''' - ''' The exception being logged - ''' The type of message (error, info, etc...) - ''' Extra information to append to the message + ''' The exception being logged. + ''' The type of message (error, info, etc...). + ''' Extra information to append to the message. Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String) WriteException(ex, severity, additionalInfo, TraceEventTypeToId(severity)) End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in an exception to form the message - ''' and appending additional info + ''' Has the TraceSource fire a TraceEvent for all listeners using information in + ''' an exception to form the message and appending additional info. ''' - ''' The exception being logged - ''' The type of message (error, info, etc...) - ''' Extra information to append to the message - ''' An id for the message (used for correlation) + ''' The exception being logged. + ''' The type of message (error, info, etc...). + ''' Extra information to append to the message. + ''' An id for the message (used for correlation). Public Sub WriteException(ex As Exception, severity As TraceEventType, additionalInfo As String, id As Integer) If ex Is Nothing Then - Throw GetArgumentNullException("ex") + Throw ExUtils.GetArgumentNullException(NameOf(ex)) End If Dim builder As New StringBuilder() @@ -117,20 +116,21 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gives access to the log's underlying TraceSource + ''' Gives access to the log's underlying TraceSource. ''' - ''' The log's underlying TraceSource + ''' The log's underlying TraceSource. Public ReadOnly Property TraceSource() As TraceSource Get - Return _traceSource 'Note, this is a downcast from the DefaultTraceSource class we are using + 'Note, this is a downcast from the DefaultTraceSource class we are using + Return _traceSource End Get End Property ''' - ''' Returns the file log trace listener we create for the Log + ''' Returns the file log trace listener we create for the Log. ''' - ''' The file log trace listener + ''' The file log trace listener. Public ReadOnly Property DefaultFileLogWriter() As FileLogTraceListener Get Return CType(TraceSource.Listeners(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME), FileLogTraceListener) @@ -138,14 +138,15 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that it knows if it was initialized - ''' using a config file or not. + ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that + ''' it knows if it was initialized using a config file or not. ''' Friend NotInheritable Class DefaultTraceSource Inherits TraceSource ''' - ''' TraceSource has other constructors, this is the only one we care about for this internal class + ''' TraceSource has other constructors, this is the only one we care about + ''' for this internal class. ''' ''' Public Sub New(name As String) @@ -153,9 +154,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Tells us whether this TraceSource found a config file to configure itself from + ''' Tells us whether this TraceSource found a config file to configure itself from. ''' - ''' True - The TraceSource was configured from a config file + ''' True - The TraceSource was configured from a config file. Public ReadOnly Property HasBeenConfigured() As Boolean Get ' This forces initialization of the attributes list @@ -163,7 +164,7 @@ Namespace Microsoft.VisualBasic.Logging _listenerAttributes = Attributes End If - ' TODO: This is a tempory fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590 + ' TODO: This is a temporary fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590 Return False End Get End Property @@ -173,8 +174,8 @@ Namespace Microsoft.VisualBasic.Logging End Class ''' - ''' When there is no config file to configure the trace source, this function is called in order to - ''' configure the trace source according to the defaults they would have had in a default AppConfig + ''' When there is no config file to configure the trace source, this function is called in order to + ''' configure the trace source according to the defaults they would have had in a default AppConfig. ''' Protected Friend Overridable Sub InitializeWithDefaultsSinceNoConfigExists() 'By default, you get a file log listener that picks everything from level Information on up. @@ -183,7 +184,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Make sure we flush the log on exit + ''' Make sure we flush the log on exit. ''' Private Sub CloseOnProcessExit(sender As Object, e As EventArgs) RemoveHandler AppDomain.CurrentDomain.ProcessExit, AddressOf CloseOnProcessExit @@ -191,9 +192,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Adds the default id values + ''' Adds the default id values. ''' - ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline + ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline. Private Shared Function InitializeIDHash() As Dictionary(Of TraceEventType, Integer) Dim result As New Dictionary(Of TraceEventType, Integer)(10) @@ -215,14 +216,14 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Converts a TraceEventType to an Id + ''' Converts a TraceEventType to an Id. ''' ''' - ''' The Id + ''' The Id. Private Shared Function TraceEventTypeToId(traceEventValue As TraceEventType) As Integer - Dim Id As Integer = 0 - s_idHash.TryGetValue(traceEventValue, Id) - Return Id + Dim id As Integer = 0 + s_idHash.TryGetValue(traceEventValue, id) + Return id End Function ' The underlying TraceSource for the log @@ -233,8 +234,8 @@ Namespace Microsoft.VisualBasic.Logging ' Names of TraceSources Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" 'taken from appconfig + ' Taken from appConfig + Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index b60616852ca..22b27ee61c2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Drawing @@ -36,9 +33,9 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Gets text from the clipboard saved in the passed in format ''' - ''' The type of text to get - ''' The text as a String - Public Function GetText(format As System.Windows.Forms.TextDataFormat) As String + ''' The type of text to get. + ''' The text as a String. + Public Function GetText(format As TextDataFormat) As String Return Clipboard.GetText(format) End Function @@ -51,12 +48,12 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard in + ''' Indicates whether or not text is available on the clipboard in ''' the passed in format ''' - ''' The type of text being checked for - ''' True if text is available, otherwise False - Public Function ContainsText(format As System.Windows.Forms.TextDataFormat) As Boolean + ''' The type of text being checked for. + ''' True if text is available, otherwise False. + Public Function ContainsText(format As TextDataFormat) As Boolean Return Clipboard.ContainsText(format) End Function @@ -71,9 +68,9 @@ Namespace Microsoft.VisualBasic.MyServices ''' ''' Saves the passed in String to the clipboard in the passed in format ''' - ''' The String to save - ''' The format in which to save the String - Public Sub SetText(text As String, format As System.Windows.Forms.TextDataFormat) + ''' The String to save. + ''' The format in which to save the String. + Public Sub SetText(text As String, format As TextDataFormat) Clipboard.SetText(text, format) End Sub @@ -197,7 +194,7 @@ Namespace Microsoft.VisualBasic.MyServices ''' The data object ''' This gives the ability to save an object in multiple formats - Public Function GetDataObject() As System.Windows.Forms.IDataObject + Public Function GetDataObject() As IDataObject Return Clipboard.GetDataObject() End Function @@ -207,8 +204,9 @@ Namespace Microsoft.VisualBasic.MyServices ''' The data object to be saved ''' This gives the ability to save an object in multiple formats - Public Sub SetDataObject(data As System.Windows.Forms.DataObject) + Public Sub SetDataObject(data As DataObject) Clipboard.SetDataObject(data) End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb index b4a14a98322..f755d24a944 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.Text @@ -12,7 +9,7 @@ Imports Microsoft.VisualBasic.FileIO Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.FileSystem to expose the type through My. + ''' An extremely thin wrapper around Microsoft.VisualBasic.FileIO.FileSystem to expose the type through My. ''' Public Class FileSystemProxy @@ -271,7 +268,7 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 428d45d6e2b..73d2e2cb6af 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -1,26 +1,24 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Threading Namespace Microsoft.VisualBasic.MyServices.Internal ''' - ''' Stores an object in a context appropriate for the environment we are + ''' Stores an object in a context appropriate for the environment we are ''' running in (web/windows) ''' ''' ''' - ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the + ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the ''' context of the current request (meaning the object is stored per request on the web). ''' Note that an instance of this class can only be associated ''' with the one item to be stored/retrieved at a time. ''' Public Class ContextValue(Of T) + Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub @@ -51,5 +49,4 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Private Shared s_threadLocal As ThreadLocal(Of IDictionary) End Class 'ContextValue - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb index e981b1c5316..505da1308a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb @@ -7,7 +7,7 @@ Imports Microsoft.Win32 Namespace Microsoft.VisualBasic.MyServices ''' - ''' An extremely thin wrapper around Microsoft.Win32.Registry to expose the type through My. + ''' An extremely thin wrapper around Microsoft.Win32.Registry to expose the type through My. ''' Public Class RegistryProxy @@ -65,11 +65,10 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Proxy class can only created by internal classes. + ''' Proxy class can only created by internal classes. ''' Friend Sub New() End Sub End Class End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 5dea00d249f..9eb5f65eeee 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -5,6 +5,7 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Xunit Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.Forms.Tests @@ -23,7 +24,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = VbUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) Assert.IsType(Of IO.DirectoryNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) @@ -31,7 +32,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = VbUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) Assert.IsType(Of IO.FileNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) From 5b2865701b543e50aac4a3189191556ef17ccec2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 17:04:14 -0700 Subject: [PATCH 234/342] Clean up comments --- .../ApplyApplicationDefaultsEventArgs.vb | 14 +- .../ApplicationServices/AssemblyInfo.vb | 88 +++--- .../NoStartupFormException.vb | 4 +- ...FormsApplicationBase.WinFormsAppContext.vb | 31 +- .../Microsoft/VisualBasic/Devices/Audio.vb | 50 ++-- .../Microsoft/VisualBasic/Devices/Clock.vb | 14 +- .../Microsoft/VisualBasic/Devices/Computer.vb | 26 +- .../VisualBasic/Devices/ComputerInfo.vb | 28 +- .../Microsoft/VisualBasic/Devices/Keyboard.vb | 31 +- .../Microsoft/VisualBasic/Devices/Mouse.vb | 30 +- .../Microsoft/VisualBasic/Devices/Network.vb | 4 +- .../VisualBasic/Devices/ServerComputer.vb | 33 +-- .../VisualBasic/Helpers/FileSystemUtils.vb | 90 +++--- .../Logging/FileLogTraceListener.vb | 268 +++++++++--------- .../VisualBasic/MyServices/ClipboardProxy.vb | 96 +++---- .../MyServices/Internal/ContextValue.vb | 14 +- 16 files changed, 411 insertions(+), 410 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 206bbaf0344..0033ac0ad62 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -9,7 +9,7 @@ Imports System.Windows.Forms Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Provides context for the ApplyApplicationDefaults event. + ''' Provides context for the ApplyApplicationDefaults event. ''' Public Class ApplyApplicationDefaultsEventArgs @@ -22,25 +22,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. + ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. ''' ''' - ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the - ''' application is applied by setting this property with a value different than nothing. + ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the + ''' application is applied by setting this property with a value different than nothing. ''' Public Property Font As Font ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. ''' Public Property MinimumSplashScreenDisplayTime As Integer = WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT ''' - ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. + ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' ''' - ''' The default value for this property is SystemAware. + ''' The default value for this property is SystemAware. ''' Public Property HighDpiMode As HighDpiMode diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 7297c951cb8..ee017140e55 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -37,9 +37,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _trademark As String ''' - ''' Creates an AssemblyInfo from an assembly + ''' Creates an AssemblyInfo from an assembly. ''' - ''' The assembly for which we want to obtain the information. + ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) If currentAssembly Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(currentAssembly)) @@ -48,19 +48,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the description associated with the assembly. + ''' Gets the description associated with the assembly. ''' ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. ''' if the AssemblyDescriptionAttribute is not defined. Public ReadOnly Property Description() As String Get If _description Is Nothing Then - Dim Attribute As AssemblyDescriptionAttribute = + Dim attribute As AssemblyDescriptionAttribute = CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _description = String.Empty Else - _description = Attribute.Description + _description = attribute.Description End If End If Return _description @@ -68,19 +68,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the company name associated with the assembly. + ''' Gets the company name associated with the assembly. ''' ''' A String containing the AssemblyCompanyAttribute associated with the assembly. ''' if the AssemblyCompanyAttribute is not defined. Public ReadOnly Property CompanyName() As String Get If _companyName Is Nothing Then - Dim Attribute As AssemblyCompanyAttribute = + Dim attribute As AssemblyCompanyAttribute = CType(GetAttribute(GetType(AssemblyCompanyAttribute)), AssemblyCompanyAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _companyName = String.Empty Else - _companyName = Attribute.Company + _companyName = attribute.Company End If End If Return _companyName @@ -88,19 +88,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the title associated with the assembly. + ''' Gets the company name associated with the assembly. ''' ''' A String containing the AssemblyTitleAttribute associated with the assembly. ''' if the AssemblyTitleAttribute is not defined. Public ReadOnly Property Title() As String Get If _title Is Nothing Then - Dim Attribute As AssemblyTitleAttribute = + Dim attribute As AssemblyTitleAttribute = CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If Attribute Is Nothing Then + If attribute Is Nothing Then _title = String.Empty Else - _title = Attribute.Title + _title = attribute.Title End If End If Return _title @@ -108,18 +108,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the copyright notices associated with the assembly. + ''' Gets the copyright notices associated with the assembly. ''' ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. ''' if the AssemblyCopyrightAttribute is not defined. Public ReadOnly Property Copyright() As String Get If _copyright Is Nothing Then - Dim Attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) + If attribute Is Nothing Then _copyright = String.Empty Else - _copyright = Attribute.Copyright + _copyright = attribute.Copyright End If End If Return _copyright @@ -127,18 +127,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the trademark notices associated with the assembly. ''' ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. ''' if the AssemblyTrademarkAttribute is not defined. Public ReadOnly Property Trademark() As String Get If _trademark Is Nothing Then - Dim Attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If attribute Is Nothing Then _trademark = String.Empty Else - _trademark = Attribute.Trademark + _trademark = attribute.Trademark End If End If Return _trademark @@ -146,18 +146,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the product name associated with the assembly. + ''' Gets the product name associated with the assembly. ''' ''' A String containing the AssemblyProductAttribute associated with the assembly. ''' if the AssemblyProductAttribute is not defined. Public ReadOnly Property ProductName() As String Get If _productName Is Nothing Then - Dim Attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) - If Attribute Is Nothing Then + Dim attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) + If attribute Is Nothing Then _productName = String.Empty Else - _productName = Attribute.Product + _productName = attribute.Product End If End If Return _productName @@ -165,9 +165,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the version number of the assembly. + ''' Gets the version number of the assembly. ''' - ''' A System.Version class containing the version number of the assembly + ''' A System.Version class containing the version number of the assembly. ''' Cannot use AssemblyVersionAttribute since it always return Nothing. Public ReadOnly Property Version() As Version Get @@ -176,7 +176,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' ''' A String containing the file name. Public ReadOnly Property AssemblyName() As String @@ -186,7 +186,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the directory where the assembly lives. + ''' Gets the directory where the assembly lives. ''' Public ReadOnly Property DirectoryPath() As String Get @@ -195,22 +195,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the names of all assemblies loaded by the current application. + ''' Returns the names of all assemblies loaded by the current application. ''' ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. ''' attempt on an unloaded application domain. Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) Get - Dim Result As New Collection(Of Assembly) - For Each Assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - Result.Add(Assembly) + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) Next - Return New ReadOnlyCollection(Of Assembly)(Result) + Return New ReadOnlyCollection(Of Assembly)(result) End Get End Property ''' - ''' Returns the current stack trace information. + ''' Returns the current stack trace information. ''' ''' A string containing stack trace information. Value can be String.Empty. ''' The requested stack trace information is out of range. @@ -221,10 +221,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the amount of physical memory mapped to the process context. + ''' Gets the amount of physical memory mapped to the process context. ''' ''' - ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. + ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. ''' Public ReadOnly Property WorkingSet() As Long Get @@ -233,20 +233,20 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. + ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. ''' - ''' The type of the required attribute. + ''' The type of the required attribute. ''' The attribute with the given type gotten from the assembly, or Nothing. - Private Function GetAttribute(AttributeType As Type) As Object + Private Function GetAttribute(attributeType As Type) As Object Debug.Assert(_assembly IsNot Nothing, "Null m_Assembly") - Dim Attributes() As Object = _assembly.GetCustomAttributes(AttributeType, inherit:=True) + Dim attributes() As Object = _assembly.GetCustomAttributes(attributeType, inherit:=True) - If Attributes.Length = 0 Then + If attributes.Length = 0 Then Return Nothing Else - Return Attributes(0) + Return attributes(0) End If End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 0102e2ed1b9..471325fd0fb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -3,7 +3,7 @@ Imports System.ComponentModel -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.ApplicationServices @@ -18,7 +18,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(GetResourceString(SR.AppModel_NoStartupForm)) + MyBase.New(VbUtils.GetResourceString(SR.AppModel_NoStartupForm)) End Sub Public Sub New(message As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index 846eab5d858..33f2e9ef756 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -1,7 +1,4 @@ -Option Strict On -Option Explicit On -Option Infer On -' Licensed to the .NET Foundation under one or more agreements. +' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Security @@ -12,10 +9,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Partial Public Class WindowsFormsApplicationBase ''' - ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we - ''' offer in the application model. This derivation of the ApplicationContext listens for when - ''' the main form closes and provides for shutting down when the main form closes or the - ''' last form closes, depending on the mode this application is running in. + ''' Encapsulates an ApplicationContext. We have our own to get the shutdown behaviors we + ''' offer in the application model. This derivation of the ApplicationContext listens for when + ''' the main form closes and provides for shutting down when the main form closes or the + ''' last form closes, depending on the mode this application is running in. ''' Private NotInheritable Class WinFormsAppContext Inherits ApplicationContext @@ -27,9 +24,14 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the two types of application shutdown: - ''' 1 - shutdown when the main form closes - ''' 2 - shutdown only after the last form closes + ''' + ''' + ''' Shutdown when the main form closes. + ''' + ''' + ''' Shutdown only after the last form closes. + ''' + ''' ''' ''' ''' @@ -41,10 +43,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim forms As FormCollection = Application.OpenForms If forms.Count > 0 Then - 'Note: Initially I used Process::MainWindowHandle to obtain an open form. But that is bad for two reasons: - '1 - It appears to be broken and returns NULL sometimes even when there is still a window around. WinForms people are looking at that issue. + 'Note: Initially I used Process::MainWindowHandle to obtain an open form. But that is bad for two reasons: + '1 - It appears to be broken and returns NULL sometimes even when there is still a window around. WinForms people are looking at that issue. '2 - It returns the first window it hits from enum thread windows, which is not necessarily a windows forms form, so that doesn't help us even if it did work - 'all the time. So I'll use one of our open forms. We may not necessarily get a visible form here but that's OK. Some apps may run on an invisible window + 'all the time. So I'll use one of our open forms. We may not necessarily get a visible form here but that's OK. Some apps may run on an invisible window 'and we need to keep them going until all windows close. MainForm = forms(0) Else @@ -52,6 +54,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If End If End Sub + End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 0e7defb51cc..5ca6aa33c5c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -8,7 +8,7 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic ''' - ''' Enum for three ways to play a .wav file + ''' Enum for three ways to play a .wav file. ''' Public Enum AudioPlayMode ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() @@ -20,31 +20,31 @@ Namespace Microsoft.VisualBasic Namespace Devices ''' - ''' An object that makes it easy to play wav files + ''' An object that makes it easy to play wav files. ''' Public Class Audio ''' - ''' Creates a new Audio object + ''' Creates a new Audio object. ''' Public Sub New() End Sub ''' - ''' Plays a .wav file in background mode + ''' Plays a .wav file in background mode. ''' - ''' The name of the file + ''' The name of the file. Public Sub Play(location As String) Play(location, AudioPlayMode.Background) End Sub ''' - ''' Plays a .wav file in the passed in mode + ''' Plays a .wav file in the passed in mode. ''' - ''' The name of the file + ''' The name of the file. ''' - ''' An enum value representing the mode, Background (async), - ''' WaitToComplete (sync) or BackgroundLoop + ''' An enum value representing the mode, Background (async), + ''' WaitToComplete (sync) or BackgroundLoop ''' Public Sub Play(location As String, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) @@ -54,10 +54,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays a Byte array representation of a .wav file in the passed in mode + ''' Plays a Byte array representation of a .wav file in the passed in mode. ''' - ''' The array representing the .wav file - ''' The mode in which the array should be played + ''' The array representing the .wav file. + ''' The mode in which the array should be played. Public Sub Play(data() As Byte, playMode As AudioPlayMode) If data Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(data)) @@ -70,10 +70,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays a stream representation of a .wav file in the passed in mode + ''' Plays a stream representation of a .wav file in the passed in mode. ''' - ''' The stream representing the .wav file - ''' The mode in which the stream should be played + ''' The stream representing the .wav file. + ''' The mode in which the stream should be played. Public Sub Play(stream As Stream, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) If stream Is Nothing Then @@ -86,8 +86,8 @@ Namespace Microsoft.VisualBasic ''' ''' Plays a system messageBeep sound. ''' - ''' The sound to be played - ''' Plays the sound asynchronously + ''' The sound to be played. + ''' Plays the sound asynchronously. Public Sub PlaySystemSound(systemSound As Media.SystemSound) If systemSound Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(systemSound)) @@ -98,7 +98,7 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Stops the play of any playing sound + ''' Stops the play of any playing sound. ''' Public Sub [Stop]() Dim sound As New Media.SoundPlayer() @@ -106,10 +106,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Plays the passed in SoundPlayer in the passed in mode + ''' Plays the passed in SoundPlayer in the passed in mode. ''' - ''' The SoundPlayer to play - ''' The mode in which to play the sound + ''' The SoundPlayer to play. + ''' The mode in which to play the sound. Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") @@ -134,10 +134,10 @@ Namespace Microsoft.VisualBasic End Sub ''' - ''' Gets the full name and path for the file. Throws if unable to get full name and path + ''' Gets the full name and path for the file. Throws if unable to get full name and path. ''' - ''' The filename being tested - ''' A full name and path of the file + ''' The filename being tested. + ''' A full name and path of the file. Private Shared Function ValidateFilename(location As String) As String If String.IsNullOrEmpty(location) Then Throw ExUtils.GetArgumentNullException(NameOf(location)) @@ -147,7 +147,7 @@ Namespace Microsoft.VisualBasic End Function ''' - ''' Validates that the value being passed as an AudioPlayMode enum is a legal value + ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. ''' ''' Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index 858837821f8..ee2d35811f1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -4,15 +4,15 @@ Namespace Microsoft.VisualBasic.Devices ''' - ''' A wrapper object that acts as a discovery mechanism to quickly find out - ''' the current local time of the machine and the GMT time. + ''' A wrapper object that acts as a discovery mechanism to quickly find out + ''' the current local time of the machine and the GMT time. ''' Public Class Clock #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= ''' - ''' Gets a Date that is the current local date and time on this computer. + ''' Gets a Date that is the current local date and time on this computer. ''' ''' A Date whose value is the current date and time. Public ReadOnly Property LocalTime() As DateTime @@ -22,8 +22,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets a DateTime that is the current local date and time on this - ''' computer expressed as GMT time. + ''' Gets a DateTime that is the current local date and time on this + ''' computer expressed as GMT time. ''' ''' A Date whose value is the current date and time expressed as GMT time. Public ReadOnly Property GmtTime() As DateTime @@ -35,8 +35,8 @@ Namespace Microsoft.VisualBasic.Devices #Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' - ''' This property wraps the Environment.TickCount property to get the - ''' number of milliseconds elapsed since the system started. + ''' This property wraps the Environment.TickCount property to get the + ''' number of milliseconds elapsed since the system started. ''' ''' An Integer containing the amount of time in milliseconds. Public ReadOnly Property TickCount() As Integer diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index fdad391c89b..59507783f17 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -17,14 +17,14 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Computer : Inherits ServerComputer - 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. + 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. 'Since My.Computer creates the instance of Computer in a thread-safe way, access to the Computer will necessarily be thread-safe. 'There is nothing to prevent a user from passing our computer object across threads or creating their own instance and then getting into trouble. - ' But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. + ' But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. ' If you dim them up yourself, you are responsible for managing the threading. ''' - ''' Gets an Audio object which can play sound files or resources. + ''' Gets an Audio object which can play sound files or resources. ''' ''' A sound object. Public ReadOnly Property Audio() As Audio @@ -36,9 +36,9 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' A thin wrapper for System.Windows.Forms.Clipboard + ''' A thin wrapper for System.Windows.Forms.Clipboard ''' - ''' An object representing the clipboard + ''' An object representing the clipboard. Public ReadOnly Property Clipboard() As ClipboardProxy Get If s_clipboard Is Nothing Then @@ -50,8 +50,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Mouse object containing information about - ''' the physical mouse installed to the machine. + ''' This property returns the Mouse object containing information about + ''' the physical mouse installed to the machine. ''' ''' An instance of the Mouse class. Public ReadOnly Property Mouse() As Mouse @@ -63,8 +63,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Keyboard object representing some - ''' keyboard properties and a send keys method + ''' This property returns the Keyboard object representing some + ''' keyboard properties and a send keys method ''' ''' An instance of the Keyboard class. Public ReadOnly Property Keyboard() As Keyboard @@ -76,13 +76,13 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the primary display screen. + ''' This property returns the primary display screen. ''' ''' A System.Windows.Forms.Screen object as the primary screen. Public ReadOnly Property Screen() As Screen Get - 'Don't cache this. The Screen class responds to display resolution changes by nulling out AllScreens, which - 'PrimaryScreen relies on to find the primary. So we always need to access the latest PrimaryScreen so we + 'Don't cache this. The Screen class responds to display resolution changes by nulling out AllScreens, which + 'PrimaryScreen relies on to find the primary. So we always need to access the latest PrimaryScreen so we 'will get the current resolution reported. Return Screen.PrimaryScreen End Get @@ -91,7 +91,7 @@ Namespace Microsoft.VisualBasic.Devices Private _audio As Audio 'Lazy initialized cache for the Audio class. Private Shared s_clipboard As ClipboardProxy 'Lazy initialized cache for the clipboard class. (proxies can be shared - they have no state) Private Shared s_mouse As Mouse 'Lazy initialized cache for the Mouse class. SHARED because Mouse behaves as a ReadOnly singleton class - Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class + Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class End Class 'Computer End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index c4e026fa938..63e05043f72 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -7,7 +7,7 @@ Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.Devices ''' - ''' Provides configuration information about the current computer and the current process. + ''' Provides configuration information about the current computer and the current process. ''' Public Class ComputerInfo @@ -15,14 +15,14 @@ Namespace Microsoft.VisualBasic.Devices ' Keep the debugger proxy current as you change this class - see the nested ComputerInfoDebugView below. ''' - ''' Default constructor + ''' Default constructor ''' Public Sub New() End Sub #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:=" ''' - ''' Gets the total size of physical memory on the machine. + ''' Gets the total size of physical memory on the machine. ''' ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. ''' If we are unable to obtain the memory status. @@ -34,7 +34,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of free physical memory on the machine. + ''' Gets the total size of free physical memory on the machine. ''' ''' A 64-bit unsigned integer containing the size of free physical memory on the machine, in bytes. ''' If we are unable to obtain the memory status. @@ -46,7 +46,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of user potion of virtual address space for calling process. + ''' Gets the total size of user potion of virtual address space for calling process. ''' ''' ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, @@ -61,7 +61,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the total size of free user potion of virtual address space for calling process. + ''' Gets the total size of free user potion of virtual address space for calling process. ''' ''' ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, @@ -77,7 +77,7 @@ Namespace Microsoft.VisualBasic.Devices #Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' - ''' Gets the current UICulture installed on the machine. + ''' Gets the current UICulture installed on the machine. ''' ''' A CultureInfo object represents the UI culture installed on the machine. Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -87,7 +87,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the full operating system name. + ''' Gets the full operating system name. ''' ''' A string contains the operating system name. Public ReadOnly Property OSFullName() As String @@ -97,7 +97,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the platform OS name. + ''' Gets the platform OS name. ''' ''' A string containing a Platform ID like "Win32NT", "Win32S", "Win32Windows". See PlatformID enum. ''' If cannot obtain the OS Version information. @@ -108,7 +108,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the current version number of the operating system. + ''' Gets the current version number of the operating system. ''' ''' A string contains the current version number of the operating system. ''' If cannot obtain the OS Version information. @@ -119,8 +119,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger - ''' so we offer a view that doesn't have that field. + ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger + ''' so we offer a view that doesn't have that field. ''' Friend NotInheritable Class ComputerInfoDebugView Public Sub New(RealClass As ComputerInfo) @@ -183,7 +183,7 @@ Namespace Microsoft.VisualBasic.Devices End Class ''' - ''' Gets the whole memory information details. + ''' Gets the whole memory information details. ''' ''' An InternalMemoryStatus class. Private ReadOnly Property MemoryStatus() As InternalMemoryStatus @@ -198,7 +198,7 @@ Namespace Microsoft.VisualBasic.Devices Private _internalMemoryStatus As InternalMemoryStatus ' Cache our InternalMemoryStatus ''' - ''' Calls GlobalMemoryStatusEx and returns the correct value. + ''' Calls GlobalMemoryStatusEx and returns the correct value. ''' Private NotInheritable Class InternalMemoryStatus Friend Sub New() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index 14ff9561c05..eb1d8110b33 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -13,7 +13,7 @@ Namespace Microsoft.VisualBasic.Devices Public Class Keyboard ''' - ''' Sends keys to the active window as if typed as keyboard with wait = false. + ''' Sends keys to the active window as if typed as keyboard with wait = false. ''' ''' A string containing the keys to be sent (typed). Public Sub SendKeys(keys As String) @@ -21,8 +21,8 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Sends keys to the active window as if typed at keyboard. This overloaded - ''' version uses the same conventions as the VB6 SendKeys. + ''' Sends keys to the active window as if typed at keyboard. This overloaded + ''' version uses the same conventions as the VB6 SendKeys. ''' ''' A string containing the keys to be sent (typed). ''' Wait for messages to be processed before returning. @@ -35,40 +35,40 @@ Namespace Microsoft.VisualBasic.Devices End Sub ''' - ''' Gets the state (up or down) of the Shift key. + ''' Gets the state (up or down) of the Shift key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property ShiftKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Shift, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And Keys.Shift, Boolean) End Get End Property ''' - ''' Gets the state (up or down) of the Alt key. + ''' Gets the state (up or down) of the Alt key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property AltKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Alt, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And Keys.Alt, Boolean) End Get End Property ''' - ''' Gets the state (up or down) of the Ctrl key. + ''' Gets the state (up or down) of the Ctrl key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property CtrlKeyDown() As Boolean Get - Dim Keys As Keys = Control.ModifierKeys - Return CType(Keys And Keys.Control, Boolean) + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And Keys.Control, Boolean) End Get End Property ''' - ''' Gets the toggle state of the Caps Lock key. + ''' Gets the toggle state of the Caps Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property CapsLock() As Boolean @@ -82,7 +82,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the toggle state of the Num Lock key. + ''' Gets the toggle state of the Num Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property NumLock() As Boolean @@ -96,7 +96,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the toggle state of the Scroll Lock key. + ''' Gets the toggle state of the Scroll Lock key. ''' ''' True if the key is down otherwise false. Public ReadOnly Property ScrollLock() As Boolean @@ -110,5 +110,4 @@ Namespace Microsoft.VisualBasic.Devices End Property End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb index e9174f4d891..350413c9f3a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Mouse.vb @@ -1,29 +1,27 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports System.Windows.Forms -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices ''' - ''' A wrapper object that acts as a discovery mechanism for finding - ''' information about the mouse on your computer such as whether the mouse - ''' exists, the number of buttons, WheelScrolls details. + ''' A wrapper object that acts as a discovery mechanism for finding + ''' information about the mouse on your computer such as whether the mouse + ''' exists, the number of buttons, WheelScrolls details. ''' - ''' This class is a Singleton Class. See Common.Computer for details. + ''' This class is a Singleton Class. See Common.Computer for details. ''' Public Class Mouse ''' - ''' Gets a value indicating whether the functions of the left and right - ''' mouses buttons have been swapped. + ''' Gets a value indicating whether the functions of the left and right + ''' mouses buttons have been swapped. ''' ''' - ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. + ''' true if the functions of the left and right mouse buttons are swapped. false otherwise. ''' ''' If no mouse is installed. Public ReadOnly Property ButtonsSwapped() As Boolean @@ -31,13 +29,13 @@ Namespace Microsoft.VisualBasic.Devices If SystemInformation.MousePresent Then Return SystemInformation.MouseButtonsSwapped Else - Throw GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) End If End Get End Property ''' - ''' Gets a value indicating whether a mouse with a mouse wheel is installed + ''' Gets a value indicating whether a mouse with a mouse wheel is installed ''' ''' true if a mouse with a mouse wheel is installed, false otherwise. ''' If no mouse is installed. @@ -46,13 +44,13 @@ Namespace Microsoft.VisualBasic.Devices If SystemInformation.MousePresent Then Return SystemInformation.MouseWheelPresent Else - Throw GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) End If End Get End Property ''' - ''' Gets the number of lines to scroll when the mouse wheel is rotated. + ''' Gets the number of lines to scroll when the mouse wheel is rotated. ''' ''' The number of lines to scroll. ''' if no mouse is installed or no wheels exists. @@ -61,7 +59,7 @@ Namespace Microsoft.VisualBasic.Devices If WheelExists Then Return SystemInformation.MouseWheelScrollLines Else - Throw GetInvalidOperationException(SR.Mouse_NoWheelIsPresent) + Throw ExUtils.GetInvalidOperationException(SR.Mouse_NoWheelIsPresent) End If End Get End Property diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index 68aacc4f3ef..bc8fd9c8187 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -364,7 +364,7 @@ Namespace Microsoft.VisualBasic.Devices client.UseNonPassiveFtp = showUI 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, "destinationFileName") + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path @@ -590,7 +590,7 @@ Namespace Microsoft.VisualBasic.Devices showUI As Boolean, connectionTimeout As Integer, onUserCancel As UICancelOption) - sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, "sourceFileName") + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) 'Make sure the file exists If Not IO.File.Exists(sourceFileName) Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 757cd880b0a..6a806f24b60 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -1,28 +1,25 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On -Option Explicit On - Imports Microsoft.VisualBasic.MyServices Namespace Microsoft.VisualBasic.Devices ''' - ''' A RAD object representing the server 'computer' for the web/Windows Services - ''' that serves as a discovery mechanism for finding principle abstractions in - ''' the system that you can code against + ''' A RAD object representing the server 'computer' for the web/Windows Services + ''' that serves as a discovery mechanism for finding principle abstractions in + ''' the system that you can code against. ''' Public Class ServerComputer - 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. + 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. 'Since My.Computer creates the instance of Computer in a thread-safe way, access to the Computer will necessarily be thread-safe. 'There is nothing to prevent a user from passing our computer object across threads or creating their own instance and then getting into trouble. - 'But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. + 'But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. 'If you dim them up yourself, you are responsible for managing the threading. ''' - ''' Returns the Clock object which contains the LocalTime and GMTTime. + ''' Returns the Clock object which contains the LocalTime and GMTTime. ''' Public ReadOnly Property Clock() As Clock Get @@ -33,7 +30,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the object representing the file system of the computer. + ''' Gets the object representing the file system of the computer. ''' ''' A System.IO.FileSystem object. ''' The instance returned by this property is lazy initialized and cached. @@ -47,7 +44,7 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the object representing information about the computer's state + ''' Gets the object representing information about the computer's state ''' ''' A Microsoft.VisualBasic.MyServices.ComputerInfo object. ''' The instance returned by this property is lazy initialized and cached. @@ -61,8 +58,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Network object containing information about - ''' the network the machine is part of. + ''' This property returns the Network object containing information about + ''' the network the machine is part of. ''' ''' An instance of the Network.Network class. Public ReadOnly Property Network() As Network @@ -74,8 +71,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property wraps the System.Environment.MachineName property - ''' in the .NET framework to return the name of the computer. + ''' This property wraps the property + ''' in the .NET framework to return the name of the computer. ''' ''' A string containing the name of the computer. Public ReadOnly Property Name() As String @@ -85,8 +82,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Gets the Registry object, which can be used to read, set and - ''' enumerate keys and values in the system registry. + ''' Gets the Registry object, which can be used to read, set and + ''' enumerate keys and values in the system registry. ''' ''' An instance of the RegistryProxy object Public ReadOnly Property Registry() As RegistryProxy @@ -101,7 +98,7 @@ Namespace Microsoft.VisualBasic.Devices Private _fileIO As FileSystemProxy 'Lazy initialized cache for the FileSystem. Private _network As Network 'Lazy initialized cache for the Network class. Private _registryInstance As RegistryProxy 'Lazy initialized cache for the Registry class - Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class + Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class End Class 'MyServerComputer End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index 0ae0c807c1c..c1c848a9580 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports System.IO Imports System.Security Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils @@ -13,34 +14,37 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class FileSystemUtils ''' - ''' Normalize the path, but throw exception if the path ends with separator. + ''' Normalize the path, but throw exception if the path ends with separator. ''' - ''' The input path. - ''' The parameter name to include in the exception if one is raised. + ''' The input path. + ''' The parameter name to include in the exception if one is raised. ''' The normalized path. - Friend Shared Function NormalizeFilePath(Path As String, ParamName As String) As String - CheckFilePathTrailingSeparator(Path, ParamName) - Return NormalizePath(Path) + Friend Shared Function NormalizeFilePath(path As String, + paramName As String) As String + CheckFilePathTrailingSeparator(path, paramName) + Return NormalizePath(path) End Function ''' - ''' Get full path, get long format, and remove any pending separator. + ''' Get full path, get long format, and remove any pending separator. ''' - ''' The path to be normalized. + ''' The path to be normalized. ''' The normalized path. ''' See IO.Path.GetFullPath for possible exceptions. ''' Keep this function since we might change the implementation / behavior later. - Friend Shared Function NormalizePath(Path As String) As String - Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) + Friend Shared Function NormalizePath(path As String) As String + Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) End Function ''' - ''' Throw ArgumentException if the file path ends with a separator. + ''' Throw if the file path ends with a separator. ''' ''' The file path. - ''' The parameter name to include in ArgumentException. - Friend Shared Sub CheckFilePathTrailingSeparator(path As String, paramName As String) - If String.IsNullOrEmpty(path) Then ' Check for argument null + ''' The parameter name to include in . + Friend Shared Sub CheckFilePathTrailingSeparator(path As String, + paramName As String) + ' Check for argument null + If String.IsNullOrEmpty(path) Then Throw ExUtils.GetArgumentNullException(paramName) End If If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or @@ -52,33 +56,34 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' ''' Returns the given path in long format (v.s 8.3 format) if the path exists. ''' - ''' The path to resolve to long format. + ''' The path to resolve to long format. ''' The given path in long format if the path exists. ''' ''' GetLongPathName is a PInvoke call and requires unmanaged code permission. - ''' Use DirectoryInfo.GetFiles and GetDirectories (which call FindFirstFile) so that we always have permission. + ''' Use and (which call FindFirstFile) so that we always have permission. ''' - Private Shared Function GetLongPath(FullPath As String) As String - Debug.Assert(Not String.IsNullOrEmpty(FullPath) AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") + Private Shared Function GetLongPath(fullPath As String) As String + Debug.Assert(Not String.IsNullOrEmpty(fullPath) AndAlso IO.Path.IsPathRooted(fullPath), "Must be full path") Try ' If root path, return itself. UNC path do not recognize 8.3 format in root path, so this is fine. - If IsRoot(FullPath) Then - Return FullPath + If IsRoot(fullPath) Then + Return fullPath End If ' DirectoryInfo.GetFiles and GetDirectories call FindFirstFile which resolves 8.3 path. ' Get the DirectoryInfo (user must have code permission or access permission). - Dim DInfo As New IO.DirectoryInfo(FileIO.FileSystem.GetParentPath(FullPath)) + Dim dInfo As New IO.DirectoryInfo(FileIO.FileSystem.GetParentPath(fullPath)) - If IO.File.Exists(FullPath) Then - Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") - Return DInfo.GetFiles(IO.Path.GetFileName(FullPath))(0).FullName - ElseIf IO.Directory.Exists(FullPath) Then - Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, + If IO.File.Exists(fullPath) Then + Debug.Assert(dInfo.GetFiles(IO.Path.GetFileName(fullPath)).Length = 1, "Must found exactly 1") + Return dInfo.GetFiles(IO.Path.GetFileName(fullPath))(0).FullName + ElseIf IO.Directory.Exists(fullPath) Then + Debug.Assert(dInfo.GetDirectories(IO.Path.GetFileName(fullPath)).Length = 1, "Must found exactly 1") - Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName + Return dInfo.GetDirectories(IO.Path.GetFileName(fullPath))(0).FullName Else - Return FullPath ' Path does not exist, cannot resolve. + ' Path does not exist, cannot resolve. + Return fullPath End If Catch ex As Exception ' Ignore these type of exceptions and return FullPath. These type of exceptions should either be caught by calling functions @@ -96,7 +101,7 @@ Namespace Microsoft.VisualBasic.CompilerServices TypeOf ex Is IO.PathTooLongException OrElse TypeOf ex Is NotSupportedException), "These exceptions should be caught above") - Return FullPath + Return fullPath Else Throw End If @@ -104,48 +109,47 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function ''' - ''' Checks if the full path is a root path. + ''' Checks if the full path is a root path. ''' - ''' The path to check. + ''' The path to check. ''' True if FullPath is a root path, False otherwise. ''' ''' IO.Path.GetPathRoot: C: -> C:, C:\ -> C:\, \\machine\share -> \\machine\share, ''' BUT \\machine\share\ -> \\machine\share (No separator here). ''' Therefore, remove any separators at the end to have correct result. ''' - Private Shared Function IsRoot(Path As String) As Boolean + Private Shared Function IsRoot(path As String) As Boolean ' This function accepts a relative path since GetParentPath will call this, ' and GetParentPath accept relative paths. - If Not IO.Path.IsPathRooted(Path) Then + If Not IO.Path.IsPathRooted(path) Then Return False End If - Path = Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) - Return String.Equals(Path, IO.Path.GetPathRoot(Path), + path = path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) + Return String.Equals(path, IO.Path.GetPathRoot(path), StringComparison.OrdinalIgnoreCase) End Function ''' - ''' Removes all directory separators at the end of a path. + ''' Removes all directory separators at the end of a path. ''' - ''' a full or relative path. + ''' a full or relative path. ''' If Path is a root path, the same value. Otherwise, removes any directory separators at the end. ''' We decided not to return path with separators at the end. - Private Shared Function RemoveEndingSeparator(Path As String) As String - If IO.Path.IsPathRooted(Path) Then + Private Shared Function RemoveEndingSeparator(path As String) As String + If IO.Path.IsPathRooted(path) Then ' If the path is rooted, attempt to check if it is a root path. ' Note: IO.Path.GetPathRoot: C: -> C:, C:\ -> C:\, \\myshare\mydir -> \\myshare\mydir ' BUT \\myshare\mydir\ -> \\myshare\mydir!!! This function will remove the ending separator of ' \\myshare\mydir\ as well. Do not use IsRoot here. - If Path.Equals(IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) Then - Return Path + If path.Equals(IO.Path.GetPathRoot(path), StringComparison.OrdinalIgnoreCase) Then + Return path End If End If ' Otherwise, remove all separators at the end. - Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) + Return path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) End Function End Class - End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index ba59d879c6b..4551aefec35 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -14,7 +14,7 @@ Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory + ''' Options for the location of a log's directory. ''' Public Enum LogFileLocation As Integer @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for the date stamp in the name of a log file + ''' Options for the date stamp in the name of a log file. ''' Public Enum LogFileCreationScheduleOption As Integer None '(default) @@ -37,7 +37,7 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted + ''' Options for behavior when resources are exhausted. ''' Public Enum DiskSpaceExhaustedOption As Integer ThrowException @@ -45,35 +45,35 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Class for logging to a text file + ''' Class for logging to a text file. ''' ''' - ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). - ''' Therefore, mark FileLogTraceListener as ComVisible(False). + ''' TraceListener is ComVisible(False), Microsoft.VisualBasic.dll is ComVisible(True). + ''' Therefore, mark FileLogTraceListener as ComVisible(False). ''' Partial Public Class FileLogTraceListener Inherits TraceListener ''' - ''' Creates a FileLogTraceListener with the passed in name + ''' Creates a FileLogTraceListener with the passed in name. ''' - ''' The name of the listener + ''' The name of the listener. Public Sub New(name As String) MyBase.New(name) End Sub ''' - ''' Creates a FileLogTraceListener with default name + ''' Creates a FileLogTraceListener with default name. ''' Public Sub New() Me.New(DEFAULT_NAME) End Sub ''' - ''' Indicates the log's directory + ''' Indicates the log's directory. ''' - ''' An enum which can indicate one of several logical locations for the log + ''' An enum which can indicate one of several logical locations for the log. Public Property Location() As LogFileLocation Get If Not _propertiesSet(LOCATION_INDEX) Then @@ -97,9 +97,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the stream should be flushed after every write + ''' Indicates whether or not the stream should be flushed after every write. ''' - ''' True if the stream should be flushed after every write, otherwise False + ''' True if the stream should be flushed after every write, otherwise False. Public Property AutoFlush() As Boolean Get If Not _propertiesSet(AUTOFLUSH_INDEX) Then @@ -118,10 +118,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' - ''' True if the HostId should be included, otherwise False + ''' True if the HostId should be included, otherwise False. Public Property IncludeHostName() As Boolean Get If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then @@ -139,9 +139,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten + ''' Indicates whether or not the file should be appended to or overwritten. ''' - ''' True if the file should be appended to, otherwise False + ''' True if the file should be appended to, otherwise False. Public Property Append() As Boolean Get If Not _propertiesSet(APPEND_INDEX) Then @@ -166,10 +166,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user. ''' - ''' An enum indicating the desired behavior (do nothing, throw) + ''' An enum indicating the desired behavior (do nothing, throw). Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption Get If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then @@ -189,9 +189,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The name of the log file not including DateStamp, file number, Path or extension + ''' The name of the log file not including DateStamp, file number, Path or extension. ''' - ''' The name of the log file + ''' The name of the log file. Public Property BaseFileName() As String Get If Not _propertiesSet(BASEFILENAME_INDEX) Then @@ -219,10 +219,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number + ''' The full name and path of the actual log file including DateStamp and file number. ''' - ''' The full name and path - ''' Calling this method will open the log file if it's not already open + ''' The full name and path. + ''' Calling this method will open the log file if it's not already open. Public ReadOnly Property FullLogFileName() As String Get ' The only way to reliably know the file name is to open the file. If we @@ -237,9 +237,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day) + ''' Indicates what Date to stamp the log file with (none, first day of week, day). ''' - ''' An enum indicating how to stamp the file + ''' An enum indicating how to stamp the file. Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption Get If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then @@ -263,9 +263,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The maximum size in bytes the log file is allowed to grow to + ''' The maximum size in bytes the log file is allowed to grow to. ''' - ''' The maximum size + ''' The maximum size. Public Property MaxFileSize() As Long Get If Not _propertiesSet(MAXFILESIZE_INDEX) Then @@ -286,9 +286,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The amount of disk space, in bytes, that must be available after a write + ''' The amount of disk space, in bytes, that must be available after a write. ''' - ''' The reserved disk space + ''' The reserved disk space. Public Property ReserveDiskSpace() As Long Get If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then @@ -309,9 +309,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The delimiter to be used to delimit fields in a line of output + ''' The delimiter to be used to delimit fields in a line of output. ''' - ''' The delimiter + ''' The delimiter. Public Property Delimiter() As String Get If Not _propertiesSet(DELIMITER_INDEX) Then @@ -328,12 +328,12 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The encoding to try when opening a file. + ''' The encoding to try when opening a file. ''' - ''' The encoding + ''' The encoding. ''' - ''' If Append is true then this value will be trumped by the actual encoding value - ''' of the file + ''' If Append is true then this value will be trumped by the actual + ''' encoding value of the file. ''' Public Property Encoding() As Encoding Get @@ -354,10 +354,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom + ''' The directory to be used if Location is set to Custom. ''' - ''' The name of the directory - ''' This will throw if the path cannot be resolved + ''' The name of the directory. + ''' This will throw if the path cannot be resolved. Public Property CustomLocation() As String Get If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then @@ -394,9 +394,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Writes the message to the log + ''' Writes the message to the log. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub Write(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -404,9 +404,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message) + Dim newEntrySize As Long = Encoding.GetByteCount(message) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.Write(message) If AutoFlush Then ListenerStream.Flush() @@ -420,9 +420,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Writes the message to the log as a line + ''' Writes the message to the log as a line. ''' - ''' The message to be written + ''' The message to be written. Public Overloads Overrides Sub WriteLine(message As String) ' Use Try block to attempt to close stream if an exception is thrown @@ -430,9 +430,9 @@ Namespace Microsoft.VisualBasic.Logging HandleDateChange() ' Check resources - Dim NewEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) + Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - If ResourcesAvailable(NewEntrySize) Then + If ResourcesAvailable(newEntrySize) Then ListenerStream.WriteLine(message) If AutoFlush Then ListenerStream.Flush() @@ -445,13 +445,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' The message + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' The message. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) If Filter IsNot Nothing Then @@ -516,14 +516,14 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A string with placeholders that serves as a format for the message - ''' The values for the placeholders in format + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A string with placeholders that serves as a format for the message. + ''' The values for the placeholders in format. Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) ' Create the message @@ -538,13 +538,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' An object containing the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' An object containing the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) Dim message As String = String.Empty @@ -556,13 +556,13 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Method of the base class we override to keep message format consistent + ''' Method of the base class we override to keep message format consistent. ''' - ''' Cache of information - ''' The name of the TraceSourceListener - ''' The eventType of the message - ''' The id of the message - ''' A list of objects making up the message to be logged + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A list of objects making up the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) Dim messageBuilder As New StringBuilder() @@ -580,30 +580,30 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Flushes the underlying stream + ''' Flushes the underlying stream. ''' Public Overrides Sub Flush() _stream?.Flush() End Sub ''' - ''' Closes the underlying stream + ''' Closes the underlying stream. ''' Public Overrides Sub Close() Dispose(True) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception. ''' - ''' An array of attribute names + ''' An array of attribute names. Protected Overrides Function GetSupportedAttributes() As String() Return _supportedAttributes End Function ''' - ''' Makes sure stream is flushed + ''' Makes sure stream is flushed. ''' ''' Protected Overrides Sub Dispose(disposing As Boolean) @@ -613,12 +613,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Gets the log file name under the current configuration. ''' - ''' The log file name + ''' The log file name. ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. ''' Private ReadOnly Property LogFileName() As String Get @@ -666,9 +666,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets the stream to use for writing to the log + ''' Gets the stream to use for writing to the log. ''' - ''' The stream + ''' The stream. Private ReadOnly Property ListenerStream() As ReferencedStream Get EnsureStreamIsOpen() @@ -679,9 +679,9 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Gets or creates the stream used for writing to the log + ''' Gets or creates the stream used for writing to the log. ''' - ''' The stream + ''' The stream. Private Function GetStream() As ReferencedStream ' Check the hash table to see if this file is already opened by another @@ -747,13 +747,13 @@ Namespace Microsoft.VisualBasic.Logging i += 1 End SyncLock End While - 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system + 'If we fall out the loop, we have failed to obtain a valid stream name. This occurs if there are files on your system 'ranging from BaseStreamName0..BaseStreamName{integer.MaxValue} which is pretty unlikely but hey. Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function ''' - ''' Makes sure we have an open stream + ''' Makes sure we have an open stream. ''' Private Sub EnsureStreamIsOpen() If _stream Is Nothing Then @@ -762,9 +762,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Closes the stream. + ''' Closes the stream. ''' - ''' This method should be safe to call whether or not there is a stream + ''' This method should be safe to call whether or not there is a stream. Private Sub CloseCurrentStream() If _stream IsNot Nothing Then SyncLock s_streams @@ -778,35 +778,35 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates whether or not the current date has changed to new day + ''' Indicates whether or not the current date has changed to new day. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function DayChanged() As Boolean Return _day.Date <> Now.Date End Function ''' - ''' Indicates whether or not the date has changed to a new week + ''' Indicates whether or not the date has changed to a new week. ''' - ''' True if the date has changed, otherwise False + ''' True if the date has changed, otherwise False. Private Function WeekChanged() As Boolean Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) End Function ''' - ''' Utility to get the date of the first day of the week from the passed in date + ''' Utility to get the date of the first day of the week from the passed in date. ''' - ''' The date being checked + ''' The date being checked. Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date Return checkDate.AddDays(-checkDate.DayOfWeek).Date End Function ''' - ''' Checks for date changes and carries out appropriate actions + ''' Checks for date changes and carries out appropriate actions. ''' ''' - ''' If the user has selected a DateStamp option then a change of - ''' date means we need to open a new file. + ''' If the user has selected a DateStamp option then a change of + ''' date means we need to open a new file. ''' Private Sub HandleDateChange() If LogFileCreationSchedule = LogFileCreationScheduleOption.Daily Then @@ -821,12 +821,12 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Checks the size of the current log plus the new entry and the free disk space against - ''' the user's limits. + ''' Checks the size of the current log plus the new entry and + ''' the free disk space against the user's limits. ''' - ''' The size of what's about to be written to the file - ''' True if the limits aren't trespassed, otherwise False - ''' This method is not 100% accurate if AutoFlush is False + ''' The size of what's about to be written to the file. + ''' True if the limits aren't trespassed, otherwise False. + ''' This method is not 100% accurate if AutoFlush is False. Private Function ResourcesAvailable(newEntrySize As Long) As Boolean If ListenerStream.FileSize + newEntrySize > MaxFileSize Then @@ -847,21 +847,21 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user + ''' Returns the total amount of free disk space available to the current user. ''' - ''' The total amount, in bytes, of free disk space available to the current user - ''' Throws an exception if API fails + ''' The total amount, in bytes, of free disk space available to the current user. + ''' Throws an exception if API fails. Private Function GetFreeDiskSpace() As Long - Dim PathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) + Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim FreeUserSpace As Long = -1 - Dim TotalUserSpace As Long - Dim TotalFreeSpace As Long + Dim freeUserSpace As Long = -1 + Dim totalUserSpace As Long + Dim totalFreeSpace As Long - If UnsafeNativeMethods.GetDiskFreeSpaceEx(PathName, FreeUserSpace, TotalUserSpace, TotalFreeSpace) Then - If FreeUserSpace > -1 Then - Return FreeUserSpace + If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then + If freeUserSpace > -1 Then + Return freeUserSpace End If End If @@ -869,27 +869,27 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Opens a file and attempts to determine the file's encoding + ''' Opens a file and attempts to determine the file's encoding. ''' - ''' The encoding or Nothing + ''' The encoding or Nothing. Private Function GetFileEncoding(fileName As String) As Encoding If File.Exists(fileName) Then - Dim Reader As StreamReader = Nothing + Dim reader As StreamReader = Nothing Try 'Attempt to determine the encoding of the file. The call to Reader.ReadLine 'will change the current encoding of Reader to that of the file. - Reader = New StreamReader(fileName, Encoding, True) + reader = New StreamReader(fileName, Encoding, True) 'Ignore 0 length file - If Reader.BaseStream.Length > 0 Then - Reader.ReadLine() + If reader.BaseStream.Length > 0 Then + reader.ReadLine() - Return Reader.CurrentEncoding + Return reader.CurrentEncoding End If Finally - Reader?.Close() + reader?.Close() End Try End If @@ -897,10 +897,10 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Gets the host name + ''' Gets the host name. ''' - ''' The host name - ''' We use the machine name because we can get that even if not hooked up to a network + ''' The host name. + ''' We use the machine name because we can get that even if not hooked up to a network. Private ReadOnly Property HostName() As String Get If String.IsNullOrEmpty(_hostName) Then @@ -912,10 +912,10 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Demands a FileIO write permission. + ''' Demands a FileIO write permission. ''' ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS + ''' This ensures these API cannot be used to circumvent CAS. ''' Private Sub DemandWritePermission() Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") @@ -923,7 +923,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value + ''' Validates that the value being passed as an LogFileLocation enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) @@ -933,7 +933,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. ''' ''' Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) @@ -943,7 +943,7 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. ''' ''' Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) @@ -953,10 +953,10 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Convert a stack into a string + ''' Convert a stack into a string. ''' ''' - ''' Returns the stack as a .csv string + ''' Returns the stack as a .csv string. Private Shared Function StackToString(stack As Stack) As String Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index 22b27ee61c2..4e62ce9122e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -10,28 +10,28 @@ Imports System.Windows.Forms Namespace Microsoft.VisualBasic.MyServices ''' - ''' A class that wraps System.Windows.Forms.Clipboard so that - ''' a clipboard can be instanced. + ''' A class that wraps System.Windows.Forms.Clipboard so that + ''' a clipboard can be instanced. ''' Public Class ClipboardProxy ''' - ''' Only Allows instantiation of the class + ''' Only allows instantiation of the class ''' Friend Sub New() End Sub ''' - ''' Gets text from the clipboard + ''' Gets text from the clipboard. ''' - ''' The text as a String + ''' The text as a String. Public Function GetText() As String Return Clipboard.GetText() End Function ''' - ''' Gets text from the clipboard saved in the passed in format + ''' Gets text from the clipboard saved in the passed in format. ''' ''' The type of text to get. ''' The text as a String. @@ -40,16 +40,16 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Indicates whether or not text is available on the clipboard + ''' Indicates whether or not text is available on the clipboard. ''' - ''' True if text is available, otherwise False + ''' True if text is available, otherwise False. Public Function ContainsText() As Boolean Return Clipboard.ContainsText End Function ''' - ''' Indicates whether or not text is available on the clipboard in - ''' the passed in format + ''' Indicates whether or not text is available on the clipboard in + ''' the passed in format. ''' ''' The type of text being checked for. ''' True if text is available, otherwise False. @@ -58,15 +58,15 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in String to the clipboard + ''' Saves the passed in String to the clipboard. ''' - ''' The String to save + ''' The String to save. Public Sub SetText(text As String) Clipboard.SetText(text) End Sub ''' - ''' Saves the passed in String to the clipboard in the passed in format + ''' Saves the passed in String to the clipboard in the passed in format. ''' ''' The String to save. ''' The format in which to save the String. @@ -75,134 +75,134 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets an Image from the clipboard + ''' Gets an Image from the clipboard. ''' - ''' The image + ''' The image. Public Function GetImage() As Image Return Clipboard.GetImage() End Function ''' - ''' Indicate whether or not an image has been saved to the clipboard + ''' Indicate whether or not an image has been saved to the clipboard. ''' - ''' True if an image is available, otherwise False + ''' True if an image is available, otherwise False. Public Function ContainsImage() As Boolean Return Clipboard.ContainsImage() End Function ''' - ''' Saves the passed in image to the clipboard + ''' Saves the passed in image to the clipboard. ''' - ''' The image to be saved + ''' The image to be saved. Public Sub SetImage(image As Image) Clipboard.SetImage(image) End Sub ''' - ''' Gets an audio stream from the clipboard + ''' Gets an audio stream from the clipboard. ''' - ''' The audio stream as a Stream + ''' The audio stream as a Stream. Public Function GetAudioStream() As Stream Return Clipboard.GetAudioStream() End Function ''' - ''' Indicates whether or not there's an audio stream saved to the clipboard + ''' Indicates whether or not there's an audio stream saved to the clipboard. ''' - ''' True if an audio stream is available, otherwise False + ''' True if an audio stream is available, otherwise False. Public Function ContainsAudio() As Boolean Return Clipboard.ContainsAudio() End Function ''' - ''' Saves the passed in audio byte array to the clipboard + ''' Saves the passed in audio byte array to the clipboard. ''' - ''' The byte array to be saved + ''' The byte array to be saved. Public Sub SetAudio(audioBytes As Byte()) Clipboard.SetAudio(audioBytes) End Sub ''' - ''' Saves the passed in audio stream to the clipboard + ''' Saves the passed in audio stream to the clipboard. ''' - ''' The stream to be saved + ''' The stream to be saved. Public Sub SetAudio(audioStream As Stream) Clipboard.SetAudio(audioStream) End Sub ''' - ''' Gets a file drop list from the clipboard + ''' Gets a file drop list from the clipboard. ''' - ''' The list of file paths as a StringCollection + ''' The list of file paths as a StringCollection. Public Function GetFileDropList() As StringCollection Return Clipboard.GetFileDropList() End Function ''' - ''' Indicates whether or not a file drop list has been saved to the clipboard + ''' Indicates whether or not a file drop list has been saved to the clipboard. ''' - ''' True if a file drop list is available, otherwise False + ''' True if a file drop list is available, otherwise False. Public Function ContainsFileDropList() As Boolean Return Clipboard.ContainsFileDropList() End Function ''' - ''' Saves the passed in file drop list to the clipboard + ''' Saves the passed in file drop list to the clipboard. ''' - ''' The file drop list as a StringCollection + ''' The file drop list as a StringCollection. Public Sub SetFileDropList(filePaths As StringCollection) Clipboard.SetFileDropList(filePaths) End Sub ''' - ''' Gets data from the clipboard that's been saved in the passed in format. + ''' Gets data from the clipboard that's been saved in the passed in format. ''' - ''' The type of data being sought - ''' The data + ''' The type of data being sought. + ''' The data. Public Function GetData(format As String) As Object Return Clipboard.GetData(format) End Function ''' - ''' Indicates whether or not there is data on the clipboard in the passed in format + ''' Indicates whether or not there is data on the clipboard in the passed in format. ''' ''' - ''' True if there's data in the passed in format, otherwise False + ''' True if there's data in the passed in format, otherwise False. Public Function ContainsData(format As String) As Boolean Return Clipboard.ContainsData(format) End Function ''' - ''' Saves the passed in data to the clipboard in the passed in format + ''' Saves the passed in data to the clipboard in the passed in format. ''' - ''' The format in which to save the data - ''' The data to be saved + ''' The format in which to save the data. + ''' The data to be saved. Public Sub SetData(format As String, data As Object) Clipboard.SetData(format, data) End Sub ''' - ''' Removes everything from the clipboard + ''' Removes everything from the clipboard. ''' Public Sub Clear() Clipboard.Clear() End Sub ''' - ''' Gets a Data Object from the clipboard. + ''' Gets a from the clipboard. ''' - ''' The data object - ''' This gives the ability to save an object in multiple formats + ''' The data object. + ''' This gives the ability to save an object in multiple formats. Public Function GetDataObject() As IDataObject Return Clipboard.GetDataObject() End Function ''' - ''' Saves a DataObject to the clipboard + ''' Saves a to the clipboard. ''' - ''' The data object to be saved - ''' This gives the ability to save an object in multiple formats + ''' The data object to be saved. + ''' This gives the ability to save an object in multiple formats. Public Sub SetDataObject(data As DataObject) Clipboard.SetDataObject(data) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 73d2e2cb6af..833f0475505 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -6,15 +6,15 @@ Imports System.Threading Namespace Microsoft.VisualBasic.MyServices.Internal ''' - ''' Stores an object in a context appropriate for the environment we are - ''' running in (web/windows) + ''' Stores an object in a context appropriate for the environment we are + ''' running in (web/windows). ''' ''' ''' - ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the - ''' context of the current request (meaning the object is stored per request on the web). - ''' Note that an instance of this class can only be associated - ''' with the one item to be stored/retrieved at a time. + ''' "Thread appropriate" means that if we are running on ASP.Net the object will be stored in the + ''' context of the current request (meaning the object is stored per request on the web). + ''' Note that an instance of this class can only be associated + ''' with the one item to be stored/retrieved at a time. ''' Public Class ContextValue(Of T) @@ -24,7 +24,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Get the object from the correct thread-appropriate location + ''' Get the object from the correct thread-appropriate location. ''' Public Property Value() As T 'No SyncLocks required because we are operating upon instance data and the object is not shared across threads Get From cce696236b5882901086c025d2e6b85d2f1f133b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 17:28:21 -0700 Subject: [PATCH 235/342] Rename Hosting File --- .../Microsoft/VisualBasic/Helpers/{Hosting.vb => HostServices.vb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/{Hosting.vb => HostServices.vb} (100%) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/HostServices.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/Hosting.vb rename to src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/HostServices.vb From 79bd7a69a4277e892b9ac1b049adad57f3297ad3 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 17:50:16 -0700 Subject: [PATCH 236/342] Cleanup ExceptionUtilities --- .../CompilerServices/ExceptionUtils.vb | 161 +++++++++--------- 1 file changed, 80 insertions(+), 81 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 29c91d3633c..aab06ac0662 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,9 +1,8 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Strict On - -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports System.Runtime.InteropServices +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Namespace Microsoft.VisualBasic.CompilerServices @@ -14,24 +13,20 @@ Namespace Microsoft.VisualBasic.CompilerServices End Enum ' Implements error utilities for Basic - Friend NotInheritable Class ExceptionUtils - - ' Prevent creation. - Private Sub New() - End Sub + Friend Module ExceptionUtils - Friend Shared Function VbMakeException(hr As Integer) As Exception + Friend Function VbMakeException(hr As Integer) As Exception Dim sMsg As String If hr > 0 AndAlso hr <= &HFFFFI Then - sMsg = GetResourceString(CType(hr, vbErrors)) + sMsg = VbUtils.GetResourceString(CType(hr, vbErrors)) Else sMsg = String.Empty End If VbMakeException = VbMakeExceptionEx(hr, sMsg) End Function - Friend Shared Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception + Friend Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception Dim vBDefinedError As Boolean VbMakeExceptionEx = BuildException(number, sMsg, vBDefinedError) @@ -43,130 +38,134 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function - Friend Shared Function BuildException(Number As Integer, Description As String, ByRef VBDefinedError As Boolean) As Exception + Friend Function BuildException(resourceId As Integer, + description As String, + ByRef vbDefinedError As Boolean) As Exception - VBDefinedError = True + vbDefinedError = True - Select Case Number + Select Case resourceId Case vbErrors.None Case vbErrors.FileNotFound - Return New IO.FileNotFoundException(Description) + Return New IO.FileNotFoundException(description) Case vbErrors.PermissionDenied - Return New IO.IOException(Description) + Return New IO.IOException(description) Case Else 'Fall below to default - VBDefinedError = False - Return New Exception(Description) + vbDefinedError = False + Return New Exception(description) End Select - VBDefinedError = False - Return New Exception(Description) + vbDefinedError = False + Return New Exception(description) End Function ''' - ''' Returns a new instance of ArgumentException with the message from resource file and the Exception.ArgumentName property set. + ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentException. + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . ''' This is the preferred way to construct an argument exception. - Friend Shared Function GetArgumentExceptionWithArgName(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentException + Friend Function GetArgumentExceptionWithArgName(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentException - Return New ArgumentException(GetResourceString(ResourceID, PlaceHolders), ArgumentName) + Return New ArgumentException(VbUtils.GetResourceString(resourceID, placeHolders), argumentName) End Function ''' - ''' Returns a new instance of ArgumentNullException with message: "Argument cannot be Nothing." + ''' Returns a new instance of with message: "Argument cannot be Nothing." ''' - ''' The name of the argument (parameter). Not localized. - ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String) As ArgumentNullException + ''' The name of the argument (parameter). Not localized. + ''' A new instance of . + Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException - Return New ArgumentNullException(ArgumentName, GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(argumentName, VbUtils.GetResourceString(SR.General_ArgumentNullException)) End Function ''' - ''' Returns a new instance of ArgumentNullException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The name of the argument (parameter). Not localized. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of ArgumentNullException. - Friend Shared Function GetArgumentNullException(ArgumentName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As ArgumentNullException - - Return New ArgumentNullException(ArgumentName, GetResourceString(ResourceID, PlaceHolders)) + ''' The name of the argument (parameter). Not localized. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetArgumentNullException(argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentNullException + + Return New ArgumentNullException(argumentName, VbUtils.GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.DirectoryNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.DirectoryNotFoundException. - Friend Shared Function GetDirectoryNotFoundException( - ResourceID As String, ParamArray PlaceHolders() As String) As IO.DirectoryNotFoundException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetDirectoryNotFoundException(resourceID As String, + ParamArray placeHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.DirectoryNotFoundException(VbUtils.GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.FileNotFoundException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The file name (path) of the not found file. - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.FileNotFoundException. - Friend Shared Function GetFileNotFoundException(FileName As String, - ResourceID As String, ParamArray PlaceHolders() As String) As IO.FileNotFoundException - - Return New IO.FileNotFoundException(GetResourceString(ResourceID, PlaceHolders), FileName) + ''' The file name (path) of the not found file. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetFileNotFoundException(fileName As String, + resourceID As String, + ParamArray placeHolders() As String) As IO.FileNotFoundException + + Return New IO.FileNotFoundException(VbUtils.GetResourceString(resourceID, placeHolders), fileName) End Function ''' - ''' Returns a new instance of InvalidOperationException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of InvalidOperationException. - Friend Shared Function GetInvalidOperationException( - ResourceID As String, ParamArray PlaceHolders() As String) As InvalidOperationException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetInvalidOperationException(resourceID As String, + ParamArray placeHolders() As String) As InvalidOperationException - Return New InvalidOperationException(GetResourceString(ResourceID, PlaceHolders)) + Return New InvalidOperationException(VbUtils.GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of IO.IOException with the message from resource file. + ''' Returns a new instance of with the message from resource file. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of IO.IOException. - Friend Shared Function GetIOException(ResourceID As String, ParamArray PlaceHolders() As String) As IO.IOException + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . + Friend Function GetIOException(resourceID As String, + ParamArray placeHolders() As String) As IO.IOException - Return New IO.IOException(GetResourceString(ResourceID, PlaceHolders)) + Return New IO.IOException(VbUtils.GetResourceString(resourceID, placeHolders)) End Function ''' - ''' Returns a new instance of Win32Exception with the message from resource file and the last Win32 error. + ''' Returns a new instance of with the message from resource file and the last Win32 error. ''' - ''' The resource ID. - ''' Strings that will replace place holders in the resource string, if any. - ''' A new instance of Win32Exception. + ''' The resource ID. + ''' Strings that will replace place holders in the resource string, if any. + ''' A new instance of . ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. + Friend Function GetWin32Exception(resourceID As String, + ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Friend Shared Function GetWin32Exception( - ResourceID As String, ParamArray PlaceHolders() As String) As ComponentModel.Win32Exception - - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(ResourceID, PlaceHolders)) + Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), VbUtils.GetResourceString(resourceID, placeHolders)) End Function - End Class - + End Module End Namespace From 30d74ac3a984449c242b51d78863c1aef9b567d9 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 17:56:37 -0700 Subject: [PATCH 237/342] PR Review change --- .../UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 3265ca4189b..2a82fd02937 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -53,14 +53,16 @@ public void PingUri_Success() public void PingUri_Throw() { Network network = new(); - Assert.Throws(() => network.Ping((Uri)null)); + Action action = () => network.Ping((Uri)null); + action.Should().Throw(); } [Fact] public void PingUriTimeout_Throw() { Network network = new(); - Assert.Throws(() => network.Ping((Uri)null, 1)); + Action action = () => network.Ping((Uri)null, 1); + action.Should().Throw(); } // Not tested: From 7b0a44de4a27297715ef38b92ee647bd25459498 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 15 Jul 2024 17:59:07 -0700 Subject: [PATCH 238/342] Remove old comment --- .../UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 2a82fd02937..54807a82ea9 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -66,6 +66,5 @@ public void PingUriTimeout_Throw() } // Not tested: - // Public Sub DownloadFile(...) [multiple overloads] // Public Sub UploadFile(...) [multiple overloads] } From 12e709d4eb91ce7732429091fa21338c6a4686c9 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Jul 2024 16:53:11 -0700 Subject: [PATCH 239/342] Remove Option statement from VB because its in Project file --- .../My Project/Application.Designer.vb | 3 --- .../VisualBasic/MyServices/Internal/ProgressDialog.vb | 3 --- .../Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb | 3 --- 3 files changed, 9 deletions(-) diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb index 007b31fc7d3..a26f9100f6a 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb @@ -8,9 +8,6 @@ ' '------------------------------------------------------------------------------ -Option Strict On -Option Explicit On - Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 8ec8036e665..20a8de87469 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.Drawing Imports System.Globalization Imports System.Threading diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 539204e84a8..432b452ba62 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -1,9 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Option Explicit On -Option Strict On - Imports System.IO Imports System.Net Imports System.Windows.Forms From e5c1d9d68af4b5578d3631b137223aae3c067bd6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Jul 2024 16:56:15 -0700 Subject: [PATCH 240/342] Remove Option statement from VB because its in Project file --- .../My Project/Application.Designer.vb | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb index 007b31fc7d3..a26f9100f6a 100644 --- a/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb +++ b/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-VisualBasic/My Project/Application.Designer.vb @@ -8,9 +8,6 @@ ' '------------------------------------------------------------------------------ -Option Strict On -Option Explicit On - Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, From 719a6dbf9940c3f7e243742d3d18ccfd57ae86d2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Jul 2024 17:35:08 -0700 Subject: [PATCH 241/342] Rename Class Utils to Utils1 to avoid conflict. Class will be remove in future PR --- .../ApplicationServices/CantStartSingleInstanceException.vb | 2 +- .../VisualBasic/ApplicationServices/NoStartupFormException.vb | 2 +- .../ApplicationServices/WindowsFormsApplicationBase.vb | 2 +- .../Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 2 +- .../VisualBasic/CompilerServices/{Utils.vb => Utils1.vb} | 2 +- .../src/Microsoft/VisualBasic/Devices/Network.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 2 +- .../src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb | 2 +- .../tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/{Utils.vb => Utils1.vb} (95%) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index 056992d019d..4211c1ad3d1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -3,7 +3,7 @@ Imports System.ComponentModel -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 471325fd0fb..54933940215 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -3,7 +3,7 @@ Imports System.ComponentModel -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 8de33f6b462..19ef4d5b5af 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -12,7 +12,7 @@ Imports System.Threading Imports System.Windows.Forms Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.ApplicationServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index aab06ac0662..de3cf42c5b0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Runtime.InteropServices -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.CompilerServices diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb similarity index 95% rename from src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb rename to src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb index f20925ab2b9..97d81bdfcdc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb @@ -6,7 +6,7 @@ Imports System.Globalization Namespace Microsoft.VisualBasic.CompilerServices ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils + Friend NotInheritable Class Utils1 Friend Shared Function GetResourceString(ResourceId As vbErrors) As String Dim id As String = "ID" & CStr(ResourceId) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index bc8fd9c8187..c1b4faa7e66 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -7,7 +7,7 @@ Imports System.Security Imports System.Threading Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils +Imports Microsoft.VisualBasic.CompilerServices.Utils1 Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal Imports NetInfoAlias = System.Net.NetworkInformation diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 6aa828c617b..326a50b84c7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -9,7 +9,7 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 4551aefec35..fd8a3863789 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -9,7 +9,7 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.Logging diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 9eb5f65eeee..62df59836a8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -5,7 +5,7 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Xunit Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.Forms.Tests From 668fa70bd814ed3755f95e425fc753dc6c7bf65b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 18:45:04 -0700 Subject: [PATCH 242/342] Change VbUtils to ExUtils, and simplify ExceptionUtils --- .../src/GlobalSuppressions.vb | 2 +- .../CantStartSingleInstanceException.vb | 4 +- .../NoStartupFormException.vb | 5 +- .../WindowsFormsApplicationBase.vb | 5 +- .../CompilerServices/ExceptionUtils.vb | 64 +++++++------------ .../VisualBasic/CompilerServices/Utils1.vb | 27 -------- .../Microsoft/VisualBasic/Devices/Network.vb | 2 - .../src/Microsoft/VisualBasic/Interaction.vb | 15 ++--- .../Logging/FileLogTraceListener.vb | 5 +- .../Windows/Forms/ExceptionUtilsTests.vb | 5 +- 10 files changed, 41 insertions(+), 93 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb index 3a8799db6e7..4d98c52e39c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb +++ b/src/Microsoft.VisualBasic.Forms/src/GlobalSuppressions.vb @@ -5,4 +5,4 @@ Imports System.Diagnostics.CodeAnalysis - + diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index 4211c1ad3d1..f79a4ee9b8f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -3,7 +3,7 @@ Imports System.ComponentModel -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices @@ -19,7 +19,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(VbUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) + MyBase.New(ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) End Sub Public Sub New(message As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 54933940215..c890afde63a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -3,7 +3,8 @@ Imports System.ComponentModel -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + Namespace Microsoft.VisualBasic.ApplicationServices @@ -18,7 +19,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Creates a new exception ''' Public Sub New() - MyBase.New(VbUtils.GetResourceString(SR.AppModel_NoStartupForm)) + MyBase.New(ExUtils.GetResourceString(SR.AppModel_NoStartupForm)) End Sub Public Sub New(message As String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 19ef4d5b5af..34d1de1ee0d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -12,7 +12,6 @@ Imports System.Threading Imports System.Windows.Forms Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.ApplicationServices @@ -381,7 +380,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _appContext.MainForm = value End Set @@ -398,7 +397,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Allow for the case where they set splash screen = nothing and mainForm is currently nothing. If value IsNot Nothing AndAlso value Is _appContext.MainForm Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _splashScreen = value diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index de3cf42c5b0..76844282735 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,8 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Runtime.InteropServices -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 +Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -15,39 +14,25 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils - Friend Function VbMakeException(hr As Integer) As Exception - Dim sMsg As String - - If hr > 0 AndAlso hr <= &HFFFFI Then - sMsg = VbUtils.GetResourceString(CType(hr, vbErrors)) - Else - sMsg = String.Empty - End If - VbMakeException = VbMakeExceptionEx(hr, sMsg) + Friend Function GetResourceString(resourceKey As String, + ParamArray args() As String) As String + Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) End Function - Friend Function VbMakeExceptionEx(number As Integer, sMsg As String) As Exception - Dim vBDefinedError As Boolean - - VbMakeExceptionEx = BuildException(number, sMsg, vBDefinedError) - - If vBDefinedError Then - ' .NET Framework implementation calls: - ' Err().SetUnmappedError(number) - End If - + Friend Function GetResourceString(resourceId As vbErrors) As String + Dim id As String = $"ID{CStr(resourceId)}" + Return SR.GetResourceString(id, id) End Function - Friend Function BuildException(resourceId As Integer, - description As String, - ByRef vbDefinedError As Boolean) As Exception + Friend Function VbMakeException(resourceId As Integer) As Exception + Dim description As String = "" - vbDefinedError = True + If resourceId > 0 AndAlso resourceId <= &HFFFFI Then + description = GetResourceString(DirectCast(resourceId, vbErrors)) + End If Select Case resourceId - Case vbErrors.None - Case vbErrors.FileNotFound Return New IO.FileNotFoundException(description) @@ -55,14 +40,9 @@ Namespace Microsoft.VisualBasic.CompilerServices Return New IO.IOException(description) Case Else - 'Fall below to default - vbDefinedError = False Return New Exception(description) End Select - vbDefinedError = False - Return New Exception(description) - End Function ''' @@ -77,7 +57,7 @@ Namespace Microsoft.VisualBasic.CompilerServices resourceID As String, ParamArray placeHolders() As String) As ArgumentException - Return New ArgumentException(VbUtils.GetResourceString(resourceID, placeHolders), argumentName) + Return New ArgumentException(GetResourceString(resourceID, placeHolders), argumentName) End Function ''' @@ -87,7 +67,7 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' A new instance of . Friend Function GetArgumentNullException(argumentName As String) As ArgumentNullException - Return New ArgumentNullException(argumentName, VbUtils.GetResourceString(SR.General_ArgumentNullException)) + Return New ArgumentNullException(argumentName, GetResourceString(SR.General_ArgumentNullException)) End Function ''' @@ -101,7 +81,7 @@ Namespace Microsoft.VisualBasic.CompilerServices resourceID As String, ParamArray placeHolders() As String) As ArgumentNullException - Return New ArgumentNullException(argumentName, VbUtils.GetResourceString(resourceID, placeHolders)) + Return New ArgumentNullException(argumentName, GetResourceString(resourceID, placeHolders)) End Function ''' @@ -113,7 +93,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetDirectoryNotFoundException(resourceID As String, ParamArray placeHolders() As String) As IO.DirectoryNotFoundException - Return New IO.DirectoryNotFoundException(VbUtils.GetResourceString(resourceID, placeHolders)) + Return New IO.DirectoryNotFoundException(GetResourceString(resourceID, placeHolders)) End Function ''' @@ -124,10 +104,10 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . Friend Function GetFileNotFoundException(fileName As String, - resourceID As String, - ParamArray placeHolders() As String) As IO.FileNotFoundException + resourceID As String, + ParamArray placeHolders() As String) As IO.FileNotFoundException - Return New IO.FileNotFoundException(VbUtils.GetResourceString(resourceID, placeHolders), fileName) + Return New IO.FileNotFoundException(GetResourceString(resourceID, placeHolders), fileName) End Function ''' @@ -139,7 +119,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetInvalidOperationException(resourceID As String, ParamArray placeHolders() As String) As InvalidOperationException - Return New InvalidOperationException(VbUtils.GetResourceString(resourceID, placeHolders)) + Return New InvalidOperationException(GetResourceString(resourceID, placeHolders)) End Function ''' @@ -151,7 +131,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetIOException(resourceID As String, ParamArray placeHolders() As String) As IO.IOException - Return New IO.IOException(VbUtils.GetResourceString(resourceID, placeHolders)) + Return New IO.IOException(GetResourceString(resourceID, placeHolders)) End Function ''' @@ -164,7 +144,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetWin32Exception(resourceID As String, ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), VbUtils.GetResourceString(resourceID, placeHolders)) + Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb deleted file mode 100644 index 97d81bdfcdc..00000000000 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/Utils1.vb +++ /dev/null @@ -1,27 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.Globalization - -Namespace Microsoft.VisualBasic.CompilerServices - - ' Purpose: various helpers for the vb runtime functions - Friend NotInheritable Class Utils1 - - Friend Shared Function GetResourceString(ResourceId As vbErrors) As String - Dim id As String = "ID" & CStr(ResourceId) - Return SR.GetResourceString(id, id) - End Function - - Friend Shared Function GetResourceString(resourceKey As String, ParamArray args() As String) As String - Return String.Format(GetCultureInfo(), resourceKey, args) - End Function - - Friend Shared Function GetCultureInfo() As CultureInfo - Return Threading.Thread.CurrentThread.CurrentCulture - End Function - - End Class - -End Namespace - diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb index c1b4faa7e66..539d70e4e94 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb @@ -6,8 +6,6 @@ Imports System.Net Imports System.Security Imports System.Threading Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports Microsoft.VisualBasic.CompilerServices.Utils1 Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal Imports NetInfoAlias = System.Net.NetworkInformation diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 326a50b84c7..ebc55acb0e6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -9,7 +9,6 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic @@ -26,11 +25,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(VbUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If NativeMethods.GetStartupInfo(startupInfo) @@ -127,7 +126,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'we never found a window belonging to the desired process - Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, CStr(ProcessId))) Else AppActivateHelper(windowHandle, CStr(ProcessId)) End If @@ -186,7 +185,7 @@ Namespace Microsoft.VisualBasic End If If IntPtr.op_Equality(windowHandle, IntPtr.Zero) Then 'no match - Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, Title)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, Title)) Else AppActivateHelper(windowHandle, Title) End If @@ -213,7 +212,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, processId)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -342,7 +341,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try @@ -362,7 +361,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index fd8a3863789..c0fc7547c9d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -9,7 +9,6 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.Logging @@ -831,14 +830,14 @@ Namespace Microsoft.VisualBasic.Logging If ListenerStream.FileSize + newEntrySize > MaxFileSize Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(VbUtils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) + Throw New InvalidOperationException(ExUtils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) End If Return False End If If GetFreeDiskSpace() - newEntrySize < ReserveDiskSpace Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(VbUtils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) + Throw New InvalidOperationException(ExUtils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) End If Return False End If diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 62df59836a8..5dea00d249f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -5,7 +5,6 @@ Imports Microsoft.VisualBasic.CompilerServices Imports Xunit Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils1 Namespace Microsoft.VisualBasic.Forms.Tests @@ -24,7 +23,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = VbUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) Assert.IsType(Of IO.DirectoryNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) @@ -32,7 +31,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = VbUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) Assert.IsType(Of IO.FileNotFoundException)(ex) Assert.Equal("File not found.", ex.Message) From b9c2f714aa64d851448d2c1aee00a3d723125b4a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 21:18:12 -0700 Subject: [PATCH 243/342] Sort privates and functions without code changes Split Network into 7 files by function and move to sub directory, no code changes. Cleanup XML Comment for Network code and update indenting to match C# --- .../ApplicationServices/ApplicationBase.vb | 75 +- .../ApplyApplicationDefaultsEventArgs.vb | 12 +- .../ApplicationServices/AssemblyInfo.vb | 170 +- .../CantStartSingleInstanceException.vb | 14 +- .../ConsoleApplicationBase.vb | 22 +- .../NoStartupFormException.vb | 15 +- .../SingleInstanceHelpers.vb | 82 +- .../VisualBasic/ApplicationServices/User.vb | 40 +- .../WindowsFormsApplicationBase.vb | 1354 ++++++++-------- .../CompilerServices/ExceptionUtils.vb | 3 +- .../Microsoft/VisualBasic/Devices/Network.vb | 816 ---------- .../Devices/Network/NetworkAvailability.vb | 129 ++ .../Network/NetworkAvailableEventArgs.vb | 19 + .../Devices/Network/NetworkDownload.vb | 316 ++++ .../Devices/Network/NetworkPing.vb | 98 ++ .../Devices/Network/NetworkUpload.vb | 255 +++ .../Devices/Network/NetworkUtilities.vb | 88 ++ .../Devices/Network/WebClientExtended.vb | 75 + .../Logging/FileLogTraceListener.vb | 1381 +++++++++-------- 19 files changed, 2576 insertions(+), 2388 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 4e491b56a94..995e0150bff 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -13,42 +13,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Class ApplicationBase - Public Sub New() - End Sub - - ''' - ''' Returns the value of the specified environment variable. - ''' - ''' A String containing the name of the environment variable. - ''' A string containing the value of the environment variable. - ''' if name is Nothing. - ''' if the specified environment variable does not exist. - Public Function GetEnvironmentVariable(name As String) As String - - ' Framework returns Null if not found. - Dim variableValue As String = Environment.GetEnvironmentVariable(name) + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo - ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If variableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) - End If + 'Lazy-initialized and cached log object. + Private _log As Logging.Log - Return variableValue - End Function + Public Sub New() + End Sub ''' - ''' Provides access to logging capability. + ''' Gets the information about the current culture used by the current thread. ''' - ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. - ''' - Public ReadOnly Property Log() As Logging.Log + Public ReadOnly Property Culture() As Globalization.CultureInfo Get - If _log Is Nothing Then - _log = New Logging.Log - End If - Return _log + Return Thread.CurrentThread.CurrentCulture End Get End Property @@ -67,11 +46,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the information about the current culture used by the current thread. + ''' Provides access to logging capability. ''' - Public ReadOnly Property Culture() As Globalization.CultureInfo + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' + Public ReadOnly Property Log() As Logging.Log Get - Return Thread.CurrentThread.CurrentCulture + If _log Is Nothing Then + _log = New Logging.Log + End If + Return _log End Get End Property @@ -112,10 +98,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - 'Lazy-initialized and cached log object. - Private _log As Logging.Log - ' The executing application (the EntryAssembly) - Private _info As AssemblyInfo + ''' + ''' Returns the value of the specified environment variable. + ''' + ''' A String containing the name of the environment variable. + ''' A string containing the value of the environment variable. + ''' if name is Nothing. + ''' if the specified environment variable does not exist. + Public Function GetEnvironmentVariable(name As String) As String + + ' Framework returns Null if not found. + Dim variableValue As String = Environment.GetEnvironmentVariable(name) + + ' Since the explicitly requested a specific environment variable and we couldn't find it, throw + If variableValue Is Nothing Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + End If + + Return variableValue + End Function End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 0033ac0ad62..7c6ac816137 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -30,12 +30,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property Font As Font - ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. - ''' - Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT - ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' @@ -44,5 +38,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property HighDpiMode As HighDpiMode + ''' + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' + Public Property MinimumSplashScreenDisplayTime As Integer = + WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index ee017140e55..5afb2636fcc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -18,6 +18,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' reduced to a number of relevant properties. ''' Public Class AssemblyInfo + ' The assembly with the information. Private ReadOnly _assembly As Assembly @@ -25,14 +26,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' String.Empty is not Nothing so use Nothing to mark an un-accessed property. ' Cache the assembly's company name. Private _companyName As String + ' Cache the assembly's copyright. Private _copyright As String + ' Cache the assembly's description. Private _description As String + ' Cache the assembly's product name. Private _productName As String + ' Cache the assembly's title. Private _title As String + ' Cache the assembly's trademark. Private _trademark As String @@ -48,29 +54,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the description associated with the assembly. + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' - ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. - ''' if the AssemblyDescriptionAttribute is not defined. - Public ReadOnly Property Description() As String + ''' A String containing the file name. + Public ReadOnly Property AssemblyName() As String Get - If _description Is Nothing Then - Dim attribute As AssemblyDescriptionAttribute = - CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) - If attribute Is Nothing Then - _description = String.Empty - Else - _description = attribute.Description - End If - End If - Return _description + Return _assembly.GetName.Name End Get End Property ''' ''' Gets the company name associated with the assembly. ''' - ''' A String containing the AssemblyCompanyAttribute associated with the assembly. + ''' A String containing the AssemblyCompanyAttribute associated with the assembly. ''' if the AssemblyCompanyAttribute is not defined. Public ReadOnly Property CompanyName() As String Get @@ -87,30 +83,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - ''' - ''' Gets the company name associated with the assembly. - ''' - ''' A String containing the AssemblyTitleAttribute associated with the assembly. - ''' if the AssemblyTitleAttribute is not defined. - Public ReadOnly Property Title() As String - Get - If _title Is Nothing Then - Dim attribute As AssemblyTitleAttribute = - CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If attribute Is Nothing Then - _title = String.Empty - Else - _title = attribute.Title - End If - End If - Return _title - End Get - End Property - ''' ''' Gets the copyright notices associated with the assembly. ''' - ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. + ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. ''' if the AssemblyCopyrightAttribute is not defined. Public ReadOnly Property Copyright() As String Get @@ -127,28 +103,53 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the description associated with the assembly. ''' - ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. - ''' if the AssemblyTrademarkAttribute is not defined. - Public ReadOnly Property Trademark() As String + ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. + ''' if the AssemblyDescriptionAttribute is not defined. + Public ReadOnly Property Description() As String Get - If _trademark Is Nothing Then - Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If _description Is Nothing Then + Dim attribute As AssemblyDescriptionAttribute = + CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) If attribute Is Nothing Then - _trademark = String.Empty + _description = String.Empty Else - _trademark = attribute.Trademark + _description = attribute.Description End If End If - Return _trademark + Return _description + End Get + End Property + + ''' + ''' Gets the directory where the assembly lives. + ''' + Public ReadOnly Property DirectoryPath() As String + Get + Return IO.Path.GetDirectoryName(_assembly.Location) + End Get + End Property + + ''' + ''' Returns the names of all assemblies loaded by the current application. + ''' + ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. + ''' attempt on an unloaded application domain. + Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + Get + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) + Next + Return New ReadOnlyCollection(Of Assembly)(result) End Get End Property ''' ''' Gets the product name associated with the assembly. ''' - ''' A String containing the AssemblyProductAttribute associated with the assembly. + ''' A String containing the AssemblyProductAttribute associated with the assembly. ''' if the AssemblyProductAttribute is not defined. Public ReadOnly Property ProductName() As String Get @@ -165,67 +166,72 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the version number of the assembly. - ''' - ''' A System.Version class containing the version number of the assembly. - ''' Cannot use AssemblyVersionAttribute since it always return Nothing. - Public ReadOnly Property Version() As Version - Get - Return _assembly.GetName().Version - End Get - End Property - - ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Returns the current stack trace information. ''' - ''' A String containing the file name. - Public ReadOnly Property AssemblyName() As String + ''' A string containing stack trace information. Value can be String.Empty. + ''' The requested stack trace information is out of range. + Public ReadOnly Property StackTrace() As String Get - Return _assembly.GetName.Name + Return Environment.StackTrace End Get End Property ''' - ''' Gets the directory where the assembly lives. + ''' Gets the company name associated with the assembly. ''' - Public ReadOnly Property DirectoryPath() As String + ''' A String containing the AssemblyTitleAttribute associated with the assembly. + ''' if the AssemblyTitleAttribute is not defined. + Public ReadOnly Property Title() As String Get - Return IO.Path.GetDirectoryName(_assembly.Location) + If _title Is Nothing Then + Dim attribute As AssemblyTitleAttribute = + CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) + If attribute Is Nothing Then + _title = String.Empty + Else + _title = attribute.Title + End If + End If + Return _title End Get End Property ''' - ''' Returns the names of all assemblies loaded by the current application. + ''' Gets the trademark notices associated with the assembly. ''' - ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. - ''' attempt on an unloaded application domain. - Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. + ''' if the AssemblyTrademarkAttribute is not defined. + Public ReadOnly Property Trademark() As String Get - Dim result As New Collection(Of Assembly) - For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - result.Add(assembly) - Next - Return New ReadOnlyCollection(Of Assembly)(result) + If _trademark Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If attribute Is Nothing Then + _trademark = String.Empty + Else + _trademark = attribute.Trademark + End If + End If + Return _trademark End Get End Property ''' - ''' Returns the current stack trace information. + ''' Gets the version number of the assembly. ''' - ''' A string containing stack trace information. Value can be String.Empty. - ''' The requested stack trace information is out of range. - Public ReadOnly Property StackTrace() As String + ''' A System.Version class containing the version number of the assembly.> + ''' Cannot use AssemblyVersionAttribute since it always return Nothing. + Public ReadOnly Property Version() As Version Get - Return Environment.StackTrace + Return _assembly.GetName().Version End Get End Property ''' ''' Gets the amount of physical memory mapped to the process context. ''' - ''' + ''' ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. - ''' + ''' Public ReadOnly Property WorkingSet() As Long Get Return Environment.WorkingSet @@ -236,7 +242,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. ''' ''' The type of the required attribute. - ''' The attribute with the given type gotten from the assembly, or Nothing. + ''' + ''' The attribute with the given type gotten from the assembly, or Nothing. + ''' Private Function GetAttribute(attributeType As Type) As Object Debug.Assert(_assembly IsNot Nothing, "Null m_Assembly") diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index f79a4ee9b8f..f05ab60a321 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -15,6 +15,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Class CantStartSingleInstanceException : Inherits Exception + ' Deserialization constructor must be defined since we are serializable + + + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + End Sub + ''' ''' Creates a new exception ''' @@ -30,12 +37,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New(message, inner) End Sub - ' Deserialization constructor must be defined since we are serializable - - - Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 029cbd64537..1c4819c065b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -26,6 +26,17 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New() End Sub + ''' + ''' Allows derived classes to set what the command line should look like. calls this + ''' for instance because we snag the command line from Main(). + ''' + + Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) + Set(value As ObjectModel.ReadOnlyCollection(Of String)) + _commandLineArgs = value + End Set + End Property + ''' ''' Returns the command line arguments for the current application. ''' @@ -50,16 +61,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - ''' - ''' Allows derived classes to set what the command line should look like. calls this - ''' for instance because we snag the command line from Main(). - ''' - - Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) - Set(value As ObjectModel.ReadOnlyCollection(Of String)) - _commandLineArgs = value - End Set - End Property - End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index c890afde63a..49f9d9a2a56 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -5,7 +5,6 @@ Imports System.ComponentModel Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils - Namespace Microsoft.VisualBasic.ApplicationServices ''' @@ -15,6 +14,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Class NoStartupFormException : Inherits Exception + ' De-serialization constructor must be defined since we are serializable + + + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + End Sub + ''' ''' Creates a new exception ''' @@ -30,12 +36,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New(message, inner) End Sub - ' De-serialization constructor must be defined since we are serializable - - - Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb index b48d061c571..1a57fd6e201 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb @@ -12,47 +12,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices Friend Module SingleInstanceHelpers Private Const NamedPipeOptions As PipeOptions = PipeOptions.Asynchronous Or PipeOptions.CurrentUserOnly - Friend Function TryCreatePipeServer(pipeName As String, ByRef pipeServer As NamedPipeServerStream) As Boolean - Try - pipeServer = New NamedPipeServerStream( - pipeName:=pipeName, - direction:=PipeDirection.In, - maxNumberOfServerInstances:=1, - transmissionMode:=PipeTransmissionMode.Byte, - options:=NamedPipeOptions) - Return True - Catch ex As Exception - pipeServer = Nothing - Return False - End Try - End Function - - Friend Async Function WaitForClientConnectionsAsync(pipeServer As NamedPipeServerStream, callback As Action(Of String()), cancellationToken As CancellationToken) As Task - While True - cancellationToken.ThrowIfCancellationRequested() - Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) - Try - Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) - If args IsNot Nothing Then - callback(args) - End If - Finally - pipeServer.Disconnect() - End Try - End While - End Function - - Friend Async Function SendSecondInstanceArgsAsync(pipeName As String, args As String(), cancellationToken As CancellationToken) As Task - Using pipeClient As New NamedPipeClientStream( - serverName:=".", - pipeName:=pipeName, - direction:=PipeDirection.Out, - options:=NamedPipeOptions) - Await pipeClient.ConnectAsync(cancellationToken).ConfigureAwait(False) - Await WriteArgsAsync(pipeClient, args, cancellationToken).ConfigureAwait(False) - End Using - End Function - Private Async Function ReadArgsAsync(pipeServer As NamedPipeServerStream, cancellationToken As CancellationToken) As Task(Of String()) Const bufferLength As Integer = 1024 Dim buffer As Byte() = New Byte(bufferLength - 1) {} @@ -84,5 +43,46 @@ Namespace Microsoft.VisualBasic.ApplicationServices Await pipeClient.WriteAsync(content.AsMemory(0, content.Length), cancellationToken).ConfigureAwait(False) End Function + Friend Async Function SendSecondInstanceArgsAsync(pipeName As String, args As String(), cancellationToken As CancellationToken) As Task + Using pipeClient As New NamedPipeClientStream( + serverName:=".", + pipeName:=pipeName, + direction:=PipeDirection.Out, + options:=NamedPipeOptions) + Await pipeClient.ConnectAsync(cancellationToken).ConfigureAwait(False) + Await WriteArgsAsync(pipeClient, args, cancellationToken).ConfigureAwait(False) + End Using + End Function + + Friend Function TryCreatePipeServer(pipeName As String, ByRef pipeServer As NamedPipeServerStream) As Boolean + Try + pipeServer = New NamedPipeServerStream( + pipeName:=pipeName, + direction:=PipeDirection.In, + maxNumberOfServerInstances:=1, + transmissionMode:=PipeTransmissionMode.Byte, + options:=NamedPipeOptions) + Return True + Catch ex As Exception + pipeServer = Nothing + Return False + End Try + End Function + + Friend Async Function WaitForClientConnectionsAsync(pipeServer As NamedPipeServerStream, callback As Action(Of String()), cancellationToken As CancellationToken) As Task + While True + cancellationToken.ThrowIfCancellationRequested() + Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) + Try + Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) + If args IsNot Nothing Then + callback(args) + End If + Finally + pipeServer.Disconnect() + End Try + End While + End Function + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index 134272fc87d..5234d3e88b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -19,12 +19,20 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The name of the current user + ''' The principal representing the current user. ''' - Public ReadOnly Property Name() As String + ''' An IPrincipal representing the current user + ''' + ''' This should be overridden by derived classes that don't get the current + ''' user from the current thread + ''' + Protected Overridable Property InternalPrincipal() As IPrincipal Get - Return InternalPrincipal.Identity.Name + Return Thread.CurrentPrincipal End Get + Set(value As IPrincipal) + Thread.CurrentPrincipal = value + End Set End Property ''' @@ -50,6 +58,15 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property + ''' + ''' The name of the current user + ''' + Public ReadOnly Property Name() As String + Get + Return InternalPrincipal.Identity.Name + End Get + End Property + ''' ''' Indicates whether or not the current user is a member of the passed in role ''' @@ -59,22 +76,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Return InternalPrincipal.IsInRole(role) End Function - ''' - ''' The principal representing the current user. - ''' - ''' An IPrincipal representing the current user - ''' - ''' This should be overridden by derived classes that don't get the current - ''' user from the current thread - ''' - Protected Overridable Property InternalPrincipal() As IPrincipal - Get - Return Thread.CurrentPrincipal - End Get - Set(value As IPrincipal) - Thread.CurrentPrincipal = value - End Set - End Property - End Class 'User End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 34d1de1ee0d..760e7d12fbf 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -15,18 +15,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices - ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). - Public Enum AuthenticationMode - Windows - ApplicationDefined - End Enum - - ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). - Public Enum ShutdownMode - AfterMainFormCloses - AfterAllFormsClose - End Enum - ''' ''' Signature for the ApplyApplicationDefaults event handler. ''' @@ -34,22 +22,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub ApplyApplicationDefaultsEventHandler(sender As Object, e As ApplyApplicationDefaultsEventArgs) ''' - ''' Signature for the Startup event handler. + ''' Signature for the Shutdown event handler. ''' - Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) + Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) ''' - ''' Signature for the StartupNextInstance event handler. + ''' Signature for the Startup event handler. ''' - Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) + Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) ''' - ''' Signature for the Shutdown event handler. + ''' Signature for the StartupNextInstance event handler. ''' - Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) + Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) ''' ''' Signature for the UnhandledException event handler. @@ -57,210 +45,86 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As UnhandledExceptionEventArgs) + ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). + Public Enum AuthenticationMode + Windows + ApplicationDefined + End Enum + + ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). + Public Enum ShutdownMode + AfterMainFormCloses + AfterAllFormsClose + End Enum + ''' ''' Provides the infrastructure for the VB Windows Forms application model. ''' ''' Don't put access on this definition. Partial Public Class WindowsFormsApplicationBase : Inherits ConsoleApplicationBase - ''' - ''' Occurs when the application is ready to accept default values for various application areas. - ''' - Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler - - ''' - ''' Occurs when the application starts. - ''' - Public Event Startup As StartupEventHandler - - ''' - ''' Occurs when attempting to start a single-instance application and the application is already active. - ''' - Public Event StartupNextInstance As StartupNextInstanceEventHandler - - ''' - ''' Occurs when the application shuts down. - ''' - Public Event Shutdown As ShutdownEventHandler - - ' Used to marshal a call to Dispose on the Splash Screen. - Private Delegate Sub DisposeDelegate() - ' How long a subsequent instance will wait for the original instance to get on its feet. - Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. - - Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. + Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 - Private ReadOnly _splashLock As New Object Private ReadOnly _appContext As WinFormsAppContext ' Sync object Private ReadOnly _networkAvailabilityChangeLock As New Object - Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) - Private _processingUnhandledExceptionEvent As Boolean - - ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. - Private _turnOnNetworkListener As Boolean - - ' Whether we have made it through the processing of OnInitialize. - Private _finishedOnInitialize As Boolean - - Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) - Private _networkObject As Devices.Network - - ' Whether this app runs using Word like instancing behavior. - Private _isSingleInstance As Boolean - - ' Defines when the application decides to close. - Private _shutdownStyle As ShutdownMode + Private ReadOnly _splashLock As New Object - ' Whether to use Windows XP styles. - Private _enableVisualStyles As Boolean + Private _appSynchronizationContext As SynchronizationContext ' We only need to show the splash screen once. ' Protect the user from himself if they are overriding our app model. Private _didSplashScreen As Boolean - ' For splash screens with a minimum display time, this let's us know when that time - ' has expired and it is OK to close the splash screen. - Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - - Private _formLoadWaiter As AutoResetEvent - Private _splashScreen As Form + ' Whether to use Windows XP styles. + Private _enableVisualStyles As Boolean - ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. - Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - Private _splashTimer As Timers.Timer - Private _appSynchronizationContext As SynchronizationContext + ' Whether we have made it through the processing of OnInitialize. + Private _finishedOnInitialize As Boolean - ' Informs My.Settings whether to save the settings on exit or not. - Private _saveMySettingsOnExit As Boolean + Private _formLoadWaiter As AutoResetEvent ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware - ''' - ''' Occurs when the network availability changes. - ''' - Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler - ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only - ' if the user writes a handler for it. - ' The reason being that it is very expensive to handle and kills our application startup performance. - AddHandler(value As Devices.NetworkAvailableEventHandler) - SyncLock _networkAvailabilityChangeLock - If _networkAvailabilityEventHandlers Is Nothing Then - _networkAvailabilityEventHandlers = New List(Of Devices.NetworkAvailableEventHandler) - End If - - _networkAvailabilityEventHandlers.Add(value) - - ' We don't want to create the network object now - it takes a snapshot - ' of the executionContext and our IPrincipal isn't on the thread yet. - ' We know we need to create it and we will at the appropriate time - _turnOnNetworkListener = True - - ' But the user may be doing an AddHandler of their own in which case we need - ' to make sure to honor the request. If we aren't past OnInitialize() yet - ' we shouldn't do it but the flag above catches that case. - If _networkObject Is Nothing AndAlso _finishedOnInitialize Then - _networkObject = New Devices.Network - Dim windowsFormsApplicationBase As WindowsFormsApplicationBase = Me - AddHandler _networkObject.NetworkAvailabilityChanged, - AddressOf windowsFormsApplicationBase.NetworkAvailableEventAdaptor - End If - End SyncLock - End AddHandler - - RemoveHandler(value As Devices.NetworkAvailableEventHandler) - If _networkAvailabilityEventHandlers IsNot Nothing AndAlso - _networkAvailabilityEventHandlers.Count > 0 Then - - _networkAvailabilityEventHandlers.Remove(value) - - ' Last one to leave - turn out the lights... - If _networkAvailabilityEventHandlers.Count = 0 Then - RemoveHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor - If _networkObject IsNot Nothing Then - - ' Stop listening to network change events because we are going to go away. - _networkObject.DisconnectListener() + ' Whether this app runs using Word like instancing behavior. + Private _isSingleInstance As Boolean - ' No sense holding on to this if nobody is listening. - _networkObject = Nothing - End If - End If - End If - End RemoveHandler + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. + Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) - If _networkAvailabilityEventHandlers IsNot Nothing Then - For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers - Try - If handler IsNot Nothing Then handler.Invoke(sender, e) - Catch ex As Exception - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) - ' The user didn't write a handler so throw the error up the chain. - Throw - End If - End Try - Next - End If - End RaiseEvent - End Event + Private _networkObject As Devices.Network - ''' - ''' Occurs when the application encounters an . - ''' - Public Custom Event UnhandledException As UnhandledExceptionEventHandler + Private _processingUnhandledExceptionEvent As Boolean - ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event - ' if the user is handling this event because the act of listening to Application.ThreadException - ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that - ' the user wrote their own handler to deal with the error instead. - AddHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers Is Nothing Then - _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) - End If + ' Informs My.Settings whether to save the settings on exit or not. + Private _saveMySettingsOnExit As Boolean - _unhandledExceptionHandlers.Add(value) + ' Defines when the application decides to close. + Private _shutdownStyle As ShutdownMode - ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception - If _unhandledExceptionHandlers.Count = 1 Then - AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End AddHandler + Private _splashScreen As Form - RemoveHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers IsNot Nothing AndAlso - _unhandledExceptionHandlers.Count > 0 Then - _unhandledExceptionHandlers.Remove(value) + ' For splash screens with a minimum display time, this let's us know when that time + ' has expired and it is OK to close the splash screen. + Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - ' Last one to leave, turn out the lights... - If _unhandledExceptionHandlers.Count = 0 Then - RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End If - End RemoveHandler + Private _splashTimer As Timers.Timer - RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) - If _unhandledExceptionHandlers IsNot Nothing Then + ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. + Private _turnOnNetworkListener As Boolean - ' In the case that we throw from the handler, we don't want to - ' run the handler again. - _processingUnhandledExceptionEvent = True + Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) - For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers - handler?.Invoke(sender, e) - Next + Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 - ' Now that we are out of the handler, treat exceptions normally again. - _processingUnhandledExceptionEvent = False - End If - End RaiseEvent - End Event + ' Used to marshal a call to Dispose on the Splash Screen. + Private Delegate Sub DisposeDelegate() ''' ''' Constructs the application Shutdown/Startup model object @@ -310,79 +174,86 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' Use GDI for the text rendering engine by default. + ''' The user can shadow this function to return True if they want their app + ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' determine how to set the text rendering flag on the WinForms application object. ''' - ''' The command line from Main(). - - Public Sub Run(commandLine As String()) - - ' Prime the command line args with what we receive from Main() so that Click-Once windows - ' apps don't have to do a System.Environment call which would require permissions. - InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) - - If Not IsSingleInstance Then - DoApplicationModel() - Else - ' This is a Single-Instance application + ''' True - Use GDI+ renderer. False - use GDI renderer. + + Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Get + Return False + End Get + End Property - ' Note: Must pass the calling assembly from here so we can get the running app. - ' Otherwise, can break single instance. - Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) - Dim pipeServer As NamedPipeServerStream = Nothing + ''' + ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. + ''' + Protected Property EnableVisualStyles() As Boolean + Get + Return _enableVisualStyles + End Get + Set(value As Boolean) + _enableVisualStyles = value + End Set + End Property - If TryCreatePipeServer(applicationInstanceID, pipeServer) Then + ''' + ''' Gets or sets the HighDpiMode for the Application. + ''' + + Protected Property HighDpiMode() As HighDpiMode + Get + Return _highDpiMode + End Get + Set(value As HighDpiMode) + _highDpiMode = value + End Set + End Property - ' --- This is the first instance of a single-instance application to run. - ' This is the instance that subsequent instances will attach to. - Using pipeServer - Dim tokenSource As New CancellationTokenSource() -#Disable Warning BC42358 ' Call is not awaited. - WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) -#Enable Warning BC42358 - DoApplicationModel() - tokenSource.Cancel() - End Using - Else + + Protected Property IsSingleInstance() As Boolean + Get + Return _isSingleInstance + End Get + Set(value As Boolean) + _isSingleInstance = value + End Set + End Property - ' --- We are launching a subsequent instance. - Dim tokenSource As New CancellationTokenSource() - tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) - Try - Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) - awaitable.GetAwaiter().GetResult() - Catch ex As Exception - Throw New CantStartSingleInstanceException() - End Try - End If - End If 'Single-Instance application - End Sub + ''' + ''' Determines when this application will terminate (when the main form goes down, all forms) + ''' + Protected Friend Property ShutdownStyle() As ShutdownMode + Get + Return _shutdownStyle + End Get + Set(value As ShutdownMode) + ValidateShutdownModeEnumValue(value, NameOf(value)) + _shutdownStyle = value + End Set + End Property ''' - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. + ''' Provides the WinForms application context that we are running on ''' - Public ReadOnly Property OpenForms() As FormCollection + + Public ReadOnly Property ApplicationContext() As ApplicationContext Get - Return Application.OpenForms + Return _appContext End Get End Property ''' - ''' Provides access to the main form for this application + ''' Informs My.Settings whether to save the settings on exit or not ''' - Protected Property MainForm() As Form + Public Property SaveMySettingsOnExit() As Boolean Get - Return _appContext?.MainForm + Return _saveMySettingsOnExit End Get - Set(value As Form) - If value Is Nothing Then - Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") - End If - If value Is _splashScreen Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) - End If - _appContext.MainForm = value + Set(value As Boolean) + _saveMySettingsOnExit = value End Set End Property @@ -404,6 +275,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property + ''' + ''' Provides access to the main form for this application + ''' + Protected Property MainForm() As Form + Get + Return _appContext?.MainForm + End Get + Set(value As Form) + If value Is Nothing Then + Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + End If + If value Is _splashScreen Then + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + End If + _appContext.MainForm = value + End Set + End Property + ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash ''' screen should be displayed for. When not set then the splash screen is hidden @@ -428,437 +317,281 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Use GDI for the text rendering engine by default. - ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to - ''' determine how to set the text rendering flag on the WinForms application object. + ''' Returns the collection of forms that are open. We no longer have thread + ''' affinity meaning that this is the WinForms collection that contains Forms that may + ''' have been opened on another thread then the one we are calling in on right now. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer. - - Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Public ReadOnly Property OpenForms() As FormCollection Get - Return False + Return Application.OpenForms End Get End Property ''' - ''' Provides the WinForms application context that we are running on + ''' Occurs when the application is ready to accept default values for various application areas. ''' - - Public ReadOnly Property ApplicationContext() As ApplicationContext - Get - Return _appContext - End Get - End Property + Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler ''' - ''' Informs My.Settings whether to save the settings on exit or not + ''' Occurs when the application shuts down. ''' - Public Property SaveMySettingsOnExit() As Boolean - Get - Return _saveMySettingsOnExit - End Get - Set(value As Boolean) - _saveMySettingsOnExit = value - End Set - End Property + Public Event Shutdown As ShutdownEventHandler ''' - ''' Processes all windows messages currently in the message queue + ''' Occurs when the application starts. ''' - Public Sub DoEvents() - Application.DoEvents() - End Sub + Public Event Startup As StartupEventHandler ''' - ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows - ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its - ''' variants was passed in. + ''' Occurs when attempting to start a single-instance application and the application is already active. ''' - ''' - ''' Returning True indicates that we should continue on with the application Startup sequence. - ''' - ''' This extensibility point is exposed for people who want to override - ''' the Startup sequence at the earliest possible point to - ''' - - Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean - - ' Rationale for how we process the default values and how we let the user modify - ' them on demand via the ApplyApplicationDefaults event. - ' =========================================================================================== - ' a) Users used to be able to set MinimumSplashScreenDisplayTime _only_ by overriding OnInitialize - ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. - ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents - ' where it could be modified (again). So event wins over Override over default value (2 seconds). - ' b) We feed the default HighDpiMode (SystemAware) to the EventArgs. With the introduction of - ' the HighDpiMode property, we give Project System the chance to reflect the HighDpiMode - ' in the App Designer UI and have it code-generated based on a modified Application.myapp, which - ' would result it to be set in the derived constructor. (See the hidden file in the Solution Explorer - ' "My Project\Application.myapp\Application.Designer.vb for how those UI-set values get applied.) - ' Once all this is done, we give the User another chance to change the value by code through - ' the ApplyDefaults event. - ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! - Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( - MinimumSplashScreenDisplayTime, - HighDpiMode) With - { - .MinimumSplashScreenDisplayTime = MinimumSplashScreenDisplayTime - } + Public Event StartupNextInstance As StartupNextInstanceEventHandler - RaiseEvent ApplyApplicationDefaults(Me, applicationDefaultsEventArgs) + ' milliseconds. - If (applicationDefaultsEventArgs.Font IsNot Nothing) Then - Application.SetDefaultFont(applicationDefaultsEventArgs.Font) - End If + ''' + ''' Occurs when the application encounters an . + ''' + Public Custom Event UnhandledException As UnhandledExceptionEventHandler - MinimumSplashScreenDisplayTime = applicationDefaultsEventArgs.MinimumSplashScreenDisplayTime + ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException + ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' if the user is handling this event because the act of listening to Application.ThreadException + ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that + ' the user wrote their own handler to deal with the error instead. + AddHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers Is Nothing Then + _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) + End If - ' This creates the native window, and that means, we can no longer apply a different Default Font. - ' So, this is the earliest point in time to set the AsyncOperationManager's SyncContext. - AsyncOperationManager.SynchronizationContext = New WindowsFormsSynchronizationContext() + _unhandledExceptionHandlers.Add(value) - _highDpiMode = applicationDefaultsEventArgs.HighDpiMode + ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception + If _unhandledExceptionHandlers.Count = 1 Then + AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End AddHandler - ' Then, it's applying what we got back as HighDpiMode. - Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) - If dpiSetResult Then - _highDpiMode = Application.HighDpiMode - End If - Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") + RemoveHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers IsNot Nothing AndAlso + _unhandledExceptionHandlers.Count > 0 Then + _unhandledExceptionHandlers.Remove(value) - ' And finally we take care of EnableVisualStyles. - If _enableVisualStyles Then - Application.EnableVisualStyles() - End If + ' Last one to leave, turn out the lights... + If _unhandledExceptionHandlers.Count = 0 Then + RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End If + End RemoveHandler - ' We'll handle "/nosplash" for you. - If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then - ShowSplashScreen() - End If + RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) + If _unhandledExceptionHandlers IsNot Nothing Then - _finishedOnInitialize = True + ' In the case that we throw from the handler, we don't want to + ' run the handler again. + _processingUnhandledExceptionEvent = True - ' We are now at a point where we can allow the network object - ' to be created since the iPrincipal is on the thread by now. + For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers + handler?.Invoke(sender, e) + Next - ' True means to not bail out but keep on running after OnInitialize() finishes - Return True - End Function + ' Now that we are out of the handler, treat exceptions normally again. + _processingUnhandledExceptionEvent = False + End If + End RaiseEvent + End Event + ' milliseconds. ''' - ''' Extensibility point which raises the Startup event + ''' Occurs when the network availability changes. ''' - ''' - - Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean + Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler + ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only + ' if the user writes a handler for it. + ' The reason being that it is very expensive to handle and kills our application startup performance. + AddHandler(value As Devices.NetworkAvailableEventHandler) + SyncLock _networkAvailabilityChangeLock + If _networkAvailabilityEventHandlers Is Nothing Then + _networkAvailabilityEventHandlers = New List(Of Devices.NetworkAvailableEventHandler) + End If - eventArgs.Cancel = False + _networkAvailabilityEventHandlers.Add(value) - ' It is important not to create the network object until the ExecutionContext has everything on it. - ' By now the principal will be on the thread so we can create the network object. - ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() - ' which makes a copy of the executionContext. That execution context shows up on your thread during - ' the callback so I delay creating the network object (and consequently the capturing of the execution context) - ' until the principal has been set on the thread. This avoids the problem where My.User isn't set - ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future - ' callback that involved the asyncOperationsManager so this is where we need to create objects that - ' have a asyncOperationsContext in them. - If _turnOnNetworkListener And _networkObject Is Nothing Then + ' We don't want to create the network object now - it takes a snapshot + ' of the executionContext and our IPrincipal isn't on the thread yet. + ' We know we need to create it and we will at the appropriate time + _turnOnNetworkListener = True - ' The is-nothing-check is to avoid hooking the object more than once. - _networkObject = New Devices.Network - AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor - End If + ' But the user may be doing an AddHandler of their own in which case we need + ' to make sure to honor the request. If we aren't past OnInitialize() yet + ' we shouldn't do it but the flag above catches that case. + If _networkObject Is Nothing AndAlso _finishedOnInitialize Then + _networkObject = New Devices.Network + Dim windowsFormsApplicationBase As WindowsFormsApplicationBase = Me + AddHandler _networkObject.NetworkAvailabilityChanged, + AddressOf windowsFormsApplicationBase.NetworkAvailableEventAdaptor + End If + End SyncLock + End AddHandler - RaiseEvent Startup(Me, eventArgs) + RemoveHandler(value As Devices.NetworkAvailableEventHandler) + If _networkAvailabilityEventHandlers IsNot Nothing AndAlso + _networkAvailabilityEventHandlers.Count > 0 Then - Return Not eventArgs.Cancel - End Function + _networkAvailabilityEventHandlers.Remove(value) - ''' - ''' Extensibility point which raises the StartupNextInstance - ''' - ''' - - - Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) + ' Last one to leave - turn out the lights... + If _networkAvailabilityEventHandlers.Count = 0 Then + RemoveHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor + If _networkObject IsNot Nothing Then - RaiseEvent StartupNextInstance(Me, eventArgs) + ' Stop listening to network change events because we are going to go away. + _networkObject.DisconnectListener() - ' Activate the original instance. - If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then - If MainForm.WindowState = FormWindowState.Minimized Then - MainForm.WindowState = FormWindowState.Normal + ' No sense holding on to this if nobody is listening. + _networkObject = Nothing + End If + End If End If + End RemoveHandler - MainForm.Activate() - End If - End Sub + RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) + If _networkAvailabilityEventHandlers IsNot Nothing Then + For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers + Try + If handler IsNot Nothing Then handler.Invoke(sender, e) + Catch ex As Exception + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + + ' The user didn't write a handler so throw the error up the chain. + Throw + End If + End Try + Next + End If + End RaiseEvent + End Event ''' - ''' At this point, the command line args should have been processed and the application will create the - ''' main form and enter the message loop. + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. ''' - - - Protected Overridable Sub OnRun() + ''' + ''' + ''' A string unique to the application that should be the same for versions of + ''' the application that have the same Major and Minor Version Number. + ''' + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String - If MainForm Is Nothing Then + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() - ' A designer overrides OnCreateMainForm() to set the main form we are supposed to use. - OnCreateMainForm() + If guidAttrib IsNot Nothing Then - If MainForm Is Nothing Then - Throw New NoStartupFormException - End If + Dim version As Version = entry.GetName.Version - ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to - ' block the main form from painting. To do that I let the form get past the Load() event and hold it until - ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of - ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. - AddHandler MainForm.Load, AddressOf MainFormLoadingDone + If version IsNot Nothing Then + Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" + Else + Return guidAttrib.Value + End If End If - ' Run() eats all exceptions (unless running under the debugger). If the user wrote an - ' UnhandledException handler we will hook the System.Windows.Forms.Application.ThreadException event - ' (see Public Custom Event UnhandledException) which will raise our UnhandledException Event. - ' If our user didn't write an UnhandledException event, then we land in the try/catch handler for Forms.Application.Run(). - Try - Application.Run(_appContext) - Finally - - ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) - ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it - ' can't fire any events in response to changing network availability conditions through a dead context. - If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() - - 'Restore the prior sync context. - AsyncOperationManager.SynchronizationContext = _appSynchronizationContext - _appSynchronizationContext = Nothing - End Try - End Sub - - ''' - ''' A designer will override this method and provide a splash screen if this application has one. - ''' - ''' - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app - ''' - - Protected Overridable Sub OnCreateSplashScreen() - End Sub + Return entry.ManifestModule.ModuleVersionId.ToString() + End Function ''' - ''' Provides a hook that designers will override to set the main form. + ''' Validates that the value being passed as an AuthenticationMode enum is a legal value ''' - - Protected Overridable Sub OnCreateMainForm() + ''' + Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) + If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) + End If End Sub ''' - ''' The last in a series of extensibility points for the Shutdown process + ''' Validates that the value being passed as an ShutdownMode enum is a legal value ''' - - Protected Overridable Sub OnShutdown() - RaiseEvent Shutdown(Me, EventArgs.Empty) + ''' + Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) + If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) + End If End Sub ''' - ''' Raises the event and exits the application if the event handler indicated - ''' that execution shouldn't continue. + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' it doesn't freeze up while the main form is getting it together. ''' - ''' - ''' True indicates the exception event was raised / False it was not. - - Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean - - ' Does the user have a handler for this event? - If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then + Private Sub DisplaySplash() + Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - ' We don't put a try/catch around the handler event so that exceptions in there will - ' bubble out - else we will have a recursive exception handler. - RaiseEvent UnhandledException(Me, e) - If e.ExitApplication Then Application.Exit() + If _splashTimer IsNot Nothing Then - ' User handled the event. - Return True + ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. + ' Enable the timer now that we are about to show the splash screen. + _splashTimer.Enabled = True End If - ' Nobody was listening to the UnhandledException event. - Return False - End Function + Application.Run(_splashScreen) + End Sub ''' - ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, - ''' displays it. + ''' Runs the user's program through the VB Startup/Shutdown application model ''' - - Protected Sub ShowSplashScreen() - If Not _didSplashScreen Then - _didSplashScreen = True + Private Sub DoApplicationModel() - If _splashScreen Is Nothing Then + Dim eventArgs As New StartupEventArgs(CommandLineArgs) - ' If the user specified a splash screen, the designer will have overridden this method to set it. - OnCreateSplashScreen() - End If + ' Only do the try/catch if we aren't running under the debugger. + ' If we do try/catch under the debugger the debugger never gets + ' a crack at exceptions which breaks the exception helper. + If Not Debugger.IsAttached Then - If _splashScreen IsNot Nothing Then + ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code + ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) + ' need to be mirrored in the ELSE debugger attached clause below. + Try + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If + Catch ex As Exception - ' Some splash screens have minimum face time they are supposed to get. - ' We'll set up a time to let us know when we can take it down. - If _minimumSplashExposure > 0 Then + ' This catch is for exceptions that happen during the On* methods above, + ' but have occurred outside of the message pump (which exceptions we would + ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). + If _processingUnhandledExceptionEvent Then - ' Don't close until the timer expires. - _splashTimer = New Timers.Timer(_minimumSplashExposure) - AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp - _splashTimer.AutoReset = False + ' If the UnhandledException handler threw for some reason, throw that error out to the system. + Throw + Else - ' We only need this, when we actually need to wait for it. - _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) + ' We had an exception, but not during the OnUnhandledException handler so give the user + ' a chance to look at what happened in the UnhandledException event handler + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then - ' We'll enable it in DisplaySplash() once the splash screen thread gets running. + ' The user didn't write a handler so throw the error out to the system + Throw + End If + End If + End Try + Else + ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception + ' will bubble out to the exception helper. + ' We also don't hook up the Application.ThreadException event because WinForms ignores it + ' when we are running under the debugger. + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() End If - - ' Run the splash screen on another thread so we don't starve it for events and painting - ' while the main form gets its act together. - Task.Run(AddressOf DisplaySplash) - End If - End If - End Sub - - ''' - ''' Hide the splash screen. The splash screen was created on another thread - ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. - ''' This function gets called from the main thread by the app fx. - ''' - - - Protected Sub HideSplashScreen() - - 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. - SyncLock _splashLock - - ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling - ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) - ' This is to fix the issue where the main form doesn't come to the front after the - ' Splash screen disappears. - MainForm?.Activate() - - If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then - Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) - _splashScreen.Invoke(disposeSplashDelegate) - _splashScreen = Nothing End If - End SyncLock - End Sub - - ''' - ''' Determines when this application will terminate (when the main form goes down, all forms) - ''' - Protected Friend Property ShutdownStyle() As ShutdownMode - Get - Return _shutdownStyle - End Get - Set(value As ShutdownMode) - ValidateShutdownModeEnumValue(value, NameOf(value)) - _shutdownStyle = value - End Set - End Property - - ''' - ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. - ''' - Protected Property EnableVisualStyles() As Boolean - Get - Return _enableVisualStyles - End Get - Set(value As Boolean) - _enableVisualStyles = value - End Set - End Property - - ''' - ''' Gets or sets the HighDpiMode for the Application. - ''' - - Protected Property HighDpiMode() As HighDpiMode - Get - Return _highDpiMode - End Get - Set(value As HighDpiMode) - _highDpiMode = value - End Set - End Property - - - Protected Property IsSingleInstance() As Boolean - Get - Return _isSingleInstance - End Get - Set(value As Boolean) - _isSingleInstance = value - End Set - End Property - - ''' - ''' Validates that the value being passed as an AuthenticationMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) - If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) - End If - End Sub - - ''' - ''' Validates that the value being passed as an ShutdownMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) - If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) - End If - End Sub - - ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. - ''' - Private Sub DisplaySplash() - Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - - If _splashTimer IsNot Nothing Then - - ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. - ' Enable the timer now that we are about to show the splash screen. - _splashTimer.Enabled = True - End If - - Application.Run(_splashScreen) - End Sub - - ''' - ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. - ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. - ''' - Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) - - If _splashTimer IsNot Nothing Then - - 'We only have a timer if there was a minimum timeout on the splash screen. - _splashTimer.Dispose() - _splashTimer = Nothing End If - - _splashScreenCompletionSource.SetResult(True) End Sub ''' @@ -896,16 +629,31 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event. + ''' If a splash screen has a minimum time out, then once that is up we check to see whether + ''' we should close the splash screen. If the main form has activated then we close it. + ''' Note that we are getting called on a secondary thread here which isn't necessarily + ''' associated with any form. Don't touch forms from this function. ''' - ''' - ''' - ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' event so we do the translation here before raising our event. - ''' - Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) - OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) + Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) + + If _splashTimer IsNot Nothing Then + + 'We only have a timer if there was a minimum timeout on the splash screen. + _splashTimer.Dispose() + _splashTimer = Nothing + End If + + _splashScreenCompletionSource.SetResult(True) + End Sub + + ''' + ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the + ''' NetworkAvailabilityChanged event. + ''' + ''' Contains the Network instance that raised the event. + ''' Contains whether the network is available or not. + Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) + RaiseEvent NetworkAvailabilityChanged(sender, e) End Sub Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) @@ -932,7 +680,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices SynchronizationContext. Send(Sub() handleNextInstance(), Nothing) End If - Catch ex As Exception When Not invoked ' Only catch exceptions thrown when the UI thread is not available, before ' the UI thread has been created or after it has been terminated. Exceptions @@ -941,98 +688,359 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event. + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event. ''' - ''' Contains the Network instance that raised the event. - ''' Contains whether the network is available or not. - Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) - RaiseEvent NetworkAvailabilityChanged(sender, e) + ''' + ''' + ''' Our UnHandledException event has a different signature then the Windows.Forms.Application + ''' event so we do the translation here before raising our event. + ''' + Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) + OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) End Sub ''' - ''' Runs the user's program through the VB Startup/Shutdown application model + ''' Hide the splash screen. The splash screen was created on another thread + ''' thread (main thread) than the one it was run on (secondary thread for the + ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' This function gets called from the main thread by the app fx. ''' - Private Sub DoApplicationModel() - - Dim eventArgs As New StartupEventArgs(CommandLineArgs) - - ' Only do the try/catch if we aren't running under the debugger. - ' If we do try/catch under the debugger the debugger never gets - ' a crack at exceptions which breaks the exception helper. - If Not Debugger.IsAttached Then + + + Protected Sub HideSplashScreen() - ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code - ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) - ' need to be mirrored in the ELSE debugger attached clause below. - Try - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() - End If - End If - Catch ex As Exception + 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. + SyncLock _splashLock - ' This catch is for exceptions that happen during the On* methods above, - ' but have occurred outside of the message pump (which exceptions we would - ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). - If _processingUnhandledExceptionEvent Then + ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling + ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) + ' This is to fix the issue where the main form doesn't come to the front after the + ' Splash screen disappears. + MainForm?.Activate() - ' If the UnhandledException handler threw for some reason, throw that error out to the system. - Throw - Else + If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then + Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) + _splashScreen.Invoke(disposeSplashDelegate) + _splashScreen = Nothing + End If + End SyncLock + End Sub - ' We had an exception, but not during the OnUnhandledException handler so give the user - ' a chance to look at what happened in the UnhandledException event handler - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + ''' + ''' Provides a hook that designers will override to set the main form. + ''' + + Protected Overridable Sub OnCreateMainForm() + End Sub - ' The user didn't write a handler so throw the error out to the system - Throw - End If - End If - End Try - Else - ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception - ' will bubble out to the exception helper. - ' We also don't hook up the Application.ThreadException event because WinForms ignores it - ' when we are running under the debugger. - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() - End If + ''' + ''' A designer will override this method and provide a splash screen if this application has one. + ''' + ''' + ''' For instance, a designer would override this method and emit: Me.Splash = new Splash + ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + + Protected Overridable Sub OnCreateSplashScreen() + End Sub + + ''' + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its + ''' variants was passed in. + ''' + ''' + ''' Returning True indicates that we should continue on with the application Startup sequence. + ''' + ''' This extensibility point is exposed for people who want to override + ''' the Startup sequence at the earliest possible point to + ''' + + Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean + + ' Rationale for how we process the default values and how we let the user modify + ' them on demand via the ApplyApplicationDefaults event. + ' =========================================================================================== + ' a) Users used to be able to set MinimumSplashScreenDisplayTime _only_ by overriding OnInitialize + ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. + ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents + ' where it could be modified (again). So event wins over Override over default value (2 seconds). + ' b) We feed the default HighDpiMode (SystemAware) to the EventArgs. With the introduction of + ' the HighDpiMode property, we give Project System the chance to reflect the HighDpiMode + ' in the App Designer UI and have it code-generated based on a modified Application.myapp, which + ' would result it to be set in the derived constructor. (See the hidden file in the Solution Explorer + ' "My Project\Application.myapp\Application.Designer.vb for how those UI-set values get applied.) + ' Once all this is done, we give the User another chance to change the value by code through + ' the ApplyDefaults event. + ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! + Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( + MinimumSplashScreenDisplayTime, + HighDpiMode) With + { + .MinimumSplashScreenDisplayTime = MinimumSplashScreenDisplayTime + } + + RaiseEvent ApplyApplicationDefaults(Me, applicationDefaultsEventArgs) + + If (applicationDefaultsEventArgs.Font IsNot Nothing) Then + Application.SetDefaultFont(applicationDefaultsEventArgs.Font) + End If + + MinimumSplashScreenDisplayTime = applicationDefaultsEventArgs.MinimumSplashScreenDisplayTime + + ' This creates the native window, and that means, we can no longer apply a different Default Font. + ' So, this is the earliest point in time to set the AsyncOperationManager's SyncContext. + AsyncOperationManager.SynchronizationContext = New WindowsFormsSynchronizationContext() + + _highDpiMode = applicationDefaultsEventArgs.HighDpiMode + + ' Then, it's applying what we got back as HighDpiMode. + Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) + If dpiSetResult Then + _highDpiMode = Application.HighDpiMode + End If + Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") + + ' And finally we take care of EnableVisualStyles. + If _enableVisualStyles Then + Application.EnableVisualStyles() + End If + + ' We'll handle "/nosplash" for you. + If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then + ShowSplashScreen() + End If + + _finishedOnInitialize = True + + ' We are now at a point where we can allow the network object + ' to be created since the iPrincipal is on the thread by now. + + ' True means to not bail out but keep on running after OnInitialize() finishes + Return True + End Function + + ''' + ''' At this point, the command line args should have been processed and the application will create the + ''' main form and enter the message loop. + ''' + + + Protected Overridable Sub OnRun() + + If MainForm Is Nothing Then + + ' A designer overrides OnCreateMainForm() to set the main form we are supposed to use. + OnCreateMainForm() + + If MainForm Is Nothing Then + Throw New NoStartupFormException End If + + ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to + ' block the main form from painting. To do that I let the form get past the Load() event and hold it until + ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of + ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. + AddHandler MainForm.Load, AddressOf MainFormLoadingDone End If + + ' Run() eats all exceptions (unless running under the debugger). If the user wrote an + ' UnhandledException handler we will hook the System.Windows.Forms.Application.ThreadException event + ' (see Public Custom Event UnhandledException) which will raise our UnhandledException Event. + ' If our user didn't write an UnhandledException event, then we land in the try/catch handler for Forms.Application.Run(). + Try + Application.Run(_appContext) + Finally + + ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) + ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it + ' can't fire any events in response to changing network availability conditions through a dead context. + If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() + + 'Restore the prior sync context. + AsyncOperationManager.SynchronizationContext = _appSynchronizationContext + _appSynchronizationContext = Nothing + End Try End Sub ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. + ''' The last in a series of extensibility points for the Shutdown process ''' - ''' - ''' - ''' A string unique to the application that should be the same for versions of - ''' the application that have the same Major and Minor Version Number. - ''' - ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. - Private Shared Function GetApplicationInstanceID(entry As Assembly) As String + + Protected Overridable Sub OnShutdown() + RaiseEvent Shutdown(Me, EventArgs.Empty) + End Sub - Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() + ''' + ''' Extensibility point which raises the Startup event + ''' + ''' + + Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean - If guidAttrib IsNot Nothing Then + eventArgs.Cancel = False - Dim version As Version = entry.GetName.Version + ' It is important not to create the network object until the ExecutionContext has everything on it. + ' By now the principal will be on the thread so we can create the network object. + ' The timing is important because the network object has an AsyncOperationsManager in it that marshals + ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' which makes a copy of the executionContext. That execution context shows up on your thread during + ' the callback so I delay creating the network object (and consequently the capturing of the execution context) + ' until the principal has been set on the thread. This avoids the problem where My.User isn't set + ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future + ' callback that involved the asyncOperationsManager so this is where we need to create objects that + ' have a asyncOperationsContext in them. + If _turnOnNetworkListener And _networkObject Is Nothing Then - If version IsNot Nothing Then - Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" - Else - Return guidAttrib.Value + ' The is-nothing-check is to avoid hooking the object more than once. + _networkObject = New Devices.Network + AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor + End If + + RaiseEvent Startup(Me, eventArgs) + + Return Not eventArgs.Cancel + End Function + + ''' + ''' Extensibility point which raises the StartupNextInstance + ''' + ''' + + + Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) + + RaiseEvent StartupNextInstance(Me, eventArgs) + + ' Activate the original instance. + If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then + If MainForm.WindowState = FormWindowState.Minimized Then + MainForm.WindowState = FormWindowState.Normal End If + + MainForm.Activate() End If + End Sub - Return entry.ManifestModule.ModuleVersionId.ToString() + ''' + ''' Raises the event and exits the application if the event handler indicated + ''' that execution shouldn't continue. + ''' + ''' + ''' True indicates the exception event was raised / False it was not. + + Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean + + ' Does the user have a handler for this event? + If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then + + ' We don't put a try/catch around the handler event so that exceptions in there will + ' bubble out - else we will have a recursive exception handler. + RaiseEvent UnhandledException(Me, e) + If e.ExitApplication Then Application.Exit() + + ' User handled the event. + Return True + End If + + ' Nobody was listening to the UnhandledException event. + Return False End Function + ''' + ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, + ''' displays it. + ''' + + Protected Sub ShowSplashScreen() + If Not _didSplashScreen Then + _didSplashScreen = True + + If _splashScreen Is Nothing Then + + ' If the user specified a splash screen, the designer will have overridden this method to set it. + OnCreateSplashScreen() + End If + + If _splashScreen IsNot Nothing Then + + ' Some splash screens have minimum face time they are supposed to get. + ' We'll set up a time to let us know when we can take it down. + If _minimumSplashExposure > 0 Then + + ' Don't close until the timer expires. + _splashTimer = New Timers.Timer(_minimumSplashExposure) + AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp + _splashTimer.AutoReset = False + + ' We only need this, when we actually need to wait for it. + _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) + + ' We'll enable it in DisplaySplash() once the splash screen thread gets running. + End If + + ' Run the splash screen on another thread so we don't starve it for events and painting + ' while the main form gets its act together. + Task.Run(AddressOf DisplaySplash) + End If + End If + End Sub + + ''' + ''' Processes all windows messages currently in the message queue + ''' + Public Sub DoEvents() + Application.DoEvents() + End Sub + + ''' + ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' + ''' The command line from Main(). + + Public Sub Run(commandLine As String()) + + ' Prime the command line args with what we receive from Main() so that Click-Once windows + ' apps don't have to do a System.Environment call which would require permissions. + InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) + + If Not IsSingleInstance Then + DoApplicationModel() + Else + ' This is a Single-Instance application + + ' Note: Must pass the calling assembly from here so we can get the running app. + ' Otherwise, can break single instance. + Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) + Dim pipeServer As NamedPipeServerStream = Nothing + + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then + + ' --- This is the first instance of a single-instance application to run. + ' This is the instance that subsequent instances will attach to. + Using pipeServer + Dim tokenSource As New CancellationTokenSource() +#Disable Warning BC42358 ' Call is not awaited. + WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) +#Enable Warning BC42358 + DoApplicationModel() + tokenSource.Cancel() + End Using + Else + + ' --- We are launching a subsequent instance. + Dim tokenSource As New CancellationTokenSource() + tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) + Try + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + awaitable.GetAwaiter().GetResult() + Catch ex As Exception + Throw New CantStartSingleInstanceException() + End Try + End If + End If 'Single-Instance application + End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 76844282735..0da9995dd79 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports System.Runtime.InteropServices Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -144,7 +145,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetWin32Exception(resourceID As String, ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) + Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb deleted file mode 100644 index 539d70e4e94..00000000000 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb +++ /dev/null @@ -1,816 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.ComponentModel -Imports System.Net -Imports System.Security -Imports System.Threading -Imports Microsoft.VisualBasic.CompilerServices -Imports Microsoft.VisualBasic.FileIO -Imports Microsoft.VisualBasic.MyServices.Internal -Imports NetInfoAlias = System.Net.NetworkInformation - -Namespace Microsoft.VisualBasic.Devices - - ''' - ''' Used to pass network connectivity status. - ''' - Public Class NetworkAvailableEventArgs - Inherits EventArgs - Public Sub New(networkAvailable As Boolean) - IsNetworkAvailable = networkAvailable - End Sub - - Public ReadOnly Property IsNetworkAvailable() As Boolean - End Class - - - Public Delegate Sub NetworkAvailableEventHandler(sender As Object, e As NetworkAvailableEventArgs) - - ''' - ''' An object that allows easy access to some simple network properties and functionality. - ''' - Public Class Network - - ''' - ''' Event fired when connected to the network - ''' - ''' Has no meaning for this event - ''' Has no meaning for this event - Public Custom Event NetworkAvailabilityChanged As NetworkAvailableEventHandler - 'This is a custom event because we want to hook up the NetworkAvailabilityChanged event only if the user writes a handler for it. - 'The reason being that it is very expensive to handle and kills our application startup perf. - AddHandler(handler As NetworkAvailableEventHandler) - - ' Set the current state of connectedness, swallow known exceptions since user won't be able to correct problem - Try - _connected = IsAvailable - Catch ex As SecurityException - Return - Catch ex As PlatformNotSupportedException - Return - End Try - SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. - If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) - _networkAvailabilityEventHandlers.Add(handler) - - 'Only setup the event Marshalling infrastructure once - If _networkAvailabilityEventHandlers.Count = 1 Then - _networkAvailabilityChangedCallback = New SendOrPostCallback(AddressOf NetworkAvailabilityChangedHandler) 'the async operation posts to this delegate - If AsyncOperationManager.SynchronizationContext IsNot Nothing Then - _synchronizationContext = AsyncOperationManager.SynchronizationContext 'We need to hang on to the synchronization context associated with the thread the network object is created on - Try ' Exceptions are thrown if the user isn't an admin. - AddHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) 'listen to the OS event - Catch ex As PlatformNotSupportedException - Catch ex As NetInfoAlias.NetworkInformationException - End Try - End If - End If - End SyncLock - End AddHandler - - RemoveHandler(handler As NetworkAvailableEventHandler) - If _networkAvailabilityEventHandlers IsNot Nothing AndAlso _networkAvailabilityEventHandlers.Count > 0 Then - _networkAvailabilityEventHandlers.Remove(handler) - 'Last one to leave, turn out the lights... - If _networkAvailabilityEventHandlers.Count = 0 Then - RemoveHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) 'listen to the OS event - DisconnectListener() 'Stop listening to network change events since nobody is listening to us anymore - End If - End If - End RemoveHandler - - RaiseEvent(sender As Object, e As NetworkAvailableEventArgs) - If _networkAvailabilityEventHandlers IsNot Nothing Then - For Each handler As NetworkAvailableEventHandler In _networkAvailabilityEventHandlers - If handler IsNot Nothing Then handler.Invoke(sender, e) - Next - End If - End RaiseEvent - End Event - - ''' - ''' Creates class and hooks up events - ''' - Public Sub New() - End Sub - - ''' - ''' Indicates whether or not the local machine is connected to an IP network. - ''' - ''' True if connected, otherwise False - Public ReadOnly Property IsAvailable() As Boolean - Get - - Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() - - End Get - End Property - - ''' - ''' Sends and receives a packet to and from the passed in address. - ''' - ''' - ''' True if ping was successful, otherwise False - Public Function Ping(hostNameOrAddress As String) As Boolean - Return Ping(hostNameOrAddress, DEFAULT_PING_TIMEOUT) - End Function - - ''' - ''' Sends and receives a packet to and from the passed in Uri. - ''' - ''' A Uri representing the host - ''' True if ping was successful, otherwise False - Public Function Ping(address As Uri) As Boolean - ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). - ' However, it is good practice to verify address before calling address.Host. - If address Is Nothing Then - Throw GetArgumentNullException("address") - End If - Return Ping(address.Host, DEFAULT_PING_TIMEOUT) - End Function - - ''' - ''' Sends and receives a packet to and from the passed in address. - ''' - ''' The name of the host as a Url or IP Address - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False - Public Function Ping(hostNameOrAddress As String, timeout As Integer) As Boolean - - ' Make sure a network is available - If Not IsAvailable Then - Throw GetInvalidOperationException(SR.Network_NetworkNotAvailable) - End If - - Dim PingMaker As New NetInfoAlias.Ping - Dim Reply As NetInfoAlias.PingReply = PingMaker.Send(hostNameOrAddress, timeout, PingBuffer) - If Reply.Status = NetInfoAlias.IPStatus.Success Then - Return True - End If - Return False - End Function - - ''' - ''' Sends and receives a packet to and from the passed in Uri. - ''' - ''' A Uri representing the host - ''' Time to wait before aborting ping - ''' True if ping was successful, otherwise False - Public Function Ping(address As Uri, timeout As Integer) As Boolean - ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). - ' However, it is good practice to verify address before calling address.Host. - If address Is Nothing Then - Throw GetArgumentNullException("address") - End If - Return Ping(address.Host, timeout) - End Function - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - Public Sub DownloadFile(address As String, destinationFileName As String) - DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - Public Sub DownloadFile(address As Uri, destinationFileName As String) - DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - Public Sub DownloadFile(address As String, destinationFileName As String, userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - Public Sub DownloadFile(address As Uri, destinationFileName As String, userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) - - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Address to the remote file, http, ftp etc... - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) - - ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). - ' However, it is good practice to verify address before calling Trim. - If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") - End If - - Dim addressUri As Uri = GetUri(address.Trim()) - - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - - DownloadFile(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) - - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The name of the user performing the download - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) - - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Calls to all the other overloads will come through here - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) - - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) - - End Sub - - ''' - ''' Downloads a file from the network to the specified path - ''' - ''' Uri to the remote file - ''' Name and path of file where download is saved - ''' The credentials of the user performing the download - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates whether or not the file should be overwritten if local file already exists - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - ''' Calls to all the other overloads will come through here - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) - If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) - End If - - If address Is Nothing Then - Throw GetArgumentNullException("address") - End If - - Using client As New WebClientExtended - client.Timeout = connectionTimeout - - ' Don't use passive mode if we're showing UI - client.UseNonPassiveFtp = showUI - - 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) - - ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really - ' have a file and path - If IO.Directory.Exists(fullFilename) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - 'Throw if the file exists and the user doesn't want to overwrite - If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) - End If - - ' Set credentials if we have any - If networkCredentials IsNot Nothing Then - client.Credentials = networkCredentials - End If - - Dim dialog As ProgressDialog = Nothing - If showUI AndAlso Environment.UserInteractive Then - dialog = New ProgressDialog With { - .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) - } - End If - - 'Check to see if the target directory exists. If it doesn't, create it - Dim targetDirectory As String = IO.Path.GetDirectoryName(fullFilename) - - ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect - If String.IsNullOrEmpty(targetDirectory) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) - End If - - If Not IO.Directory.Exists(targetDirectory) Then - IO.Directory.CreateDirectory(targetDirectory) - End If - - 'Create the copier - Dim copier As New WebClientCopy(client, dialog) - - 'Download the file - copier.DownloadFile(address, fullFilename) - - 'Handle a dialog cancel - If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then - Throw New OperationCanceledException() - End If - End If - - End Using - - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - Public Sub UploadFile(sourceFileName As String, address As String) - UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - Public Sub UploadFile(sourceFileName As String, address As Uri) - UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - Public Sub UploadFile(sourceFileName As String, address As String, userName As String, password As String) - UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, password As String) - UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - Public Sub UploadFile(sourceFileName As String, - address As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer) - - UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' The full name and path of the host destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Public Sub UploadFile(sourceFileName As String, - address As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) - - ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). - ' However, it is good practice to verify address before calling address.Trim. - If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") - End If - - ' Getting a uri will validate the form of the host address - Dim addressUri As Uri = GetUri(address.Trim()) - - ' For uploads, we need to make sure the address includes the filename - If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then - Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) - End If - - UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) - - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - Public Sub UploadFile(sourceFileName As String, - address As Uri, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer) - - UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The name of the user performing the upload - ''' The user's password - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Public Sub UploadFile(sourceFileName As String, - address As Uri, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) - - ' Get network credentials - Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - - UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, onUserCancel) - - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - Public Sub UploadFile(sourceFileName As String, - address As Uri, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer) - - UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, UICancelOption.ThrowException) - End Sub - - ''' - ''' Uploads a file from the local machine to the specified host - ''' - ''' The file to be uploaded - ''' Uri representing the destination - ''' The credentials of the user performing the upload - ''' Indicates whether or not to show a progress bar - ''' Time allotted before giving up on a connection - ''' Indicates what to do if user cancels dialog (either throw or do nothing) - Public Sub UploadFile(sourceFileName As String, - address As Uri, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) - sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) - - 'Make sure the file exists - If Not IO.File.Exists(sourceFileName) Then - Throw New IO.FileNotFoundException(GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) - End If - - If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) - End If - - If address Is Nothing Then - Throw GetArgumentNullException("address") - End If - - Using client As New WebClientExtended() - client.Timeout = connectionTimeout - - ' Set credentials if we have any - If networkCredentials IsNot Nothing Then - client.Credentials = networkCredentials - End If - - Dim Dialog As ProgressDialog = Nothing - If showUI AndAlso Environment.UserInteractive Then - Dialog = New ProgressDialog With { - .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), - .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) - } - End If - - 'Create the copier - Dim copier As New WebClientCopy(client, Dialog) - - 'Download the file - copier.UploadFile(sourceFileName, address) - - 'Handle a dialog cancel - If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then - Throw New OperationCanceledException() - End If - End If - End Using - - End Sub - - Friend Sub DisconnectListener() - RemoveHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) - End Sub - - 'Listens to the AddressChanged event from the OS which comes in on an arbitrary thread - Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) - SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure - 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that - 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was - 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original - 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. - _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) - End SyncLock - End Sub - - 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) - Private Sub NetworkAvailabilityChangedHandler(state As Object) - Dim Connected As Boolean = IsAvailable - ' Fire an event only if the connected state has changed - If _connected <> Connected Then - _connected = Connected - RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(Connected)) - End If - End Sub - - ''' - ''' A buffer for pinging. This imitates the buffer used by Ping.Exe - ''' - ''' A buffer - Private ReadOnly Property PingBuffer() As Byte() - Get - If _pingBuffer Is Nothing Then - ReDim _pingBuffer(BUFFER_SIZE - 1) - For i As Integer = 0 To BUFFER_SIZE - 1 - 'This is the same logic Ping.exe uses to fill it's buffer - _pingBuffer(i) = Convert.ToByte(Asc("a"c) + i Mod 23, Globalization.CultureInfo.InvariantCulture) - Next - End If - - Return _pingBuffer - End Get - End Property - - ''' - ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address) - ''' - ''' The remote file address - ''' A Uri if successful, otherwise it throws an exception - Private Shared Function GetUri(address As String) As Uri - Try - Return New Uri(address) - Catch ex As UriFormatException - 'Throw an exception with an error message more appropriate to our API - Throw GetArgumentExceptionWithArgName("address", SR.Network_InvalidUriString, address) - End Try - End Function - - ''' - ''' Gets network credentials from a userName and password - ''' - ''' The name of the user - ''' The password of the user - ''' A NetworkCredentials - Private Shared Function GetNetworkCredentials(userName As String, password As String) As ICredentials - - ' Make sure all nulls are empty strings - If userName Is Nothing Then - userName = String.Empty - End If - - If password Is Nothing Then - password = String.Empty - End If - - If userName.Length = 0 And password.Length = 0 Then - Return Nothing - End If - - Return New NetworkCredential(userName, password) - End Function - - 'Holds the buffer for pinging. We lazy initialize on first use - Private _pingBuffer() As Byte - - 'Size of Ping.exe buffer - Private Const BUFFER_SIZE As Integer = 32 - - ' Default timeout value - Private Const DEFAULT_TIMEOUT As Integer = 100000 - - ' Default timeout for Ping - Private Const DEFAULT_PING_TIMEOUT As Integer = 1000 - - ' UserName used in overloads where there is no userName parameter - Private Const DEFAULT_USERNAME As String = "" - - ' Password used in overloads where there is no password parameter - Private Const DEFAULT_PASSWORD As String = "" - - ' Indicates last known connection state - Private _connected As Boolean - - ' Object for syncing - Private ReadOnly _syncObject As New Object() - - Private _networkAvailabilityEventHandlers As List(Of NetworkAvailableEventHandler) 'Holds the listeners to our NetworkAvailability changed event - - Private _synchronizationContext As SynchronizationContext - Private _networkAvailabilityChangedCallback As SendOrPostCallback 'Used for marshalling the network address changed event to the foreground thread - End Class - - ''' - ''' Temporary class used to provide WebClient with a timeout property. - ''' - ''' This class will be deleted when Timeout is added to WebClient - Friend NotInheritable Class WebClientExtended - Inherits WebClient - - ''' - ''' Sets or indicates the timeout used by WebRequest used by WebClient - ''' - Public WriteOnly Property Timeout() As Integer - Set(value As Integer) - Debug.Assert(value > 0, "illegal value for timeout") - _timeout = value - End Set - End Property - - ''' - ''' Enables switching the server to non passive mode. - ''' - ''' We need this in order for the progress UI on a download to work - Public WriteOnly Property UseNonPassiveFtp() As Boolean - Set(value As Boolean) - _useNonPassiveFtp = value - End Set - End Property - - ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and Upload methods) is set - ''' to the Timeout value - ''' - ''' - Protected Overrides Function GetWebRequest(address As Uri) As WebRequest - Dim request As WebRequest = MyBase.GetWebRequest(address) - - Debug.Assert(request IsNot Nothing, "Unable to get WebRequest from base class") - If request IsNot Nothing Then - request.Timeout = _timeout - If _useNonPassiveFtp Then - Dim ftpRequest As FtpWebRequest = TryCast(request, FtpWebRequest) - If ftpRequest IsNot Nothing Then - ftpRequest.UsePassive = False - End If - End If - - Dim httpRequest As HttpWebRequest = TryCast(request, HttpWebRequest) - If httpRequest IsNot Nothing Then - httpRequest.AllowAutoRedirect = False - End If - - End If - - Return request - End Function - -#Disable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete - Friend Sub New() - End Sub -#Enable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete - - ' The Timeout value to be used by WebClient's WebRequest for Downloading or Uploading a file - Private _timeout As Integer = 100000 - - ' Flag used to indicate whether or not we should use passive mode when ftp downloading - Private _useNonPassiveFtp As Boolean - End Class - -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb new file mode 100644 index 00000000000..ec183f8f014 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -0,0 +1,129 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.ComponentModel +Imports System.Security +Imports System.Threading + +Imports NetInfoAlias = System.Net.NetworkInformation + +Namespace Microsoft.VisualBasic.Devices + + + Public Delegate Sub NetworkAvailableEventHandler(sender As Object, e As NetworkAvailableEventArgs) + + Partial Public Class Network + + ' Object for syncing + Private ReadOnly _syncObject As New Object() + + ' Indicates last known connection state + Private _connected As Boolean + + 'Used for marshalling the network address changed event to the foreground thread + Private _networkAvailabilityChangedCallback As SendOrPostCallback + + 'Holds the listeners to our NetworkAvailability changed event + Private _networkAvailabilityEventHandlers As List(Of NetworkAvailableEventHandler) + + Private _synchronizationContext As SynchronizationContext + + ''' + ''' Indicates whether or not the local machine is connected to an IP network. + ''' + ''' True if connected, otherwise False. + Public ReadOnly Property IsAvailable() As Boolean + Get + + Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() + + End Get + End Property + + ''' + ''' Event fired when connected to the network. + ''' + ''' Has no meaning for this event. + ''' Has no meaning for this event. + Public Custom Event NetworkAvailabilityChanged As NetworkAvailableEventHandler + 'This is a custom event because we want to hook up the NetworkAvailabilityChanged event only if the user writes a handler for it. + 'The reason being that it is very expensive to handle and kills our application startup perf. + AddHandler(handler As NetworkAvailableEventHandler) + + ' Set the current state of connectedness, swallow known exceptions since user won't be able to correct problem + Try + _connected = IsAvailable + Catch ex As SecurityException + Return + Catch ex As PlatformNotSupportedException + Return + End Try + SyncLock _syncObject 'we don't want our event firing before we've finished setting up the infrastructure. Also, need to assure there are no races in here so we don't hook up the OS listener twice, etc. + If _networkAvailabilityEventHandlers Is Nothing Then + _networkAvailabilityEventHandlers = New List(Of NetworkAvailableEventHandler) + End If + _networkAvailabilityEventHandlers.Add(handler) + + 'Only setup the event Marshalling infrastructure once + If _networkAvailabilityEventHandlers.Count = 1 Then + _networkAvailabilityChangedCallback = New SendOrPostCallback(AddressOf NetworkAvailabilityChangedHandler) 'the async operation posts to this delegate + If AsyncOperationManager.SynchronizationContext IsNot Nothing Then + _synchronizationContext = AsyncOperationManager.SynchronizationContext 'We need to hang on to the synchronization context associated with the thread the network object is created on + Try + ' Exceptions are thrown if the user isn't an admin. + AddHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) 'listen to the OS event + Catch ex As PlatformNotSupportedException + Catch ex As NetInfoAlias.NetworkInformationException + End Try + End If + End If + End SyncLock + End AddHandler + + RemoveHandler(handler As NetworkAvailableEventHandler) + If _networkAvailabilityEventHandlers IsNot Nothing AndAlso _networkAvailabilityEventHandlers.Count > 0 Then + _networkAvailabilityEventHandlers.Remove(handler) + 'Last one to leave, turn out the lights... + If _networkAvailabilityEventHandlers.Count = 0 Then + RemoveHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) 'listen to the OS event + DisconnectListener() 'Stop listening to network change events since nobody is listening to us anymore + End If + End If + End RemoveHandler + + RaiseEvent(sender As Object, e As NetworkAvailableEventArgs) + If _networkAvailabilityEventHandlers IsNot Nothing Then + For Each handler As NetworkAvailableEventHandler In _networkAvailabilityEventHandlers + If handler IsNot Nothing Then handler.Invoke(sender, e) + Next + End If + End RaiseEvent + End Event + + 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) + Private Sub NetworkAvailabilityChangedHandler(state As Object) + Dim connected As Boolean = IsAvailable + ' Fire an event only if the connected state has changed + If _connected <> connected Then + _connected = connected + RaiseEvent NetworkAvailabilityChanged(Me, New NetworkAvailableEventArgs(connected)) + End If + End Sub + + 'Listens to the AddressChanged event from the OS which comes in on an arbitrary thread + Private Sub OS_NetworkAvailabilityChangedListener(sender As Object, e As EventArgs) + SyncLock _syncObject 'Ensure we don't handle events until after we've finished setting up the event marshalling infrastructure + 'Don't call AsyncOperationManager.OperationSynchronizationContext.Post. The reason we want to go through m_SynchronizationContext is that + 'the OperationSynchronizationContext is thread static. Since we are getting called on some random thread, the context that was + 'in place when the Network object was created won't be available (it is on the original thread). To hang on to the original + 'context associated with the thread that the network object is created on, I use m_SynchronizationContext. + _synchronizationContext.Post(_networkAvailabilityChangedCallback, Nothing) + End SyncLock + End Sub + + Friend Sub DisconnectListener() + RemoveHandler NetInfoAlias.NetworkChange.NetworkAddressChanged, New NetInfoAlias.NetworkAddressChangedEventHandler(AddressOf OS_NetworkAvailabilityChangedListener) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb new file mode 100644 index 00000000000..7f2d99827f2 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb @@ -0,0 +1,19 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.Devices + + ''' + ''' Used to pass network connectivity status. + ''' + Public Class NetworkAvailableEventArgs + Inherits EventArgs + + Public Sub New(networkAvailable As Boolean) + IsNetworkAvailable = networkAvailable + End Sub + + Public ReadOnly Property IsNetworkAvailable() As Boolean + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb new file mode 100644 index 00000000000..981125e4c6f --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -0,0 +1,316 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices.Internal + +Namespace Microsoft.VisualBasic.Devices + + ''' + ''' An object that allows easy access to some simple network properties and functionality. + ''' + Partial Public Class Network + + ''' + ''' Creates class and hooks up events + ''' + Public Sub New() + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved. + Public Sub DownloadFile(address As String, destinationFileName As String) + DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + Public Sub DownloadFile(address As Uri, destinationFileName As String) + DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String) + + DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String) + + DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + + DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + End Sub + + ''' + ''' Downloads a file from the network to the specified path + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved. + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be + ''' overwritten if local file already exists. + ''' + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) + + ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). + ' However, it is good practice to verify address before calling Trim. + If String.IsNullOrWhiteSpace(address) Then + Throw GetArgumentNullException("address") + End If + + Dim addressUri As Uri = GetUri(address.Trim()) + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + DownloadFile(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file, + ''' + ''' Name and path of file where download is saved. + ''' + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + + DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file. + ''' + ''' Name and path of file where download is saved. + ''' + ''' The name of the user performing the download. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' + ''' Time allotted before giving up on a connection. + ''' + ''' + ''' Indicates whether or not the file should be overwritten if local file + ''' already exists. + ''' + ''' Indicates what to do if user cancels dialog + ''' (either throw or do nothing). + ''' + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file. + ''' + ''' Name and path of file where download is saved. + ''' + ''' + ''' The credentials of the user performing the download. + ''' + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates whether or not the file should be overwritten if local file already exists + ''' + ''' Calls to all the other overloads will come through here. + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + + DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + + End Sub + + ''' + ''' Downloads a file from the network to the specified path. + ''' + ''' Uri to the remote file. + ''' Name and path of file where download is saved. + ''' The credentials of the user performing the download. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' Indicates whether or not the file should be overwritten if local file already exists. + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Calls to all the other overloads will come through here. + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) + + If connectionTimeout <= 0 Then + Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + End If + + If address Is Nothing Then + Throw GetArgumentNullException("address") + End If + + Using client As New WebClientExtended + client.Timeout = connectionTimeout + + ' Don't use passive mode if we're showing UI + client.UseNonPassiveFtp = showUI + + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + + ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really + ' have a file and path + If IO.Directory.Exists(fullFilename) Then + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + 'Throw if the file exists and the user doesn't want to overwrite + If IO.File.Exists(fullFilename) And Not overwrite Then + Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + End If + + ' Set credentials if we have any + If networkCredentials IsNot Nothing Then + client.Credentials = networkCredentials + End If + + Dim dialog As ProgressDialog = Nothing + If showUI AndAlso Environment.UserInteractive Then + dialog = New ProgressDialog With { + .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), + .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) + } + End If + + 'Check to see if the target directory exists. If it doesn't, create it + Dim targetDirectory As String = IO.Path.GetDirectoryName(fullFilename) + + ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect + If String.IsNullOrEmpty(targetDirectory) Then + Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + End If + + If Not IO.Directory.Exists(targetDirectory) Then + IO.Directory.CreateDirectory(targetDirectory) + End If + + 'Create the copier + Dim copier As New WebClientCopy(client, dialog) + + 'Download the file + copier.DownloadFile(address, fullFilename) + + 'Handle a dialog cancel + If showUI AndAlso Environment.UserInteractive Then + If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then + Throw New OperationCanceledException() + End If + End If + + End Using + + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb new file mode 100644 index 00000000000..621fc81c5ba --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -0,0 +1,98 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils +Imports NetInfoAlias = System.Net.NetworkInformation + +Namespace Microsoft.VisualBasic.Devices + + Partial Public Class Network + + 'Size of Ping.exe buffer + Private Const BUFFER_SIZE As Integer = 32 + + ' Default timeout for Ping + Private Const DEFAULT_PING_TIMEOUT As Integer = 1000 + + 'Holds the buffer for pinging. We lazy initialize on first use + Private _pingBuffer() As Byte + + ''' + ''' A buffer for pinging. This imitates the buffer used by Ping.Exe. + ''' + ''' A buffer. + Private ReadOnly Property PingBuffer() As Byte() + Get + If _pingBuffer Is Nothing Then + ReDim _pingBuffer(BUFFER_SIZE - 1) + For i As Integer = 0 To BUFFER_SIZE - 1 + 'This is the same logic Ping.exe uses to fill it's buffer + _pingBuffer(i) = Convert.ToByte(Asc("a"c) + (i Mod 23), Globalization.CultureInfo.InvariantCulture) + Next + End If + + Return _pingBuffer + End Get + End Property + + ''' + ''' Sends and receives a packet to and from the passed in address. + ''' + ''' + ''' True if ping was successful, otherwise False. + Public Function Ping(hostNameOrAddress As String) As Boolean + Return Ping(hostNameOrAddress, DEFAULT_PING_TIMEOUT) + End Function + + ''' + ''' Sends and receives a packet to and from the passed in Uri. + ''' + ''' A Uri representing the host. + ''' True if ping was successful, otherwise False. + Public Function Ping(address As Uri) As Boolean + ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). + ' However, it is good practice to verify address before calling address.Host. + If address Is Nothing Then + Throw ExUtils.GetArgumentNullException(NameOf(address)) + End If + Return Ping(address.Host, DEFAULT_PING_TIMEOUT) + End Function + + ''' + ''' Sends and receives a packet to and from the passed in address. + ''' + ''' The name of the host as a Url or IP Address. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. + Public Function Ping(hostNameOrAddress As String, timeout As Integer) As Boolean + + ' Make sure a network is available + If Not IsAvailable Then + Throw ExUtils.GetInvalidOperationException(SR.Network_NetworkNotAvailable) + End If + + Dim pingMaker As New NetInfoAlias.Ping + Dim reply As NetInfoAlias.PingReply = pingMaker.Send(hostNameOrAddress, timeout, PingBuffer) + If reply.Status = NetInfoAlias.IPStatus.Success Then + Return True + End If + Return False + End Function + + ''' + ''' Sends and receives a packet to and from the passed in Uri. + ''' + ''' A Uri representing the host. + ''' Time to wait before aborting ping. + ''' True if ping was successful, otherwise False. + Public Function Ping(address As Uri, timeout As Integer) As Boolean + ' We're safe from Ping(Nothing, ...) due to overload failure (Ping(String,...) vs. Ping(Uri,...)). + ' However, it is good practice to verify address before calling address.Host. + If address Is Nothing Then + Throw ExUtils.GetArgumentNullException(NameOf(address)) + End If + Return Ping(address.Host, timeout) + End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb new file mode 100644 index 00000000000..1592ce89df3 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -0,0 +1,255 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualBasic.MyServices.Internal + +Namespace Microsoft.VisualBasic.Devices + + Public Class Network + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' The full name and path of the host destination. + Public Sub UploadFile(sourceFileName As String, address As String) + UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + Public Sub UploadFile(sourceFileName As String, address As Uri) + UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String) + + UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String) + + UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer) + + UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' The full name and path of the host destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) + + ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). + ' However, it is good practice to verify address before calling address.Trim. + If String.IsNullOrWhiteSpace(address) Then + Throw GetArgumentNullException("address") + End If + + ' Getting a uri will validate the form of the host address + Dim addressUri As Uri = GetUri(address.Trim()) + + ' For uploads, we need to make sure the address includes the filename + If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then + Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) + End If + + UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) + + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer) + + UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The name of the user performing the upload. + ''' The user's password. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) + + ' Get network credentials + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, onUserCancel) + + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer) + + UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, UICancelOption.ThrowException) + End Sub + + ''' + ''' Uploads a file from the local machine to the specified host. + ''' + ''' The file to be uploaded. + ''' Uri representing the destination. + ''' The credentials of the user performing the upload. + ''' Indicates whether or not to show a progress bar. + ''' Time allotted before giving up on a connection. + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) + + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) + + 'Make sure the file exists + If Not IO.File.Exists(sourceFileName) Then + Throw New IO.FileNotFoundException(GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) + End If + + If connectionTimeout <= 0 Then + Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) + End If + + If address Is Nothing Then + Throw GetArgumentNullException("address") + End If + + Using client As New WebClientExtended() + client.Timeout = connectionTimeout + + ' Set credentials if we have any + If networkCredentials IsNot Nothing Then + client.Credentials = networkCredentials + End If + + Dim Dialog As ProgressDialog = Nothing + If showUI AndAlso Environment.UserInteractive Then + Dialog = New ProgressDialog With { + .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), + .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) + } + End If + + 'Create the copier + Dim copier As New WebClientCopy(client, Dialog) + + 'Download the file + copier.UploadFile(sourceFileName, address) + + 'Handle a dialog cancel + If showUI AndAlso Environment.UserInteractive Then + If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then + Throw New OperationCanceledException() + End If + End If + End Using + + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb new file mode 100644 index 00000000000..48a03f6cf62 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -0,0 +1,88 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net +Imports Microsoft.VisualBasic.CompilerServices +Imports Microsoft.VisualBasic.MyServices.Internal + +Namespace Microsoft.VisualBasic.Devices + Friend Module NetworkUtilities + + ' Password used in overloads where there is no password parameter + Friend Const DEFAULT_PASSWORD As String = "" + + ' Default timeout value + Friend Const DEFAULT_TIMEOUT As Integer = 100000 + + ' UserName used in overloads where there is no userName parameter + Friend Const DEFAULT_USERNAME As String = "" + + ''' + ''' Posts a message to close the progress dialog. + ''' + Friend Sub CloseProgressDialog(dialog As ProgressDialog) + ' Don't invoke unless dialog is up and running + If dialog IsNot Nothing Then + dialog.IndicateClosing() + + If dialog.IsHandleCreated Then + dialog.BeginInvoke(New System.Windows.Forms.MethodInvoker(AddressOf dialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + dialog.Close() + End If + End If + End Sub + + ''' + ''' Gets network credentials from a userName and password. + ''' + ''' The name of the user. + ''' The password of the user. + ''' A new NetworkCredentials or Nothing. + Friend Function GetNetworkCredentials(userName As String, password As String) As ICredentials + + Return If(String.IsNullOrWhiteSpace(userName) OrElse String.IsNullOrWhiteSpace(password), + Nothing, + DirectCast(New NetworkCredential(userName, password), ICredentials) + ) + End Function + + ''' + ''' Centralize setup a ProgressDialog to be used with FileDownload and FileUpload. + ''' + ''' Address to the remote file, http, ftp etc... + ''' Name and path of file where download is saved. + ''' Indicates whether or not to show a progress bar. + ''' New ProgressDialog. + Friend Function GetProgressDialog( + address As String, destinationFileName As String, + showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then + 'Construct the local file. This will validate the full name and path + Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, paramName:=NameOf(destinationFileName)) + Return New ProgressDialog With { + .Text = Utils.GetResourceString(SR.ProgressDialogDownloadingTitle, address), + .LabelText = Utils.GetResourceString(SR.ProgressDialogDownloadingLabel, address, fullFilename) + } + End If + Return Nothing + End Function + + ''' + ''' Gets a Uri from a uri string. We also use this function to validate the UriString (remote file address). + ''' + ''' The remote file address. + ''' A Uri if successful, otherwise it throws an exception. + Friend Function GetUri(address As String) As Uri + Try + Return New Uri(address) + Catch ex As UriFormatException + 'Throw an exception with an error message more appropriate to our API + Throw GetArgumentExceptionWithArgName(NameOf(address), SR.Network_InvalidUriString, address) + End Try + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb new file mode 100644 index 00000000000..586f8f0be1a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -0,0 +1,75 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Net + +Namespace Microsoft.VisualBasic.Devices + + ''' + ''' Temporary class used to provide WebClient with a timeout property. + ''' + ''' This class will be deleted when Timeout is added to WebClient. + Friend NotInheritable Class WebClientExtended + Inherits WebClient + + ' The Timeout value to be used by WebClient's WebRequest for Downloading or Uploading a file + Private _timeout As Integer = 100000 + + ' Flag used to indicate whether or not we should use passive mode when ftp downloading + Private _useNonPassiveFtp As Boolean + +#Disable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete + Friend Sub New() + End Sub +#Enable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete + + ''' + ''' Sets or indicates the timeout used by WebRequest used by WebClient + ''' + Public WriteOnly Property Timeout() As Integer + Set(value As Integer) + Debug.Assert(value > 0, "illegal value for timeout") + _timeout = value + End Set + End Property + + ''' + ''' Enables switching the server to non passive mode. + ''' + ''' We need this in order for the progress UI on a download to work + Public WriteOnly Property UseNonPassiveFtp() As Boolean + Set(value As Boolean) + _useNonPassiveFtp = value + End Set + End Property + + ''' + ''' Makes sure that the timeout value for WebRequests (used for all Download + ''' and Upload methods) is set to the Timeout value. + ''' + ''' + Protected Overrides Function GetWebRequest(address As Uri) As WebRequest + Dim request As WebRequest = MyBase.GetWebRequest(address) + + Debug.Assert(request IsNot Nothing, "Unable to get WebRequest from base class") + If request IsNot Nothing Then + request.Timeout = _timeout + If _useNonPassiveFtp Then + Dim ftpRequest As FtpWebRequest = TryCast(request, FtpWebRequest) + If ftpRequest IsNot Nothing Then + ftpRequest.UsePassive = False + End If + End If + + Dim httpRequest As HttpWebRequest = TryCast(request, HttpWebRequest) + If httpRequest IsNot Nothing Then + httpRequest.AllowAutoRedirect = False + End If + + End If + + Return request + End Function + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index c0fc7547c9d..113c5f38082 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -13,17 +13,11 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory. + ''' Options for behavior when resources are exhausted. ''' - Public Enum LogFileLocation As Integer - - ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() - TempDirectory - - LocalUserApplicationDirectory - CommonApplicationDirectory - ExecutableDirectory - Custom + Public Enum DiskSpaceExhaustedOption As Integer + ThrowException + DiscardMessages End Enum ''' @@ -36,11 +30,17 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted. + ''' Options for the location of a log's directory. ''' - Public Enum DiskSpaceExhaustedOption As Integer - ThrowException - DiscardMessages + Public Enum LogFileLocation As Integer + + ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() + TempDirectory + + LocalUserApplicationDirectory + CommonApplicationDirectory + ExecutableDirectory + Custom End Enum ''' @@ -54,6 +54,156 @@ Namespace Microsoft.VisualBasic.Logging Partial Public Class FileLogTraceListener Inherits TraceListener + Private Const APPEND_INDEX As Integer = 0 + + Private Const AUTOFLUSH_INDEX As Integer = 1 + + Private Const BASEFILENAME_INDEX As Integer = 2 + + Private Const CUSTOMLOCATION_INDEX As Integer = 3 + + Private Const DATE_FORMAT As String = "yyyy-MM-dd" + + ' Name to be used when parameterless constructor is called + Private Const DEFAULT_NAME As String = "FileLogTraceListener" + + Private Const DELIMITER_INDEX As Integer = 4 + + Private Const DISKSPACEEXHAUSTEDBEHAVIOR_INDEX As Integer = 5 + + Private Const ENCODING_INDEX As Integer = 6 + + Private Const FILE_EXTENSION As String = ".log" + + Private Const INCLUDEHOSTNAME_INDEX As Integer = 7 + + ' Attribute keys used to access properties set in the config file + Private Const KEY_APPEND As String = "append" + Private Const KEY_APPEND_PASCAL As String = "Append" + Private Const KEY_AUTOFLUSH As String = "autoflush" + Private Const KEY_AUTOFLUSH_CAMEL As String = "autoFlush" + Private Const KEY_AUTOFLUSH_PASCAL As String = "AutoFlush" + Private Const KEY_BASEFILENAME As String = "basefilename" + Private Const KEY_BASEFILENAME_CAMEL As String = "baseFilename" + Private Const KEY_BASEFILENAME_CAMEL_ALT As String = "baseFileName" + Private Const KEY_BASEFILENAME_PASCAL As String = "BaseFilename" + Private Const KEY_BASEFILENAME_PASCAL_ALT As String = "BaseFileName" + Private Const KEY_CUSTOMLOCATION As String = "customlocation" + Private Const KEY_CUSTOMLOCATION_CAMEL As String = "customLocation" + Private Const KEY_CUSTOMLOCATION_PASCAL As String = "CustomLocation" + Private Const KEY_DELIMITER As String = "delimiter" + Private Const KEY_DELIMITER_PASCAL As String = "Delimiter" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR As String = "diskspaceexhaustedbehavior" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL As String = "diskSpaceExhaustedBehavior" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL As String = "DiskSpaceExhaustedBehavior" + Private Const KEY_ENCODING As String = "encoding" + Private Const KEY_ENCODING_PASCAL As String = "Encoding" + Private Const KEY_INCLUDEHOSTNAME As String = "includehostname" + Private Const KEY_INCLUDEHOSTNAME_CAMEL As String = "includeHostName" + Private Const KEY_INCLUDEHOSTNAME_PASCAL As String = "IncludeHostName" + Private Const KEY_LOCATION As String = "location" + Private Const KEY_LOCATION_PASCAL As String = "Location" + Private Const KEY_LOGFILECREATIONSCHEDULE As String = "logfilecreationschedule" + Private Const KEY_LOGFILECREATIONSCHEDULE_CAMEL As String = "logFileCreationSchedule" + Private Const KEY_LOGFILECREATIONSCHEDULE_PASCAL As String = "LogFileCreationSchedule" + Private Const KEY_MAXFILESIZE As String = "maxfilesize" + Private Const KEY_MAXFILESIZE_CAMEL As String = "maxFileSize" + Private Const KEY_MAXFILESIZE_PASCAL As String = "MaxFileSize" + Private Const KEY_RESERVEDISKSPACE As String = "reservediskspace" + Private Const KEY_RESERVEDISKSPACE_CAMEL As String = "reserveDiskSpace" + Private Const KEY_RESERVEDISKSPACE_PASCAL As String = "ReserveDiskSpace" + + Private Const LOCATION_INDEX As Integer = 8 + + Private Const LOGFILECREATIONSCHEDULE_INDEX As Integer = 9 + + Private Const MAX_OPEN_ATTEMPTS As Integer = Integer.MaxValue + + Private Const MAXFILESIZE_INDEX As Integer = 10 + + ' The minimum setting allowed for maximum file size + Private Const MIN_FILE_SIZE As Integer = 1000 + + ' Identifies properties in the BitArray + Private Const PROPERTY_COUNT As Integer = 12 + + Private Const RESERVEDISKSPACE_INDEX As Integer = 11 + + ' Delimiter used when converting a stack to a string + Private Const STACK_DELIMITER As String = ", " + + ' Table of all of the files opened by any FileLogTraceListener in the current process + Private Shared ReadOnly s_streams As New Dictionary(Of String, ReferencedStream) + + Private ReadOnly _day As Date = Now.Date + + ' Indicates whether or not properties have been set + ' Note: Properties that use m_PropertiesSet to track whether or not + ' they've been set should always be set through the property setter and not + ' by directly changing the corresponding private field. + Private ReadOnly _propertiesSet As New BitArray(PROPERTY_COUNT, False) + + ' A list of supported attributes + Private ReadOnly _supportedAttributes() As String = New String() { + KEY_APPEND, KEY_APPEND_PASCAL, KEY_AUTOFLUSH, KEY_AUTOFLUSH_PASCAL, + KEY_AUTOFLUSH_CAMEL, KEY_BASEFILENAME, KEY_BASEFILENAME_PASCAL, + KEY_BASEFILENAME_CAMEL, KEY_BASEFILENAME_PASCAL_ALT, + KEY_BASEFILENAME_CAMEL_ALT, KEY_CUSTOMLOCATION, KEY_CUSTOMLOCATION_PASCAL, + KEY_CUSTOMLOCATION_CAMEL, KEY_DELIMITER, KEY_DELIMITER_PASCAL, + KEY_DISKSPACEEXHAUSTEDBEHAVIOR, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL, + KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL, KEY_ENCODING, KEY_ENCODING_PASCAL, + KEY_INCLUDEHOSTNAME, KEY_INCLUDEHOSTNAME_PASCAL, KEY_INCLUDEHOSTNAME_CAMEL, + KEY_LOCATION, KEY_LOCATION_PASCAL, KEY_LOGFILECREATIONSCHEDULE, + KEY_LOGFILECREATIONSCHEDULE_PASCAL, KEY_LOGFILECREATIONSCHEDULE_CAMEL, + KEY_MAXFILESIZE, KEY_MAXFILESIZE_PASCAL, KEY_MAXFILESIZE_CAMEL, + KEY_RESERVEDISKSPACE, KEY_RESERVEDISKSPACE_PASCAL, KEY_RESERVEDISKSPACE_CAMEL} + + ' Indicates whether to append to or overwrite the log file + Private _append As Boolean = True + + ' Indicates whether or not to flush after every write + Private _autoFlush As Boolean + + ' Stores the name of the file minus the path, date stamp, and file number + Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) + + ' Directory to be used for the log file if Location is set to Custom + Private _customLocation As String = Application.UserAppDataPath + + ' The delimiter to be used to separate fields in a line of output + Private _delimiter As String = vbTab + + ' Indicates what behavior should take place when a resource level has been passed + Private _diskSpaceExhaustedBehavior As DiskSpaceExhaustedOption = DiskSpaceExhaustedOption.DiscardMessages + + ' The encoding of the log file + Private _encoding As Encoding = Encoding.UTF8 + + Private _firstDayOfWeek As Date = GetFirstDayOfWeek(Now.Date) + + ' The full name and path of the log file + Private _fullFileName As String + + Private _hostName As String + + ' Indicates whether or not to include the host id in the output + Private _includeHostName As Boolean + + ' Indicates the location of the log's directory + Private _location As LogFileLocation = LogFileLocation.LocalUserApplicationDirectory + + ' Indicate which date stamp should be used in the log file name + Private _logFileDateStamp As LogFileCreationScheduleOption = LogFileCreationScheduleOption.None + + ' The maximum size of the log file + Private _maxFileSize As Long = 5000000L + + ' The amount of free disk space there needs to be on the drive of the log file + Private _reserveDiskSpace As Long = 10000000L + + ' Reference counted stream used for writing to the log file + Private _stream As ReferencedStream + ''' ''' Creates a FileLogTraceListener with the passed in name. ''' @@ -70,92 +220,123 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates the log's directory. + ''' Gets the host name. ''' - ''' An enum which can indicate one of several logical locations for the log. - Public Property Location() As LogFileLocation + ''' The host name. + ''' We use the machine name because we can get that even if not hooked up to a network. + Private ReadOnly Property HostName() As String Get - If Not _propertiesSet(LOCATION_INDEX) Then - If Attributes.ContainsKey(KEY_LOCATION) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileLocation)) - Me.Location = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOCATION)), LogFileLocation) - End If + If String.IsNullOrEmpty(_hostName) Then + ' Use the machine name + _hostName = Environment.MachineName End If - Return _location + Return _hostName End Get - Set(value As LogFileLocation) - ValidateLogFileLocationEnumValue(value, NameOf(value)) - - ' If the location is changing we need to close the current file - If _location <> value Then - CloseCurrentStream() - End If - _location = value - _propertiesSet(LOCATION_INDEX) = True - End Set End Property ''' - ''' Indicates whether or not the stream should be flushed after every write. + ''' Gets the stream to use for writing to the log. ''' - ''' True if the stream should be flushed after every write, otherwise False. - Public Property AutoFlush() As Boolean + ''' The stream. + Private ReadOnly Property ListenerStream() As ReferencedStream Get - If Not _propertiesSet(AUTOFLUSH_INDEX) Then - If Attributes.ContainsKey(KEY_AUTOFLUSH) Then - Me.AutoFlush = Convert.ToBoolean(Attributes(KEY_AUTOFLUSH), CultureInfo.InvariantCulture) - End If - End If - - Return _autoFlush - End Get - Set(value As Boolean) - DemandWritePermission() - _autoFlush = value - _propertiesSet(AUTOFLUSH_INDEX) = True - End Set - End Property + EnsureStreamIsOpen() - ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. - ''' - ''' True if the HostId should be included, otherwise False. - Public Property IncludeHostName() As Boolean - Get - If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then - If Attributes.ContainsKey(KEY_INCLUDEHOSTNAME) Then - Me.IncludeHostName = Convert.ToBoolean(Attributes(KEY_INCLUDEHOSTNAME), CultureInfo.InvariantCulture) - End If - End If - Return _includeHostName + Debug.Assert(_stream IsNot Nothing, "Unable to get stream") + Return _stream End Get - Set(value As Boolean) - DemandWritePermission() - _includeHostName = value - _propertiesSet(INCLUDEHOSTNAME_INDEX) = True - End Set End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten. + ''' Gets the log file name under the current configuration. ''' - ''' True if the file should be appended to, otherwise False. - Public Property Append() As Boolean + ''' The log file name. + ''' + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. + ''' + Private ReadOnly Property LogFileName() As String Get - If Not _propertiesSet(APPEND_INDEX) Then - If Attributes.ContainsKey(KEY_APPEND) Then - Me.Append = Convert.ToBoolean(Attributes(KEY_APPEND), CultureInfo.InvariantCulture) - End If - End If - - Return _append - End Get - Set(value As Boolean) - - DemandWritePermission() + Dim basePath As String - ' If this property is changing, we need to close the current file + ' Get the directory + Select Case Location + Case LogFileLocation.CommonApplicationDirectory + basePath = Application.CommonAppDataPath + Case LogFileLocation.ExecutableDirectory + basePath = Path.GetDirectoryName(Application.ExecutablePath) + Case LogFileLocation.LocalUserApplicationDirectory + basePath = Application.UserAppDataPath + Case LogFileLocation.TempDirectory + basePath = Path.GetTempPath() + Case LogFileLocation.Custom + If String.IsNullOrEmpty(CustomLocation) Then + basePath = Application.UserAppDataPath + Else + basePath = CustomLocation + End If + Case Else + Debug.Fail("Unrecognized location") + basePath = Application.UserAppDataPath + End Select + + ' Add the base name + Dim fileName As String = BaseFileName + + ' Add DateTime Stamp + Select Case LogFileCreationSchedule + Case LogFileCreationScheduleOption.Daily + fileName += "-" & Now.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) + Case LogFileCreationScheduleOption.Weekly + ' Get first day of week + _firstDayOfWeek = Now.AddDays(-Now.DayOfWeek) + fileName += "-" & _firstDayOfWeek.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) + Case LogFileCreationScheduleOption.None + Case Else + Debug.Fail("Unrecognized LogFileCreationSchedule") + End Select + + Return Path.Combine(basePath, fileName) + End Get + End Property + + ''' + ''' The full name and path of the actual log file including DateStamp and file number. + ''' + ''' The full name and path. + ''' Calling this method will open the log file if it's not already open. + Public ReadOnly Property FullLogFileName() As String + Get + ' The only way to reliably know the file name is to open the file. If we + ' don't have a stream, get one (this will open the file) + EnsureStreamIsOpen() + + ' We shouldn't use fields for demands so we use a local variable + Dim returnPath As String = _fullFileName + + Return returnPath + End Get + End Property + + ''' + ''' Indicates whether or not the file should be appended to or overwritten. + ''' + ''' True if the file should be appended to, otherwise False. + Public Property Append() As Boolean + Get + If Not _propertiesSet(APPEND_INDEX) Then + If Attributes.ContainsKey(KEY_APPEND) Then + Me.Append = Convert.ToBoolean(Attributes(KEY_APPEND), CultureInfo.InvariantCulture) + End If + End If + + Return _append + End Get + Set(value As Boolean) + + DemandWritePermission() + + ' If this property is changing, we need to close the current file If value <> _append Then CloseCurrentStream() End If @@ -165,25 +346,23 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user. + ''' Indicates whether or not the stream should be flushed after every write. ''' - ''' An enum indicating the desired behavior (do nothing, throw). - Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption + ''' True if the stream should be flushed after every write, otherwise False. + Public Property AutoFlush() As Boolean Get - If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then - If Attributes.ContainsKey(KEY_DISKSPACEEXHAUSTEDBEHAVIOR) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(DiskSpaceExhaustedOption)) - Me.DiskSpaceExhaustedBehavior = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_DISKSPACEEXHAUSTEDBEHAVIOR)), DiskSpaceExhaustedOption) + If Not _propertiesSet(AUTOFLUSH_INDEX) Then + If Attributes.ContainsKey(KEY_AUTOFLUSH) Then + Me.AutoFlush = Convert.ToBoolean(Attributes(KEY_AUTOFLUSH), CultureInfo.InvariantCulture) End If End If - Return _diskSpaceExhaustedBehavior + + Return _autoFlush End Get - Set(value As DiskSpaceExhaustedOption) + Set(value As Boolean) DemandWritePermission() - ValidateDiskSpaceExhaustedOptionEnumValue(value, NameOf(value)) - _diskSpaceExhaustedBehavior = value - _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) = True + _autoFlush = value + _propertiesSet(AUTOFLUSH_INDEX) = True End Set End Property @@ -218,92 +397,42 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number. + ''' The directory to be used if Location is set to Custom. ''' - ''' The full name and path. - ''' Calling this method will open the log file if it's not already open. - Public ReadOnly Property FullLogFileName() As String + ''' The name of the directory. + ''' This will throw if the path cannot be resolved. + Public Property CustomLocation() As String Get - ' The only way to reliably know the file name is to open the file. If we - ' don't have a stream, get one (this will open the file) - EnsureStreamIsOpen() - - ' We shouldn't use fields for demands so we use a local variable - Dim returnPath As String = _fullFileName + If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then + If Attributes.ContainsKey(KEY_CUSTOMLOCATION) Then + Me.CustomLocation = Attributes(KEY_CUSTOMLOCATION) + End If + End If - Return returnPath + Dim fileName As String = Path.GetFullPath(_customLocation) + Return fileName End Get - End Property + Set(value As String) - ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day). - ''' - ''' An enum indicating how to stamp the file. - Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption - Get - If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then - If Attributes.ContainsKey(KEY_LOGFILECREATIONSCHEDULE) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileCreationScheduleOption)) - Me.LogFileCreationSchedule = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOGFILECREATIONSCHEDULE)), LogFileCreationScheduleOption) - End If + ' Validate the path + Dim tempPath As String = Path.GetFullPath(value) + + If Not Directory.Exists(tempPath) Then + Directory.CreateDirectory(tempPath) End If - Return _logFileDateStamp - End Get - Set(value As LogFileCreationScheduleOption) - ValidateLogFileCreationScheduleOptionEnumValue(value, NameOf(value)) - If value <> _logFileDateStamp Then + ' If we're using custom location and the value is changing we need to + ' close the stream + If Location = LogFileLocation.Custom And Not String.Equals(tempPath, _customLocation, StringComparison.OrdinalIgnoreCase) Then CloseCurrentStream() - _logFileDateStamp = value End If - _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) = True - End Set - End Property + ' Since the user is setting a custom path, set Location to custom + Location = LogFileLocation.Custom - ''' - ''' The maximum size in bytes the log file is allowed to grow to. - ''' - ''' The maximum size. - Public Property MaxFileSize() As Long - Get - If Not _propertiesSet(MAXFILESIZE_INDEX) Then - If Attributes.ContainsKey(KEY_MAXFILESIZE) Then - Me.MaxFileSize = Convert.ToInt64(Attributes(KEY_MAXFILESIZE), CultureInfo.InvariantCulture) - End If - End If - Return _maxFileSize - End Get - Set(value As Long) - DemandWritePermission() - If value < MIN_FILE_SIZE Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") - End If - _maxFileSize = value - _propertiesSet(MAXFILESIZE_INDEX) = True - End Set - End Property + _customLocation = tempPath + _propertiesSet(CUSTOMLOCATION_INDEX) = True - ''' - ''' The amount of disk space, in bytes, that must be available after a write. - ''' - ''' The reserved disk space. - Public Property ReserveDiskSpace() As Long - Get - If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then - If Attributes.ContainsKey(KEY_RESERVEDISKSPACE) Then - Me.ReserveDiskSpace = Convert.ToInt64(Attributes(KEY_RESERVEDISKSPACE), CultureInfo.InvariantCulture) - End If - End If - Return _reserveDiskSpace - End Get - Set(value As Long) - DemandWritePermission() - If value < 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") - End If - _reserveDiskSpace = value - _propertiesSet(RESERVEDISKSPACE_INDEX) = True End Set End Property @@ -326,6 +455,29 @@ Namespace Microsoft.VisualBasic.Logging End Set End Property + ''' + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user. + ''' + ''' An enum indicating the desired behavior (do nothing, throw). + Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption + Get + If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then + If Attributes.ContainsKey(KEY_DISKSPACEEXHAUSTEDBEHAVIOR) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(DiskSpaceExhaustedOption)) + Me.DiskSpaceExhaustedBehavior = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_DISKSPACEEXHAUSTEDBEHAVIOR)), DiskSpaceExhaustedOption) + End If + End If + Return _diskSpaceExhaustedBehavior + End Get + Set(value As DiskSpaceExhaustedOption) + DemandWritePermission() + ValidateDiskSpaceExhaustedOptionEnumValue(value, NameOf(value)) + _diskSpaceExhaustedBehavior = value + _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) = True + End Set + End Property + ''' ''' The encoding to try when opening a file. ''' @@ -353,329 +505,282 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' - ''' The name of the directory. - ''' This will throw if the path cannot be resolved. - Public Property CustomLocation() As String + ''' True if the HostId should be included, otherwise False. + Public Property IncludeHostName() As Boolean Get - If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then - If Attributes.ContainsKey(KEY_CUSTOMLOCATION) Then - Me.CustomLocation = Attributes(KEY_CUSTOMLOCATION) + If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then + If Attributes.ContainsKey(KEY_INCLUDEHOSTNAME) Then + Me.IncludeHostName = Convert.ToBoolean(Attributes(KEY_INCLUDEHOSTNAME), CultureInfo.InvariantCulture) End If End If - - Dim fileName As String = Path.GetFullPath(_customLocation) - Return fileName + Return _includeHostName End Get - Set(value As String) - - ' Validate the path - Dim tempPath As String = Path.GetFullPath(value) - - If Not Directory.Exists(tempPath) Then - Directory.CreateDirectory(tempPath) - End If + Set(value As Boolean) + DemandWritePermission() + _includeHostName = value + _propertiesSet(INCLUDEHOSTNAME_INDEX) = True + End Set + End Property - ' If we're using custom location and the value is changing we need to - ' close the stream - If Location = LogFileLocation.Custom And Not String.Equals(tempPath, _customLocation, StringComparison.OrdinalIgnoreCase) Then - CloseCurrentStream() + ''' + ''' Indicates the log's directory. + ''' + ''' An enum which can indicate one of several logical locations for the log. + Public Property Location() As LogFileLocation + Get + If Not _propertiesSet(LOCATION_INDEX) Then + If Attributes.ContainsKey(KEY_LOCATION) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileLocation)) + Me.Location = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOCATION)), LogFileLocation) + End If End If + Return _location + End Get + Set(value As LogFileLocation) + ValidateLogFileLocationEnumValue(value, NameOf(value)) - ' Since the user is setting a custom path, set Location to custom - Location = LogFileLocation.Custom - - _customLocation = tempPath - _propertiesSet(CUSTOMLOCATION_INDEX) = True - + ' If the location is changing we need to close the current file + If _location <> value Then + CloseCurrentStream() + End If + _location = value + _propertiesSet(LOCATION_INDEX) = True End Set End Property ''' - ''' Writes the message to the log. + ''' Indicates what Date to stamp the log file with (none, first day of week, day). ''' - ''' The message to be written. - Public Overloads Overrides Sub Write(message As String) - - ' Use Try block to attempt to close stream if an exception is thrown - Try - HandleDateChange() - - ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message) - - If ResourcesAvailable(newEntrySize) Then - ListenerStream.Write(message) - If AutoFlush Then - ListenerStream.Flush() + ''' An enum indicating how to stamp the file. + Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption + Get + If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then + If Attributes.ContainsKey(KEY_LOGFILECREATIONSCHEDULE) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileCreationScheduleOption)) + Me.LogFileCreationSchedule = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOGFILECREATIONSCHEDULE)), LogFileCreationScheduleOption) End If End If - Catch - CloseCurrentStream() - Throw - End Try + Return _logFileDateStamp + End Get + Set(value As LogFileCreationScheduleOption) + ValidateLogFileCreationScheduleOptionEnumValue(value, NameOf(value)) - End Sub + If value <> _logFileDateStamp Then + CloseCurrentStream() + _logFileDateStamp = value + End If + + _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) = True + End Set + End Property ''' - ''' Writes the message to the log as a line. + ''' The maximum size in bytes the log file is allowed to grow to. ''' - ''' The message to be written. - Public Overloads Overrides Sub WriteLine(message As String) - - ' Use Try block to attempt to close stream if an exception is thrown - Try - HandleDateChange() - - ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - - If ResourcesAvailable(newEntrySize) Then - ListenerStream.WriteLine(message) - If AutoFlush Then - ListenerStream.Flush() + ''' The maximum size. + Public Property MaxFileSize() As Long + Get + If Not _propertiesSet(MAXFILESIZE_INDEX) Then + If Attributes.ContainsKey(KEY_MAXFILESIZE) Then + Me.MaxFileSize = Convert.ToInt64(Attributes(KEY_MAXFILESIZE), CultureInfo.InvariantCulture) End If End If - Catch - CloseCurrentStream() - Throw - End Try - End Sub + Return _maxFileSize + End Get + Set(value As Long) + DemandWritePermission() + If value < MIN_FILE_SIZE Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") + End If + _maxFileSize = value + _propertiesSet(MAXFILESIZE_INDEX) = True + End Set + End Property ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' The amount of disk space, in bytes, that must be available after a write. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' The message. - Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) - - If Filter IsNot Nothing Then - If Not Filter.ShouldTrace(eventCache, source, eventType, id, message, Nothing, Nothing, Nothing) Then - Return + ''' The reserved disk space. + Public Property ReserveDiskSpace() As Long + Get + If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then + If Attributes.ContainsKey(KEY_RESERVEDISKSPACE) Then + Me.ReserveDiskSpace = Convert.ToInt64(Attributes(KEY_RESERVEDISKSPACE), CultureInfo.InvariantCulture) + End If End If - End If - Dim outBuilder As New StringBuilder - - ' Add fields that always appear (source, eventType, id, message) - ' source - outBuilder.Append(source & Delimiter) - - ' eventType - outBuilder.Append([Enum].GetName(GetType(TraceEventType), eventType) & Delimiter) + Return _reserveDiskSpace + End Get + Set(value As Long) + DemandWritePermission() + If value < 0 Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + End If + _reserveDiskSpace = value + _propertiesSet(RESERVEDISKSPACE_INDEX) = True + End Set + End Property - ' id - outBuilder.Append(id.ToString(CultureInfo.InvariantCulture) & Delimiter) + ''' + ''' Utility to get the date of the first day of the week from the passed in date. + ''' + ''' The date being checked. + Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date + Return checkDate.AddDays(-checkDate.DayOfWeek).Date + End Function - ' message - outBuilder.Append(message) + ''' + ''' Convert a stack into a string. + ''' + ''' + ''' Returns the stack as a .csv string. + Private Shared Function StackToString(stack As Stack) As String + Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") - ' Add optional fields - ' Callstack - If (TraceOutputOptions And TraceOptions.Callstack) = TraceOptions.Callstack Then - outBuilder.Append(Delimiter & eventCache.Callstack) - End If + Dim length As Integer = STACK_DELIMITER.Length + Dim sb As New StringBuilder() - ' LogicalOperationStack - If (TraceOutputOptions And TraceOptions.LogicalOperationStack) = TraceOptions.LogicalOperationStack Then - outBuilder.Append(Delimiter & StackToString(eventCache.LogicalOperationStack)) - End If + For Each obj As Object In stack + sb.Append(obj.ToString() & STACK_DELIMITER) + Next - ' DateTime - If (TraceOutputOptions And TraceOptions.DateTime) = TraceOptions.DateTime Then - ' Add DateTime. Time will be in GMT. - outBuilder.Append(Delimiter & eventCache.DateTime.ToString("u", CultureInfo.InvariantCulture)) - End If + ' Escape the quotes + sb.Replace("""", """""") - ' ProcessId - If (TraceOutputOptions And TraceOptions.ProcessId) = TraceOptions.ProcessId Then - outBuilder.Append(Delimiter & eventCache.ProcessId.ToString(CultureInfo.InvariantCulture)) + ' Remove trailing delimiter + If sb.Length >= length Then + sb.Remove(sb.Length - length, length) End If - ' ThreadId - If (TraceOutputOptions And TraceOptions.ThreadId) = TraceOptions.ThreadId Then - outBuilder.Append(Delimiter & eventCache.ThreadId) - End If + Return $"""{sb}""" - ' Timestamp - If (TraceOutputOptions And TraceOptions.Timestamp) = TraceOptions.Timestamp Then - outBuilder.Append(Delimiter & eventCache.Timestamp.ToString(CultureInfo.InvariantCulture)) - End If + End Function - ' HostName - If IncludeHostName Then - outBuilder.Append(Delimiter & HostName) + ''' + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. + ''' + ''' + Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) + If value < DiskSpaceExhaustedOption.ThrowException OrElse value > DiskSpaceExhaustedOption.DiscardMessages Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(DiskSpaceExhaustedOption)) End If - - WriteLine(outBuilder.ToString()) - End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A string with placeholders that serves as a format for the message. - ''' The values for the placeholders in format. - Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) - - ' Create the message - Dim message As String - If args IsNot Nothing Then - message = String.Format(CultureInfo.InvariantCulture, format, args) - Else - message = format + ''' + Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) + If value < LogFileCreationScheduleOption.None OrElse value > LogFileCreationScheduleOption.Weekly Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileCreationScheduleOption)) End If - - TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Validates that the value being passed as an LogFileLocation enum is a legal value. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' An object containing the message to be logged. - Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - - Dim message As String = String.Empty - If data IsNot Nothing Then - message = data.ToString() + ''' + Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) + If value < LogFileLocation.TempDirectory OrElse value > LogFileLocation.Custom Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileLocation)) End If - - TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Closes the stream. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A list of objects making up the message to be logged. - Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) - - Dim messageBuilder As New StringBuilder() - If data IsNot Nothing Then - Dim bound As Integer = data.Length - 1 - For i As Integer = 0 To bound - messageBuilder.Append(data(i).ToString()) - If i <> bound Then - messageBuilder.Append(Delimiter) + ''' This method should be safe to call whether or not there is a stream. + Private Sub CloseCurrentStream() + If _stream IsNot Nothing Then + SyncLock s_streams + _stream.CloseStream() + If Not _stream.IsInUse Then + s_streams.Remove(_fullFileName.ToUpper(CultureInfo.InvariantCulture)) End If - Next i + _stream = Nothing + End SyncLock End If - - TraceEvent(eventCache, source, eventType, id, messageBuilder.ToString()) End Sub ''' - ''' Flushes the underlying stream. + ''' Indicates whether or not the current date has changed to new day. ''' - Public Overrides Sub Flush() - _stream?.Flush() - End Sub + ''' True if the date has changed, otherwise False. + Private Function DayChanged() As Boolean + Return _day.Date <> Now.Date + End Function ''' - ''' Closes the underlying stream. + ''' Demands a FileIO write permission. ''' - Public Overrides Sub Close() - Dispose(True) + ''' This method should be called by public API that doesn't map to TraceListener. + ''' This ensures these API cannot be used to circumvent CAS. + ''' + Private Sub DemandWritePermission() + Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") + Dim fileName As String = Path.GetDirectoryName(LogFileName) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception. - ''' - ''' An array of attribute names. - Protected Overrides Function GetSupportedAttributes() As String() - Return _supportedAttributes - End Function - - ''' - ''' Makes sure stream is flushed. + ''' Makes sure we have an open stream. ''' - ''' - Protected Overrides Sub Dispose(disposing As Boolean) - If disposing Then - CloseCurrentStream() + Private Sub EnsureStreamIsOpen() + If _stream Is Nothing Then + _stream = GetStream() End If End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Opens a file and attempts to determine the file's encoding. ''' - ''' The log file name. - ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. - ''' - Private ReadOnly Property LogFileName() As String - Get - Dim basePath As String + ''' The encoding or Nothing. + Private Function GetFileEncoding(fileName As String) As Encoding - ' Get the directory - Select Case Location - Case LogFileLocation.CommonApplicationDirectory - basePath = Application.CommonAppDataPath - Case LogFileLocation.ExecutableDirectory - basePath = Path.GetDirectoryName(Application.ExecutablePath) - Case LogFileLocation.LocalUserApplicationDirectory - basePath = Application.UserAppDataPath - Case LogFileLocation.TempDirectory - basePath = Path.GetTempPath() - Case LogFileLocation.Custom - If String.IsNullOrEmpty(CustomLocation) Then - basePath = Application.UserAppDataPath - Else - basePath = CustomLocation - End If - Case Else - Debug.Fail("Unrecognized location") - basePath = Application.UserAppDataPath - End Select + If File.Exists(fileName) Then + Dim reader As StreamReader = Nothing + Try - ' Add the base name - Dim fileName As String = BaseFileName + 'Attempt to determine the encoding of the file. The call to Reader.ReadLine + 'will change the current encoding of Reader to that of the file. + reader = New StreamReader(fileName, Encoding, True) - ' Add DateTime Stamp - Select Case LogFileCreationSchedule - Case LogFileCreationScheduleOption.Daily - fileName += "-" & Now.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) - Case LogFileCreationScheduleOption.Weekly - ' Get first day of week - _firstDayOfWeek = Now.AddDays(-Now.DayOfWeek) - fileName += "-" & _firstDayOfWeek.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) - Case LogFileCreationScheduleOption.None - Case Else - Debug.Fail("Unrecognized LogFileCreationSchedule") - End Select + 'Ignore 0 length file + If reader.BaseStream.Length > 0 Then + reader.ReadLine() - Return Path.Combine(basePath, fileName) - End Get - End Property + Return reader.CurrentEncoding + End If + Finally + reader?.Close() + End Try + End If + + Return Nothing + End Function ''' - ''' Gets the stream to use for writing to the log. + ''' Returns the total amount of free disk space available to the current user. ''' - ''' The stream. - Private ReadOnly Property ListenerStream() As ReferencedStream - Get - EnsureStreamIsOpen() + ''' The total amount, in bytes, of free disk space available to the current user. + ''' Throws an exception if API fails. + Private Function GetFreeDiskSpace() As Long + Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) - Debug.Assert(_stream IsNot Nothing, "Unable to get stream") - Return _stream - End Get - End Property + 'Initialize FreeUserSpace so we can determine if its value is changed by the API call + Dim freeUserSpace As Long = -1 + Dim totalUserSpace As Long + Dim totalFreeSpace As Long + + If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then + If freeUserSpace > -1 Then + Return freeUserSpace + End If + End If + + Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + End Function ''' ''' Gets or creates the stream used for writing to the log. @@ -751,55 +856,6 @@ Namespace Microsoft.VisualBasic.Logging Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function - ''' - ''' Makes sure we have an open stream. - ''' - Private Sub EnsureStreamIsOpen() - If _stream Is Nothing Then - _stream = GetStream() - End If - End Sub - - ''' - ''' Closes the stream. - ''' - ''' This method should be safe to call whether or not there is a stream. - Private Sub CloseCurrentStream() - If _stream IsNot Nothing Then - SyncLock s_streams - _stream.CloseStream() - If Not _stream.IsInUse Then - s_streams.Remove(_fullFileName.ToUpper(CultureInfo.InvariantCulture)) - End If - _stream = Nothing - End SyncLock - End If - End Sub - - ''' - ''' Indicates whether or not the current date has changed to new day. - ''' - ''' True if the date has changed, otherwise False. - Private Function DayChanged() As Boolean - Return _day.Date <> Now.Date - End Function - - ''' - ''' Indicates whether or not the date has changed to a new week. - ''' - ''' True if the date has changed, otherwise False. - Private Function WeekChanged() As Boolean - Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) - End Function - - ''' - ''' Utility to get the date of the first day of the week from the passed in date. - ''' - ''' The date being checked. - Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date - Return checkDate.AddDays(-checkDate.DayOfWeek).Date - End Function - ''' ''' Checks for date changes and carries out appropriate actions. ''' @@ -846,280 +902,231 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user. + ''' Indicates whether or not the date has changed to a new week. ''' - ''' The total amount, in bytes, of free disk space available to the current user. - ''' Throws an exception if API fails. - Private Function GetFreeDiskSpace() As Long - Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) - - 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim freeUserSpace As Long = -1 - Dim totalUserSpace As Long - Dim totalFreeSpace As Long + ''' True if the date has changed, otherwise False. + Private Function WeekChanged() As Boolean + Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) + End Function - If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then - If freeUserSpace > -1 Then - Return freeUserSpace - End If + ''' + ''' Makes sure stream is flushed. + ''' + ''' + Protected Overrides Sub Dispose(disposing As Boolean) + If disposing Then + CloseCurrentStream() End If + End Sub - Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + ''' + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception. + ''' + ''' An array of attribute names. + Protected Overrides Function GetSupportedAttributes() As String() + Return _supportedAttributes End Function ''' - ''' Opens a file and attempts to determine the file's encoding. + ''' Closes the underlying stream. ''' - ''' The encoding or Nothing. - Private Function GetFileEncoding(fileName As String) As Encoding - - If File.Exists(fileName) Then - Dim reader As StreamReader = Nothing - Try - - 'Attempt to determine the encoding of the file. The call to Reader.ReadLine - 'will change the current encoding of Reader to that of the file. - reader = New StreamReader(fileName, Encoding, True) - - 'Ignore 0 length file - If reader.BaseStream.Length > 0 Then - reader.ReadLine() - - Return reader.CurrentEncoding - End If - Finally - reader?.Close() - End Try - End If - - Return Nothing - End Function + Public Overrides Sub Close() + Dispose(True) + End Sub ''' - ''' Gets the host name. - ''' - ''' The host name. - ''' We use the machine name because we can get that even if not hooked up to a network. - Private ReadOnly Property HostName() As String - Get - If String.IsNullOrEmpty(_hostName) Then - ' Use the machine name - _hostName = Environment.MachineName - End If - Return _hostName - End Get - End Property - - ''' - ''' Demands a FileIO write permission. + ''' Flushes the underlying stream. ''' - ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS. - ''' - Private Sub DemandWritePermission() - Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") - Dim fileName As String = Path.GetDirectoryName(LogFileName) + Public Overrides Sub Flush() + _stream?.Flush() End Sub ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value. + ''' Method of the base class we override to keep message format consistent. ''' - ''' - Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) - If value < LogFileLocation.TempDirectory OrElse value > LogFileLocation.Custom Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileLocation)) - End If - End Sub + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' An object containing the message to be logged. + Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. - ''' - ''' - Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) - If value < DiskSpaceExhaustedOption.ThrowException OrElse value > DiskSpaceExhaustedOption.DiscardMessages Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(DiskSpaceExhaustedOption)) + Dim message As String = String.Empty + If data IsNot Nothing Then + message = data.ToString() End If + + TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. + ''' Method of the base class we override to keep message format consistent. ''' - ''' - Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) - If value < LogFileCreationScheduleOption.None OrElse value > LogFileCreationScheduleOption.Weekly Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileCreationScheduleOption)) + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A list of objects making up the message to be logged. + Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) + + Dim messageBuilder As New StringBuilder() + If data IsNot Nothing Then + Dim bound As Integer = data.Length - 1 + For i As Integer = 0 To bound + messageBuilder.Append(data(i).ToString()) + If i <> bound Then + messageBuilder.Append(Delimiter) + End If + Next i End If + + TraceEvent(eventCache, source, eventType, id, messageBuilder.ToString()) End Sub ''' - ''' Convert a stack into a string. + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' - ''' Returns the stack as a .csv string. - Private Shared Function StackToString(stack As Stack) As String - Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") - - Dim length As Integer = STACK_DELIMITER.Length - Dim sb As New StringBuilder() - - For Each obj As Object In stack - sb.Append(obj.ToString() & STACK_DELIMITER) - Next - - ' Escape the quotes - sb.Replace("""", """""") + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' The message. + Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) - ' Remove trailing delimiter - If sb.Length >= length Then - sb.Remove(sb.Length - length, length) + If Filter IsNot Nothing Then + If Not Filter.ShouldTrace(eventCache, source, eventType, id, message, Nothing, Nothing, Nothing) Then + Return + End If End If + Dim outBuilder As New StringBuilder - Return $"""{sb}""" - - End Function - - ' Indicates the location of the log's directory - Private _location As LogFileLocation = LogFileLocation.LocalUserApplicationDirectory - - ' Indicates whether or not to flush after every write - Private _autoFlush As Boolean - - ' Indicates whether to append to or overwrite the log file - Private _append As Boolean = True - - ' Indicates whether or not to include the host id in the output - Private _includeHostName As Boolean - - ' Indicates what behavior should take place when a resource level has been passed - Private _diskSpaceExhaustedBehavior As DiskSpaceExhaustedOption = DiskSpaceExhaustedOption.DiscardMessages - - ' Stores the name of the file minus the path, date stamp, and file number - Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) - - ' Indicate which date stamp should be used in the log file name - Private _logFileDateStamp As LogFileCreationScheduleOption = LogFileCreationScheduleOption.None - - ' The maximum size of the log file - Private _maxFileSize As Long = 5000000L - - ' The amount of free disk space there needs to be on the drive of the log file - Private _reserveDiskSpace As Long = 10000000L - - ' The delimiter to be used to separate fields in a line of output - Private _delimiter As String = vbTab - - ' The encoding of the log file - Private _encoding As Encoding = Encoding.UTF8 - - ' The full name and path of the log file - Private _fullFileName As String - - ' Directory to be used for the log file if Location is set to Custom - Private _customLocation As String = Application.UserAppDataPath - - ' Reference counted stream used for writing to the log file - Private _stream As ReferencedStream - - Private ReadOnly _day As Date = Now.Date + ' Add fields that always appear (source, eventType, id, message) + ' source + outBuilder.Append(source & Delimiter) - Private _firstDayOfWeek As Date = GetFirstDayOfWeek(Now.Date) + ' eventType + outBuilder.Append([Enum].GetName(GetType(TraceEventType), eventType) & Delimiter) - Private _hostName As String + ' id + outBuilder.Append(id.ToString(CultureInfo.InvariantCulture) & Delimiter) - ' Indicates whether or not properties have been set - ' Note: Properties that use m_PropertiesSet to track whether or not - ' they've been set should always be set through the property setter and not - ' by directly changing the corresponding private field. - Private ReadOnly _propertiesSet As New BitArray(PROPERTY_COUNT, False) + ' message + outBuilder.Append(message) - ' Table of all of the files opened by any FileLogTraceListener in the current process - Private Shared ReadOnly s_streams As New Dictionary(Of String, ReferencedStream) + ' Add optional fields + ' Callstack + If (TraceOutputOptions And TraceOptions.Callstack) = TraceOptions.Callstack Then + outBuilder.Append(Delimiter & eventCache.Callstack) + End If - ' A list of supported attributes - Private ReadOnly _supportedAttributes() As String = New String() {KEY_APPEND, KEY_APPEND_PASCAL, KEY_AUTOFLUSH, KEY_AUTOFLUSH_PASCAL, KEY_AUTOFLUSH_CAMEL, - KEY_BASEFILENAME, KEY_BASEFILENAME_PASCAL, KEY_BASEFILENAME_CAMEL, KEY_BASEFILENAME_PASCAL_ALT, KEY_BASEFILENAME_CAMEL_ALT, - KEY_CUSTOMLOCATION, KEY_CUSTOMLOCATION_PASCAL, KEY_CUSTOMLOCATION_CAMEL, KEY_DELIMITER, KEY_DELIMITER_PASCAL, - KEY_DISKSPACEEXHAUSTEDBEHAVIOR, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL, - KEY_ENCODING, KEY_ENCODING_PASCAL, KEY_INCLUDEHOSTNAME, KEY_INCLUDEHOSTNAME_PASCAL, KEY_INCLUDEHOSTNAME_CAMEL, KEY_LOCATION, KEY_LOCATION_PASCAL, - KEY_LOGFILECREATIONSCHEDULE, KEY_LOGFILECREATIONSCHEDULE_PASCAL, KEY_LOGFILECREATIONSCHEDULE_CAMEL, - KEY_MAXFILESIZE, KEY_MAXFILESIZE_PASCAL, KEY_MAXFILESIZE_CAMEL, KEY_RESERVEDISKSPACE, KEY_RESERVEDISKSPACE_PASCAL, KEY_RESERVEDISKSPACE_CAMEL} + ' LogicalOperationStack + If (TraceOutputOptions And TraceOptions.LogicalOperationStack) = TraceOptions.LogicalOperationStack Then + outBuilder.Append(Delimiter & StackToString(eventCache.LogicalOperationStack)) + End If - ' Identifies properties in the BitArray - Private Const PROPERTY_COUNT As Integer = 12 + ' DateTime + If (TraceOutputOptions And TraceOptions.DateTime) = TraceOptions.DateTime Then + ' Add DateTime. Time will be in GMT. + outBuilder.Append(Delimiter & eventCache.DateTime.ToString("u", CultureInfo.InvariantCulture)) + End If - Private Const APPEND_INDEX As Integer = 0 - Private Const AUTOFLUSH_INDEX As Integer = 1 - Private Const BASEFILENAME_INDEX As Integer = 2 - Private Const CUSTOMLOCATION_INDEX As Integer = 3 - Private Const DELIMITER_INDEX As Integer = 4 - Private Const DISKSPACEEXHAUSTEDBEHAVIOR_INDEX As Integer = 5 - Private Const ENCODING_INDEX As Integer = 6 - Private Const INCLUDEHOSTNAME_INDEX As Integer = 7 - Private Const LOCATION_INDEX As Integer = 8 - Private Const LOGFILECREATIONSCHEDULE_INDEX As Integer = 9 - Private Const MAXFILESIZE_INDEX As Integer = 10 - Private Const RESERVEDISKSPACE_INDEX As Integer = 11 + ' ProcessId + If (TraceOutputOptions And TraceOptions.ProcessId) = TraceOptions.ProcessId Then + outBuilder.Append(Delimiter & eventCache.ProcessId.ToString(CultureInfo.InvariantCulture)) + End If - Private Const DATE_FORMAT As String = "yyyy-MM-dd" - Private Const FILE_EXTENSION As String = ".log" - Private Const MAX_OPEN_ATTEMPTS As Integer = Integer.MaxValue + ' ThreadId + If (TraceOutputOptions And TraceOptions.ThreadId) = TraceOptions.ThreadId Then + outBuilder.Append(Delimiter & eventCache.ThreadId) + End If - ' Name to be used when parameterless constructor is called - Private Const DEFAULT_NAME As String = "FileLogTraceListener" + ' Timestamp + If (TraceOutputOptions And TraceOptions.Timestamp) = TraceOptions.Timestamp Then + outBuilder.Append(Delimiter & eventCache.Timestamp.ToString(CultureInfo.InvariantCulture)) + End If - ' The minimum setting allowed for maximum file size - Private Const MIN_FILE_SIZE As Integer = 1000 + ' HostName + If IncludeHostName Then + outBuilder.Append(Delimiter & HostName) + End If - ' Attribute keys used to access properties set in the config file - Private Const KEY_APPEND As String = "append" + WriteLine(outBuilder.ToString()) - Private Const KEY_APPEND_PASCAL As String = "Append" + End Sub - Private Const KEY_AUTOFLUSH As String = "autoflush" - Private Const KEY_AUTOFLUSH_PASCAL As String = "AutoFlush" - Private Const KEY_AUTOFLUSH_CAMEL As String = "autoFlush" + ''' + ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A string with placeholders that serves as a format for the message. + ''' The values for the placeholders in format. + Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) - Private Const KEY_BASEFILENAME As String = "basefilename" - Private Const KEY_BASEFILENAME_PASCAL As String = "BaseFilename" - Private Const KEY_BASEFILENAME_CAMEL As String = "baseFilename" - Private Const KEY_BASEFILENAME_PASCAL_ALT As String = "BaseFileName" - Private Const KEY_BASEFILENAME_CAMEL_ALT As String = "baseFileName" + ' Create the message + Dim message As String + If args IsNot Nothing Then + message = String.Format(CultureInfo.InvariantCulture, format, args) + Else + message = format + End If - Private Const KEY_CUSTOMLOCATION As String = "customlocation" - Private Const KEY_CUSTOMLOCATION_PASCAL As String = "CustomLocation" - Private Const KEY_CUSTOMLOCATION_CAMEL As String = "customLocation" + TraceEvent(eventCache, source, eventType, id, message) + End Sub - Private Const KEY_DELIMITER As String = "delimiter" - Private Const KEY_DELIMITER_PASCAL As String = "Delimiter" + ''' + ''' Writes the message to the log. + ''' + ''' The message to be written. + Public Overloads Overrides Sub Write(message As String) - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR As String = "diskspaceexhaustedbehavior" - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL As String = "DiskSpaceExhaustedBehavior" - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL As String = "diskSpaceExhaustedBehavior" + ' Use Try block to attempt to close stream if an exception is thrown + Try + HandleDateChange() - Private Const KEY_ENCODING As String = "encoding" - Private Const KEY_ENCODING_PASCAL As String = "Encoding" + ' Check resources + Dim newEntrySize As Long = Encoding.GetByteCount(message) - Private Const KEY_INCLUDEHOSTNAME As String = "includehostname" - Private Const KEY_INCLUDEHOSTNAME_PASCAL As String = "IncludeHostName" - Private Const KEY_INCLUDEHOSTNAME_CAMEL As String = "includeHostName" + If ResourcesAvailable(newEntrySize) Then + ListenerStream.Write(message) + If AutoFlush Then + ListenerStream.Flush() + End If + End If + Catch + CloseCurrentStream() + Throw + End Try - Private Const KEY_LOCATION As String = "location" - Private Const KEY_LOCATION_PASCAL As String = "Location" + End Sub - Private Const KEY_LOGFILECREATIONSCHEDULE As String = "logfilecreationschedule" - Private Const KEY_LOGFILECREATIONSCHEDULE_PASCAL As String = "LogFileCreationSchedule" - Private Const KEY_LOGFILECREATIONSCHEDULE_CAMEL As String = "logFileCreationSchedule" + ''' + ''' Writes the message to the log as a line. + ''' + ''' The message to be written. + Public Overloads Overrides Sub WriteLine(message As String) - Private Const KEY_MAXFILESIZE As String = "maxfilesize" - Private Const KEY_MAXFILESIZE_PASCAL As String = "MaxFileSize" - Private Const KEY_MAXFILESIZE_CAMEL As String = "maxFileSize" + ' Use Try block to attempt to close stream if an exception is thrown + Try + HandleDateChange() - Private Const KEY_RESERVEDISKSPACE As String = "reservediskspace" - Private Const KEY_RESERVEDISKSPACE_PASCAL As String = "ReserveDiskSpace" - Private Const KEY_RESERVEDISKSPACE_CAMEL As String = "reserveDiskSpace" + ' Check resources + Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - ' Delimiter used when converting a stack to a string - Private Const STACK_DELIMITER As String = ", " + If ResourcesAvailable(newEntrySize) Then + ListenerStream.WriteLine(message) + If AutoFlush Then + ListenerStream.Flush() + End If + End If + Catch + CloseCurrentStream() + Throw + End Try + End Sub End Class 'FileLogTraceListener End Namespace From 68fc7732ac109a77fce4d56cdcd4eb4573dbb949 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 16 Jul 2024 16:56:15 -0700 Subject: [PATCH 244/342] Fix C# tests to be Fluent --- .../VisualBasic/Devices/NetworkTests.cs | 16 ++++++++++------ .../src/System/Windows/Forms/OLE/Clipboard.cs | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs index 504a78bae96..54807a82ea9 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/NetworkTests.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using FluentAssertions; + namespace Microsoft.VisualBasic.Devices.Tests; public class NetworkTests @@ -16,14 +18,14 @@ public void IsAvailable() public void Ping_ShortTimeout_Success() { Network network = new(); - Assert.True(network.Ping("127.0.0.1", 1)); + network.Ping("127.0.0.1", 1).Should().BeTrue(); } [Fact] public void Ping_Success() { Network network = new(); - Assert.True(network.Ping("127.0.0.1")); + network.Ping("127.0.0.1").Should().BeTrue(); } [Fact] @@ -37,28 +39,30 @@ public void Ping_Throw() public void PingUri_ShortTimeout_Success() { Network network = new(); - Assert.True(network.Ping(new Uri("http://127.0.0.1"), 1)); + network.Ping(new Uri("http://127.0.0.1"), 1).Should().BeTrue(); } [Fact] public void PingUri_Success() { Network network = new(); - Assert.True(network.Ping(new Uri("http://127.0.0.1"))); + network.Ping(new Uri("http://127.0.0.1")).Should().BeTrue(); } [Fact] public void PingUri_Throw() { Network network = new(); - Assert.Throws(() => network.Ping((Uri)null)); + Action action = () => network.Ping((Uri)null); + action.Should().Throw(); } [Fact] public void PingUriTimeout_Throw() { Network network = new(); - Assert.Throws(() => network.Ping((Uri)null, 1)); + Action action = () => network.Ping((Uri)null, 1); + action.Should().Throw(); } // Not tested: diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/Clipboard.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/Clipboard.cs index 47379df564d..7770f856fa3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/Clipboard.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/Clipboard.cs @@ -203,6 +203,9 @@ public static bool ContainsText(TextDataFormat format) /// /// Retrieves data from the in the specified format. /// + /// + /// The current thread is not in single-threaded apartment (STA) mode. + /// public static object? GetData(string format) => string.IsNullOrWhiteSpace(format) ? null : GetData(format, autoConvert: false); @@ -288,7 +291,7 @@ public static void SetFileDropList(StringCollection filePaths) // These are the only error states for Path.GetFullPath if (string.IsNullOrEmpty(path) || path.Contains('\0')) { - throw new ArgumentException(string.Format(SR.Clipboard_InvalidPath, path, "filePaths")); + throw new ArgumentException(string.Format(SR.Clipboard_InvalidPath, path, nameof(filePaths))); } } From db26c74c2693310289a34b0447c1202c87fd8dbe Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 22:10:26 -0700 Subject: [PATCH 245/342] Replace "" woth String.empty --- .../ApplicationServices/ApplicationBase.vb | 75 ++++---- .../ApplyApplicationDefaultsEventArgs.vb | 12 +- .../ApplicationServices/AssemblyInfo.vb | 166 +++++++++--------- .../CompilerServices/ExceptionUtils.vb | 2 +- .../VisualBasic/Helpers/VBInputBox.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 2 +- .../Logging/FileLogTraceListener.vb | 4 +- .../src/Microsoft/VisualBasic/Logging/Log.vb | 4 +- 8 files changed, 137 insertions(+), 130 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 4e491b56a94..995e0150bff 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -13,42 +13,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Class ApplicationBase - Public Sub New() - End Sub - - ''' - ''' Returns the value of the specified environment variable. - ''' - ''' A String containing the name of the environment variable. - ''' A string containing the value of the environment variable. - ''' if name is Nothing. - ''' if the specified environment variable does not exist. - Public Function GetEnvironmentVariable(name As String) As String - - ' Framework returns Null if not found. - Dim variableValue As String = Environment.GetEnvironmentVariable(name) + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo - ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If variableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) - End If + 'Lazy-initialized and cached log object. + Private _log As Logging.Log - Return variableValue - End Function + Public Sub New() + End Sub ''' - ''' Provides access to logging capability. + ''' Gets the information about the current culture used by the current thread. ''' - ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. - ''' - Public ReadOnly Property Log() As Logging.Log + Public ReadOnly Property Culture() As Globalization.CultureInfo Get - If _log Is Nothing Then - _log = New Logging.Log - End If - Return _log + Return Thread.CurrentThread.CurrentCulture End Get End Property @@ -67,11 +46,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the information about the current culture used by the current thread. + ''' Provides access to logging capability. ''' - Public ReadOnly Property Culture() As Globalization.CultureInfo + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' + Public ReadOnly Property Log() As Logging.Log Get - Return Thread.CurrentThread.CurrentCulture + If _log Is Nothing Then + _log = New Logging.Log + End If + Return _log End Get End Property @@ -112,10 +98,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - 'Lazy-initialized and cached log object. - Private _log As Logging.Log - ' The executing application (the EntryAssembly) - Private _info As AssemblyInfo + ''' + ''' Returns the value of the specified environment variable. + ''' + ''' A String containing the name of the environment variable. + ''' A string containing the value of the environment variable. + ''' if name is Nothing. + ''' if the specified environment variable does not exist. + Public Function GetEnvironmentVariable(name As String) As String + + ' Framework returns Null if not found. + Dim variableValue As String = Environment.GetEnvironmentVariable(name) + + ' Since the explicitly requested a specific environment variable and we couldn't find it, throw + If variableValue Is Nothing Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + End If + + Return variableValue + End Function End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 0033ac0ad62..7c6ac816137 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -30,12 +30,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property Font As Font - ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. - ''' - Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT - ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' @@ -44,5 +38,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property HighDpiMode As HighDpiMode + ''' + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' + Public Property MinimumSplashScreenDisplayTime As Integer = + WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index f8e2ba0e1b3..57af3cbb02e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -14,25 +14,31 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' a VB project in Visual Studio .NET). ''' ''' - ''' This class is based on the FileVersionInfo class of the framework, but + ''' This class is based on the class of the framework, but ''' reduced to a number of relevant properties. ''' Public Class AssemblyInfo + ' The assembly with the information. Private ReadOnly _assembly As Assembly ' Since these properties will not change during runtime, they're cached. - ' "" is not Nothing so use Nothing to mark an un-accessed property. + ' String.Empty is not Nothing so use Nothing to mark an un-accessed property. ' Cache the assembly's company name. Private _companyName As String + ' Cache the assembly's copyright. Private _copyright As String + ' Cache the assembly's description. Private _description As String + ' Cache the assembly's product name. Private _productName As String + ' Cache the assembly's title. Private _title As String + ' Cache the assembly's trademark. Private _trademark As String @@ -48,22 +54,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the description associated with the assembly. + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' - ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. - ''' if the AssemblyDescriptionAttribute is not defined. - Public ReadOnly Property Description() As String + ''' A String containing the file name. + Public ReadOnly Property AssemblyName() As String Get - If _description Is Nothing Then - Dim attribute As AssemblyDescriptionAttribute = - CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) - If attribute Is Nothing Then - _description = "" - Else - _description = attribute.Description - End If - End If - Return _description + Return _assembly.GetName.Name End Get End Property @@ -78,7 +74,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices Dim attribute As AssemblyCompanyAttribute = CType(GetAttribute(GetType(AssemblyCompanyAttribute)), AssemblyCompanyAttribute) If attribute Is Nothing Then - _companyName = "" + _companyName = String.Empty Else _companyName = attribute.Company End If @@ -87,26 +83,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - ''' - ''' Gets the title associated with the assembly. - ''' - ''' A String containing the AssemblyTitleAttribute associated with the assembly. - ''' if the AssemblyTitleAttribute is not defined. - Public ReadOnly Property Title() As String - Get - If _title Is Nothing Then - Dim attribute As AssemblyTitleAttribute = - CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If attribute Is Nothing Then - _title = "" - Else - _title = attribute.Title - End If - End If - Return _title - End Get - End Property - ''' ''' Gets the copyright notices associated with the assembly. ''' @@ -117,7 +93,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _copyright Is Nothing Then Dim attribute As AssemblyCopyrightAttribute = CType(GetAttribute(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute) If attribute Is Nothing Then - _copyright = "" + _copyright = String.Empty Else _copyright = attribute.Copyright End If @@ -127,21 +103,46 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the description associated with the assembly. ''' - ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. - ''' if the AssemblyTrademarkAttribute is not defined. - Public ReadOnly Property Trademark() As String + ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. + ''' if the AssemblyDescriptionAttribute is not defined. + Public ReadOnly Property Description() As String Get - If _trademark Is Nothing Then - Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If _description Is Nothing Then + Dim attribute As AssemblyDescriptionAttribute = + CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) If attribute Is Nothing Then - _trademark = "" + _description = String.Empty Else - _trademark = attribute.Trademark + _description = attribute.Description End If End If - Return _trademark + Return _description + End Get + End Property + + ''' + ''' Gets the directory where the assembly lives. + ''' + Public ReadOnly Property DirectoryPath() As String + Get + Return IO.Path.GetDirectoryName(_assembly.Location) + End Get + End Property + + ''' + ''' Returns the names of all assemblies loaded by the current application. + ''' + ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. + ''' attempt on an unloaded application domain. + Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + Get + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) + Next + Return New ReadOnlyCollection(Of Assembly)(result) End Get End Property @@ -155,7 +156,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _productName Is Nothing Then Dim attribute As AssemblyProductAttribute = CType(GetAttribute(GetType(AssemblyProductAttribute)), AssemblyProductAttribute) If attribute Is Nothing Then - _productName = "" + _productName = String.Empty Else _productName = attribute.Product End If @@ -165,58 +166,63 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the version number of the assembly. - ''' - ''' A System.Version class containing the version number of the assembly. - ''' Cannot use AssemblyVersionAttribute since it always return Nothing. - Public ReadOnly Property Version() As Version - Get - Return _assembly.GetName().Version - End Get - End Property - - ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Returns the current stack trace information. ''' - ''' A String containing the file name. - Public ReadOnly Property AssemblyName() As String + ''' A string containing stack trace information. Value can be String.Empty. + ''' The requested stack trace information is out of range. + Public ReadOnly Property StackTrace() As String Get - Return _assembly.GetName.Name + Return Environment.StackTrace End Get End Property ''' - ''' Gets the directory where the assembly lives. + ''' Gets the title associated with the assembly. ''' - Public ReadOnly Property DirectoryPath() As String + ''' A String containing the AssemblyTitleAttribute associated with the assembly. + ''' if the AssemblyTitleAttribute is not defined. + Public ReadOnly Property Title() As String Get - Return IO.Path.GetDirectoryName(_assembly.Location) + If _title Is Nothing Then + Dim attribute As AssemblyTitleAttribute = + CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) + If attribute Is Nothing Then + _title = String.Empty + Else + _title = attribute.Title + End If + End If + Return _title End Get End Property ''' - ''' Returns the names of all assemblies loaded by the current application. + ''' Gets the trademark notices associated with the assembly. ''' - ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. - ''' attempt on an unloaded application domain. - Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. + ''' if the AssemblyTrademarkAttribute is not defined. + Public ReadOnly Property Trademark() As String Get - Dim result As New Collection(Of Assembly) - For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - result.Add(assembly) - Next - Return New ReadOnlyCollection(Of Assembly)(result) + If _trademark Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If attribute Is Nothing Then + _trademark = String.Empty + Else + _trademark = attribute.Trademark + End If + End If + Return _trademark End Get End Property ''' - ''' Returns the current stack trace information. + ''' Gets the version number of the assembly. ''' - ''' A string containing stack trace information. Value can be String.Empty. - ''' The requested stack trace information is out of range. - Public ReadOnly Property StackTrace() As String + ''' A System.Version class containing the version number of the assembly. + ''' Cannot use AssemblyVersionAttribute since it always return Nothing. + Public ReadOnly Property Version() As Version Get - Return Environment.StackTrace + Return _assembly.GetName().Version End Get End Property diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 76844282735..7a701b5aebb 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -25,7 +25,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function Friend Function VbMakeException(resourceId As Integer) As Exception - Dim description As String = "" + Dim description As String = String.Empty If resourceId > 0 AndAlso resourceId <= &HFFFFI Then description = GetResourceString(DirectCast(resourceId, vbErrors)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 86fe04b8603..1cf59377f70 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -18,7 +18,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Private OKButton As Button Private MyCancelButton As Button #Enable Warning IDE1006 ' Naming Styles - Public Output As String = "" + Public Output As String = String.Empty 'This constructor needed to be able to show the designer at design-time. Friend Sub New() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index cb932d73cbd..f597b76397e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -293,7 +293,7 @@ Namespace Microsoft.VisualBasic title = fullName.Substring(0, firstCommaLocation) Else 'The name is not in the format we're expecting so return an empty string - title = "" + title = String.Empty End If End Try diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 3f670f3a250..40ab815d6b9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -546,7 +546,7 @@ Namespace Microsoft.VisualBasic.Logging ''' An object containing the message to be logged. Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - Dim message As String = "" + Dim message As String = String.Empty If data IsNot Nothing Then message = data.ToString() End If @@ -974,7 +974,7 @@ Namespace Microsoft.VisualBasic.Logging sb.Remove(sb.Length - length, length) End If - Return """" & sb.ToString() & """" + Return $"""{sb}""" End Function diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index c73286ec0b6..9863624b4f0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -64,7 +64,7 @@ Namespace Microsoft.VisualBasic.Logging ''' An id for the message (used for correlation). Public Sub WriteEntry(message As String, severity As TraceEventType, id As Integer) If message Is Nothing Then - message = "" + message = String.Empty End If _traceSource.TraceEvent(severity, id, message) End Sub @@ -75,7 +75,7 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' The exception being logged. Public Sub WriteException(ex As Exception) - WriteException(ex, TraceEventType.Error, "", TraceEventTypeToId(TraceEventType.Error)) + WriteException(ex, TraceEventType.Error, String.Empty, TraceEventTypeToId(TraceEventType.Error)) End Sub ''' From 57a083456dc086c3a88650c28d751e7058e63a7f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 22:25:30 -0700 Subject: [PATCH 246/342] Adjust case of Latest --- .../src/Microsoft.VisualBasic.Forms.vbproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index 8dd8816196b..acae37edf78 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -12,7 +12,7 @@ Off On - latest + Latest None true true From 95e66cf82c95bf3d091b3663a5c91f9de4ef7e5d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 22:52:25 -0700 Subject: [PATCH 247/342] Update 3 files from Master --- .../ApplicationServices/ApplicationBase.vb | 75 ++++----- .../ApplyApplicationDefaultsEventArgs.vb | 12 +- .../ApplicationServices/AssemblyInfo.vb | 158 +++++++++--------- 3 files changed, 119 insertions(+), 126 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 995e0150bff..4e491b56a94 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -13,21 +13,42 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Class ApplicationBase - ' The executing application (the EntryAssembly) - Private _info As AssemblyInfo - - 'Lazy-initialized and cached log object. - Private _log As Logging.Log - Public Sub New() End Sub ''' - ''' Gets the information about the current culture used by the current thread. + ''' Returns the value of the specified environment variable. ''' - Public ReadOnly Property Culture() As Globalization.CultureInfo + ''' A String containing the name of the environment variable. + ''' A string containing the value of the environment variable. + ''' if name is Nothing. + ''' if the specified environment variable does not exist. + Public Function GetEnvironmentVariable(name As String) As String + + ' Framework returns Null if not found. + Dim variableValue As String = Environment.GetEnvironmentVariable(name) + + ' Since the explicitly requested a specific environment variable and we couldn't find it, throw + If variableValue Is Nothing Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + End If + + Return variableValue + End Function + + ''' + ''' Provides access to logging capability. + ''' + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' + Public ReadOnly Property Log() As Logging.Log Get - Return Thread.CurrentThread.CurrentCulture + If _log Is Nothing Then + _log = New Logging.Log + End If + Return _log End Get End Property @@ -46,18 +67,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Provides access to logging capability. + ''' Gets the information about the current culture used by the current thread. ''' - ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. - ''' - Public ReadOnly Property Log() As Logging.Log + Public ReadOnly Property Culture() As Globalization.CultureInfo Get - If _log Is Nothing Then - _log = New Logging.Log - End If - Return _log + Return Thread.CurrentThread.CurrentCulture End Get End Property @@ -98,25 +112,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - ''' - ''' Returns the value of the specified environment variable. - ''' - ''' A String containing the name of the environment variable. - ''' A string containing the value of the environment variable. - ''' if name is Nothing. - ''' if the specified environment variable does not exist. - Public Function GetEnvironmentVariable(name As String) As String - - ' Framework returns Null if not found. - Dim variableValue As String = Environment.GetEnvironmentVariable(name) - - ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If variableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) - End If - - Return variableValue - End Function + 'Lazy-initialized and cached log object. + Private _log As Logging.Log + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 7c6ac816137..0033ac0ad62 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -30,6 +30,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property Font As Font + ''' + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' + Public Property MinimumSplashScreenDisplayTime As Integer = + WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT + ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' @@ -38,11 +44,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property HighDpiMode As HighDpiMode - ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. - ''' - Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 57af3cbb02e..ee017140e55 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -18,7 +18,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' reduced to a number of relevant properties. ''' Public Class AssemblyInfo - ' The assembly with the information. Private ReadOnly _assembly As Assembly @@ -26,24 +25,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' String.Empty is not Nothing so use Nothing to mark an un-accessed property. ' Cache the assembly's company name. Private _companyName As String - ' Cache the assembly's copyright. Private _copyright As String - ' Cache the assembly's description. Private _description As String - ' Cache the assembly's product name. Private _productName As String - ' Cache the assembly's title. Private _title As String - ' Cache the assembly's trademark. Private _trademark As String ''' - ''' Creates an AssemblyInfo from an assembly + ''' Creates an AssemblyInfo from an assembly. ''' ''' The assembly for which we want to obtain the information. Public Sub New(currentAssembly As Assembly) @@ -54,12 +48,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Gets the description associated with the assembly. ''' - ''' A String containing the file name. - Public ReadOnly Property AssemblyName() As String + ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. + ''' if the AssemblyDescriptionAttribute is not defined. + Public ReadOnly Property Description() As String Get - Return _assembly.GetName.Name + If _description Is Nothing Then + Dim attribute As AssemblyDescriptionAttribute = + CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) + If attribute Is Nothing Then + _description = String.Empty + Else + _description = attribute.Description + End If + End If + Return _description End Get End Property @@ -83,6 +87,26 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property + ''' + ''' Gets the company name associated with the assembly. + ''' + ''' A String containing the AssemblyTitleAttribute associated with the assembly. + ''' if the AssemblyTitleAttribute is not defined. + Public ReadOnly Property Title() As String + Get + If _title Is Nothing Then + Dim attribute As AssemblyTitleAttribute = + CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) + If attribute Is Nothing Then + _title = String.Empty + Else + _title = attribute.Title + End If + End If + Return _title + End Get + End Property + ''' ''' Gets the copyright notices associated with the assembly. ''' @@ -103,46 +127,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the description associated with the assembly. + ''' Gets the trademark notices associated with the assembly. ''' - ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. - ''' if the AssemblyDescriptionAttribute is not defined. - Public ReadOnly Property Description() As String + ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. + ''' if the AssemblyTrademarkAttribute is not defined. + Public ReadOnly Property Trademark() As String Get - If _description Is Nothing Then - Dim attribute As AssemblyDescriptionAttribute = - CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) + If _trademark Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) If attribute Is Nothing Then - _description = String.Empty + _trademark = String.Empty Else - _description = attribute.Description + _trademark = attribute.Trademark End If End If - Return _description - End Get - End Property - - ''' - ''' Gets the directory where the assembly lives. - ''' - Public ReadOnly Property DirectoryPath() As String - Get - Return IO.Path.GetDirectoryName(_assembly.Location) - End Get - End Property - - ''' - ''' Returns the names of all assemblies loaded by the current application. - ''' - ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. - ''' attempt on an unloaded application domain. - Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) - Get - Dim result As New Collection(Of Assembly) - For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - result.Add(assembly) - Next - Return New ReadOnlyCollection(Of Assembly)(result) + Return _trademark End Get End Property @@ -166,63 +165,58 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Returns the current stack trace information. + ''' Gets the version number of the assembly. ''' - ''' A string containing stack trace information. Value can be String.Empty. - ''' The requested stack trace information is out of range. - Public ReadOnly Property StackTrace() As String + ''' A System.Version class containing the version number of the assembly. + ''' Cannot use AssemblyVersionAttribute since it always return Nothing. + Public ReadOnly Property Version() As Version Get - Return Environment.StackTrace + Return _assembly.GetName().Version End Get End Property ''' - ''' Gets the title associated with the assembly. + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' - ''' A String containing the AssemblyTitleAttribute associated with the assembly. - ''' if the AssemblyTitleAttribute is not defined. - Public ReadOnly Property Title() As String + ''' A String containing the file name. + Public ReadOnly Property AssemblyName() As String Get - If _title Is Nothing Then - Dim attribute As AssemblyTitleAttribute = - CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If attribute Is Nothing Then - _title = String.Empty - Else - _title = attribute.Title - End If - End If - Return _title + Return _assembly.GetName.Name End Get End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the directory where the assembly lives. ''' - ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. - ''' if the AssemblyTrademarkAttribute is not defined. - Public ReadOnly Property Trademark() As String + Public ReadOnly Property DirectoryPath() As String Get - If _trademark Is Nothing Then - Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) - If attribute Is Nothing Then - _trademark = String.Empty - Else - _trademark = attribute.Trademark - End If - End If - Return _trademark + Return IO.Path.GetDirectoryName(_assembly.Location) End Get End Property ''' - ''' Gets the version number of the assembly. + ''' Returns the names of all assemblies loaded by the current application. ''' - ''' A System.Version class containing the version number of the assembly. - ''' Cannot use AssemblyVersionAttribute since it always return Nothing. - Public ReadOnly Property Version() As Version + ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. + ''' attempt on an unloaded application domain. + Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) Get - Return _assembly.GetName().Version + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) + Next + Return New ReadOnlyCollection(Of Assembly)(result) + End Get + End Property + + ''' + ''' Returns the current stack trace information. + ''' + ''' A string containing stack trace information. Value can be String.Empty. + ''' The requested stack trace information is out of range. + Public ReadOnly Property StackTrace() As String + Get + Return Environment.StackTrace End Get End Property From 69d75d009da31cd66f8c5920bd4ecb20edb3b0b0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 23:00:31 -0700 Subject: [PATCH 248/342] Fix formatting of GetProgressDialog --- .../Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index 48a03f6cf62..6e6cf77e6a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -57,8 +57,10 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not to show a progress bar. ''' New ProgressDialog. Friend Function GetProgressDialog( - address As String, destinationFileName As String, + address As String, + destinationFileName As String, showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, paramName:=NameOf(destinationFileName)) From 0dc02c5fd4556cbcbf54967479620ac996f579c0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 23:35:35 -0700 Subject: [PATCH 249/342] Partial Sync with Master --- .../ApplicationServices/ApplicationBase.vb | 75 +- .../ApplyApplicationDefaultsEventArgs.vb | 12 +- .../ApplicationServices/AssemblyInfo.vb | 170 +- .../ConsoleApplicationBase.vb | 24 +- .../NoStartupFormException.vb | 14 +- .../SingleInstanceHelpers.vb | 82 +- .../VisualBasic/ApplicationServices/User.vb | 42 +- ...FormsApplicationBase.WinFormsAppContext.vb | 12 +- .../WindowsFormsApplicationBase.vb | 1354 ++++++++-------- .../CompilerServices/ExceptionUtils.vb | 3 +- .../VisualBasic/Devices/ComputerInfo.vb | 2 +- .../Devices/Network/NetworkAvailability.vb | 24 +- .../Network/NetworkAvailableEventArgs.vb | 1 + .../Devices/Network/NetworkUpload.vb | 121 +- .../Devices/Network/NetworkUtilities.vb | 8 +- .../Devices/Network/WebClientExtended.vb | 14 +- .../VisualBasic/Helpers/NativeTypes.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 10 +- .../Logging/FileLogTraceListener.vb | 1389 +++++++++-------- .../MyServices/Internal/HttpClientCopy.vb | 7 +- 20 files changed, 1708 insertions(+), 1658 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 4e491b56a94..995e0150bff 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -13,42 +13,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Class ApplicationBase - Public Sub New() - End Sub - - ''' - ''' Returns the value of the specified environment variable. - ''' - ''' A String containing the name of the environment variable. - ''' A string containing the value of the environment variable. - ''' if name is Nothing. - ''' if the specified environment variable does not exist. - Public Function GetEnvironmentVariable(name As String) As String - - ' Framework returns Null if not found. - Dim variableValue As String = Environment.GetEnvironmentVariable(name) + ' The executing application (the EntryAssembly) + Private _info As AssemblyInfo - ' Since the explicitly requested a specific environment variable and we couldn't find it, throw - If variableValue Is Nothing Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) - End If + 'Lazy-initialized and cached log object. + Private _log As Logging.Log - Return variableValue - End Function + Public Sub New() + End Sub ''' - ''' Provides access to logging capability. + ''' Gets the information about the current culture used by the current thread. ''' - ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. - ''' - Public ReadOnly Property Log() As Logging.Log + Public ReadOnly Property Culture() As Globalization.CultureInfo Get - If _log Is Nothing Then - _log = New Logging.Log - End If - Return _log + Return Thread.CurrentThread.CurrentCulture End Get End Property @@ -67,11 +46,18 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the information about the current culture used by the current thread. + ''' Provides access to logging capability. ''' - Public ReadOnly Property Culture() As Globalization.CultureInfo + ''' + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window + ''' and a delimited text file or xml log. + ''' + Public ReadOnly Property Log() As Logging.Log Get - Return Thread.CurrentThread.CurrentCulture + If _log Is Nothing Then + _log = New Logging.Log + End If + Return _log End Get End Property @@ -112,10 +98,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName) End Sub - 'Lazy-initialized and cached log object. - Private _log As Logging.Log - ' The executing application (the EntryAssembly) - Private _info As AssemblyInfo + ''' + ''' Returns the value of the specified environment variable. + ''' + ''' A String containing the name of the environment variable. + ''' A string containing the value of the environment variable. + ''' if name is Nothing. + ''' if the specified environment variable does not exist. + Public Function GetEnvironmentVariable(name As String) As String + + ' Framework returns Null if not found. + Dim variableValue As String = Environment.GetEnvironmentVariable(name) + + ' Since the explicitly requested a specific environment variable and we couldn't find it, throw + If variableValue Is Nothing Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(name), SR.EnvVarNotFound_Name, name) + End If + + Return variableValue + End Function End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 0033ac0ad62..7c6ac816137 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -30,12 +30,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property Font As Font - ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. - ''' - Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT - ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' @@ -44,5 +38,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property HighDpiMode As HighDpiMode + ''' + ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' + Public Property MinimumSplashScreenDisplayTime As Integer = + WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index ee017140e55..5afb2636fcc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -18,6 +18,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' reduced to a number of relevant properties. ''' Public Class AssemblyInfo + ' The assembly with the information. Private ReadOnly _assembly As Assembly @@ -25,14 +26,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' String.Empty is not Nothing so use Nothing to mark an un-accessed property. ' Cache the assembly's company name. Private _companyName As String + ' Cache the assembly's copyright. Private _copyright As String + ' Cache the assembly's description. Private _description As String + ' Cache the assembly's product name. Private _productName As String + ' Cache the assembly's title. Private _title As String + ' Cache the assembly's trademark. Private _trademark As String @@ -48,29 +54,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Gets the description associated with the assembly. + ''' Gets the name of the file containing the manifest (usually the .exe file). ''' - ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. - ''' if the AssemblyDescriptionAttribute is not defined. - Public ReadOnly Property Description() As String + ''' A String containing the file name. + Public ReadOnly Property AssemblyName() As String Get - If _description Is Nothing Then - Dim attribute As AssemblyDescriptionAttribute = - CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) - If attribute Is Nothing Then - _description = String.Empty - Else - _description = attribute.Description - End If - End If - Return _description + Return _assembly.GetName.Name End Get End Property ''' ''' Gets the company name associated with the assembly. ''' - ''' A String containing the AssemblyCompanyAttribute associated with the assembly. + ''' A String containing the AssemblyCompanyAttribute associated with the assembly. ''' if the AssemblyCompanyAttribute is not defined. Public ReadOnly Property CompanyName() As String Get @@ -87,30 +83,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - ''' - ''' Gets the company name associated with the assembly. - ''' - ''' A String containing the AssemblyTitleAttribute associated with the assembly. - ''' if the AssemblyTitleAttribute is not defined. - Public ReadOnly Property Title() As String - Get - If _title Is Nothing Then - Dim attribute As AssemblyTitleAttribute = - CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) - If attribute Is Nothing Then - _title = String.Empty - Else - _title = attribute.Title - End If - End If - Return _title - End Get - End Property - ''' ''' Gets the copyright notices associated with the assembly. ''' - ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. + ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. ''' if the AssemblyCopyrightAttribute is not defined. Public ReadOnly Property Copyright() As String Get @@ -127,28 +103,53 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the trademark notices associated with the assembly. + ''' Gets the description associated with the assembly. ''' - ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. - ''' if the AssemblyTrademarkAttribute is not defined. - Public ReadOnly Property Trademark() As String + ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. + ''' if the AssemblyDescriptionAttribute is not defined. + Public ReadOnly Property Description() As String Get - If _trademark Is Nothing Then - Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If _description Is Nothing Then + Dim attribute As AssemblyDescriptionAttribute = + CType(GetAttribute(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute) If attribute Is Nothing Then - _trademark = String.Empty + _description = String.Empty Else - _trademark = attribute.Trademark + _description = attribute.Description End If End If - Return _trademark + Return _description + End Get + End Property + + ''' + ''' Gets the directory where the assembly lives. + ''' + Public ReadOnly Property DirectoryPath() As String + Get + Return IO.Path.GetDirectoryName(_assembly.Location) + End Get + End Property + + ''' + ''' Returns the names of all assemblies loaded by the current application. + ''' + ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. + ''' attempt on an unloaded application domain. + Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + Get + Dim result As New Collection(Of Assembly) + For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() + result.Add(assembly) + Next + Return New ReadOnlyCollection(Of Assembly)(result) End Get End Property ''' ''' Gets the product name associated with the assembly. ''' - ''' A String containing the AssemblyProductAttribute associated with the assembly. + ''' A String containing the AssemblyProductAttribute associated with the assembly. ''' if the AssemblyProductAttribute is not defined. Public ReadOnly Property ProductName() As String Get @@ -165,67 +166,72 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets the version number of the assembly. - ''' - ''' A System.Version class containing the version number of the assembly. - ''' Cannot use AssemblyVersionAttribute since it always return Nothing. - Public ReadOnly Property Version() As Version - Get - Return _assembly.GetName().Version - End Get - End Property - - ''' - ''' Gets the name of the file containing the manifest (usually the .exe file). + ''' Returns the current stack trace information. ''' - ''' A String containing the file name. - Public ReadOnly Property AssemblyName() As String + ''' A string containing stack trace information. Value can be String.Empty. + ''' The requested stack trace information is out of range. + Public ReadOnly Property StackTrace() As String Get - Return _assembly.GetName.Name + Return Environment.StackTrace End Get End Property ''' - ''' Gets the directory where the assembly lives. + ''' Gets the company name associated with the assembly. ''' - Public ReadOnly Property DirectoryPath() As String + ''' A String containing the AssemblyTitleAttribute associated with the assembly. + ''' if the AssemblyTitleAttribute is not defined. + Public ReadOnly Property Title() As String Get - Return IO.Path.GetDirectoryName(_assembly.Location) + If _title Is Nothing Then + Dim attribute As AssemblyTitleAttribute = + CType(GetAttribute(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute) + If attribute Is Nothing Then + _title = String.Empty + Else + _title = attribute.Title + End If + End If + Return _title End Get End Property ''' - ''' Returns the names of all assemblies loaded by the current application. + ''' Gets the trademark notices associated with the assembly. ''' - ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. - ''' attempt on an unloaded application domain. - Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) + ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. + ''' if the AssemblyTrademarkAttribute is not defined. + Public ReadOnly Property Trademark() As String Get - Dim result As New Collection(Of Assembly) - For Each assembly As Assembly In AppDomain.CurrentDomain.GetAssemblies() - result.Add(assembly) - Next - Return New ReadOnlyCollection(Of Assembly)(result) + If _trademark Is Nothing Then + Dim attribute As AssemblyTrademarkAttribute = CType(GetAttribute(GetType(AssemblyTrademarkAttribute)), AssemblyTrademarkAttribute) + If attribute Is Nothing Then + _trademark = String.Empty + Else + _trademark = attribute.Trademark + End If + End If + Return _trademark End Get End Property ''' - ''' Returns the current stack trace information. + ''' Gets the version number of the assembly. ''' - ''' A string containing stack trace information. Value can be String.Empty. - ''' The requested stack trace information is out of range. - Public ReadOnly Property StackTrace() As String + ''' A System.Version class containing the version number of the assembly.> + ''' Cannot use AssemblyVersionAttribute since it always return Nothing. + Public ReadOnly Property Version() As Version Get - Return Environment.StackTrace + Return _assembly.GetName().Version End Get End Property ''' ''' Gets the amount of physical memory mapped to the process context. ''' - ''' + ''' ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. - ''' + ''' Public ReadOnly Property WorkingSet() As Long Get Return Environment.WorkingSet @@ -236,7 +242,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. ''' ''' The type of the required attribute. - ''' The attribute with the given type gotten from the assembly, or Nothing. + ''' + ''' The attribute with the given type gotten from the assembly, or Nothing. + ''' Private Function GetAttribute(attributeType As Type) As Object Debug.Assert(_assembly IsNot Nothing, "Null m_Assembly") diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index cffbdce0bb0..1c4819c065b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -26,11 +26,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New() End Sub + ''' + ''' Allows derived classes to set what the command line should look like. calls this + ''' for instance because we snag the command line from Main(). + ''' + + Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) + Set(value As ObjectModel.ReadOnlyCollection(Of String)) + _commandLineArgs = value + End Set + End Property + ''' ''' Returns the command line arguments for the current application. ''' ''' - ''' This function differs from System.Environment.GetCommandLineArgs in that the + ''' This function differs from in that the ''' path of the executing file (the 0th entry) is omitted from the returned collection ''' Public ReadOnly Property CommandLineArgs() As ObjectModel.ReadOnlyCollection(Of String) @@ -50,16 +61,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - ''' - ''' Allows derived classes to set what the command line should look like. WindowsFormsApplicationBase calls this - ''' for instance because we snag the command line from Main(). - ''' - - Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) - Set(value As ObjectModel.ReadOnlyCollection(Of String)) - _commandLineArgs = value - End Set - End Property - End Class 'ApplicationBase End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 610fe986470..49f9d9a2a56 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -14,6 +14,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Class NoStartupFormException : Inherits Exception + ' De-serialization constructor must be defined since we are serializable + + + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + End Sub + ''' ''' Creates a new exception ''' @@ -29,12 +36,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New(message, inner) End Sub - ' De-serialization constructor must be defined since we are serializable - - - Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb index 3b2d5147d9d..a80cb12f1ae 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/SingleInstanceHelpers.vb @@ -12,47 +12,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices Friend Module SingleInstanceHelpers Private Const NamedPipeOptions As PipeOptions = PipeOptions.Asynchronous Or PipeOptions.CurrentUserOnly - Friend Function TryCreatePipeServer(pipeName As String, ByRef pipeServer As NamedPipeServerStream) As Boolean - Try - pipeServer = New NamedPipeServerStream( - pipeName:=pipeName, - direction:=PipeDirection.In, - maxNumberOfServerInstances:=1, - transmissionMode:=PipeTransmissionMode.Byte, - options:=NamedPipeOptions) - Return True - Catch ex As Exception - pipeServer = Nothing - Return False - End Try - End Function - - Friend Async Function WaitForClientConnectionsAsync(pipeServer As NamedPipeServerStream, callback As Action(Of String()), cancellationToken As CancellationToken) As Task - While True - cancellationToken.ThrowIfCancellationRequested() - Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) - Try - Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) - If args IsNot Nothing Then - callback(args) - End If - Finally - pipeServer.Disconnect() - End Try - End While - End Function - - Friend Async Function SendSecondInstanceArgsAsync(pipeName As String, args As String(), cancellationToken As CancellationToken) As Task - Using pipeClient As New NamedPipeClientStream( - serverName:=".", - pipeName:=pipeName, - direction:=PipeDirection.Out, - options:=NamedPipeOptions) - Await pipeClient.ConnectAsync(cancellationToken).ConfigureAwait(False) - Await WriteArgsAsync(pipeClient, args, cancellationToken).ConfigureAwait(False) - End Using - End Function - Private Async Function ReadArgsAsync(pipeServer As NamedPipeServerStream, cancellationToken As CancellationToken) As Task(Of String()) Const bufferLength As Integer = 1024 Dim buffer As Byte() = New Byte(bufferLength - 1) {} @@ -84,5 +43,46 @@ Namespace Microsoft.VisualBasic.ApplicationServices Await pipeClient.WriteAsync(content.AsMemory(0, content.Length), cancellationToken).ConfigureAwait(False) End Function + Friend Async Function SendSecondInstanceArgsAsync(pipeName As String, args As String(), cancellationToken As CancellationToken) As Task + Using pipeClient As New NamedPipeClientStream( + serverName:=".", + pipeName:=pipeName, + direction:=PipeDirection.Out, + options:=NamedPipeOptions) + Await pipeClient.ConnectAsync(cancellationToken).ConfigureAwait(False) + Await WriteArgsAsync(pipeClient, args, cancellationToken).ConfigureAwait(False) + End Using + End Function + + Friend Function TryCreatePipeServer(pipeName As String, ByRef pipeServer As NamedPipeServerStream) As Boolean + Try + pipeServer = New NamedPipeServerStream( + pipeName:=pipeName, + direction:=PipeDirection.In, + maxNumberOfServerInstances:=1, + transmissionMode:=PipeTransmissionMode.Byte, + options:=NamedPipeOptions) + Return True + Catch ex As Exception + pipeServer = Nothing + Return False + End Try + End Function + + Friend Async Function WaitForClientConnectionsAsync(pipeServer As NamedPipeServerStream, callback As Action(Of String()), cancellationToken As CancellationToken) As Task + While True + cancellationToken.ThrowIfCancellationRequested() + Await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(False) + Try + Dim args() As String = Await ReadArgsAsync(pipeServer, cancellationToken).ConfigureAwait(False) + If args IsNot Nothing Then + callback(args) + End If + Finally + pipeServer.Disconnect() + End Try + End While + End Function + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb index 25ef7c8acae..5234d3e88b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/User.vb @@ -19,16 +19,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The name of the current user + ''' The principal representing the current user. ''' - Public ReadOnly Property Name() As String + ''' An IPrincipal representing the current user + ''' + ''' This should be overridden by derived classes that don't get the current + ''' user from the current thread + ''' + Protected Overridable Property InternalPrincipal() As IPrincipal Get - Return InternalPrincipal.Identity.Name + Return Thread.CurrentPrincipal End Get + Set(value As IPrincipal) + Thread.CurrentPrincipal = value + End Set End Property ''' - ''' The current IPrincipal which represents the current user + ''' The current which represents the current user. ''' ''' An IPrincipal representing the current user @@ -50,6 +58,15 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property + ''' + ''' The name of the current user + ''' + Public ReadOnly Property Name() As String + Get + Return InternalPrincipal.Identity.Name + End Get + End Property + ''' ''' Indicates whether or not the current user is a member of the passed in role ''' @@ -59,22 +76,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Return InternalPrincipal.IsInRole(role) End Function - ''' - ''' The principal representing the current user. - ''' - ''' An IPrincipal representing the current user - ''' - ''' This should be overridden by derived classes that don't get the current - ''' user from the current thread - ''' - Protected Overridable Property InternalPrincipal() As IPrincipal - Get - Return Thread.CurrentPrincipal - End Get - Set(value As IPrincipal) - Thread.CurrentPrincipal = value - End Set - End Property - End Class 'User End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb index b3e509ead58..33f2e9ef756 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.WinFormsAppContext.vb @@ -25,12 +25,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' - ''' - ''' shutdown when the main form closes. - ''' - ''' - ''' shutdown only after the last form closes. - ''' + ''' + ''' Shutdown when the main form closes. + ''' + ''' + ''' Shutdown only after the last form closes. + ''' ''' ''' ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 34d1de1ee0d..760e7d12fbf 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -15,18 +15,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices - ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). - Public Enum AuthenticationMode - Windows - ApplicationDefined - End Enum - - ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). - Public Enum ShutdownMode - AfterMainFormCloses - AfterAllFormsClose - End Enum - ''' ''' Signature for the ApplyApplicationDefaults event handler. ''' @@ -34,22 +22,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub ApplyApplicationDefaultsEventHandler(sender As Object, e As ApplyApplicationDefaultsEventArgs) ''' - ''' Signature for the Startup event handler. + ''' Signature for the Shutdown event handler. ''' - Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) + Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) ''' - ''' Signature for the StartupNextInstance event handler. + ''' Signature for the Startup event handler. ''' - Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) + Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) ''' - ''' Signature for the Shutdown event handler. + ''' Signature for the StartupNextInstance event handler. ''' - Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) + Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) ''' ''' Signature for the UnhandledException event handler. @@ -57,210 +45,86 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As UnhandledExceptionEventArgs) + ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). + Public Enum AuthenticationMode + Windows + ApplicationDefined + End Enum + + ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). + Public Enum ShutdownMode + AfterMainFormCloses + AfterAllFormsClose + End Enum + ''' ''' Provides the infrastructure for the VB Windows Forms application model. ''' ''' Don't put access on this definition. Partial Public Class WindowsFormsApplicationBase : Inherits ConsoleApplicationBase - ''' - ''' Occurs when the application is ready to accept default values for various application areas. - ''' - Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler - - ''' - ''' Occurs when the application starts. - ''' - Public Event Startup As StartupEventHandler - - ''' - ''' Occurs when attempting to start a single-instance application and the application is already active. - ''' - Public Event StartupNextInstance As StartupNextInstanceEventHandler - - ''' - ''' Occurs when the application shuts down. - ''' - Public Event Shutdown As ShutdownEventHandler - - ' Used to marshal a call to Dispose on the Splash Screen. - Private Delegate Sub DisposeDelegate() - ' How long a subsequent instance will wait for the original instance to get on its feet. - Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. - - Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. + Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 - Private ReadOnly _splashLock As New Object Private ReadOnly _appContext As WinFormsAppContext ' Sync object Private ReadOnly _networkAvailabilityChangeLock As New Object - Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) - Private _processingUnhandledExceptionEvent As Boolean - - ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. - Private _turnOnNetworkListener As Boolean - - ' Whether we have made it through the processing of OnInitialize. - Private _finishedOnInitialize As Boolean - - Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) - Private _networkObject As Devices.Network - - ' Whether this app runs using Word like instancing behavior. - Private _isSingleInstance As Boolean - - ' Defines when the application decides to close. - Private _shutdownStyle As ShutdownMode + Private ReadOnly _splashLock As New Object - ' Whether to use Windows XP styles. - Private _enableVisualStyles As Boolean + Private _appSynchronizationContext As SynchronizationContext ' We only need to show the splash screen once. ' Protect the user from himself if they are overriding our app model. Private _didSplashScreen As Boolean - ' For splash screens with a minimum display time, this let's us know when that time - ' has expired and it is OK to close the splash screen. - Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - - Private _formLoadWaiter As AutoResetEvent - Private _splashScreen As Form + ' Whether to use Windows XP styles. + Private _enableVisualStyles As Boolean - ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. - Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - Private _splashTimer As Timers.Timer - Private _appSynchronizationContext As SynchronizationContext + ' Whether we have made it through the processing of OnInitialize. + Private _finishedOnInitialize As Boolean - ' Informs My.Settings whether to save the settings on exit or not. - Private _saveMySettingsOnExit As Boolean + Private _formLoadWaiter As AutoResetEvent ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware - ''' - ''' Occurs when the network availability changes. - ''' - Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler - ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only - ' if the user writes a handler for it. - ' The reason being that it is very expensive to handle and kills our application startup performance. - AddHandler(value As Devices.NetworkAvailableEventHandler) - SyncLock _networkAvailabilityChangeLock - If _networkAvailabilityEventHandlers Is Nothing Then - _networkAvailabilityEventHandlers = New List(Of Devices.NetworkAvailableEventHandler) - End If - - _networkAvailabilityEventHandlers.Add(value) - - ' We don't want to create the network object now - it takes a snapshot - ' of the executionContext and our IPrincipal isn't on the thread yet. - ' We know we need to create it and we will at the appropriate time - _turnOnNetworkListener = True - - ' But the user may be doing an AddHandler of their own in which case we need - ' to make sure to honor the request. If we aren't past OnInitialize() yet - ' we shouldn't do it but the flag above catches that case. - If _networkObject Is Nothing AndAlso _finishedOnInitialize Then - _networkObject = New Devices.Network - Dim windowsFormsApplicationBase As WindowsFormsApplicationBase = Me - AddHandler _networkObject.NetworkAvailabilityChanged, - AddressOf windowsFormsApplicationBase.NetworkAvailableEventAdaptor - End If - End SyncLock - End AddHandler - - RemoveHandler(value As Devices.NetworkAvailableEventHandler) - If _networkAvailabilityEventHandlers IsNot Nothing AndAlso - _networkAvailabilityEventHandlers.Count > 0 Then - - _networkAvailabilityEventHandlers.Remove(value) - - ' Last one to leave - turn out the lights... - If _networkAvailabilityEventHandlers.Count = 0 Then - RemoveHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor - If _networkObject IsNot Nothing Then - - ' Stop listening to network change events because we are going to go away. - _networkObject.DisconnectListener() + ' Whether this app runs using Word like instancing behavior. + Private _isSingleInstance As Boolean - ' No sense holding on to this if nobody is listening. - _networkObject = Nothing - End If - End If - End If - End RemoveHandler + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. + Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT - RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) - If _networkAvailabilityEventHandlers IsNot Nothing Then - For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers - Try - If handler IsNot Nothing Then handler.Invoke(sender, e) - Catch ex As Exception - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) - ' The user didn't write a handler so throw the error up the chain. - Throw - End If - End Try - Next - End If - End RaiseEvent - End Event + Private _networkObject As Devices.Network - ''' - ''' Occurs when the application encounters an . - ''' - Public Custom Event UnhandledException As UnhandledExceptionEventHandler + Private _processingUnhandledExceptionEvent As Boolean - ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event - ' if the user is handling this event because the act of listening to Application.ThreadException - ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that - ' the user wrote their own handler to deal with the error instead. - AddHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers Is Nothing Then - _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) - End If + ' Informs My.Settings whether to save the settings on exit or not. + Private _saveMySettingsOnExit As Boolean - _unhandledExceptionHandlers.Add(value) + ' Defines when the application decides to close. + Private _shutdownStyle As ShutdownMode - ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception - If _unhandledExceptionHandlers.Count = 1 Then - AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End AddHandler + Private _splashScreen As Form - RemoveHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers IsNot Nothing AndAlso - _unhandledExceptionHandlers.Count > 0 Then - _unhandledExceptionHandlers.Remove(value) + ' For splash screens with a minimum display time, this let's us know when that time + ' has expired and it is OK to close the splash screen. + Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - ' Last one to leave, turn out the lights... - If _unhandledExceptionHandlers.Count = 0 Then - RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End If - End RemoveHandler + Private _splashTimer As Timers.Timer - RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) - If _unhandledExceptionHandlers IsNot Nothing Then + ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. + Private _turnOnNetworkListener As Boolean - ' In the case that we throw from the handler, we don't want to - ' run the handler again. - _processingUnhandledExceptionEvent = True + Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) - For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers - handler?.Invoke(sender, e) - Next + Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 - ' Now that we are out of the handler, treat exceptions normally again. - _processingUnhandledExceptionEvent = False - End If - End RaiseEvent - End Event + ' Used to marshal a call to Dispose on the Splash Screen. + Private Delegate Sub DisposeDelegate() ''' ''' Constructs the application Shutdown/Startup model object @@ -310,79 +174,86 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' Use GDI for the text rendering engine by default. + ''' The user can shadow this function to return True if they want their app + ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' determine how to set the text rendering flag on the WinForms application object. ''' - ''' The command line from Main(). - - Public Sub Run(commandLine As String()) - - ' Prime the command line args with what we receive from Main() so that Click-Once windows - ' apps don't have to do a System.Environment call which would require permissions. - InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) - - If Not IsSingleInstance Then - DoApplicationModel() - Else - ' This is a Single-Instance application + ''' True - Use GDI+ renderer. False - use GDI renderer. + + Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Get + Return False + End Get + End Property - ' Note: Must pass the calling assembly from here so we can get the running app. - ' Otherwise, can break single instance. - Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) - Dim pipeServer As NamedPipeServerStream = Nothing + ''' + ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. + ''' + Protected Property EnableVisualStyles() As Boolean + Get + Return _enableVisualStyles + End Get + Set(value As Boolean) + _enableVisualStyles = value + End Set + End Property - If TryCreatePipeServer(applicationInstanceID, pipeServer) Then + ''' + ''' Gets or sets the HighDpiMode for the Application. + ''' + + Protected Property HighDpiMode() As HighDpiMode + Get + Return _highDpiMode + End Get + Set(value As HighDpiMode) + _highDpiMode = value + End Set + End Property - ' --- This is the first instance of a single-instance application to run. - ' This is the instance that subsequent instances will attach to. - Using pipeServer - Dim tokenSource As New CancellationTokenSource() -#Disable Warning BC42358 ' Call is not awaited. - WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) -#Enable Warning BC42358 - DoApplicationModel() - tokenSource.Cancel() - End Using - Else + + Protected Property IsSingleInstance() As Boolean + Get + Return _isSingleInstance + End Get + Set(value As Boolean) + _isSingleInstance = value + End Set + End Property - ' --- We are launching a subsequent instance. - Dim tokenSource As New CancellationTokenSource() - tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) - Try - Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) - awaitable.GetAwaiter().GetResult() - Catch ex As Exception - Throw New CantStartSingleInstanceException() - End Try - End If - End If 'Single-Instance application - End Sub + ''' + ''' Determines when this application will terminate (when the main form goes down, all forms) + ''' + Protected Friend Property ShutdownStyle() As ShutdownMode + Get + Return _shutdownStyle + End Get + Set(value As ShutdownMode) + ValidateShutdownModeEnumValue(value, NameOf(value)) + _shutdownStyle = value + End Set + End Property ''' - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. + ''' Provides the WinForms application context that we are running on ''' - Public ReadOnly Property OpenForms() As FormCollection + + Public ReadOnly Property ApplicationContext() As ApplicationContext Get - Return Application.OpenForms + Return _appContext End Get End Property ''' - ''' Provides access to the main form for this application + ''' Informs My.Settings whether to save the settings on exit or not ''' - Protected Property MainForm() As Form + Public Property SaveMySettingsOnExit() As Boolean Get - Return _appContext?.MainForm + Return _saveMySettingsOnExit End Get - Set(value As Form) - If value Is Nothing Then - Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") - End If - If value Is _splashScreen Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) - End If - _appContext.MainForm = value + Set(value As Boolean) + _saveMySettingsOnExit = value End Set End Property @@ -404,6 +275,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property + ''' + ''' Provides access to the main form for this application + ''' + Protected Property MainForm() As Form + Get + Return _appContext?.MainForm + End Get + Set(value As Form) + If value Is Nothing Then + Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + End If + If value Is _splashScreen Then + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + End If + _appContext.MainForm = value + End Set + End Property + ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash ''' screen should be displayed for. When not set then the splash screen is hidden @@ -428,437 +317,281 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Use GDI for the text rendering engine by default. - ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to - ''' determine how to set the text rendering flag on the WinForms application object. + ''' Returns the collection of forms that are open. We no longer have thread + ''' affinity meaning that this is the WinForms collection that contains Forms that may + ''' have been opened on another thread then the one we are calling in on right now. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer. - - Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Public ReadOnly Property OpenForms() As FormCollection Get - Return False + Return Application.OpenForms End Get End Property ''' - ''' Provides the WinForms application context that we are running on + ''' Occurs when the application is ready to accept default values for various application areas. ''' - - Public ReadOnly Property ApplicationContext() As ApplicationContext - Get - Return _appContext - End Get - End Property + Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler ''' - ''' Informs My.Settings whether to save the settings on exit or not + ''' Occurs when the application shuts down. ''' - Public Property SaveMySettingsOnExit() As Boolean - Get - Return _saveMySettingsOnExit - End Get - Set(value As Boolean) - _saveMySettingsOnExit = value - End Set - End Property + Public Event Shutdown As ShutdownEventHandler ''' - ''' Processes all windows messages currently in the message queue + ''' Occurs when the application starts. ''' - Public Sub DoEvents() - Application.DoEvents() - End Sub + Public Event Startup As StartupEventHandler ''' - ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows - ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its - ''' variants was passed in. + ''' Occurs when attempting to start a single-instance application and the application is already active. ''' - ''' - ''' Returning True indicates that we should continue on with the application Startup sequence. - ''' - ''' This extensibility point is exposed for people who want to override - ''' the Startup sequence at the earliest possible point to - ''' - - Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean - - ' Rationale for how we process the default values and how we let the user modify - ' them on demand via the ApplyApplicationDefaults event. - ' =========================================================================================== - ' a) Users used to be able to set MinimumSplashScreenDisplayTime _only_ by overriding OnInitialize - ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. - ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents - ' where it could be modified (again). So event wins over Override over default value (2 seconds). - ' b) We feed the default HighDpiMode (SystemAware) to the EventArgs. With the introduction of - ' the HighDpiMode property, we give Project System the chance to reflect the HighDpiMode - ' in the App Designer UI and have it code-generated based on a modified Application.myapp, which - ' would result it to be set in the derived constructor. (See the hidden file in the Solution Explorer - ' "My Project\Application.myapp\Application.Designer.vb for how those UI-set values get applied.) - ' Once all this is done, we give the User another chance to change the value by code through - ' the ApplyDefaults event. - ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! - Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( - MinimumSplashScreenDisplayTime, - HighDpiMode) With - { - .MinimumSplashScreenDisplayTime = MinimumSplashScreenDisplayTime - } + Public Event StartupNextInstance As StartupNextInstanceEventHandler - RaiseEvent ApplyApplicationDefaults(Me, applicationDefaultsEventArgs) + ' milliseconds. - If (applicationDefaultsEventArgs.Font IsNot Nothing) Then - Application.SetDefaultFont(applicationDefaultsEventArgs.Font) - End If + ''' + ''' Occurs when the application encounters an . + ''' + Public Custom Event UnhandledException As UnhandledExceptionEventHandler - MinimumSplashScreenDisplayTime = applicationDefaultsEventArgs.MinimumSplashScreenDisplayTime + ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException + ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' if the user is handling this event because the act of listening to Application.ThreadException + ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that + ' the user wrote their own handler to deal with the error instead. + AddHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers Is Nothing Then + _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) + End If - ' This creates the native window, and that means, we can no longer apply a different Default Font. - ' So, this is the earliest point in time to set the AsyncOperationManager's SyncContext. - AsyncOperationManager.SynchronizationContext = New WindowsFormsSynchronizationContext() + _unhandledExceptionHandlers.Add(value) - _highDpiMode = applicationDefaultsEventArgs.HighDpiMode + ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception + If _unhandledExceptionHandlers.Count = 1 Then + AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End AddHandler - ' Then, it's applying what we got back as HighDpiMode. - Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) - If dpiSetResult Then - _highDpiMode = Application.HighDpiMode - End If - Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") + RemoveHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers IsNot Nothing AndAlso + _unhandledExceptionHandlers.Count > 0 Then + _unhandledExceptionHandlers.Remove(value) - ' And finally we take care of EnableVisualStyles. - If _enableVisualStyles Then - Application.EnableVisualStyles() - End If + ' Last one to leave, turn out the lights... + If _unhandledExceptionHandlers.Count = 0 Then + RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End If + End RemoveHandler - ' We'll handle "/nosplash" for you. - If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then - ShowSplashScreen() - End If + RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) + If _unhandledExceptionHandlers IsNot Nothing Then - _finishedOnInitialize = True + ' In the case that we throw from the handler, we don't want to + ' run the handler again. + _processingUnhandledExceptionEvent = True - ' We are now at a point where we can allow the network object - ' to be created since the iPrincipal is on the thread by now. + For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers + handler?.Invoke(sender, e) + Next - ' True means to not bail out but keep on running after OnInitialize() finishes - Return True - End Function + ' Now that we are out of the handler, treat exceptions normally again. + _processingUnhandledExceptionEvent = False + End If + End RaiseEvent + End Event + ' milliseconds. ''' - ''' Extensibility point which raises the Startup event + ''' Occurs when the network availability changes. ''' - ''' - - Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean + Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler + ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only + ' if the user writes a handler for it. + ' The reason being that it is very expensive to handle and kills our application startup performance. + AddHandler(value As Devices.NetworkAvailableEventHandler) + SyncLock _networkAvailabilityChangeLock + If _networkAvailabilityEventHandlers Is Nothing Then + _networkAvailabilityEventHandlers = New List(Of Devices.NetworkAvailableEventHandler) + End If - eventArgs.Cancel = False + _networkAvailabilityEventHandlers.Add(value) - ' It is important not to create the network object until the ExecutionContext has everything on it. - ' By now the principal will be on the thread so we can create the network object. - ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() - ' which makes a copy of the executionContext. That execution context shows up on your thread during - ' the callback so I delay creating the network object (and consequently the capturing of the execution context) - ' until the principal has been set on the thread. This avoids the problem where My.User isn't set - ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future - ' callback that involved the asyncOperationsManager so this is where we need to create objects that - ' have a asyncOperationsContext in them. - If _turnOnNetworkListener And _networkObject Is Nothing Then + ' We don't want to create the network object now - it takes a snapshot + ' of the executionContext and our IPrincipal isn't on the thread yet. + ' We know we need to create it and we will at the appropriate time + _turnOnNetworkListener = True - ' The is-nothing-check is to avoid hooking the object more than once. - _networkObject = New Devices.Network - AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor - End If + ' But the user may be doing an AddHandler of their own in which case we need + ' to make sure to honor the request. If we aren't past OnInitialize() yet + ' we shouldn't do it but the flag above catches that case. + If _networkObject Is Nothing AndAlso _finishedOnInitialize Then + _networkObject = New Devices.Network + Dim windowsFormsApplicationBase As WindowsFormsApplicationBase = Me + AddHandler _networkObject.NetworkAvailabilityChanged, + AddressOf windowsFormsApplicationBase.NetworkAvailableEventAdaptor + End If + End SyncLock + End AddHandler - RaiseEvent Startup(Me, eventArgs) + RemoveHandler(value As Devices.NetworkAvailableEventHandler) + If _networkAvailabilityEventHandlers IsNot Nothing AndAlso + _networkAvailabilityEventHandlers.Count > 0 Then - Return Not eventArgs.Cancel - End Function + _networkAvailabilityEventHandlers.Remove(value) - ''' - ''' Extensibility point which raises the StartupNextInstance - ''' - ''' - - - Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) + ' Last one to leave - turn out the lights... + If _networkAvailabilityEventHandlers.Count = 0 Then + RemoveHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor + If _networkObject IsNot Nothing Then - RaiseEvent StartupNextInstance(Me, eventArgs) + ' Stop listening to network change events because we are going to go away. + _networkObject.DisconnectListener() - ' Activate the original instance. - If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then - If MainForm.WindowState = FormWindowState.Minimized Then - MainForm.WindowState = FormWindowState.Normal + ' No sense holding on to this if nobody is listening. + _networkObject = Nothing + End If + End If End If + End RemoveHandler - MainForm.Activate() - End If - End Sub + RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) + If _networkAvailabilityEventHandlers IsNot Nothing Then + For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers + Try + If handler IsNot Nothing Then handler.Invoke(sender, e) + Catch ex As Exception + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + + ' The user didn't write a handler so throw the error up the chain. + Throw + End If + End Try + Next + End If + End RaiseEvent + End Event ''' - ''' At this point, the command line args should have been processed and the application will create the - ''' main form and enter the message loop. + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. ''' - - - Protected Overridable Sub OnRun() + ''' + ''' + ''' A string unique to the application that should be the same for versions of + ''' the application that have the same Major and Minor Version Number. + ''' + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String - If MainForm Is Nothing Then + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() - ' A designer overrides OnCreateMainForm() to set the main form we are supposed to use. - OnCreateMainForm() + If guidAttrib IsNot Nothing Then - If MainForm Is Nothing Then - Throw New NoStartupFormException - End If + Dim version As Version = entry.GetName.Version - ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to - ' block the main form from painting. To do that I let the form get past the Load() event and hold it until - ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of - ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. - AddHandler MainForm.Load, AddressOf MainFormLoadingDone + If version IsNot Nothing Then + Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" + Else + Return guidAttrib.Value + End If End If - ' Run() eats all exceptions (unless running under the debugger). If the user wrote an - ' UnhandledException handler we will hook the System.Windows.Forms.Application.ThreadException event - ' (see Public Custom Event UnhandledException) which will raise our UnhandledException Event. - ' If our user didn't write an UnhandledException event, then we land in the try/catch handler for Forms.Application.Run(). - Try - Application.Run(_appContext) - Finally - - ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) - ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it - ' can't fire any events in response to changing network availability conditions through a dead context. - If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() - - 'Restore the prior sync context. - AsyncOperationManager.SynchronizationContext = _appSynchronizationContext - _appSynchronizationContext = Nothing - End Try - End Sub - - ''' - ''' A designer will override this method and provide a splash screen if this application has one. - ''' - ''' - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app - ''' - - Protected Overridable Sub OnCreateSplashScreen() - End Sub + Return entry.ManifestModule.ModuleVersionId.ToString() + End Function ''' - ''' Provides a hook that designers will override to set the main form. + ''' Validates that the value being passed as an AuthenticationMode enum is a legal value ''' - - Protected Overridable Sub OnCreateMainForm() + ''' + Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) + If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) + End If End Sub ''' - ''' The last in a series of extensibility points for the Shutdown process + ''' Validates that the value being passed as an ShutdownMode enum is a legal value ''' - - Protected Overridable Sub OnShutdown() - RaiseEvent Shutdown(Me, EventArgs.Empty) + ''' + Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) + If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) + End If End Sub ''' - ''' Raises the event and exits the application if the event handler indicated - ''' that execution shouldn't continue. + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' it doesn't freeze up while the main form is getting it together. ''' - ''' - ''' True indicates the exception event was raised / False it was not. - - Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean - - ' Does the user have a handler for this event? - If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then + Private Sub DisplaySplash() + Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - ' We don't put a try/catch around the handler event so that exceptions in there will - ' bubble out - else we will have a recursive exception handler. - RaiseEvent UnhandledException(Me, e) - If e.ExitApplication Then Application.Exit() + If _splashTimer IsNot Nothing Then - ' User handled the event. - Return True + ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. + ' Enable the timer now that we are about to show the splash screen. + _splashTimer.Enabled = True End If - ' Nobody was listening to the UnhandledException event. - Return False - End Function + Application.Run(_splashScreen) + End Sub ''' - ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, - ''' displays it. + ''' Runs the user's program through the VB Startup/Shutdown application model ''' - - Protected Sub ShowSplashScreen() - If Not _didSplashScreen Then - _didSplashScreen = True + Private Sub DoApplicationModel() - If _splashScreen Is Nothing Then + Dim eventArgs As New StartupEventArgs(CommandLineArgs) - ' If the user specified a splash screen, the designer will have overridden this method to set it. - OnCreateSplashScreen() - End If + ' Only do the try/catch if we aren't running under the debugger. + ' If we do try/catch under the debugger the debugger never gets + ' a crack at exceptions which breaks the exception helper. + If Not Debugger.IsAttached Then - If _splashScreen IsNot Nothing Then + ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code + ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) + ' need to be mirrored in the ELSE debugger attached clause below. + Try + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If + Catch ex As Exception - ' Some splash screens have minimum face time they are supposed to get. - ' We'll set up a time to let us know when we can take it down. - If _minimumSplashExposure > 0 Then + ' This catch is for exceptions that happen during the On* methods above, + ' but have occurred outside of the message pump (which exceptions we would + ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). + If _processingUnhandledExceptionEvent Then - ' Don't close until the timer expires. - _splashTimer = New Timers.Timer(_minimumSplashExposure) - AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp - _splashTimer.AutoReset = False + ' If the UnhandledException handler threw for some reason, throw that error out to the system. + Throw + Else - ' We only need this, when we actually need to wait for it. - _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) + ' We had an exception, but not during the OnUnhandledException handler so give the user + ' a chance to look at what happened in the UnhandledException event handler + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then - ' We'll enable it in DisplaySplash() once the splash screen thread gets running. + ' The user didn't write a handler so throw the error out to the system + Throw + End If + End If + End Try + Else + ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception + ' will bubble out to the exception helper. + ' We also don't hook up the Application.ThreadException event because WinForms ignores it + ' when we are running under the debugger. + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() End If - - ' Run the splash screen on another thread so we don't starve it for events and painting - ' while the main form gets its act together. - Task.Run(AddressOf DisplaySplash) - End If - End If - End Sub - - ''' - ''' Hide the splash screen. The splash screen was created on another thread - ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. - ''' This function gets called from the main thread by the app fx. - ''' - - - Protected Sub HideSplashScreen() - - 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. - SyncLock _splashLock - - ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling - ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) - ' This is to fix the issue where the main form doesn't come to the front after the - ' Splash screen disappears. - MainForm?.Activate() - - If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then - Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) - _splashScreen.Invoke(disposeSplashDelegate) - _splashScreen = Nothing End If - End SyncLock - End Sub - - ''' - ''' Determines when this application will terminate (when the main form goes down, all forms) - ''' - Protected Friend Property ShutdownStyle() As ShutdownMode - Get - Return _shutdownStyle - End Get - Set(value As ShutdownMode) - ValidateShutdownModeEnumValue(value, NameOf(value)) - _shutdownStyle = value - End Set - End Property - - ''' - ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. - ''' - Protected Property EnableVisualStyles() As Boolean - Get - Return _enableVisualStyles - End Get - Set(value As Boolean) - _enableVisualStyles = value - End Set - End Property - - ''' - ''' Gets or sets the HighDpiMode for the Application. - ''' - - Protected Property HighDpiMode() As HighDpiMode - Get - Return _highDpiMode - End Get - Set(value As HighDpiMode) - _highDpiMode = value - End Set - End Property - - - Protected Property IsSingleInstance() As Boolean - Get - Return _isSingleInstance - End Get - Set(value As Boolean) - _isSingleInstance = value - End Set - End Property - - ''' - ''' Validates that the value being passed as an AuthenticationMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) - If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) - End If - End Sub - - ''' - ''' Validates that the value being passed as an ShutdownMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) - If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) - End If - End Sub - - ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. - ''' - Private Sub DisplaySplash() - Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - - If _splashTimer IsNot Nothing Then - - ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. - ' Enable the timer now that we are about to show the splash screen. - _splashTimer.Enabled = True - End If - - Application.Run(_splashScreen) - End Sub - - ''' - ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. - ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. - ''' - Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) - - If _splashTimer IsNot Nothing Then - - 'We only have a timer if there was a minimum timeout on the splash screen. - _splashTimer.Dispose() - _splashTimer = Nothing End If - - _splashScreenCompletionSource.SetResult(True) End Sub ''' @@ -896,16 +629,31 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event. + ''' If a splash screen has a minimum time out, then once that is up we check to see whether + ''' we should close the splash screen. If the main form has activated then we close it. + ''' Note that we are getting called on a secondary thread here which isn't necessarily + ''' associated with any form. Don't touch forms from this function. ''' - ''' - ''' - ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' event so we do the translation here before raising our event. - ''' - Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) - OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) + Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) + + If _splashTimer IsNot Nothing Then + + 'We only have a timer if there was a minimum timeout on the splash screen. + _splashTimer.Dispose() + _splashTimer = Nothing + End If + + _splashScreenCompletionSource.SetResult(True) + End Sub + + ''' + ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the + ''' NetworkAvailabilityChanged event. + ''' + ''' Contains the Network instance that raised the event. + ''' Contains whether the network is available or not. + Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) + RaiseEvent NetworkAvailabilityChanged(sender, e) End Sub Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) @@ -932,7 +680,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices SynchronizationContext. Send(Sub() handleNextInstance(), Nothing) End If - Catch ex As Exception When Not invoked ' Only catch exceptions thrown when the UI thread is not available, before ' the UI thread has been created or after it has been terminated. Exceptions @@ -941,98 +688,359 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event. + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event. ''' - ''' Contains the Network instance that raised the event. - ''' Contains whether the network is available or not. - Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) - RaiseEvent NetworkAvailabilityChanged(sender, e) + ''' + ''' + ''' Our UnHandledException event has a different signature then the Windows.Forms.Application + ''' event so we do the translation here before raising our event. + ''' + Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) + OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) End Sub ''' - ''' Runs the user's program through the VB Startup/Shutdown application model + ''' Hide the splash screen. The splash screen was created on another thread + ''' thread (main thread) than the one it was run on (secondary thread for the + ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' This function gets called from the main thread by the app fx. ''' - Private Sub DoApplicationModel() - - Dim eventArgs As New StartupEventArgs(CommandLineArgs) - - ' Only do the try/catch if we aren't running under the debugger. - ' If we do try/catch under the debugger the debugger never gets - ' a crack at exceptions which breaks the exception helper. - If Not Debugger.IsAttached Then + + + Protected Sub HideSplashScreen() - ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code - ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) - ' need to be mirrored in the ELSE debugger attached clause below. - Try - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() - End If - End If - Catch ex As Exception + 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. + SyncLock _splashLock - ' This catch is for exceptions that happen during the On* methods above, - ' but have occurred outside of the message pump (which exceptions we would - ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). - If _processingUnhandledExceptionEvent Then + ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling + ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) + ' This is to fix the issue where the main form doesn't come to the front after the + ' Splash screen disappears. + MainForm?.Activate() - ' If the UnhandledException handler threw for some reason, throw that error out to the system. - Throw - Else + If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then + Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) + _splashScreen.Invoke(disposeSplashDelegate) + _splashScreen = Nothing + End If + End SyncLock + End Sub - ' We had an exception, but not during the OnUnhandledException handler so give the user - ' a chance to look at what happened in the UnhandledException event handler - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + ''' + ''' Provides a hook that designers will override to set the main form. + ''' + + Protected Overridable Sub OnCreateMainForm() + End Sub - ' The user didn't write a handler so throw the error out to the system - Throw - End If - End If - End Try - Else - ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception - ' will bubble out to the exception helper. - ' We also don't hook up the Application.ThreadException event because WinForms ignores it - ' when we are running under the debugger. - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() - End If + ''' + ''' A designer will override this method and provide a splash screen if this application has one. + ''' + ''' + ''' For instance, a designer would override this method and emit: Me.Splash = new Splash + ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + + Protected Overridable Sub OnCreateSplashScreen() + End Sub + + ''' + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its + ''' variants was passed in. + ''' + ''' + ''' Returning True indicates that we should continue on with the application Startup sequence. + ''' + ''' This extensibility point is exposed for people who want to override + ''' the Startup sequence at the earliest possible point to + ''' + + Protected Overridable Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean + + ' Rationale for how we process the default values and how we let the user modify + ' them on demand via the ApplyApplicationDefaults event. + ' =========================================================================================== + ' a) Users used to be able to set MinimumSplashScreenDisplayTime _only_ by overriding OnInitialize + ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. + ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents + ' where it could be modified (again). So event wins over Override over default value (2 seconds). + ' b) We feed the default HighDpiMode (SystemAware) to the EventArgs. With the introduction of + ' the HighDpiMode property, we give Project System the chance to reflect the HighDpiMode + ' in the App Designer UI and have it code-generated based on a modified Application.myapp, which + ' would result it to be set in the derived constructor. (See the hidden file in the Solution Explorer + ' "My Project\Application.myapp\Application.Designer.vb for how those UI-set values get applied.) + ' Once all this is done, we give the User another chance to change the value by code through + ' the ApplyDefaults event. + ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! + Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( + MinimumSplashScreenDisplayTime, + HighDpiMode) With + { + .MinimumSplashScreenDisplayTime = MinimumSplashScreenDisplayTime + } + + RaiseEvent ApplyApplicationDefaults(Me, applicationDefaultsEventArgs) + + If (applicationDefaultsEventArgs.Font IsNot Nothing) Then + Application.SetDefaultFont(applicationDefaultsEventArgs.Font) + End If + + MinimumSplashScreenDisplayTime = applicationDefaultsEventArgs.MinimumSplashScreenDisplayTime + + ' This creates the native window, and that means, we can no longer apply a different Default Font. + ' So, this is the earliest point in time to set the AsyncOperationManager's SyncContext. + AsyncOperationManager.SynchronizationContext = New WindowsFormsSynchronizationContext() + + _highDpiMode = applicationDefaultsEventArgs.HighDpiMode + + ' Then, it's applying what we got back as HighDpiMode. + Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) + If dpiSetResult Then + _highDpiMode = Application.HighDpiMode + End If + Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") + + ' And finally we take care of EnableVisualStyles. + If _enableVisualStyles Then + Application.EnableVisualStyles() + End If + + ' We'll handle "/nosplash" for you. + If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then + ShowSplashScreen() + End If + + _finishedOnInitialize = True + + ' We are now at a point where we can allow the network object + ' to be created since the iPrincipal is on the thread by now. + + ' True means to not bail out but keep on running after OnInitialize() finishes + Return True + End Function + + ''' + ''' At this point, the command line args should have been processed and the application will create the + ''' main form and enter the message loop. + ''' + + + Protected Overridable Sub OnRun() + + If MainForm Is Nothing Then + + ' A designer overrides OnCreateMainForm() to set the main form we are supposed to use. + OnCreateMainForm() + + If MainForm Is Nothing Then + Throw New NoStartupFormException End If + + ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to + ' block the main form from painting. To do that I let the form get past the Load() event and hold it until + ' the splash screen goes down. Then I let the main form continue it's startup sequence. The ordering of + ' Form startup events for reference is: Ctor(), Load Event, Layout event, Shown event, Activated event, Paint event. + AddHandler MainForm.Load, AddressOf MainFormLoadingDone End If + + ' Run() eats all exceptions (unless running under the debugger). If the user wrote an + ' UnhandledException handler we will hook the System.Windows.Forms.Application.ThreadException event + ' (see Public Custom Event UnhandledException) which will raise our UnhandledException Event. + ' If our user didn't write an UnhandledException event, then we land in the try/catch handler for Forms.Application.Run(). + Try + Application.Run(_appContext) + Finally + + ' When Run() returns, the context we pushed in our ctor (which was a WindowsFormsSynchronizationContext) + ' is restored. But we are going to dispose it so we need to disconnect the network listener so that it + ' can't fire any events in response to changing network availability conditions through a dead context. + If _networkObject IsNot Nothing Then _networkObject.DisconnectListener() + + 'Restore the prior sync context. + AsyncOperationManager.SynchronizationContext = _appSynchronizationContext + _appSynchronizationContext = Nothing + End Try End Sub ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. + ''' The last in a series of extensibility points for the Shutdown process ''' - ''' - ''' - ''' A string unique to the application that should be the same for versions of - ''' the application that have the same Major and Minor Version Number. - ''' - ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. - Private Shared Function GetApplicationInstanceID(entry As Assembly) As String + + Protected Overridable Sub OnShutdown() + RaiseEvent Shutdown(Me, EventArgs.Empty) + End Sub - Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() + ''' + ''' Extensibility point which raises the Startup event + ''' + ''' + + Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean - If guidAttrib IsNot Nothing Then + eventArgs.Cancel = False - Dim version As Version = entry.GetName.Version + ' It is important not to create the network object until the ExecutionContext has everything on it. + ' By now the principal will be on the thread so we can create the network object. + ' The timing is important because the network object has an AsyncOperationsManager in it that marshals + ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' which makes a copy of the executionContext. That execution context shows up on your thread during + ' the callback so I delay creating the network object (and consequently the capturing of the execution context) + ' until the principal has been set on the thread. This avoids the problem where My.User isn't set + ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future + ' callback that involved the asyncOperationsManager so this is where we need to create objects that + ' have a asyncOperationsContext in them. + If _turnOnNetworkListener And _networkObject Is Nothing Then - If version IsNot Nothing Then - Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" - Else - Return guidAttrib.Value + ' The is-nothing-check is to avoid hooking the object more than once. + _networkObject = New Devices.Network + AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor + End If + + RaiseEvent Startup(Me, eventArgs) + + Return Not eventArgs.Cancel + End Function + + ''' + ''' Extensibility point which raises the StartupNextInstance + ''' + ''' + + + Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) + + RaiseEvent StartupNextInstance(Me, eventArgs) + + ' Activate the original instance. + If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then + If MainForm.WindowState = FormWindowState.Minimized Then + MainForm.WindowState = FormWindowState.Normal End If + + MainForm.Activate() End If + End Sub - Return entry.ManifestModule.ModuleVersionId.ToString() + ''' + ''' Raises the event and exits the application if the event handler indicated + ''' that execution shouldn't continue. + ''' + ''' + ''' True indicates the exception event was raised / False it was not. + + Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean + + ' Does the user have a handler for this event? + If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then + + ' We don't put a try/catch around the handler event so that exceptions in there will + ' bubble out - else we will have a recursive exception handler. + RaiseEvent UnhandledException(Me, e) + If e.ExitApplication Then Application.Exit() + + ' User handled the event. + Return True + End If + + ' Nobody was listening to the UnhandledException event. + Return False End Function + ''' + ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, + ''' displays it. + ''' + + Protected Sub ShowSplashScreen() + If Not _didSplashScreen Then + _didSplashScreen = True + + If _splashScreen Is Nothing Then + + ' If the user specified a splash screen, the designer will have overridden this method to set it. + OnCreateSplashScreen() + End If + + If _splashScreen IsNot Nothing Then + + ' Some splash screens have minimum face time they are supposed to get. + ' We'll set up a time to let us know when we can take it down. + If _minimumSplashExposure > 0 Then + + ' Don't close until the timer expires. + _splashTimer = New Timers.Timer(_minimumSplashExposure) + AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp + _splashTimer.AutoReset = False + + ' We only need this, when we actually need to wait for it. + _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) + + ' We'll enable it in DisplaySplash() once the splash screen thread gets running. + End If + + ' Run the splash screen on another thread so we don't starve it for events and painting + ' while the main form gets its act together. + Task.Run(AddressOf DisplaySplash) + End If + End If + End Sub + + ''' + ''' Processes all windows messages currently in the message queue + ''' + Public Sub DoEvents() + Application.DoEvents() + End Sub + + ''' + ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' + ''' The command line from Main(). + + Public Sub Run(commandLine As String()) + + ' Prime the command line args with what we receive from Main() so that Click-Once windows + ' apps don't have to do a System.Environment call which would require permissions. + InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) + + If Not IsSingleInstance Then + DoApplicationModel() + Else + ' This is a Single-Instance application + + ' Note: Must pass the calling assembly from here so we can get the running app. + ' Otherwise, can break single instance. + Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) + Dim pipeServer As NamedPipeServerStream = Nothing + + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then + + ' --- This is the first instance of a single-instance application to run. + ' This is the instance that subsequent instances will attach to. + Using pipeServer + Dim tokenSource As New CancellationTokenSource() +#Disable Warning BC42358 ' Call is not awaited. + WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) +#Enable Warning BC42358 + DoApplicationModel() + tokenSource.Cancel() + End Using + Else + + ' --- We are launching a subsequent instance. + Dim tokenSource As New CancellationTokenSource() + tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) + Try + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + awaitable.GetAwaiter().GetResult() + Catch ex As Exception + Throw New CantStartSingleInstanceException() + End Try + End If + End If 'Single-Instance application + End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 7a701b5aebb..63b65abfb60 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports System.Runtime.InteropServices Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices @@ -144,7 +145,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Function GetWin32Exception(resourceID As String, ParamArray placeHolders() As String) As ComponentModel.Win32Exception - Return New ComponentModel.Win32Exception(Runtime.InteropServices.Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) + Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function End Module diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index afaa7acdf99..63e05043f72 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -238,7 +238,7 @@ Namespace Microsoft.VisualBasic.Devices _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX _memoryStatusEx.Init() If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then - Throw GetWin32Exception(SR.DiagnosticInfo_Memory) + Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) End If End Sub diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb index 8f36a01def9..ec183f8f014 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailability.vb @@ -28,6 +28,18 @@ Namespace Microsoft.VisualBasic.Devices Private _synchronizationContext As SynchronizationContext + ''' + ''' Indicates whether or not the local machine is connected to an IP network. + ''' + ''' True if connected, otherwise False. + Public ReadOnly Property IsAvailable() As Boolean + Get + + Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() + + End Get + End Property + ''' ''' Event fired when connected to the network. ''' @@ -88,18 +100,6 @@ Namespace Microsoft.VisualBasic.Devices End RaiseEvent End Event - ''' - ''' Indicates whether or not the local machine is connected to an IP network. - ''' - ''' True if connected, otherwise False. - Public ReadOnly Property IsAvailable() As Boolean - Get - - Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() - - End Get - End Property - 'Listens to the AddressChanged event which will come on the same thread that this class was created on (AsyncEventManager is responsible for getting the event here) Private Sub NetworkAvailabilityChangedHandler(state As Object) Dim connected As Boolean = IsAvailable diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb index 5413098f516..7f2d99827f2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkAvailableEventArgs.vb @@ -14,5 +14,6 @@ Namespace Microsoft.VisualBasic.Devices End Sub Public ReadOnly Property IsNetworkAvailable() As Boolean + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index 9ddf98c75a4..50e9ffb722d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -8,7 +8,7 @@ Imports Microsoft.VisualBasic.MyServices.Internal Namespace Microsoft.VisualBasic.Devices - Partial Public Class Network + Public Class Network ''' ''' Uploads a file from the local machine to the specified host. @@ -35,7 +35,12 @@ Namespace Microsoft.VisualBasic.Devices ''' The full name and path of the host destination. ''' The name of the user performing the upload. ''' The user's password. - Public Sub UploadFile(sourceFileName As String, address As String, userName As String, password As String) + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String) + UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub @@ -46,7 +51,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri representing the destination. ''' The name of the user performing the upload. ''' The user's password. - Public Sub UploadFile(sourceFileName As String, address As Uri, userName As String, password As String) + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String) + UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) End Sub @@ -59,12 +69,13 @@ Namespace Microsoft.VisualBasic.Devices ''' The user's password. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - Public Sub UploadFile(sourceFileName As String, - address As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer) + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer) UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) End Sub @@ -78,19 +89,22 @@ Namespace Microsoft.VisualBasic.Devices ''' The user's password. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Public Sub UploadFile(sourceFileName As String, - address As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). ' However, it is good practice to verify address before calling address.Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If ' Getting a uri will validate the form of the host address @@ -114,12 +128,13 @@ Namespace Microsoft.VisualBasic.Devices ''' The user's password. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - Public Sub UploadFile(sourceFileName As String, - address As Uri, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer) + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer) UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) End Sub @@ -133,14 +148,17 @@ Namespace Microsoft.VisualBasic.Devices ''' The user's password. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Public Sub UploadFile(sourceFileName As String, - address As Uri, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) @@ -157,11 +175,12 @@ Namespace Microsoft.VisualBasic.Devices ''' The credentials of the user performing the upload. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - Public Sub UploadFile(sourceFileName As String, - address As Uri, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer) + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer) UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, UICancelOption.ThrowException) End Sub @@ -174,26 +193,30 @@ Namespace Microsoft.VisualBasic.Devices ''' The credentials of the user performing the upload. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Public Sub UploadFile(sourceFileName As String, - address As Uri, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - onUserCancel As UICancelOption) + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' + Public Sub UploadFile( + sourceFileName As String, + address As Uri, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + onUserCancel As UICancelOption) + sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, NameOf(sourceFileName)) 'Make sure the file exists If Not IO.File.Exists(sourceFileName) Then - Throw New IO.FileNotFoundException(Utils.GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) + Throw New IO.FileNotFoundException(GetResourceString(SR.IO_FileNotFound_Path, sourceFileName)) End If If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw GetArgumentNullException(NameOf(address)) + Throw GetArgumentNullException("address") End If Using client As New WebClientExtended() @@ -207,8 +230,8 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then dialog = New ProgressDialog With { - .Text = Utils.GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), - .LabelText = Utils.GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) + .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), + .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) } End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb index e0a2cf74415..6e6cf77e6a5 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUtilities.vb @@ -18,7 +18,7 @@ Namespace Microsoft.VisualBasic.Devices Friend Const DEFAULT_USERNAME As String = "" ''' - ''' Posts a message to close the progress dialog + ''' Posts a message to close the progress dialog. ''' Friend Sub CloseProgressDialog(dialog As ProgressDialog) ' Don't invoke unless dialog is up and running @@ -56,7 +56,11 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved. ''' Indicates whether or not to show a progress bar. ''' New ProgressDialog. - Friend Function GetProgressDialog(address As String, destinationFileName As String, showUI As Boolean) As ProgressDialog + Friend Function GetProgressDialog( + address As String, + destinationFileName As String, + showUI As Boolean) As ProgressDialog + If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(path:=destinationFileName, paramName:=NameOf(destinationFileName)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb index 0d01e1f6423..586f8f0be1a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/WebClientExtended.vb @@ -8,9 +8,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Temporary class used to provide WebClient with a timeout property. ''' - ''' - ''' This class will be deleted when Timeout is added to WebClient. - ''' + ''' This class will be deleted when Timeout is added to WebClient. Friend NotInheritable Class WebClientExtended Inherits WebClient @@ -21,14 +19,12 @@ Namespace Microsoft.VisualBasic.Devices Private _useNonPassiveFtp As Boolean #Disable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete - Friend Sub New() End Sub - #Enable Warning BC41004 ' First statement of this 'Sub New' should be an explicit call to 'MyBase.New' or 'MyClass.New' because the constructor in the base class is marked obsolete ''' - ''' Sets or indicates the timeout used by WebRequest used by WebClient + ''' Sets or indicates the timeout used by WebRequest used by WebClient ''' Public WriteOnly Property Timeout() As Integer Set(value As Integer) @@ -40,7 +36,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Enables switching the server to non passive mode. ''' - ''' We need this in order for the progress UI on a download to work. + ''' We need this in order for the progress UI on a download to work Public WriteOnly Property UseNonPassiveFtp() As Boolean Set(value As Boolean) _useNonPassiveFtp = value @@ -48,8 +44,8 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Makes sure that the timeout value for WebRequests (used for all Download and - ''' Upload methods) is set to the Timeout value. + ''' Makes sure that the timeout value for WebRequests (used for all Download + ''' and Upload methods) is set to the Timeout value. ''' ''' Protected Overrides Function GetWebRequest(address As Uri) As WebRequest diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 06a61d141d2..698afb2de47 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -39,7 +39,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Class ''' - ''' Inherits SafeHandleZeroOrMinusOneIsInvalid, with additional InitialSetHandle method. + ''' Inherits , with additional InitialSetHandle method. ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. ''' Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index f597b76397e..19ebd71aa9a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -77,10 +77,10 @@ Namespace Microsoft.VisualBasic 'If not, throw FileNotFound Const ERROR_ACCESS_DENIED As Integer = 5 If errorCode = ERROR_ACCESS_DENIED Then - Throw VbMakeException(vbErrors.PermissionDenied) + Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) End If - Throw VbMakeException(vbErrors.FileNotFound) + Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) End If Finally safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. @@ -212,7 +212,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) + Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -341,7 +341,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) End Try Try @@ -361,7 +361,7 @@ Namespace Microsoft.VisualBasic Catch ex As ThreadAbortException Throw Catch - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) + Throw New ArgumentException(GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 40ab815d6b9..113c5f38082 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -13,17 +13,11 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Options for the location of a log's directory. + ''' Options for behavior when resources are exhausted. ''' - Public Enum LogFileLocation As Integer - - ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() - TempDirectory - - LocalUserApplicationDirectory - CommonApplicationDirectory - ExecutableDirectory - Custom + Public Enum DiskSpaceExhaustedOption As Integer + ThrowException + DiscardMessages End Enum ''' @@ -36,11 +30,17 @@ Namespace Microsoft.VisualBasic.Logging End Enum ''' - ''' Options for behavior when resources are exhausted. + ''' Options for the location of a log's directory. ''' - Public Enum DiskSpaceExhaustedOption As Integer - ThrowException - DiscardMessages + Public Enum LogFileLocation As Integer + + ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() + TempDirectory + + LocalUserApplicationDirectory + CommonApplicationDirectory + ExecutableDirectory + Custom End Enum ''' @@ -54,6 +54,156 @@ Namespace Microsoft.VisualBasic.Logging Partial Public Class FileLogTraceListener Inherits TraceListener + Private Const APPEND_INDEX As Integer = 0 + + Private Const AUTOFLUSH_INDEX As Integer = 1 + + Private Const BASEFILENAME_INDEX As Integer = 2 + + Private Const CUSTOMLOCATION_INDEX As Integer = 3 + + Private Const DATE_FORMAT As String = "yyyy-MM-dd" + + ' Name to be used when parameterless constructor is called + Private Const DEFAULT_NAME As String = "FileLogTraceListener" + + Private Const DELIMITER_INDEX As Integer = 4 + + Private Const DISKSPACEEXHAUSTEDBEHAVIOR_INDEX As Integer = 5 + + Private Const ENCODING_INDEX As Integer = 6 + + Private Const FILE_EXTENSION As String = ".log" + + Private Const INCLUDEHOSTNAME_INDEX As Integer = 7 + + ' Attribute keys used to access properties set in the config file + Private Const KEY_APPEND As String = "append" + Private Const KEY_APPEND_PASCAL As String = "Append" + Private Const KEY_AUTOFLUSH As String = "autoflush" + Private Const KEY_AUTOFLUSH_CAMEL As String = "autoFlush" + Private Const KEY_AUTOFLUSH_PASCAL As String = "AutoFlush" + Private Const KEY_BASEFILENAME As String = "basefilename" + Private Const KEY_BASEFILENAME_CAMEL As String = "baseFilename" + Private Const KEY_BASEFILENAME_CAMEL_ALT As String = "baseFileName" + Private Const KEY_BASEFILENAME_PASCAL As String = "BaseFilename" + Private Const KEY_BASEFILENAME_PASCAL_ALT As String = "BaseFileName" + Private Const KEY_CUSTOMLOCATION As String = "customlocation" + Private Const KEY_CUSTOMLOCATION_CAMEL As String = "customLocation" + Private Const KEY_CUSTOMLOCATION_PASCAL As String = "CustomLocation" + Private Const KEY_DELIMITER As String = "delimiter" + Private Const KEY_DELIMITER_PASCAL As String = "Delimiter" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR As String = "diskspaceexhaustedbehavior" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL As String = "diskSpaceExhaustedBehavior" + Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL As String = "DiskSpaceExhaustedBehavior" + Private Const KEY_ENCODING As String = "encoding" + Private Const KEY_ENCODING_PASCAL As String = "Encoding" + Private Const KEY_INCLUDEHOSTNAME As String = "includehostname" + Private Const KEY_INCLUDEHOSTNAME_CAMEL As String = "includeHostName" + Private Const KEY_INCLUDEHOSTNAME_PASCAL As String = "IncludeHostName" + Private Const KEY_LOCATION As String = "location" + Private Const KEY_LOCATION_PASCAL As String = "Location" + Private Const KEY_LOGFILECREATIONSCHEDULE As String = "logfilecreationschedule" + Private Const KEY_LOGFILECREATIONSCHEDULE_CAMEL As String = "logFileCreationSchedule" + Private Const KEY_LOGFILECREATIONSCHEDULE_PASCAL As String = "LogFileCreationSchedule" + Private Const KEY_MAXFILESIZE As String = "maxfilesize" + Private Const KEY_MAXFILESIZE_CAMEL As String = "maxFileSize" + Private Const KEY_MAXFILESIZE_PASCAL As String = "MaxFileSize" + Private Const KEY_RESERVEDISKSPACE As String = "reservediskspace" + Private Const KEY_RESERVEDISKSPACE_CAMEL As String = "reserveDiskSpace" + Private Const KEY_RESERVEDISKSPACE_PASCAL As String = "ReserveDiskSpace" + + Private Const LOCATION_INDEX As Integer = 8 + + Private Const LOGFILECREATIONSCHEDULE_INDEX As Integer = 9 + + Private Const MAX_OPEN_ATTEMPTS As Integer = Integer.MaxValue + + Private Const MAXFILESIZE_INDEX As Integer = 10 + + ' The minimum setting allowed for maximum file size + Private Const MIN_FILE_SIZE As Integer = 1000 + + ' Identifies properties in the BitArray + Private Const PROPERTY_COUNT As Integer = 12 + + Private Const RESERVEDISKSPACE_INDEX As Integer = 11 + + ' Delimiter used when converting a stack to a string + Private Const STACK_DELIMITER As String = ", " + + ' Table of all of the files opened by any FileLogTraceListener in the current process + Private Shared ReadOnly s_streams As New Dictionary(Of String, ReferencedStream) + + Private ReadOnly _day As Date = Now.Date + + ' Indicates whether or not properties have been set + ' Note: Properties that use m_PropertiesSet to track whether or not + ' they've been set should always be set through the property setter and not + ' by directly changing the corresponding private field. + Private ReadOnly _propertiesSet As New BitArray(PROPERTY_COUNT, False) + + ' A list of supported attributes + Private ReadOnly _supportedAttributes() As String = New String() { + KEY_APPEND, KEY_APPEND_PASCAL, KEY_AUTOFLUSH, KEY_AUTOFLUSH_PASCAL, + KEY_AUTOFLUSH_CAMEL, KEY_BASEFILENAME, KEY_BASEFILENAME_PASCAL, + KEY_BASEFILENAME_CAMEL, KEY_BASEFILENAME_PASCAL_ALT, + KEY_BASEFILENAME_CAMEL_ALT, KEY_CUSTOMLOCATION, KEY_CUSTOMLOCATION_PASCAL, + KEY_CUSTOMLOCATION_CAMEL, KEY_DELIMITER, KEY_DELIMITER_PASCAL, + KEY_DISKSPACEEXHAUSTEDBEHAVIOR, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL, + KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL, KEY_ENCODING, KEY_ENCODING_PASCAL, + KEY_INCLUDEHOSTNAME, KEY_INCLUDEHOSTNAME_PASCAL, KEY_INCLUDEHOSTNAME_CAMEL, + KEY_LOCATION, KEY_LOCATION_PASCAL, KEY_LOGFILECREATIONSCHEDULE, + KEY_LOGFILECREATIONSCHEDULE_PASCAL, KEY_LOGFILECREATIONSCHEDULE_CAMEL, + KEY_MAXFILESIZE, KEY_MAXFILESIZE_PASCAL, KEY_MAXFILESIZE_CAMEL, + KEY_RESERVEDISKSPACE, KEY_RESERVEDISKSPACE_PASCAL, KEY_RESERVEDISKSPACE_CAMEL} + + ' Indicates whether to append to or overwrite the log file + Private _append As Boolean = True + + ' Indicates whether or not to flush after every write + Private _autoFlush As Boolean + + ' Stores the name of the file minus the path, date stamp, and file number + Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) + + ' Directory to be used for the log file if Location is set to Custom + Private _customLocation As String = Application.UserAppDataPath + + ' The delimiter to be used to separate fields in a line of output + Private _delimiter As String = vbTab + + ' Indicates what behavior should take place when a resource level has been passed + Private _diskSpaceExhaustedBehavior As DiskSpaceExhaustedOption = DiskSpaceExhaustedOption.DiscardMessages + + ' The encoding of the log file + Private _encoding As Encoding = Encoding.UTF8 + + Private _firstDayOfWeek As Date = GetFirstDayOfWeek(Now.Date) + + ' The full name and path of the log file + Private _fullFileName As String + + Private _hostName As String + + ' Indicates whether or not to include the host id in the output + Private _includeHostName As Boolean + + ' Indicates the location of the log's directory + Private _location As LogFileLocation = LogFileLocation.LocalUserApplicationDirectory + + ' Indicate which date stamp should be used in the log file name + Private _logFileDateStamp As LogFileCreationScheduleOption = LogFileCreationScheduleOption.None + + ' The maximum size of the log file + Private _maxFileSize As Long = 5000000L + + ' The amount of free disk space there needs to be on the drive of the log file + Private _reserveDiskSpace As Long = 10000000L + + ' Reference counted stream used for writing to the log file + Private _stream As ReferencedStream + ''' ''' Creates a FileLogTraceListener with the passed in name. ''' @@ -70,92 +220,123 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Indicates the log's directory. + ''' Gets the host name. ''' - ''' An enum which can indicate one of several logical locations for the log. - Public Property Location() As LogFileLocation + ''' The host name. + ''' We use the machine name because we can get that even if not hooked up to a network. + Private ReadOnly Property HostName() As String Get - If Not _propertiesSet(LOCATION_INDEX) Then - If Attributes.ContainsKey(KEY_LOCATION) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileLocation)) - Me.Location = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOCATION)), LogFileLocation) - End If + If String.IsNullOrEmpty(_hostName) Then + ' Use the machine name + _hostName = Environment.MachineName End If - Return _location + Return _hostName End Get - Set(value As LogFileLocation) - ValidateLogFileLocationEnumValue(value, NameOf(value)) - - ' If the location is changing we need to close the current file - If _location <> value Then - CloseCurrentStream() - End If - _location = value - _propertiesSet(LOCATION_INDEX) = True - End Set End Property ''' - ''' Indicates whether or not the stream should be flushed after every write. + ''' Gets the stream to use for writing to the log. ''' - ''' True if the stream should be flushed after every write, otherwise False. - Public Property AutoFlush() As Boolean + ''' The stream. + Private ReadOnly Property ListenerStream() As ReferencedStream Get - If Not _propertiesSet(AUTOFLUSH_INDEX) Then - If Attributes.ContainsKey(KEY_AUTOFLUSH) Then - Me.AutoFlush = Convert.ToBoolean(Attributes(KEY_AUTOFLUSH), CultureInfo.InvariantCulture) - End If - End If - - Return _autoFlush - End Get - Set(value As Boolean) - DemandWritePermission() - _autoFlush = value - _propertiesSet(AUTOFLUSH_INDEX) = True - End Set - End Property + EnsureStreamIsOpen() - ''' - ''' Indicates whether or not the host name of the logging machine should - ''' be included in the output. - ''' - ''' True if the HostId should be included, otherwise False. - Public Property IncludeHostName() As Boolean - Get - If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then - If Attributes.ContainsKey(KEY_INCLUDEHOSTNAME) Then - Me.IncludeHostName = Convert.ToBoolean(Attributes(KEY_INCLUDEHOSTNAME), CultureInfo.InvariantCulture) - End If - End If - Return _includeHostName + Debug.Assert(_stream IsNot Nothing, "Unable to get stream") + Return _stream End Get - Set(value As Boolean) - DemandWritePermission() - _includeHostName = value - _propertiesSet(INCLUDEHOSTNAME_INDEX) = True - End Set End Property ''' - ''' Indicates whether or not the file should be appended to or overwritten. + ''' Gets the log file name under the current configuration. ''' - ''' True if the file should be appended to, otherwise False. - Public Property Append() As Boolean + ''' The log file name. + ''' + ''' Includes the full path and the DateStamp, but does not include the + ''' file number or the extension. + ''' + Private ReadOnly Property LogFileName() As String Get - If Not _propertiesSet(APPEND_INDEX) Then - If Attributes.ContainsKey(KEY_APPEND) Then - Me.Append = Convert.ToBoolean(Attributes(KEY_APPEND), CultureInfo.InvariantCulture) - End If - End If - - Return _append - End Get - Set(value As Boolean) - - DemandWritePermission() + Dim basePath As String - ' If this property is changing, we need to close the current file + ' Get the directory + Select Case Location + Case LogFileLocation.CommonApplicationDirectory + basePath = Application.CommonAppDataPath + Case LogFileLocation.ExecutableDirectory + basePath = Path.GetDirectoryName(Application.ExecutablePath) + Case LogFileLocation.LocalUserApplicationDirectory + basePath = Application.UserAppDataPath + Case LogFileLocation.TempDirectory + basePath = Path.GetTempPath() + Case LogFileLocation.Custom + If String.IsNullOrEmpty(CustomLocation) Then + basePath = Application.UserAppDataPath + Else + basePath = CustomLocation + End If + Case Else + Debug.Fail("Unrecognized location") + basePath = Application.UserAppDataPath + End Select + + ' Add the base name + Dim fileName As String = BaseFileName + + ' Add DateTime Stamp + Select Case LogFileCreationSchedule + Case LogFileCreationScheduleOption.Daily + fileName += "-" & Now.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) + Case LogFileCreationScheduleOption.Weekly + ' Get first day of week + _firstDayOfWeek = Now.AddDays(-Now.DayOfWeek) + fileName += "-" & _firstDayOfWeek.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) + Case LogFileCreationScheduleOption.None + Case Else + Debug.Fail("Unrecognized LogFileCreationSchedule") + End Select + + Return Path.Combine(basePath, fileName) + End Get + End Property + + ''' + ''' The full name and path of the actual log file including DateStamp and file number. + ''' + ''' The full name and path. + ''' Calling this method will open the log file if it's not already open. + Public ReadOnly Property FullLogFileName() As String + Get + ' The only way to reliably know the file name is to open the file. If we + ' don't have a stream, get one (this will open the file) + EnsureStreamIsOpen() + + ' We shouldn't use fields for demands so we use a local variable + Dim returnPath As String = _fullFileName + + Return returnPath + End Get + End Property + + ''' + ''' Indicates whether or not the file should be appended to or overwritten. + ''' + ''' True if the file should be appended to, otherwise False. + Public Property Append() As Boolean + Get + If Not _propertiesSet(APPEND_INDEX) Then + If Attributes.ContainsKey(KEY_APPEND) Then + Me.Append = Convert.ToBoolean(Attributes(KEY_APPEND), CultureInfo.InvariantCulture) + End If + End If + + Return _append + End Get + Set(value As Boolean) + + DemandWritePermission() + + ' If this property is changing, we need to close the current file If value <> _append Then CloseCurrentStream() End If @@ -165,25 +346,23 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' Indicates what to do when the size of the log trespasses on the MaxFileSize - ''' or the ReserveDiskSpace set by the user. + ''' Indicates whether or not the stream should be flushed after every write. ''' - ''' An enum indicating the desired behavior (do nothing, throw). - Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption + ''' True if the stream should be flushed after every write, otherwise False. + Public Property AutoFlush() As Boolean Get - If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then - If Attributes.ContainsKey(KEY_DISKSPACEEXHAUSTEDBEHAVIOR) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(DiskSpaceExhaustedOption)) - Me.DiskSpaceExhaustedBehavior = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_DISKSPACEEXHAUSTEDBEHAVIOR)), DiskSpaceExhaustedOption) + If Not _propertiesSet(AUTOFLUSH_INDEX) Then + If Attributes.ContainsKey(KEY_AUTOFLUSH) Then + Me.AutoFlush = Convert.ToBoolean(Attributes(KEY_AUTOFLUSH), CultureInfo.InvariantCulture) End If End If - Return _diskSpaceExhaustedBehavior + + Return _autoFlush End Get - Set(value As DiskSpaceExhaustedOption) + Set(value As Boolean) DemandWritePermission() - ValidateDiskSpaceExhaustedOptionEnumValue(value, NameOf(value)) - _diskSpaceExhaustedBehavior = value - _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) = True + _autoFlush = value + _propertiesSet(AUTOFLUSH_INDEX) = True End Set End Property @@ -218,92 +397,42 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The full name and path of the actual log file including DateStamp and file number. + ''' The directory to be used if Location is set to Custom. ''' - ''' The full name and path. - ''' Calling this method will open the log file if it's not already open. - Public ReadOnly Property FullLogFileName() As String + ''' The name of the directory. + ''' This will throw if the path cannot be resolved. + Public Property CustomLocation() As String Get - ' The only way to reliably know the file name is to open the file. If we - ' don't have a stream, get one (this will open the file) - EnsureStreamIsOpen() - - ' We shouldn't use fields for demands so we use a local variable - Dim returnPath As String = _fullFileName + If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then + If Attributes.ContainsKey(KEY_CUSTOMLOCATION) Then + Me.CustomLocation = Attributes(KEY_CUSTOMLOCATION) + End If + End If - Return returnPath + Dim fileName As String = Path.GetFullPath(_customLocation) + Return fileName End Get - End Property + Set(value As String) - ''' - ''' Indicates what Date to stamp the log file with (none, first day of week, day). - ''' - ''' An enum indicating how to stamp the file. - Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption - Get - If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then - If Attributes.ContainsKey(KEY_LOGFILECREATIONSCHEDULE) Then - Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileCreationScheduleOption)) - Me.LogFileCreationSchedule = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOGFILECREATIONSCHEDULE)), LogFileCreationScheduleOption) - End If + ' Validate the path + Dim tempPath As String = Path.GetFullPath(value) + + If Not Directory.Exists(tempPath) Then + Directory.CreateDirectory(tempPath) End If - Return _logFileDateStamp - End Get - Set(value As LogFileCreationScheduleOption) - ValidateLogFileCreationScheduleOptionEnumValue(value, NameOf(value)) - If value <> _logFileDateStamp Then + ' If we're using custom location and the value is changing we need to + ' close the stream + If Location = LogFileLocation.Custom And Not String.Equals(tempPath, _customLocation, StringComparison.OrdinalIgnoreCase) Then CloseCurrentStream() - _logFileDateStamp = value End If - _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) = True - End Set - End Property + ' Since the user is setting a custom path, set Location to custom + Location = LogFileLocation.Custom - ''' - ''' The maximum size in bytes the log file is allowed to grow to. - ''' - ''' The maximum size. - Public Property MaxFileSize() As Long - Get - If Not _propertiesSet(MAXFILESIZE_INDEX) Then - If Attributes.ContainsKey(KEY_MAXFILESIZE) Then - Me.MaxFileSize = Convert.ToInt64(Attributes(KEY_MAXFILESIZE), CultureInfo.InvariantCulture) - End If - End If - Return _maxFileSize - End Get - Set(value As Long) - DemandWritePermission() - If value < MIN_FILE_SIZE Then - Throw GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") - End If - _maxFileSize = value - _propertiesSet(MAXFILESIZE_INDEX) = True - End Set - End Property + _customLocation = tempPath + _propertiesSet(CUSTOMLOCATION_INDEX) = True - ''' - ''' The amount of disk space, in bytes, that must be available after a write. - ''' - ''' The reserved disk space. - Public Property ReserveDiskSpace() As Long - Get - If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then - If Attributes.ContainsKey(KEY_RESERVEDISKSPACE) Then - Me.ReserveDiskSpace = Convert.ToInt64(Attributes(KEY_RESERVEDISKSPACE), CultureInfo.InvariantCulture) - End If - End If - Return _reserveDiskSpace - End Get - Set(value As Long) - DemandWritePermission() - If value < 0 Then - Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") - End If - _reserveDiskSpace = value - _propertiesSet(RESERVEDISKSPACE_INDEX) = True End Set End Property @@ -326,6 +455,29 @@ Namespace Microsoft.VisualBasic.Logging End Set End Property + ''' + ''' Indicates what to do when the size of the log trespasses on the MaxFileSize + ''' or the ReserveDiskSpace set by the user. + ''' + ''' An enum indicating the desired behavior (do nothing, throw). + Public Property DiskSpaceExhaustedBehavior() As DiskSpaceExhaustedOption + Get + If Not _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) Then + If Attributes.ContainsKey(KEY_DISKSPACEEXHAUSTEDBEHAVIOR) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(DiskSpaceExhaustedOption)) + Me.DiskSpaceExhaustedBehavior = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_DISKSPACEEXHAUSTEDBEHAVIOR)), DiskSpaceExhaustedOption) + End If + End If + Return _diskSpaceExhaustedBehavior + End Get + Set(value As DiskSpaceExhaustedOption) + DemandWritePermission() + ValidateDiskSpaceExhaustedOptionEnumValue(value, NameOf(value)) + _diskSpaceExhaustedBehavior = value + _propertiesSet(DISKSPACEEXHAUSTEDBEHAVIOR_INDEX) = True + End Set + End Property + ''' ''' The encoding to try when opening a file. ''' @@ -353,329 +505,282 @@ Namespace Microsoft.VisualBasic.Logging End Property ''' - ''' The directory to be used if Location is set to Custom. + ''' Indicates whether or not the host name of the logging machine should + ''' be included in the output. ''' - ''' The name of the directory. - ''' This will throw if the path cannot be resolved. - Public Property CustomLocation() As String + ''' True if the HostId should be included, otherwise False. + Public Property IncludeHostName() As Boolean Get - If Not _propertiesSet(CUSTOMLOCATION_INDEX) Then - If Attributes.ContainsKey(KEY_CUSTOMLOCATION) Then - Me.CustomLocation = Attributes(KEY_CUSTOMLOCATION) + If Not _propertiesSet(INCLUDEHOSTNAME_INDEX) Then + If Attributes.ContainsKey(KEY_INCLUDEHOSTNAME) Then + Me.IncludeHostName = Convert.ToBoolean(Attributes(KEY_INCLUDEHOSTNAME), CultureInfo.InvariantCulture) End If End If - - Dim fileName As String = Path.GetFullPath(_customLocation) - Return fileName + Return _includeHostName End Get - Set(value As String) - - ' Validate the path - Dim tempPath As String = Path.GetFullPath(value) - - If Not Directory.Exists(tempPath) Then - Directory.CreateDirectory(tempPath) - End If + Set(value As Boolean) + DemandWritePermission() + _includeHostName = value + _propertiesSet(INCLUDEHOSTNAME_INDEX) = True + End Set + End Property - ' If we're using custom location and the value is changing we need to - ' close the stream - If Location = LogFileLocation.Custom And Not String.Equals(tempPath, _customLocation, StringComparison.OrdinalIgnoreCase) Then - CloseCurrentStream() + ''' + ''' Indicates the log's directory. + ''' + ''' An enum which can indicate one of several logical locations for the log. + Public Property Location() As LogFileLocation + Get + If Not _propertiesSet(LOCATION_INDEX) Then + If Attributes.ContainsKey(KEY_LOCATION) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileLocation)) + Me.Location = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOCATION)), LogFileLocation) + End If End If + Return _location + End Get + Set(value As LogFileLocation) + ValidateLogFileLocationEnumValue(value, NameOf(value)) - ' Since the user is setting a custom path, set Location to custom - Location = LogFileLocation.Custom - - _customLocation = tempPath - _propertiesSet(CUSTOMLOCATION_INDEX) = True - + ' If the location is changing we need to close the current file + If _location <> value Then + CloseCurrentStream() + End If + _location = value + _propertiesSet(LOCATION_INDEX) = True End Set End Property ''' - ''' Writes the message to the log. + ''' Indicates what Date to stamp the log file with (none, first day of week, day). ''' - ''' The message to be written. - Public Overloads Overrides Sub Write(message As String) - - ' Use Try block to attempt to close stream if an exception is thrown - Try - HandleDateChange() - - ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message) - - If ResourcesAvailable(newEntrySize) Then - ListenerStream.Write(message) - If AutoFlush Then - ListenerStream.Flush() + ''' An enum indicating how to stamp the file. + Public Property LogFileCreationSchedule() As LogFileCreationScheduleOption + Get + If Not _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) Then + If Attributes.ContainsKey(KEY_LOGFILECREATIONSCHEDULE) Then + Dim converter As TypeConverter = TypeDescriptor.GetConverter(GetType(LogFileCreationScheduleOption)) + Me.LogFileCreationSchedule = DirectCast(converter.ConvertFromInvariantString(Attributes(KEY_LOGFILECREATIONSCHEDULE)), LogFileCreationScheduleOption) End If End If - Catch - CloseCurrentStream() - Throw - End Try + Return _logFileDateStamp + End Get + Set(value As LogFileCreationScheduleOption) + ValidateLogFileCreationScheduleOptionEnumValue(value, NameOf(value)) - End Sub + If value <> _logFileDateStamp Then + CloseCurrentStream() + _logFileDateStamp = value + End If + + _propertiesSet(LOGFILECREATIONSCHEDULE_INDEX) = True + End Set + End Property ''' - ''' Writes the message to the log as a line. + ''' The maximum size in bytes the log file is allowed to grow to. ''' - ''' The message to be written. - Public Overloads Overrides Sub WriteLine(message As String) - - ' Use Try block to attempt to close stream if an exception is thrown - Try - HandleDateChange() - - ' Check resources - Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - - If ResourcesAvailable(newEntrySize) Then - ListenerStream.WriteLine(message) - If AutoFlush Then - ListenerStream.Flush() + ''' The maximum size. + Public Property MaxFileSize() As Long + Get + If Not _propertiesSet(MAXFILESIZE_INDEX) Then + If Attributes.ContainsKey(KEY_MAXFILESIZE) Then + Me.MaxFileSize = Convert.ToInt64(Attributes(KEY_MAXFILESIZE), CultureInfo.InvariantCulture) End If End If - Catch - CloseCurrentStream() - Throw - End Try - End Sub + Return _maxFileSize + End Get + Set(value As Long) + DemandWritePermission() + If value < MIN_FILE_SIZE Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLogNumberTooSmall, "MaxFileSize") + End If + _maxFileSize = value + _propertiesSet(MAXFILESIZE_INDEX) = True + End Set + End Property ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' The amount of disk space, in bytes, that must be available after a write. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' The message. - Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) - - If Filter IsNot Nothing Then - If Not Filter.ShouldTrace(eventCache, source, eventType, id, message, Nothing, Nothing, Nothing) Then - Return + ''' The reserved disk space. + Public Property ReserveDiskSpace() As Long + Get + If Not _propertiesSet(RESERVEDISKSPACE_INDEX) Then + If Attributes.ContainsKey(KEY_RESERVEDISKSPACE) Then + Me.ReserveDiskSpace = Convert.ToInt64(Attributes(KEY_RESERVEDISKSPACE), CultureInfo.InvariantCulture) + End If End If - End If - Dim outBuilder As New StringBuilder - - ' Add fields that always appear (source, eventType, id, message) - ' source - outBuilder.Append(source & Delimiter) - - ' eventType - outBuilder.Append([Enum].GetName(GetType(TraceEventType), eventType) & Delimiter) + Return _reserveDiskSpace + End Get + Set(value As Long) + DemandWritePermission() + If value < 0 Then + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(value), SR.ApplicationLog_NegativeNumber, "ReserveDiskSpace") + End If + _reserveDiskSpace = value + _propertiesSet(RESERVEDISKSPACE_INDEX) = True + End Set + End Property - ' id - outBuilder.Append(id.ToString(CultureInfo.InvariantCulture) & Delimiter) + ''' + ''' Utility to get the date of the first day of the week from the passed in date. + ''' + ''' The date being checked. + Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date + Return checkDate.AddDays(-checkDate.DayOfWeek).Date + End Function - ' message - outBuilder.Append(message) + ''' + ''' Convert a stack into a string. + ''' + ''' + ''' Returns the stack as a .csv string. + Private Shared Function StackToString(stack As Stack) As String + Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") - ' Add optional fields - ' Callstack - If (TraceOutputOptions And TraceOptions.Callstack) = TraceOptions.Callstack Then - outBuilder.Append(Delimiter & eventCache.Callstack) - End If + Dim length As Integer = STACK_DELIMITER.Length + Dim sb As New StringBuilder() - ' LogicalOperationStack - If (TraceOutputOptions And TraceOptions.LogicalOperationStack) = TraceOptions.LogicalOperationStack Then - outBuilder.Append(Delimiter & StackToString(eventCache.LogicalOperationStack)) - End If + For Each obj As Object In stack + sb.Append(obj.ToString() & STACK_DELIMITER) + Next - ' DateTime - If (TraceOutputOptions And TraceOptions.DateTime) = TraceOptions.DateTime Then - ' Add DateTime. Time will be in GMT. - outBuilder.Append(Delimiter & eventCache.DateTime.ToString("u", CultureInfo.InvariantCulture)) - End If + ' Escape the quotes + sb.Replace("""", """""") - ' ProcessId - If (TraceOutputOptions And TraceOptions.ProcessId) = TraceOptions.ProcessId Then - outBuilder.Append(Delimiter & eventCache.ProcessId.ToString(CultureInfo.InvariantCulture)) + ' Remove trailing delimiter + If sb.Length >= length Then + sb.Remove(sb.Length - length, length) End If - ' ThreadId - If (TraceOutputOptions And TraceOptions.ThreadId) = TraceOptions.ThreadId Then - outBuilder.Append(Delimiter & eventCache.ThreadId) - End If + Return $"""{sb}""" - ' Timestamp - If (TraceOutputOptions And TraceOptions.Timestamp) = TraceOptions.Timestamp Then - outBuilder.Append(Delimiter & eventCache.Timestamp.ToString(CultureInfo.InvariantCulture)) - End If + End Function - ' HostName - If IncludeHostName Then - outBuilder.Append(Delimiter & HostName) + ''' + ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. + ''' + ''' + Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) + If value < DiskSpaceExhaustedOption.ThrowException OrElse value > DiskSpaceExhaustedOption.DiscardMessages Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(DiskSpaceExhaustedOption)) End If - - WriteLine(outBuilder.ToString()) - End Sub ''' - ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A string with placeholders that serves as a format for the message. - ''' The values for the placeholders in format. - Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) - - ' Create the message - Dim message As String - If args IsNot Nothing Then - message = String.Format(CultureInfo.InvariantCulture, format, args) - Else - message = format + ''' + Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) + If value < LogFileCreationScheduleOption.None OrElse value > LogFileCreationScheduleOption.Weekly Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileCreationScheduleOption)) End If - - TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Validates that the value being passed as an LogFileLocation enum is a legal value. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' An object containing the message to be logged. - Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - - Dim message As String = String.Empty - If data IsNot Nothing Then - message = data.ToString() + ''' + Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) + If value < LogFileLocation.TempDirectory OrElse value > LogFileLocation.Custom Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileLocation)) End If - - TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Method of the base class we override to keep message format consistent. + ''' Closes the stream. ''' - ''' Cache of information. - ''' The name of the TraceSourceListener. - ''' The eventType of the message. - ''' The id of the message. - ''' A list of objects making up the message to be logged. - Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) - - Dim messageBuilder As New StringBuilder() - If data IsNot Nothing Then - Dim bound As Integer = data.Length - 1 - For i As Integer = 0 To bound - messageBuilder.Append(data(i).ToString()) - If i <> bound Then - messageBuilder.Append(Delimiter) + ''' This method should be safe to call whether or not there is a stream. + Private Sub CloseCurrentStream() + If _stream IsNot Nothing Then + SyncLock s_streams + _stream.CloseStream() + If Not _stream.IsInUse Then + s_streams.Remove(_fullFileName.ToUpper(CultureInfo.InvariantCulture)) End If - Next i + _stream = Nothing + End SyncLock End If - - TraceEvent(eventCache, source, eventType, id, messageBuilder.ToString()) End Sub ''' - ''' Flushes the underlying stream. + ''' Indicates whether or not the current date has changed to new day. ''' - Public Overrides Sub Flush() - _stream?.Flush() - End Sub + ''' True if the date has changed, otherwise False. + Private Function DayChanged() As Boolean + Return _day.Date <> Now.Date + End Function ''' - ''' Closes the underlying stream. + ''' Demands a FileIO write permission. ''' - Public Overrides Sub Close() - Dispose(True) + ''' This method should be called by public API that doesn't map to TraceListener. + ''' This ensures these API cannot be used to circumvent CAS. + ''' + Private Sub DemandWritePermission() + Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") + Dim fileName As String = Path.GetDirectoryName(LogFileName) End Sub ''' - ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list - ''' in a config file will cause a configuration exception. - ''' - ''' An array of attribute names. - Protected Overrides Function GetSupportedAttributes() As String() - Return _supportedAttributes - End Function - - ''' - ''' Makes sure stream is flushed. + ''' Makes sure we have an open stream. ''' - ''' - Protected Overrides Sub Dispose(disposing As Boolean) - If disposing Then - CloseCurrentStream() + Private Sub EnsureStreamIsOpen() + If _stream Is Nothing Then + _stream = GetStream() End If End Sub ''' - ''' Gets the log file name under the current configuration. + ''' Opens a file and attempts to determine the file's encoding. ''' - ''' The log file name. - ''' - ''' Includes the full path and the DateStamp, but does not include the - ''' file number or the extension. - ''' - Private ReadOnly Property LogFileName() As String - Get - Dim basePath As String + ''' The encoding or Nothing. + Private Function GetFileEncoding(fileName As String) As Encoding - ' Get the directory - Select Case Location - Case LogFileLocation.CommonApplicationDirectory - basePath = Application.CommonAppDataPath - Case LogFileLocation.ExecutableDirectory - basePath = Path.GetDirectoryName(Application.ExecutablePath) - Case LogFileLocation.LocalUserApplicationDirectory - basePath = Application.UserAppDataPath - Case LogFileLocation.TempDirectory - basePath = Path.GetTempPath() - Case LogFileLocation.Custom - If String.IsNullOrEmpty(CustomLocation) Then - basePath = Application.UserAppDataPath - Else - basePath = CustomLocation - End If - Case Else - Debug.Fail("Unrecognized location") - basePath = Application.UserAppDataPath - End Select + If File.Exists(fileName) Then + Dim reader As StreamReader = Nothing + Try - ' Add the base name - Dim fileName As String = BaseFileName + 'Attempt to determine the encoding of the file. The call to Reader.ReadLine + 'will change the current encoding of Reader to that of the file. + reader = New StreamReader(fileName, Encoding, True) - ' Add DateTime Stamp - Select Case LogFileCreationSchedule - Case LogFileCreationScheduleOption.Daily - fileName += "-" & Now.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) - Case LogFileCreationScheduleOption.Weekly - ' Get first day of week - _firstDayOfWeek = Now.AddDays(-Now.DayOfWeek) - fileName += "-" & _firstDayOfWeek.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture) - Case LogFileCreationScheduleOption.None - Case Else - Debug.Fail("Unrecognized LogFileCreationSchedule") - End Select + 'Ignore 0 length file + If reader.BaseStream.Length > 0 Then + reader.ReadLine() - Return Path.Combine(basePath, fileName) - End Get - End Property + Return reader.CurrentEncoding + End If + Finally + reader?.Close() + End Try + End If + + Return Nothing + End Function ''' - ''' Gets the stream to use for writing to the log. + ''' Returns the total amount of free disk space available to the current user. ''' - ''' The stream. - Private ReadOnly Property ListenerStream() As ReferencedStream - Get - EnsureStreamIsOpen() + ''' The total amount, in bytes, of free disk space available to the current user. + ''' Throws an exception if API fails. + Private Function GetFreeDiskSpace() As Long + Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) - Debug.Assert(_stream IsNot Nothing, "Unable to get stream") - Return _stream - End Get - End Property + 'Initialize FreeUserSpace so we can determine if its value is changed by the API call + Dim freeUserSpace As Long = -1 + Dim totalUserSpace As Long + Dim totalFreeSpace As Long + + If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then + If freeUserSpace > -1 Then + Return freeUserSpace + End If + End If + + Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + End Function ''' ''' Gets or creates the stream used for writing to the log. @@ -751,55 +856,6 @@ Namespace Microsoft.VisualBasic.Logging Throw ExUtils.GetInvalidOperationException(SR.ApplicationLog_ExhaustedPossibleStreamNames, baseStreamName) End Function - ''' - ''' Makes sure we have an open stream. - ''' - Private Sub EnsureStreamIsOpen() - If _stream Is Nothing Then - _stream = GetStream() - End If - End Sub - - ''' - ''' Closes the stream. - ''' - ''' This method should be safe to call whether or not there is a stream. - Private Sub CloseCurrentStream() - If _stream IsNot Nothing Then - SyncLock s_streams - _stream.CloseStream() - If Not _stream.IsInUse Then - s_streams.Remove(_fullFileName.ToUpper(CultureInfo.InvariantCulture)) - End If - _stream = Nothing - End SyncLock - End If - End Sub - - ''' - ''' Indicates whether or not the current date has changed to new day. - ''' - ''' True if the date has changed, otherwise False. - Private Function DayChanged() As Boolean - Return _day.Date <> Now.Date - End Function - - ''' - ''' Indicates whether or not the date has changed to a new week. - ''' - ''' True if the date has changed, otherwise False. - Private Function WeekChanged() As Boolean - Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) - End Function - - ''' - ''' Utility to get the date of the first day of the week from the passed in date. - ''' - ''' The date being checked. - Private Shared Function GetFirstDayOfWeek(checkDate As Date) As Date - Return checkDate.AddDays(-checkDate.DayOfWeek).Date - End Function - ''' ''' Checks for date changes and carries out appropriate actions. ''' @@ -830,14 +886,14 @@ Namespace Microsoft.VisualBasic.Logging If ListenerStream.FileSize + newEntrySize > MaxFileSize Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) + Throw New InvalidOperationException(ExUtils.GetResourceString(SR.ApplicationLog_FileExceedsMaximumSize)) End If Return False End If If GetFreeDiskSpace() - newEntrySize < ReserveDiskSpace Then If DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException Then - Throw New InvalidOperationException(GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) + Throw New InvalidOperationException(ExUtils.GetResourceString(SR.ApplicationLog_ReservedSpaceEncroached)) End If Return False End If @@ -846,280 +902,231 @@ Namespace Microsoft.VisualBasic.Logging End Function ''' - ''' Returns the total amount of free disk space available to the current user. + ''' Indicates whether or not the date has changed to a new week. ''' - ''' The total amount, in bytes, of free disk space available to the current user. - ''' Throws an exception if API fails. - Private Function GetFreeDiskSpace() As Long - Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) - - 'Initialize FreeUserSpace so we can determine if its value is changed by the API call - Dim freeUserSpace As Long = -1 - Dim totalUserSpace As Long - Dim totalFreeSpace As Long + ''' True if the date has changed, otherwise False. + Private Function WeekChanged() As Boolean + Return _firstDayOfWeek.Date <> GetFirstDayOfWeek(Now.Date) + End Function - If UnsafeNativeMethods.GetDiskFreeSpaceEx(pathName, freeUserSpace, totalUserSpace, totalFreeSpace) Then - If freeUserSpace > -1 Then - Return freeUserSpace - End If + ''' + ''' Makes sure stream is flushed. + ''' + ''' + Protected Overrides Sub Dispose(disposing As Boolean) + If disposing Then + CloseCurrentStream() End If + End Sub - Throw ExUtils.GetWin32Exception(SR.ApplicationLog_FreeSpaceError) + ''' + ''' Gets a list of all the attributes recognized by the this listener. Trying to use an item not in this list + ''' in a config file will cause a configuration exception. + ''' + ''' An array of attribute names. + Protected Overrides Function GetSupportedAttributes() As String() + Return _supportedAttributes End Function ''' - ''' Opens a file and attempts to determine the file's encoding. + ''' Closes the underlying stream. ''' - ''' The encoding or Nothing. - Private Function GetFileEncoding(fileName As String) As Encoding + Public Overrides Sub Close() + Dispose(True) + End Sub - If File.Exists(fileName) Then - Dim reader As StreamReader = Nothing - Try - - 'Attempt to determine the encoding of the file. The call to Reader.ReadLine - 'will change the current encoding of Reader to that of the file. - reader = New StreamReader(fileName, Encoding, True) - - 'Ignore 0 length file - If reader.BaseStream.Length > 0 Then - reader.ReadLine() - - Return reader.CurrentEncoding - End If - Finally - reader?.Close() - End Try - End If - - Return Nothing - End Function + ''' + ''' Flushes the underlying stream. + ''' + Public Overrides Sub Flush() + _stream?.Flush() + End Sub ''' - ''' Gets the host name. - ''' - ''' The host name. - ''' We use the machine name because we can get that even if not hooked up to a network. - Private ReadOnly Property HostName() As String - Get - If String.IsNullOrEmpty(_hostName) Then - ' Use the machine name - _hostName = Environment.MachineName - End If - Return _hostName - End Get - End Property - - ''' - ''' Demands a FileIO write permission. + ''' Method of the base class we override to keep message format consistent. ''' - ''' This method should be called by public API that doesn't map to TraceListener. - ''' This ensures these API cannot be used to circumvent CAS. - ''' - Private Sub DemandWritePermission() - Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") - Dim fileName As String = Path.GetDirectoryName(LogFileName) - End Sub + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' An object containing the message to be logged. + Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object) - ''' - ''' Validates that the value being passed as an LogFileLocation enum is a legal value. - ''' - ''' - Private Shared Sub ValidateLogFileLocationEnumValue(value As LogFileLocation, paramName As String) - If value < LogFileLocation.TempDirectory OrElse value > LogFileLocation.Custom Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileLocation)) + Dim message As String = String.Empty + If data IsNot Nothing Then + message = data.ToString() End If - End Sub - ''' - ''' Validates that the value being passed as an DiskSpaceExhaustedOption enum is a legal value. - ''' - ''' - Private Shared Sub ValidateDiskSpaceExhaustedOptionEnumValue(value As DiskSpaceExhaustedOption, paramName As String) - If value < DiskSpaceExhaustedOption.ThrowException OrElse value > DiskSpaceExhaustedOption.DiscardMessages Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(DiskSpaceExhaustedOption)) - End If + TraceEvent(eventCache, source, eventType, id, message) End Sub ''' - ''' Validates that the value being passed as an LogFileCreationScheduleOption enum is a legal value. + ''' Method of the base class we override to keep message format consistent. ''' - ''' - Private Shared Sub ValidateLogFileCreationScheduleOptionEnumValue(value As LogFileCreationScheduleOption, paramName As String) - If value < LogFileCreationScheduleOption.None OrElse value > LogFileCreationScheduleOption.Weekly Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(LogFileCreationScheduleOption)) + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A list of objects making up the message to be logged. + Public Overrides Sub TraceData(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object()) + + Dim messageBuilder As New StringBuilder() + If data IsNot Nothing Then + Dim bound As Integer = data.Length - 1 + For i As Integer = 0 To bound + messageBuilder.Append(data(i).ToString()) + If i <> bound Then + messageBuilder.Append(Delimiter) + End If + Next i End If + + TraceEvent(eventCache, source, eventType, id, messageBuilder.ToString()) End Sub ''' - ''' Convert a stack into a string. + ''' Event fired by TraceSourceListener resulting in writing to the log. ''' - ''' - ''' Returns the stack as a .csv string. - Private Shared Function StackToString(stack As Stack) As String - Debug.Assert(stack IsNot Nothing, "Stack wasn't created.") - - Dim length As Integer = STACK_DELIMITER.Length - Dim sb As New StringBuilder() - - For Each obj As Object In stack - sb.Append(obj.ToString() & STACK_DELIMITER) - Next - - ' Escape the quotes - sb.Replace("""", """""") + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' The message. + Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String) - ' Remove trailing delimiter - If sb.Length >= length Then - sb.Remove(sb.Length - length, length) + If Filter IsNot Nothing Then + If Not Filter.ShouldTrace(eventCache, source, eventType, id, message, Nothing, Nothing, Nothing) Then + Return + End If End If + Dim outBuilder As New StringBuilder - Return $"""{sb}""" - - End Function - - ' Indicates the location of the log's directory - Private _location As LogFileLocation = LogFileLocation.LocalUserApplicationDirectory - - ' Indicates whether or not to flush after every write - Private _autoFlush As Boolean - - ' Indicates whether to append to or overwrite the log file - Private _append As Boolean = True - - ' Indicates whether or not to include the host id in the output - Private _includeHostName As Boolean - - ' Indicates what behavior should take place when a resource level has been passed - Private _diskSpaceExhaustedBehavior As DiskSpaceExhaustedOption = DiskSpaceExhaustedOption.DiscardMessages - - ' Stores the name of the file minus the path, date stamp, and file number - Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) - - ' Indicate which date stamp should be used in the log file name - Private _logFileDateStamp As LogFileCreationScheduleOption = LogFileCreationScheduleOption.None - - ' The maximum size of the log file - Private _maxFileSize As Long = 5000000L - - ' The amount of free disk space there needs to be on the drive of the log file - Private _reserveDiskSpace As Long = 10000000L - - ' The delimiter to be used to separate fields in a line of output - Private _delimiter As String = vbTab - - ' The encoding of the log file - Private _encoding As Encoding = Encoding.UTF8 - - ' The full name and path of the log file - Private _fullFileName As String - - ' Directory to be used for the log file if Location is set to Custom - Private _customLocation As String = Application.UserAppDataPath - - ' Reference counted stream used for writing to the log file - Private _stream As ReferencedStream - - Private ReadOnly _day As Date = Now.Date + ' Add fields that always appear (source, eventType, id, message) + ' source + outBuilder.Append(source & Delimiter) - Private _firstDayOfWeek As Date = GetFirstDayOfWeek(Now.Date) + ' eventType + outBuilder.Append([Enum].GetName(GetType(TraceEventType), eventType) & Delimiter) - Private _hostName As String + ' id + outBuilder.Append(id.ToString(CultureInfo.InvariantCulture) & Delimiter) - ' Indicates whether or not properties have been set - ' Note: Properties that use m_PropertiesSet to track whether or not - ' they've been set should always be set through the property setter and not - ' by directly changing the corresponding private field. - Private ReadOnly _propertiesSet As New BitArray(PROPERTY_COUNT, False) + ' message + outBuilder.Append(message) - ' Table of all of the files opened by any FileLogTraceListener in the current process - Private Shared ReadOnly s_streams As New Dictionary(Of String, ReferencedStream) + ' Add optional fields + ' Callstack + If (TraceOutputOptions And TraceOptions.Callstack) = TraceOptions.Callstack Then + outBuilder.Append(Delimiter & eventCache.Callstack) + End If - ' A list of supported attributes - Private ReadOnly _supportedAttributes() As String = New String() {KEY_APPEND, KEY_APPEND_PASCAL, KEY_AUTOFLUSH, KEY_AUTOFLUSH_PASCAL, KEY_AUTOFLUSH_CAMEL, - KEY_BASEFILENAME, KEY_BASEFILENAME_PASCAL, KEY_BASEFILENAME_CAMEL, KEY_BASEFILENAME_PASCAL_ALT, KEY_BASEFILENAME_CAMEL_ALT, - KEY_CUSTOMLOCATION, KEY_CUSTOMLOCATION_PASCAL, KEY_CUSTOMLOCATION_CAMEL, KEY_DELIMITER, KEY_DELIMITER_PASCAL, - KEY_DISKSPACEEXHAUSTEDBEHAVIOR, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL, KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL, - KEY_ENCODING, KEY_ENCODING_PASCAL, KEY_INCLUDEHOSTNAME, KEY_INCLUDEHOSTNAME_PASCAL, KEY_INCLUDEHOSTNAME_CAMEL, KEY_LOCATION, KEY_LOCATION_PASCAL, - KEY_LOGFILECREATIONSCHEDULE, KEY_LOGFILECREATIONSCHEDULE_PASCAL, KEY_LOGFILECREATIONSCHEDULE_CAMEL, - KEY_MAXFILESIZE, KEY_MAXFILESIZE_PASCAL, KEY_MAXFILESIZE_CAMEL, KEY_RESERVEDISKSPACE, KEY_RESERVEDISKSPACE_PASCAL, KEY_RESERVEDISKSPACE_CAMEL} + ' LogicalOperationStack + If (TraceOutputOptions And TraceOptions.LogicalOperationStack) = TraceOptions.LogicalOperationStack Then + outBuilder.Append(Delimiter & StackToString(eventCache.LogicalOperationStack)) + End If - ' Identifies properties in the BitArray - Private Const PROPERTY_COUNT As Integer = 12 + ' DateTime + If (TraceOutputOptions And TraceOptions.DateTime) = TraceOptions.DateTime Then + ' Add DateTime. Time will be in GMT. + outBuilder.Append(Delimiter & eventCache.DateTime.ToString("u", CultureInfo.InvariantCulture)) + End If - Private Const APPEND_INDEX As Integer = 0 - Private Const AUTOFLUSH_INDEX As Integer = 1 - Private Const BASEFILENAME_INDEX As Integer = 2 - Private Const CUSTOMLOCATION_INDEX As Integer = 3 - Private Const DELIMITER_INDEX As Integer = 4 - Private Const DISKSPACEEXHAUSTEDBEHAVIOR_INDEX As Integer = 5 - Private Const ENCODING_INDEX As Integer = 6 - Private Const INCLUDEHOSTNAME_INDEX As Integer = 7 - Private Const LOCATION_INDEX As Integer = 8 - Private Const LOGFILECREATIONSCHEDULE_INDEX As Integer = 9 - Private Const MAXFILESIZE_INDEX As Integer = 10 - Private Const RESERVEDISKSPACE_INDEX As Integer = 11 + ' ProcessId + If (TraceOutputOptions And TraceOptions.ProcessId) = TraceOptions.ProcessId Then + outBuilder.Append(Delimiter & eventCache.ProcessId.ToString(CultureInfo.InvariantCulture)) + End If - Private Const DATE_FORMAT As String = "yyyy-MM-dd" - Private Const FILE_EXTENSION As String = ".log" - Private Const MAX_OPEN_ATTEMPTS As Integer = Integer.MaxValue + ' ThreadId + If (TraceOutputOptions And TraceOptions.ThreadId) = TraceOptions.ThreadId Then + outBuilder.Append(Delimiter & eventCache.ThreadId) + End If - ' Name to be used when parameterless constructor is called - Private Const DEFAULT_NAME As String = "FileLogTraceListener" + ' Timestamp + If (TraceOutputOptions And TraceOptions.Timestamp) = TraceOptions.Timestamp Then + outBuilder.Append(Delimiter & eventCache.Timestamp.ToString(CultureInfo.InvariantCulture)) + End If - ' The minimum setting allowed for maximum file size - Private Const MIN_FILE_SIZE As Integer = 1000 + ' HostName + If IncludeHostName Then + outBuilder.Append(Delimiter & HostName) + End If - ' Attribute keys used to access properties set in the config file - Private Const KEY_APPEND As String = "append" + WriteLine(outBuilder.ToString()) - Private Const KEY_APPEND_PASCAL As String = "Append" + End Sub - Private Const KEY_AUTOFLUSH As String = "autoflush" - Private Const KEY_AUTOFLUSH_PASCAL As String = "AutoFlush" - Private Const KEY_AUTOFLUSH_CAMEL As String = "autoFlush" + ''' + ''' Event fired by TraceSourceListener resulting in writing to the log. + ''' + ''' Cache of information. + ''' The name of the TraceSourceListener. + ''' The eventType of the message. + ''' The id of the message. + ''' A string with placeholders that serves as a format for the message. + ''' The values for the placeholders in format. + Public Overrides Sub TraceEvent(eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args() As Object) - Private Const KEY_BASEFILENAME As String = "basefilename" - Private Const KEY_BASEFILENAME_PASCAL As String = "BaseFilename" - Private Const KEY_BASEFILENAME_CAMEL As String = "baseFilename" - Private Const KEY_BASEFILENAME_PASCAL_ALT As String = "BaseFileName" - Private Const KEY_BASEFILENAME_CAMEL_ALT As String = "baseFileName" + ' Create the message + Dim message As String + If args IsNot Nothing Then + message = String.Format(CultureInfo.InvariantCulture, format, args) + Else + message = format + End If - Private Const KEY_CUSTOMLOCATION As String = "customlocation" - Private Const KEY_CUSTOMLOCATION_PASCAL As String = "CustomLocation" - Private Const KEY_CUSTOMLOCATION_CAMEL As String = "customLocation" + TraceEvent(eventCache, source, eventType, id, message) + End Sub - Private Const KEY_DELIMITER As String = "delimiter" - Private Const KEY_DELIMITER_PASCAL As String = "Delimiter" + ''' + ''' Writes the message to the log. + ''' + ''' The message to be written. + Public Overloads Overrides Sub Write(message As String) - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR As String = "diskspaceexhaustedbehavior" - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_PASCAL As String = "DiskSpaceExhaustedBehavior" - Private Const KEY_DISKSPACEEXHAUSTEDBEHAVIOR_CAMEL As String = "diskSpaceExhaustedBehavior" + ' Use Try block to attempt to close stream if an exception is thrown + Try + HandleDateChange() - Private Const KEY_ENCODING As String = "encoding" - Private Const KEY_ENCODING_PASCAL As String = "Encoding" + ' Check resources + Dim newEntrySize As Long = Encoding.GetByteCount(message) - Private Const KEY_INCLUDEHOSTNAME As String = "includehostname" - Private Const KEY_INCLUDEHOSTNAME_PASCAL As String = "IncludeHostName" - Private Const KEY_INCLUDEHOSTNAME_CAMEL As String = "includeHostName" + If ResourcesAvailable(newEntrySize) Then + ListenerStream.Write(message) + If AutoFlush Then + ListenerStream.Flush() + End If + End If + Catch + CloseCurrentStream() + Throw + End Try - Private Const KEY_LOCATION As String = "location" - Private Const KEY_LOCATION_PASCAL As String = "Location" + End Sub - Private Const KEY_LOGFILECREATIONSCHEDULE As String = "logfilecreationschedule" - Private Const KEY_LOGFILECREATIONSCHEDULE_PASCAL As String = "LogFileCreationSchedule" - Private Const KEY_LOGFILECREATIONSCHEDULE_CAMEL As String = "logFileCreationSchedule" + ''' + ''' Writes the message to the log as a line. + ''' + ''' The message to be written. + Public Overloads Overrides Sub WriteLine(message As String) - Private Const KEY_MAXFILESIZE As String = "maxfilesize" - Private Const KEY_MAXFILESIZE_PASCAL As String = "MaxFileSize" - Private Const KEY_MAXFILESIZE_CAMEL As String = "maxFileSize" + ' Use Try block to attempt to close stream if an exception is thrown + Try + HandleDateChange() - Private Const KEY_RESERVEDISKSPACE As String = "reservediskspace" - Private Const KEY_RESERVEDISKSPACE_PASCAL As String = "ReserveDiskSpace" - Private Const KEY_RESERVEDISKSPACE_CAMEL As String = "reserveDiskSpace" + ' Check resources + Dim newEntrySize As Long = Encoding.GetByteCount(message & vbCrLf) - ' Delimiter used when converting a stack to a string - Private Const STACK_DELIMITER As String = ", " + If ResourcesAvailable(newEntrySize) Then + ListenerStream.WriteLine(message) + If AutoFlush Then + ListenerStream.Flush() + End If + End If + Catch + CloseCurrentStream() + Throw + End Try + End Sub End Class 'FileLogTraceListener End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb index c6eed7ab397..6d6fc459959 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/HttpClientCopy.vb @@ -27,6 +27,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' The percentage of the operation completed Private _percentage As Integer + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + ''' ''' Creates an instance of a HttpClientCopy, used to download or upload a file. ''' @@ -44,9 +47,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) - ''' ''' Posts a message to close the progress dialog ''' @@ -197,5 +197,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If End Sub #End If + End Class End Namespace From 5c81663850a83f6008afdccc29b5959761f2463b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 19 Jul 2024 23:41:46 -0700 Subject: [PATCH 250/342] Replce "" with String.Empty --- .../Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 0da9995dd79..63b65abfb60 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -26,7 +26,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Function Friend Function VbMakeException(resourceId As Integer) As Exception - Dim description As String = "" + Dim description As String = String.Empty If resourceId > 0 AndAlso resourceId <= &HFFFFI Then description = GetResourceString(DirectCast(resourceId, vbErrors)) From 0c1fbf076d1fe69bf5175d4e8817d1f09be03c1d Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 00:03:42 -0700 Subject: [PATCH 251/342] Minor Cleanup and move PROCESS_INFORMATION class to separate file Simplify Dim New statements --- .../Microsoft/VisualBasic/Devices/Audio.vb | 147 +++++++++--------- .../Devices/Network/NetworkUpload.vb | 8 +- .../VisualBasic/Helpers/NativeMethods.vb | 121 +++++++------- .../NativeTypes.PROCESS_INFORMATION.vb | 31 ++++ .../VisualBasic/Helpers/NativeTypes.vb | 100 +++++------- .../VisualBasic/Helpers/VBInputBox.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 2 +- .../FileLogTraceListener.ReferencedStream.vb | 2 +- .../MyServices/Internal/ProgressDialog.vb | 4 +- .../Windows/Forms/NetworkDownloadTests.vb | 2 +- .../System/Windows/Forms/UserTests.vb | 2 +- 11 files changed, 215 insertions(+), 206 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 5ca6aa33c5c..31ba2f2af0a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -7,16 +7,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic - ''' - ''' Enum for three ways to play a .wav file. - ''' - Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() - WaitToComplete = 0 'Synchronous - Background = 1 'Asynchronous - BackgroundLoop = 2 'Asynchronous and looping - End Enum - Namespace Devices ''' @@ -24,12 +14,74 @@ Namespace Microsoft.VisualBasic ''' Public Class Audio + ' Object that plays the sounds. We use a private member so we can ensure we have a reference for async plays + Private _sound As Media.SoundPlayer + ''' ''' Creates a new Audio object. ''' Public Sub New() End Sub + ''' + ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. + ''' + ''' + Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) + If value < AudioPlayMode.WaitToComplete OrElse value > AudioPlayMode.BackgroundLoop Then + Throw New ComponentModel.InvalidEnumArgumentException(paramName, value, GetType(AudioPlayMode)) + End If + End Sub + + ''' + ''' Gets the full name and path for the file. Throws if unable to get full name and path. + ''' + ''' The filename being tested. + ''' A full name and path of the file. + Private Shared Function ValidateFilename(location As String) As String + If String.IsNullOrEmpty(location) Then + Throw ExUtils.GetArgumentNullException(NameOf(location)) + End If + + Return location + End Function + + ''' + ''' Plays the passed in SoundPlayer in the passed in mode. + ''' + ''' The SoundPlayer to play. + ''' The mode in which to play the sound. + Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) + + Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") + Debug.Assert([Enum].IsDefined(GetType(AudioPlayMode), mode), "Enum value is out of range") + + ' Stopping the sound ensures it's safe to dispose it. This could happen when we change the value of m_Sound below + _sound?.Stop() + + _sound = sound + + Select Case mode + Case AudioPlayMode.WaitToComplete + _sound.PlaySync() + Case AudioPlayMode.Background + _sound.Play() + Case AudioPlayMode.BackgroundLoop + _sound.PlayLooping() + Case Else + Debug.Fail("Unknown AudioPlayMode") + End Select + + End Sub + + ''' + ''' Stops the play of any playing sound. + ''' + Public Sub [Stop]() + Dim sound As New Media.SoundPlayer() + sound.Stop() + End Sub + ''' ''' Plays a .wav file in background mode. ''' @@ -49,7 +101,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(location As String, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) Dim safeFilename As String = ValidateFilename(location) - Dim sound As Media.SoundPlayer = New Media.SoundPlayer(safeFilename) + Dim sound As New Media.SoundPlayer(safeFilename) Play(sound, playMode) End Sub @@ -64,7 +116,7 @@ Namespace Microsoft.VisualBasic End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) - Dim soundStream As MemoryStream = New MemoryStream(data) + Dim soundStream As New MemoryStream(data) Play(soundStream, playMode) soundStream.Close() End Sub @@ -97,68 +149,19 @@ Namespace Microsoft.VisualBasic End Sub - ''' - ''' Stops the play of any playing sound. - ''' - Public Sub [Stop]() - Dim sound As New Media.SoundPlayer() - sound.Stop() - End Sub - - ''' - ''' Plays the passed in SoundPlayer in the passed in mode. - ''' - ''' The SoundPlayer to play. - ''' The mode in which to play the sound. - Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) - - Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") - Debug.Assert([Enum].IsDefined(GetType(AudioPlayMode), mode), "Enum value is out of range") - - ' Stopping the sound ensures it's safe to dispose it. This could happen when we change the value of m_Sound below - _sound?.Stop() - - _sound = sound - - Select Case mode - Case AudioPlayMode.WaitToComplete - _sound.PlaySync() - Case AudioPlayMode.Background - _sound.Play() - Case AudioPlayMode.BackgroundLoop - _sound.PlayLooping() - Case Else - Debug.Fail("Unknown AudioPlayMode") - End Select - - End Sub - - ''' - ''' Gets the full name and path for the file. Throws if unable to get full name and path. - ''' - ''' The filename being tested. - ''' A full name and path of the file. - Private Shared Function ValidateFilename(location As String) As String - If String.IsNullOrEmpty(location) Then - Throw ExUtils.GetArgumentNullException(NameOf(location)) - End If + End Class 'Audio + End Namespace - Return location - End Function + ''' + ''' Enum for three ways to play a .wav file. + ''' + Public Enum AudioPlayMode - ''' - ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. - ''' - ''' - Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) - If value < AudioPlayMode.WaitToComplete OrElse value > AudioPlayMode.BackgroundLoop Then - Throw New ComponentModel.InvalidEnumArgumentException(paramName, value, GetType(AudioPlayMode)) - End If - End Sub + ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() + WaitToComplete = 0 'Synchronous - ' Object that plays the sounds. We use a private member so we can ensure we have a reference for async plays - Private _sound As Media.SoundPlayer + Background = 1 'Asynchronous + BackgroundLoop = 2 'Asynchronous and looping + End Enum - End Class 'Audio - End Namespace End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index 1592ce89df3..50e9ffb722d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -227,23 +227,23 @@ Namespace Microsoft.VisualBasic.Devices client.Credentials = networkCredentials End If - Dim Dialog As ProgressDialog = Nothing + Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then - Dialog = New ProgressDialog With { + dialog = New ProgressDialog With { .Text = GetResourceString(SR.ProgressDialogUploadingTitle, sourceFileName), .LabelText = GetResourceString(SR.ProgressDialogUploadingLabel, sourceFileName, address.AbsolutePath) } End If 'Create the copier - Dim copier As New WebClientCopy(client, Dialog) + Dim copier As New WebClientCopy(client, dialog) 'Download the file copier.UploadFile(sourceFileName, address) 'Handle a dialog cancel If showUI AndAlso Environment.UserInteractive Then - If onUserCancel = UICancelOption.ThrowException And Dialog.UserCanceledTheDialog Then + If onUserCancel = UICancelOption.ThrowException And dialog.UserCanceledTheDialog Then Throw New OperationCanceledException() End If End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 771b72fbe48..9cc70890c31 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -10,86 +10,85 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Module NativeMethods - Friend Declare Auto Function _ - WaitForInputIdle _ - Lib "user32" (Process As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, Milliseconds As Integer) As Integer + Friend Declare Auto Function WaitForInputIdle Lib "user32" ( + Process As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, + Milliseconds As Integer) As Integer - Friend Declare Function _ - GetWindow _ - Lib "user32" (hwnd As IntPtr, wFlag As Integer) As IntPtr + Friend Declare Function GetWindow Lib "user32" ( + hwnd As IntPtr, + wFlag As Integer) As IntPtr - Friend Declare Function _ - GetDesktopWindow _ - Lib "user32" () As IntPtr + Friend Declare Function GetDesktopWindow Lib "user32" () As IntPtr #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes + + + Friend Function CreateProcess( + lpApplicationName As String, + lpCommandLine As String, + lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, + lpThreadAttributes As NativeTypes.SECURITY_ATTRIBUTES, + bInheritHandles As Boolean, + dwCreationFlags As Integer, + lpEnvironment As IntPtr, + lpCurrentDirectory As String, + lpStartupInfo As NativeTypes.STARTUPINFO, + lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer + End Function + + + Friend Sub GetStartupInfo( + <[In](), + Out()> lpStartupInfo As NativeTypes.STARTUPINFO) + End Sub + - Friend Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer + Friend Function GetWindowText( + hWnd As IntPtr, + lpString As StringBuilder, + nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes End Function - Friend Declare Function _ - AttachThreadInput _ - Lib "user32" (idAttach As Integer, idAttachTo As Integer, fAttach As Integer) As Integer + Friend Declare Function AttachThreadInput Lib "user32" ( + idAttach As Integer, + idAttachTo As Integer, + fAttach As Integer) As Integer - Friend Declare Function _ - SetForegroundWindow _ - Lib "user32" (hwnd As IntPtr) As Boolean + Friend Declare Function SetForegroundWindow Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - SetFocus _ - Lib "user32" (hwnd As IntPtr) As IntPtr + Friend Declare Function SetFocus Lib "user32" (hwnd As IntPtr) As IntPtr - Friend Declare Auto Function _ - FindWindow _ - Lib "user32" (lpClassName As String, lpWindowName As String) As IntPtr + Friend Declare Auto Function FindWindow Lib "user32" ( + lpClassName As String, + lpWindowName As String) As IntPtr - Friend Declare Function _ - CloseHandle _ - Lib "kernel32" (hObject As IntPtr) As Integer + Friend Declare Function CloseHandle Lib "kernel32" (hObject As IntPtr) As Integer - Friend Declare Function _ - WaitForSingleObject _ - Lib "kernel32" (hHandle As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, dwMilliseconds As Integer) As Integer - - - Friend Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) - End Sub + Friend Declare Function WaitForSingleObject Lib "kernel32" ( + hHandle As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, + dwMilliseconds As Integer) As Integer +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= +#Disable Warning IDE1006 ' Naming Styles, Justification:= - - Friend Function CreateProcess( - lpApplicationName As String, - lpCommandLine As String, - lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, - lpThreadAttributes As NativeTypes.SECURITY_ATTRIBUTES, - bInheritHandles As Boolean, - dwCreationFlags As Integer, - lpEnvironment As IntPtr, - lpCurrentDirectory As String, - lpStartupInfo As NativeTypes.STARTUPINFO, - lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer + ''' + ''' Obtains information about the system's current usage of both physical and virtual memory. + ''' + ''' Pointer to a MEMORYSTATUSEX structure. + ''' True if the function succeeds. Otherwise, False. + + Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean End Function -#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= -#Disable Warning IDE1006 ' Naming Styles, Justification:= ''' ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' @@ -121,17 +120,9 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub Init() dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub + End Structure #Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references - ''' - ''' Obtains information about the system's current usage of both physical and virtual memory. - ''' - ''' Pointer to a MEMORYSTATUSEX structure. - ''' True if the function succeeds. Otherwise, False. - - Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean - End Function - End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb new file mode 100644 index 00000000000..885793b7380 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb @@ -0,0 +1,31 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + + Partial Friend NotInheritable Class NativeTypes + + ''' + ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. + ''' + ''' + ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. + ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. + ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class + ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. + ''' + + Friend NotInheritable Class PROCESS_INFORMATION + Public hProcess As IntPtr = IntPtr.Zero + Public hThread As IntPtr = IntPtr.Zero + Public dwProcessId As Integer + Public dwThreadId As Integer + + Friend Sub New() + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 698afb2de47..200e0386e27 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -7,36 +7,30 @@ Imports Microsoft.Win32.SafeHandles Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class NativeTypes + Partial Friend NotInheritable Class NativeTypes #Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. - - Friend NotInheritable Class SECURITY_ATTRIBUTES -#Enable Warning CA1812 - Implements IDisposable + Friend Const GW_CHILD As Integer = 5 - Friend Sub New() - nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) - End Sub + ' GetWindow() Constants + Friend Const GW_HWNDFIRST As Integer = 0 - Public nLength As Integer - Public lpSecurityDescriptor As IntPtr - Public bInheritHandle As Boolean + Friend Const GW_HWNDLAST As Integer = 1 - Public Overloads Sub Dispose() Implements IDisposable.Dispose - If lpSecurityDescriptor <> IntPtr.Zero Then - UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) - lpSecurityDescriptor = IntPtr.Zero - End If - GC.SuppressFinalize(Me) - End Sub + Friend Const GW_HWNDNEXT As Integer = 2 - Protected Overrides Sub Finalize() - Dispose() - MyBase.Finalize() - End Sub + Friend Const GW_HWNDPREV As Integer = 3 - End Class + Friend Const GW_MAX As Integer = 5 + + Friend Const GW_OWNER As Integer = 4 + + Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 + + Friend Const STARTF_USESHOWWINDOW As Integer = 1 + + ' Handle Values + Friend Shared ReadOnly s_invalidHandle As New IntPtr(-1) ''' ''' Inherits , with additional InitialSetHandle method. @@ -49,34 +43,41 @@ Namespace Microsoft.VisualBasic.CompilerServices MyBase.New(True) End Sub + Protected Overrides Function ReleaseHandle() As Boolean + Return NativeMethods.CloseHandle(handle) <> 0 + End Function + Friend Sub InitialSetHandle(h As IntPtr) Debug.Assert(IsInvalid, "Safe handle should only be set once.") SetHandle(h) End Sub - Protected Overrides Function ReleaseHandle() As Boolean - Return NativeMethods.CloseHandle(handle) <> 0 - End Function - End Class - ''' - ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. - ''' - ''' - ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. - ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. - ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class - ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. - ''' - Friend NotInheritable Class PROCESS_INFORMATION - Public hProcess As IntPtr = IntPtr.Zero - Public hThread As IntPtr = IntPtr.Zero - Public dwProcessId As Integer - Public dwThreadId As Integer + Friend NotInheritable Class SECURITY_ATTRIBUTES +#Enable Warning CA1812 + Implements IDisposable Friend Sub New() + nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) + End Sub + + Public nLength As Integer + Public lpSecurityDescriptor As IntPtr + Public bInheritHandle As Boolean + + Public Overloads Sub Dispose() Implements IDisposable.Dispose + If lpSecurityDescriptor <> IntPtr.Zero Then + UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) + lpSecurityDescriptor = IntPtr.Zero + End If + GC.SuppressFinalize(Me) + End Sub + + Protected Overrides Sub Finalize() + Dispose() + MyBase.Finalize() End Sub End Class @@ -159,22 +160,5 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub End Class - - ' Handle Values - Friend Shared ReadOnly s_invalidHandle As IntPtr = New IntPtr(-1) - - ' GetWindow() Constants - Friend Const GW_HWNDFIRST As Integer = 0 - Friend Const GW_HWNDLAST As Integer = 1 - Friend Const GW_HWNDNEXT As Integer = 2 - Friend Const GW_HWNDPREV As Integer = 3 - Friend Const GW_OWNER As Integer = 4 - Friend Const GW_CHILD As Integer = 5 - Friend Const GW_MAX As Integer = 5 - - Friend Const STARTF_USESHOWWINDOW As Integer = 1 - - Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 1cf59377f70..a2e78f58b76 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub Private Sub InitializeComponent() - Dim resources As ComponentResourceManager = New ComponentResourceManager(GetType(VBInputBox)) + Dim resources As New ComponentResourceManager(GetType(VBInputBox)) OKButton = New Button MyCancelButton = New Button TextBox = New TextBox diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index fd94def4305..23ea4248dbc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -302,7 +302,7 @@ Namespace Microsoft.VisualBasic End Function Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String - Dim box As VBInputBox = New VBInputBox(prompt, title, defaultResponse, xPos, yPos) + Dim box As New VBInputBox(prompt, title, defaultResponse, xPos, yPos) box.ShowDialog(parentWindow) InternalInputBox = box.Output diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb index eeb859cad7e..6ef1b91e1b8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Logging Implements IDisposable ' Used for synchronizing writing and reference counting - Private ReadOnly _syncObject As Object = New Object + Private ReadOnly _syncObject As New Object ' Indicates whether or not the object has been disposed Private _disposed As Boolean diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index 20a8de87469..e4258b73bf4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -194,7 +194,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' Used to signal when the dialog is in a closable state. The dialog is in a closable ' state when it has been activated or when it has been flagged to be closed before ' ShowDialog has been called - Private _formClosableSemaphore As ManualResetEvent = New ManualResetEvent(False) + Private _formClosableSemaphore As New ManualResetEvent(False) ' Indicates CloseDialog has been called Private _closeDialogInvoked As Boolean @@ -230,7 +230,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal 'Do not modify it using the code editor. Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) + Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) LabelInfo = New Label ProgressBarWork = New ProgressBar ButtonCloseDialog = New Button diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 78964e033ca..d85b7c17b2e 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -352,7 +352,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - Dim networkCredentials As ICredentials = New NetworkCredential(DefaultUserName, DefaultPassword) + Dim networkCredentials As New NetworkCredential(DefaultUserName, DefaultPassword) Try My.Computer.Network _ diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb index 0883ea8f99a..b6b6329d349 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -12,7 +12,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub UserBaseTest() Dim testUser As New User Assert.Null(testUser.CurrentPrincipal) - Dim userPrincipal As UserPrincipal = New UserPrincipal( + Dim userPrincipal As New UserPrincipal( authenticationType:="Basic", name:="Test", isAuthenticated:=True, From 0aaa9dd3b7b1aecef4300bee3755c3851fa921e0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 00:17:00 -0700 Subject: [PATCH 252/342] Code and comment cleanup --- .../MyServices/Internal/ProgressDialog.vb | 57 +++--- .../MyServices/Internal/WebClientCopy.vb | 174 +++++++++--------- 2 files changed, 114 insertions(+), 117 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index e4258b73bf4..c21f4b4d595 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -15,7 +15,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Inherits Form ''' - ''' Event raised when user cancels the dialog or closes it before the operation is completed + ''' Event raised when user cancels the dialog or closes it before the operation is completed. ''' Public Event UserHitCancel() @@ -28,9 +28,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Increments the progress bar by the passed in amount + ''' Increments the progress bar by the passed in amount. ''' - ''' The amount to increment the bar + ''' The amount to increment the bar. ''' ''' This method should never be called directly. It should be called with ''' an InvokeBegin by a secondary thread. @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Closes the Progress Dialog + ''' Closes the Progress Dialog. ''' ''' ''' This method should never be called directly. It should be called with @@ -54,7 +54,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Displays the progress dialog modally ''' - ''' This method should be called on the main thread after the worker thread has been started + ''' This method should be called on the main thread after the worker thread has been started. Public Sub ShowProgressDialog() Try If Not _closing Then @@ -66,10 +66,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Sets the text of the label (usually something like Copying x to y) + ''' Sets the text of the label (usually something like Copying x to y). ''' - ''' The value to set the label to - ''' This should only be called on the main thread before showing the dialog + ''' The value to set the label to. + ''' This should only be called on the main thread before showing the dialog. Public Property LabelText() As String Get Return LabelInfo.Text @@ -80,10 +80,10 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' Used to set or get the semaphore which signals when the dialog - ''' is in a closable state. + ''' Used to set or get the semaphore which signals when the dialog + ''' is in a closable state. ''' - ''' The ManualResetEvent + ''' The ManualResetEvent. Public ReadOnly Property FormClosableSemaphore() As ManualResetEvent Get Return _formClosableSemaphore @@ -91,21 +91,21 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' Inform the dialog that CloseDialog will soon be called + ''' Inform the dialog that CloseDialog will soon be called. ''' ''' ''' This method should be called directly from the secondary thread. We want ''' to indicate we're closing as soon as we can so w don't show the dialog when we - ''' don't need to (when the work is finished before we can show the dialog) + ''' don't need to (when the work is finished before we can show the dialog). ''' Public Sub IndicateClosing() _closing = True End Sub ''' - ''' Indicated if the user has clicked the cancel button + ''' Indicated if the user has clicked the cancel button. ''' - ''' True if the user has canceled, otherwise False + ''' True if the user has canceled, otherwise False. ''' ''' The secondary thread checks this property directly. If it's True, the thread ''' breaks out of its loop. @@ -117,7 +117,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' This enables a dialog with a close button, sizable borders, and no icon + ''' This enables a dialog with a close button, sizable borders, and no icon ''' Protected Overrides ReadOnly Property CreateParams() As CreateParams Get @@ -130,8 +130,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Handles user clicking Cancel. Sets a flag read by secondary thread. ''' - ''' The cancel button - ''' Arguments + ''' The cancel button. + ''' Arguments. Private Sub ButtonCloseDialog_Click(sender As Object, e As EventArgs) Handles ButtonCloseDialog.Click ButtonCloseDialog.Enabled = False _canceled = True @@ -139,13 +139,13 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Indicates the form is closing + ''' Indicates the form is closing ''' ''' ''' ''' - ''' We listen for this event since we want to make closing the dialog before it's - ''' finished behave the same as a cancel + ''' We listen for this event since we want to make closing the dialog before it's + ''' finished behave the same as a cancel. ''' Private Sub ProgressDialog_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing If e.CloseReason = CloseReason.UserClosing And Not _closeDialogInvoked Then @@ -163,21 +163,21 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Ensure the label resizes with the dialog + ''' Ensure the label resizes with the dialog. ''' ''' ''' ''' - ''' Since the label has AutoSize set to True we have to set the maximum size so the label - ''' will grow down rather than off the dialog. As the size of the dialog changes, the maximum - ''' size needs to be adjusted. + ''' Since the label has AutoSize set to True we have to set the maximum size so the label + ''' will grow down rather than off the dialog. As the size of the dialog changes, the maximum + ''' size needs to be adjusted. ''' Private Sub ProgressDialog_Resize(sender As Object, e As EventArgs) Handles Me.Resize LabelInfo.MaximumSize = New Size(ClientSize.Width - BORDER_SIZE, 0) End Sub ''' - ''' Exits the monitor when we're activated + ''' Exits the monitor when we're activated. ''' ''' Dialog ''' Arguments @@ -205,8 +205,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' Border area for label (10 pixels on each side) Private Const BORDER_SIZE As Integer = 20 -#Region " Windows Form Designer generated code " - 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(disposing As Boolean) If disposing Then @@ -218,6 +216,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End If MyBase.Dispose(disposing) End Sub + Friend WithEvents LabelInfo As Label Friend WithEvents ProgressBarWork As ProgressBar Friend WithEvents ButtonCloseDialog As Button @@ -268,7 +267,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub -#End Region - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 432b452ba62..062efc1744d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -12,77 +12,57 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Friend NotInheritable Class WebClientCopy - ''' - ''' Creates an instance of a WebClientCopy, used to download or upload a file - ''' - ''' The WebClient used to do the downloading or uploading - ''' UI for indicating progress - Public Sub New(client As WebClient, dialog As ProgressDialog) + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog - Debug.Assert(client IsNot Nothing, "No WebClient") + ' The WebClient performs the downloading or uploading operations for us + Private WithEvents m_WebClient As WebClient - m_WebClient = client - m_ProgressDialog = dialog + 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread + Private _exceptionEncounteredDuringFileTransfer As Exception - End Sub + ' The percentage of the operation completed + Private _percentage As Integer + + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) ''' - ''' Downloads a file + ''' Creates an instance of a WebClientCopy, used to download or upload a file. ''' - ''' The source for the file - ''' The path and name where the file is saved - Public Sub DownloadFile(address As Uri, destinationFileName As String) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") + ''' The WebClient used to do the downloading or uploading. + ''' UI for indicating progress. + Public Sub New(client As WebClient, dialog As ProgressDialog) - ' If we have a dialog we need to set up an async download - If m_ProgressDialog IsNot Nothing Then - m_WebClient.DownloadFileAsync(address, destinationFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.DownloadFile(address, destinationFileName) - End If + Debug.Assert(client IsNot Nothing, "No WebClient") - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer - End If - End If + m_WebClient = client + m_ProgressDialog = dialog End Sub ''' - ''' Uploads a file + ''' Posts a message to close the progress dialog. ''' - ''' The name and path of the source file - ''' The address to which the file is uploaded - Public Sub UploadFile(sourceFileName As String, address As Uri) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - - ' If we have a dialog we need to set up an async download + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then - m_WebClient.UploadFileAsync(address, sourceFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.UploadFile(address, sourceFileName) - End If + m_ProgressDialog.IndicateClosing() - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() End If End If End Sub ''' - ''' Notifies the progress dialog to increment the progress bar + ''' Notifies the progress dialog to increment the progress bar. ''' - ''' The percentage of bytes read + ''' The percentage of bytes read. Private Sub InvokeIncrement(progressPercentage As Integer) ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then @@ -100,25 +80,19 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Posts a message to close the progress dialog + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation. ''' - Private Sub CloseProgressDialog() - ' Don't invoke unless dialog is up and running - If m_ProgressDialog IsNot Nothing Then - m_ProgressDialog.IndicateClosing() - - If m_ProgressDialog.IsHandleCreated Then - m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - m_ProgressDialog.Close() - End If - End If + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. End Sub ''' - ''' Handles the WebClient's DownloadFileCompleted event + ''' Handles the WebClient's DownloadFileCompleted event. ''' ''' ''' @@ -139,7 +113,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles event WebClient fires whenever progress of download changes + ''' Handles event WebClient fires whenever progress of download changes. ''' ''' ''' @@ -148,7 +122,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles the WebClient's UploadFileCompleted event + ''' Handles the WebClient's UploadFileCompleted event. ''' ''' ''' @@ -169,7 +143,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Handles event WebClient fires whenever progress of upload changes + ''' Handles event WebClient fires whenever progress of upload changes. ''' ''' ''' @@ -179,31 +153,57 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation + ''' Downloads a file. ''' - ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. - ''' - Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. - End Sub + ''' The source for the file. + ''' The path and name where the file is saved. + Public Sub DownloadFile(address As Uri, destinationFileName As String) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(destinationFileName)) AndAlso Directory.Exists(Path.GetDirectoryName(Path.GetFullPath(destinationFileName))), "Invalid path") - ' The WebClient performs the downloading or uploading operations for us - Private WithEvents m_WebClient As WebClient + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.DownloadFileAsync(address, destinationFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.DownloadFile(address, destinationFileName) + End If - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. - Private WithEvents m_ProgressDialog As ProgressDialog + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If - 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread - Private _exceptionEncounteredDuringFileTransfer As Exception + End Sub - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) + ''' + ''' Uploads a file. + ''' + ''' The name and path of the source file. + ''' The address to which the file is uploaded. + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - ' The percentage of the operation completed - Private _percentage As Integer + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If + + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If + End Sub End Class End Namespace From 66dbad2fb6a91cb37bb716c593758d12253ce31c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 00:25:23 -0700 Subject: [PATCH 253/342] Fix wrong error code Cleanup formatting --- .../Devices/Network/NetworkDownload.vb | 123 ++++++++++-------- .../src/Microsoft/VisualBasic/Interaction.vb | 2 +- 2 files changed, 68 insertions(+), 57 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 9778b5d0dd0..aaf7ac88c7a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -10,11 +10,11 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Devices + ''' + ''' An object that allows easy access to some simple network properties and functionality. + ''' Partial Public Class Network - ''' - ''' Creates class and hooks up events. - ''' Public Sub New() End Sub @@ -47,10 +47,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved. ''' The name of the user performing the download. ''' The user's password - Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String) + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String) + Try DownloadFileAsync(address, destinationFileName, @@ -77,13 +79,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. - Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address, destinationFileName, showUI) @@ -138,14 +142,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Public Sub DownloadFile(address As String, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + Public Sub DownloadFile( + address As String, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. @@ -203,12 +208,13 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Calls to all the other overloads will come through here. - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) @@ -256,13 +262,14 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). ''' Calls to all the other overloads will come through here. - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) If connectionTimeout <= 0 Then Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) @@ -312,13 +319,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean) + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean) + If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) End If @@ -366,14 +375,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String, - showUI As Boolean, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String, + showUI As Boolean, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) If address Is Nothing Then Throw ExUtils.GetArgumentNullException(NameOf(address)) @@ -417,8 +427,7 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Uri to the remote file. ''' Name and path of file where download is saved. - Public Sub DownloadFile(address As Uri, - destinationFileName As String) + Public Sub DownloadFile(address As Uri, destinationFileName As String) Try DownloadFileAsync(addressUri:=address, @@ -443,10 +452,12 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved. ''' The name of the user performing the download. ''' The user's password. - Public Sub DownloadFile(address As Uri, - destinationFileName As String, - userName As String, - password As String) + Public Sub DownloadFile( + address As Uri, + destinationFileName As String, + userName As String, + password As String) + Try DownloadFileAsync(addressUri:=address, destinationFileName, diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 19ebd71aa9a..fd94def4305 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -80,7 +80,7 @@ Namespace Microsoft.VisualBasic Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) End If - Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) + Throw ExUtils.VbMakeException(vbErrors.FileNotFound) End If Finally safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. From dc73c6332fe78fb90e0e207661e41c43fc440447 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 00:40:36 -0700 Subject: [PATCH 254/342] Cleanup NetworkDownload comments --- .../Devices/Network/NetworkDownload.vb | 100 ++++++++++++++---- 1 file changed, 78 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 981125e4c6f..24151580af1 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -2,10 +2,11 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Net -Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal +Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils + Namespace Microsoft.VisualBasic.Devices ''' @@ -13,9 +14,6 @@ Namespace Microsoft.VisualBasic.Devices ''' Partial Public Class Network - ''' - ''' Creates class and hooks up events - ''' Public Sub New() End Sub @@ -34,7 +32,14 @@ Namespace Microsoft.VisualBasic.Devices ''' Uri to the remote file. ''' Name and path of file where download is saved. Public Sub DownloadFile(address As Uri, destinationFileName As String) - DownloadFile(address, destinationFileName, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT, False) + DownloadFile( + address, + destinationFileName, + DEFAULT_USERNAME, + DEFAULT_PASSWORD, + False, + DEFAULT_TIMEOUT, + False) End Sub ''' @@ -50,7 +55,14 @@ Namespace Microsoft.VisualBasic.Devices userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) + DownloadFile( + address, + destinationFileName, + userName, + password, + showUI:=False, + DEFAULT_TIMEOUT, + False) End Sub ''' @@ -66,7 +78,14 @@ Namespace Microsoft.VisualBasic.Devices userName As String, password As String) - DownloadFile(address, destinationFileName, userName, password, False, DEFAULT_TIMEOUT, False) + DownloadFile( + address, + destinationFileName, + userName, + password, + False, + DEFAULT_TIMEOUT, + False) End Sub ''' @@ -90,11 +109,19 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + DownloadFile( + address, + destinationFileName, + userName, + password, + showUI, + connectionTimeout, + overwrite, + UICancelOption.ThrowException) End Sub ''' - ''' Downloads a file from the network to the specified path + ''' Downloads a file from the network to the specified path. ''' ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved. @@ -121,7 +148,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from DownloadFile(Nothing, ...) due to overload failure (DownloadFile(String,...) vs. DownloadFile(Uri,...)). ' However, it is good practice to verify address before calling Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Dim addressUri As Uri = GetUri(address.Trim()) @@ -129,7 +156,14 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - DownloadFile(addressUri, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + DownloadFile( + addressUri, + destinationFileName, + networkCredentials, + showUI, + connectionTimeout, + overwrite, + onUserCancel) End Sub ''' @@ -155,7 +189,15 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, userName, password, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + DownloadFile( + address, + destinationFileName, + userName, + password, + showUI, + connectionTimeout, + overwrite, + UICancelOption.ThrowException) End Sub ''' @@ -191,7 +233,14 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, onUserCancel) + DownloadFile( + address, + destinationFileName, + networkCredentials, + showUI, + connectionTimeout, + overwrite, + onUserCancel) End Sub ''' @@ -218,7 +267,14 @@ Namespace Microsoft.VisualBasic.Devices connectionTimeout As Integer, overwrite As Boolean) - DownloadFile(address, destinationFileName, networkCredentials, showUI, connectionTimeout, overwrite, UICancelOption.ThrowException) + DownloadFile( + address, + destinationFileName, + networkCredentials, + showUI, + connectionTimeout, + overwrite, + UICancelOption.ThrowException) End Sub @@ -243,11 +299,11 @@ Namespace Microsoft.VisualBasic.Devices onUserCancel As UICancelOption) If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw ExUtils.GetArgumentNullException(NameOf(address)) End If Using client As New WebClientExtended @@ -257,17 +313,17 @@ Namespace Microsoft.VisualBasic.Devices client.UseNonPassiveFtp = showUI 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + Dim fullFilename As String = CompilerServices.FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) ' Sometime a path that can't be parsed is normalized to the current directory. This makes sure we really ' have a file and path If IO.Directory.Exists(fullFilename) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If 'Throw if the file exists and the user doesn't want to overwrite If IO.File.Exists(fullFilename) And Not overwrite Then - Throw New IO.IOException(GetResourceString(SR.IO_FileExists_Path, destinationFileName)) + Throw New IO.IOException(ExUtils.GetResourceString(SR.IO_FileExists_Path, destinationFileName)) End If ' Set credentials if we have any @@ -278,8 +334,8 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing If showUI AndAlso Environment.UserInteractive Then dialog = New ProgressDialog With { - .Text = GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), - .LabelText = GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) + .Text = ExUtils.GetResourceString(SR.ProgressDialogDownloadingTitle, address.AbsolutePath), + .LabelText = ExUtils.GetResourceString(SR.ProgressDialogDownloadingLabel, address.AbsolutePath, fullFilename) } End If @@ -288,7 +344,7 @@ Namespace Microsoft.VisualBasic.Devices ' Make sure we have a meaningful directory. If we don't, the destinationFileName is suspect If String.IsNullOrEmpty(targetDirectory) Then - Throw GetInvalidOperationException(SR.Network_DownloadNeedsFilename) + Throw ExUtils.GetInvalidOperationException(SR.Network_DownloadNeedsFilename) End If If Not IO.Directory.Exists(targetDirectory) Then From 8f546f7dcf830aa2365fdd4aea3bd8947457d959 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 00:52:57 -0700 Subject: [PATCH 255/342] Clean up formatting and comments in NetworkDownload --- .../Devices/Network/NetworkDownload.vb | 122 ++++++++++-------- 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index aaf7ac88c7a..493e092c2d2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -2,7 +2,6 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Net -Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices.Internal @@ -25,13 +24,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Name and path of file where download is saved. Public Sub DownloadFile(address As String, destinationFileName As String) Try - DownloadFileAsync(address, + DownloadFileAsync( + address, destinationFileName, userName:=DEFAULT_USERNAME, password:=DEFAULT_PASSWORD, dialog:=Nothing, connectionTimeout:=DEFAULT_TIMEOUT, overwrite:=False).Wait() + Catch ex As Exception If ex.InnerException IsNot Nothing Then Throw ex.InnerException @@ -54,7 +55,8 @@ Namespace Microsoft.VisualBasic.Devices password As String) Try - DownloadFileAsync(address, + DownloadFileAsync( + address, destinationFileName, userName, password, @@ -92,14 +94,16 @@ Namespace Microsoft.VisualBasic.Devices Try dialog = GetProgressDialog(address, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException) + Dim t As Task = DownloadFileAsync( + address, + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException) + If t.IsFaulted Then ' This will be true if any parameters are bad Throw t.Exception @@ -137,11 +141,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Address to the remote file, http, ftp etc... ''' Name and path of file where download is saved. ''' The name of the user performing the download. - ''' The user's password + ''' The user's password. ''' Indicates whether or not to show a progress bar. ''' Time allotted before giving up on a connection. - ''' Indicates whether or not the file should be overwritten if local file already exists. - ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Indicates whether or not the file should be + ''' overwritten if local file already exists. + ''' + ''' + ''' Indicates what to do if user cancels dialog (either throw or do nothing). + ''' Public Sub DownloadFile( address As String, destinationFileName As String, @@ -167,17 +175,19 @@ Namespace Microsoft.VisualBasic.Devices Try If showUI AndAlso Environment.UserInteractive Then 'Construct the local file. This will validate the full name and path - Dim fullFilename As String = FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) + Dim fullFilename As String = CompilerServices.FileSystemUtils.NormalizeFilePath(destinationFileName, NameOf(destinationFileName)) dialog = GetProgressDialog(address, destinationFileName, showUI) End If - Dim t As Task = DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel) + Dim t As Task = DownloadFileAsync( + addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) + If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -223,13 +233,13 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite - ) + Dim t As Task = DownloadFileAsync( + address, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite) If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad @@ -282,13 +292,15 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel) + Dim t As Task = DownloadFileAsync( + address, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) + If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -337,13 +349,15 @@ Namespace Microsoft.VisualBasic.Devices Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException) + Dim t As Task = DownloadFileAsync( + address, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException) + If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -395,13 +409,15 @@ Namespace Microsoft.VisualBasic.Devices Dim dialog As ProgressDialog = Nothing Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) - Dim t As Task = DownloadFileAsync(addressUri:=address, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel) + Dim t As Task = DownloadFileAsync( + addressUri:=address, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel) + If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad Throw t.Exception @@ -430,7 +446,8 @@ Namespace Microsoft.VisualBasic.Devices Public Sub DownloadFile(address As Uri, destinationFileName As String) Try - DownloadFileAsync(addressUri:=address, + DownloadFileAsync( + addressUri:=address, destinationFileName, userName:=DEFAULT_USERNAME, password:=DEFAULT_PASSWORD, @@ -459,7 +476,8 @@ Namespace Microsoft.VisualBasic.Devices password As String) Try - DownloadFileAsync(addressUri:=address, + DownloadFileAsync( + addressUri:=address, destinationFileName, userName, password, From 8dee54a3f146aab18c3fd33fc320d0c1e20a8bfb Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:12:12 -0700 Subject: [PATCH 256/342] Fix formatting in 2 files --- .../CantStartSingleInstanceException.vb | 14 +- .../Microsoft/VisualBasic/Devices/Audio.vb | 149 +++++++++--------- 2 files changed, 82 insertions(+), 81 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index f79a4ee9b8f..f05ab60a321 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -15,6 +15,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Class CantStartSingleInstanceException : Inherits Exception + ' Deserialization constructor must be defined since we are serializable + + + Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + End Sub + ''' ''' Creates a new exception ''' @@ -30,12 +37,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices MyBase.New(message, inner) End Sub - ' Deserialization constructor must be defined since we are serializable - - - Protected Sub New(info As Runtime.Serialization.SerializationInfo, context As Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 5ca6aa33c5c..a3848db1ce4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -7,16 +7,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic - ''' - ''' Enum for three ways to play a .wav file. - ''' - Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() - WaitToComplete = 0 'Synchronous - Background = 1 'Asynchronous - BackgroundLoop = 2 'Asynchronous and looping - End Enum - Namespace Devices ''' @@ -24,12 +14,74 @@ Namespace Microsoft.VisualBasic ''' Public Class Audio + ' Object that plays the sounds. We use a private member so we can ensure we have a reference for async plays + Private _sound As Media.SoundPlayer + ''' ''' Creates a new Audio object. ''' Public Sub New() End Sub + ''' + ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. + ''' + ''' + Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) + If value < AudioPlayMode.WaitToComplete OrElse value > AudioPlayMode.BackgroundLoop Then + Throw New ComponentModel.InvalidEnumArgumentException(paramName, value, GetType(AudioPlayMode)) + End If + End Sub + + ''' + ''' Gets the full name and path for the file. Throws if unable to get full name and path. + ''' + ''' The filename being tested. + ''' A full name and path of the file. + Private Shared Function ValidateFilename(location As String) As String + If String.IsNullOrEmpty(location) Then + Throw ExUtils.GetArgumentNullException(NameOf(location)) + End If + + Return location + End Function + + ''' + ''' Plays the passed in SoundPlayer in the passed in mode. + ''' + ''' The SoundPlayer to play. + ''' The mode in which to play the sound. + Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) + + Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") + Debug.Assert([Enum].IsDefined(GetType(AudioPlayMode), mode), "Enum value is out of range") + + ' Stopping the sound ensures it's safe to dispose it. This could happen when we change the value of m_Sound below + _sound?.Stop() + + _sound = sound + + Select Case mode + Case AudioPlayMode.WaitToComplete + _sound.PlaySync() + Case AudioPlayMode.Background + _sound.Play() + Case AudioPlayMode.BackgroundLoop + _sound.PlayLooping() + Case Else + Debug.Fail("Unknown AudioPlayMode") + End Select + + End Sub + + ''' + ''' Stops the play of any playing sound. + ''' + Public Sub [Stop]() + Dim sound As New Media.SoundPlayer() + sound.Stop() + End Sub + ''' ''' Plays a .wav file in background mode. ''' @@ -49,7 +101,7 @@ Namespace Microsoft.VisualBasic Public Sub Play(location As String, playMode As AudioPlayMode) ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) Dim safeFilename As String = ValidateFilename(location) - Dim sound As Media.SoundPlayer = New Media.SoundPlayer(safeFilename) + Dim sound As New Media.SoundPlayer(safeFilename) Play(sound, playMode) End Sub @@ -64,7 +116,7 @@ Namespace Microsoft.VisualBasic End If ValidateAudioPlayModeEnum(playMode, NameOf(playMode)) - Dim soundStream As MemoryStream = New MemoryStream(data) + Dim soundStream As New MemoryStream(data) Play(soundStream, playMode) soundStream.Close() End Sub @@ -97,68 +149,17 @@ Namespace Microsoft.VisualBasic End Sub - ''' - ''' Stops the play of any playing sound. - ''' - Public Sub [Stop]() - Dim sound As New Media.SoundPlayer() - sound.Stop() - End Sub - - ''' - ''' Plays the passed in SoundPlayer in the passed in mode. - ''' - ''' The SoundPlayer to play. - ''' The mode in which to play the sound. - Private Sub Play(sound As Media.SoundPlayer, mode As AudioPlayMode) - - Debug.Assert(sound IsNot Nothing, "There's no SoundPlayer") - Debug.Assert([Enum].IsDefined(GetType(AudioPlayMode), mode), "Enum value is out of range") - - ' Stopping the sound ensures it's safe to dispose it. This could happen when we change the value of m_Sound below - _sound?.Stop() - - _sound = sound - - Select Case mode - Case AudioPlayMode.WaitToComplete - _sound.PlaySync() - Case AudioPlayMode.Background - _sound.Play() - Case AudioPlayMode.BackgroundLoop - _sound.PlayLooping() - Case Else - Debug.Fail("Unknown AudioPlayMode") - End Select - - End Sub - - ''' - ''' Gets the full name and path for the file. Throws if unable to get full name and path. - ''' - ''' The filename being tested. - ''' A full name and path of the file. - Private Shared Function ValidateFilename(location As String) As String - If String.IsNullOrEmpty(location) Then - Throw ExUtils.GetArgumentNullException(NameOf(location)) - End If - - Return location - End Function - - ''' - ''' Validates that the value being passed as an AudioPlayMode enum is a legal value. - ''' - ''' - Private Shared Sub ValidateAudioPlayModeEnum(value As AudioPlayMode, paramName As String) - If value < AudioPlayMode.WaitToComplete OrElse value > AudioPlayMode.BackgroundLoop Then - Throw New ComponentModel.InvalidEnumArgumentException(paramName, value, GetType(AudioPlayMode)) - End If - End Sub - - ' Object that plays the sounds. We use a private member so we can ensure we have a reference for async plays - Private _sound As Media.SoundPlayer - End Class 'Audio End Namespace + + ''' + ''' Enum for three ways to play a .wav file. + ''' + Public Enum AudioPlayMode + ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() + WaitToComplete = 0 'Synchronous + Background = 1 'Asynchronous + BackgroundLoop = 2 'Asynchronous and looping + End Enum + End Namespace From add6c0790d4353e1289de370d7e3e17bcc6828c6 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:13:18 -0700 Subject: [PATCH 257/342] Fix formatting in Audio.vb --- .../src/Microsoft/VisualBasic/Devices/Audio.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb index 31ba2f2af0a..a3848db1ce4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb @@ -156,10 +156,8 @@ Namespace Microsoft.VisualBasic ''' Enum for three ways to play a .wav file. ''' Public Enum AudioPlayMode - ' Any changes to this enum must be reflected in ValidateAudioPlayModeEnum() WaitToComplete = 0 'Synchronous - Background = 1 'Asynchronous BackgroundLoop = 2 'Asynchronous and looping End Enum From 56b3487577893997aeef6a2be5f4ab184155ca6f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:30:27 -0700 Subject: [PATCH 258/342] Cleanup NativeMethids Split NativeTypes --- .../VisualBasic/Helpers/NativeMethods.vb | 122 +++++++------ ...teInitSafeHandleZeroOrMinusOneIsInvalid.vb | 31 ++++ .../NativeTypes.PROCESS_INFORMATION.vb | 30 ++++ .../NativeTypes.SECURITY_ATTRIBUTES.vb | 38 +++++ .../Helpers/NativeTypes.STARTUPINFO.vb | 92 ++++++++++ .../VisualBasic/Helpers/NativeTypes.vb | 161 +----------------- 6 files changed, 251 insertions(+), 223 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 771b72fbe48..69682abae82 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -10,86 +10,86 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Module NativeMethods - Friend Declare Auto Function _ - WaitForInputIdle _ - Lib "user32" (Process As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, Milliseconds As Integer) As Integer + Friend Declare Auto Function WaitForInputIdle Lib "user32" ( + Process As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, + Milliseconds As Integer) As Integer - Friend Declare Function _ - GetWindow _ - Lib "user32" (hwnd As IntPtr, wFlag As Integer) As IntPtr + Friend Declare Function GetWindow Lib "user32" ( + hwnd As IntPtr, + wFlag As Integer) As IntPtr - Friend Declare Function _ - GetDesktopWindow _ - Lib "user32" () As IntPtr + Friend Declare Function GetDesktopWindow Lib "user32" () As IntPtr #Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes + + + Friend Function CreateProcess( + lpApplicationName As String, + lpCommandLine As String, + lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, + lpThreadAttributes As NativeTypes.SECURITY_ATTRIBUTES, + bInheritHandles As Boolean, + dwCreationFlags As Integer, + lpEnvironment As IntPtr, + lpCurrentDirectory As String, + lpStartupInfo As NativeTypes.STARTUPINFO, + lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer + End Function + + + Friend Sub GetStartupInfo( + <[In](), + Out()> lpStartupInfo As NativeTypes.STARTUPINFO) + End Sub + - Friend Function GetWindowText(hWnd As IntPtr, lpString As StringBuilder, nMaxCount As Integer) As Integer + Friend Function GetWindowText( + hWnd As IntPtr, + lpString As StringBuilder, + nMaxCount As Integer) As Integer #Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes End Function - Friend Declare Function _ - AttachThreadInput _ - Lib "user32" (idAttach As Integer, idAttachTo As Integer, fAttach As Integer) As Integer + Friend Declare Function AttachThreadInput Lib "user32" ( + idAttach As Integer, + idAttachTo As Integer, + fAttach As Integer) As Integer - Friend Declare Function _ - SetForegroundWindow _ - Lib "user32" (hwnd As IntPtr) As Boolean + Friend Declare Function SetForegroundWindow Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - SetFocus _ - Lib "user32" (hwnd As IntPtr) As IntPtr + Friend Declare Function SetFocus Lib "user32" (hwnd As IntPtr) As IntPtr - Friend Declare Auto Function _ - FindWindow _ - Lib "user32" (lpClassName As String, lpWindowName As String) As IntPtr + Friend Declare Auto Function FindWindow Lib "user32" ( + lpClassName As String, + lpWindowName As String) As IntPtr - Friend Declare Function _ - CloseHandle _ - Lib "kernel32" (hObject As IntPtr) As Integer + Friend Declare Function CloseHandle Lib "kernel32" (hObject As IntPtr) As Integer - Friend Declare Function _ - WaitForSingleObject _ - Lib "kernel32" (hHandle As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, dwMilliseconds As Integer) As Integer - - - Friend Sub GetStartupInfo(<[In](), Out()> lpStartupInfo As NativeTypes.STARTUPINFO) - End Sub - - - Friend Function CreateProcess( - lpApplicationName As String, - lpCommandLine As String, - lpProcessAttributes As NativeTypes.SECURITY_ATTRIBUTES, - lpThreadAttributes As NativeTypes.SECURITY_ATTRIBUTES, - bInheritHandles As Boolean, - dwCreationFlags As Integer, - lpEnvironment As IntPtr, - lpCurrentDirectory As String, - lpStartupInfo As NativeTypes.STARTUPINFO, - lpProcessInformation As NativeTypes.PROCESS_INFORMATION) As Integer - End Function + Friend Declare Function WaitForSingleObject Lib "kernel32" ( + hHandle As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, + dwMilliseconds As Integer) As Integer #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= + + ''' + ''' Obtains information about the system's current usage of both physical and virtual memory. + ''' + ''' Pointer to a MEMORYSTATUSEX structure. + ''' True if the function succeeds. Otherwise, False. + + Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean + End Function + ''' ''' Contains information about the current state of both physical and virtual memory, including extended memory. ''' @@ -121,17 +121,9 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Sub Init() dwLength = CType(Marshal.SizeOf(GetType(MEMORYSTATUSEX)), UInt32) End Sub + End Structure #Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references - ''' - ''' Obtains information about the system's current usage of both physical and virtual memory. - ''' - ''' Pointer to a MEMORYSTATUSEX structure. - ''' True if the function succeeds. Otherwise, False. - - Friend Function GlobalMemoryStatusEx(ByRef lpBuffer As MEMORYSTATUSEX) As Boolean - End Function - End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb new file mode 100644 index 00000000000..2f2005c658a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb @@ -0,0 +1,31 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.Win32.SafeHandles + +Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + ''' + ''' Inherits , with additional InitialSetHandle method. + ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. + ''' + Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid + Inherits SafeHandleZeroOrMinusOneIsInvalid + + Friend Sub New() + MyBase.New(True) + End Sub + + Friend Sub InitialSetHandle(h As IntPtr) + Debug.Assert(IsInvalid, "Safe handle should only be set once.") + SetHandle(h) + End Sub + + Protected Overrides Function ReleaseHandle() As Boolean + Return NativeMethods.CloseHandle(handle) <> 0 + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb new file mode 100644 index 00000000000..c216590b4d6 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb @@ -0,0 +1,30 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + ''' + ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. + ''' + ''' + ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. + ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. + ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class + ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. + ''' + + Friend NotInheritable Class PROCESS_INFORMATION + Public hProcess As IntPtr = IntPtr.Zero + Public hThread As IntPtr = IntPtr.Zero + Public dwProcessId As Integer + Public dwThreadId As Integer + + Friend Sub New() + End Sub + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb new file mode 100644 index 00000000000..df95f5a712a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb @@ -0,0 +1,38 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + +#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. + + Friend NotInheritable Class SECURITY_ATTRIBUTES +#Enable Warning CA1812 + Implements IDisposable + + Friend Sub New() + nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) + End Sub + + Public nLength As Integer + Public lpSecurityDescriptor As IntPtr + Public bInheritHandle As Boolean + + Public Overloads Sub Dispose() Implements IDisposable.Dispose + If lpSecurityDescriptor <> IntPtr.Zero Then + UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) + lpSecurityDescriptor = IntPtr.Zero + End If + GC.SuppressFinalize(Me) + End Sub + + Protected Overrides Sub Finalize() + Dispose() + MyBase.Finalize() + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb new file mode 100644 index 00000000000..ea272c3d5eb --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb @@ -0,0 +1,92 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + + Partial Friend NotInheritable Class NativeTypes + + ' Handle Values + Friend Shared ReadOnly s_invalidHandle As IntPtr = New IntPtr(-1) + + ''' + ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead + ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() + ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would + ''' and we got memory corruption problems detectable while running AppVerifier. + ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. + ''' as String so that the memory will get cleaned up. + ''' + + Friend NotInheritable Class STARTUPINFO + Implements IDisposable + + Public cb As Integer + Public lpReserved As IntPtr = IntPtr.Zero 'not string - see summary + Public lpDesktop As IntPtr = IntPtr.Zero 'not string - see summary + Public lpTitle As IntPtr = IntPtr.Zero 'not string - see summary + Public dwX As Integer + Public dwY As Integer + Public dwXSize As Integer + Public dwYSize As Integer + Public dwXCountChars As Integer + Public dwYCountChars As Integer + Public dwFillAttribute As Integer + Public dwFlags As Integer + Public wShowWindow As Short + Public cbReserved2 As Short + Public lpReserved2 As IntPtr = IntPtr.Zero + Public hStdInput As IntPtr = IntPtr.Zero + Public hStdOutput As IntPtr = IntPtr.Zero + Public hStdError As IntPtr = IntPtr.Zero + + Friend Sub New() + End Sub + + ' To detect redundant calls. Default initialize = False. + Private _hasBeenDisposed As Boolean + + Protected Overrides Sub Finalize() + Dispose(False) + End Sub + + ' IDisposable + Private Sub Dispose(disposing As Boolean) + If Not _hasBeenDisposed Then + If disposing Then + _hasBeenDisposed = True + + ' 256 Defined in windows.h + Const STARTF_USESTDHANDLES As Integer = 256 + If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then + If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdInput) + hStdInput = s_invalidHandle + End If + + If hStdOutput <> IntPtr.Zero AndAlso hStdOutput <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdOutput) + hStdOutput = s_invalidHandle + End If + + If hStdError <> IntPtr.Zero AndAlso hStdError <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdError) + hStdError = s_invalidHandle + End If + End If 'Me.dwFlags and STARTF_USESTDHANDLES + + End If + End If + End Sub + + ' This code correctly implements the disposable pattern. + Friend Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 698afb2de47..8f3d6cd56be 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -1,167 +1,12 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Runtime.InteropServices -Imports Microsoft.Win32.SafeHandles - Namespace Microsoft.VisualBasic.CompilerServices - Friend NotInheritable Class NativeTypes + Partial Friend NotInheritable Class NativeTypes #Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. - - Friend NotInheritable Class SECURITY_ATTRIBUTES -#Enable Warning CA1812 - Implements IDisposable - - Friend Sub New() - nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) - End Sub - - Public nLength As Integer - Public lpSecurityDescriptor As IntPtr - Public bInheritHandle As Boolean - - Public Overloads Sub Dispose() Implements IDisposable.Dispose - If lpSecurityDescriptor <> IntPtr.Zero Then - UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) - lpSecurityDescriptor = IntPtr.Zero - End If - GC.SuppressFinalize(Me) - End Sub - - Protected Overrides Sub Finalize() - Dispose() - MyBase.Finalize() - End Sub - - End Class - - ''' - ''' Inherits , with additional InitialSetHandle method. - ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. - ''' - Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid - Inherits SafeHandleZeroOrMinusOneIsInvalid - - Friend Sub New() - MyBase.New(True) - End Sub - - Friend Sub InitialSetHandle(h As IntPtr) - Debug.Assert(IsInvalid, "Safe handle should only be set once.") - SetHandle(h) - End Sub - - Protected Overrides Function ReleaseHandle() As Boolean - Return NativeMethods.CloseHandle(handle) <> 0 - End Function - - End Class - - ''' - ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. - ''' - ''' - ''' The handles in PROCESS_INFORMATION are initialized in unmanaged function. - ''' We can't use SafeHandle here because Interop doesn't support [out] SafeHandles in structure / classes yet. - ''' This class makes no attempt to free the handles. To use the handle, first copy it to a SafeHandle class - ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle. - ''' - - Friend NotInheritable Class PROCESS_INFORMATION - Public hProcess As IntPtr = IntPtr.Zero - Public hThread As IntPtr = IntPtr.Zero - Public dwProcessId As Integer - Public dwThreadId As Integer - - Friend Sub New() - End Sub - - End Class - - ''' - ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead - ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() - ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would - ''' and we got memory corruption problems detectable while running AppVerifier. - ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. - ''' as String so that the memory will get cleaned up. - ''' - - Friend NotInheritable Class STARTUPINFO - Implements IDisposable - - Public cb As Integer - Public lpReserved As IntPtr = IntPtr.Zero 'not string - see summary - Public lpDesktop As IntPtr = IntPtr.Zero 'not string - see summary - Public lpTitle As IntPtr = IntPtr.Zero 'not string - see summary - Public dwX As Integer - Public dwY As Integer - Public dwXSize As Integer - Public dwYSize As Integer - Public dwXCountChars As Integer - Public dwYCountChars As Integer - Public dwFillAttribute As Integer - Public dwFlags As Integer - Public wShowWindow As Short - Public cbReserved2 As Short - Public lpReserved2 As IntPtr = IntPtr.Zero - Public hStdInput As IntPtr = IntPtr.Zero - Public hStdOutput As IntPtr = IntPtr.Zero - Public hStdError As IntPtr = IntPtr.Zero - - Friend Sub New() - End Sub - - ' To detect redundant calls. Default initialize = False. - Private _hasBeenDisposed As Boolean - - Protected Overrides Sub Finalize() - Dispose(False) - End Sub - - ' IDisposable - Private Sub Dispose(disposing As Boolean) - If Not _hasBeenDisposed Then - If disposing Then - _hasBeenDisposed = True - - ' 256 Defined in windows.h - Const STARTF_USESTDHANDLES As Integer = 256 - If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then - If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdInput) - hStdInput = s_invalidHandle - End If - - If hStdOutput <> IntPtr.Zero AndAlso hStdOutput <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdOutput) - hStdOutput = s_invalidHandle - End If - - If hStdError <> IntPtr.Zero AndAlso hStdError <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdError) - hStdError = s_invalidHandle - End If - End If 'Me.dwFlags and STARTF_USESTDHANDLES - - End If - End If - End Sub - - ' This code correctly implements the disposable pattern. - Friend Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(True) - GC.SuppressFinalize(Me) - End Sub - - End Class - - ' Handle Values - Friend Shared ReadOnly s_invalidHandle As IntPtr = New IntPtr(-1) ' GetWindow() Constants Friend Const GW_HWNDFIRST As Integer = 0 @@ -169,12 +14,12 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Const GW_HWNDNEXT As Integer = 2 Friend Const GW_HWNDPREV As Integer = 3 Friend Const GW_OWNER As Integer = 4 - Friend Const GW_CHILD As Integer = 5 Friend Const GW_MAX As Integer = 5 + Friend Const GW_CHILD As Integer = 5 - Friend Const STARTF_USESHOWWINDOW As Integer = 1 Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 + Friend Const STARTF_USESHOWWINDOW As Integer = 1 End Class End Namespace From 6a279a51a85710ee6617140aee9ad17e2b415382 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:46:32 -0700 Subject: [PATCH 259/342] More Native Type cleanup. --- .../VisualBasic/Helpers/NativeMethods.vb | 1 + ...teInitSafeHandleZeroOrMinusOneIsInvalid.vb | 32 ++++ .../NativeTypes.SECURITY_ATTRIBUTES.vb | 38 +++++ .../Helpers/NativeTypes.STARTUPINFO.vb | 91 +++++++++++ .../VisualBasic/Helpers/NativeTypes.vb | 145 +----------------- .../VisualBasic/Helpers/SafeNativeMethods.vb | 17 +- .../Helpers/UnsafeNativeMethods.vb | 6 +- 7 files changed, 177 insertions(+), 153 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb index 9cc70890c31..69682abae82 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb @@ -77,6 +77,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Declare Function WaitForSingleObject Lib "kernel32" ( hHandle As NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid, dwMilliseconds As Integer) As Integer + #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= #Disable Warning IDE1006 ' Naming Styles, Justification:= diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb new file mode 100644 index 00000000000..acaec66680e --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb @@ -0,0 +1,32 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.Win32.SafeHandles + +Namespace Microsoft.VisualBasic.CompilerServices + + Partial Friend NotInheritable Class NativeTypes + + ''' + ''' Inherits , with additional InitialSetHandle method. + ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. + ''' + Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid + Inherits SafeHandleZeroOrMinusOneIsInvalid + + Friend Sub New() + MyBase.New(True) + End Sub + + Protected Overrides Function ReleaseHandle() As Boolean + Return NativeMethods.CloseHandle(handle) <> 0 + End Function + + Friend Sub InitialSetHandle(h As IntPtr) + Debug.Assert(IsInvalid, "Safe handle should only be set once.") + SetHandle(h) + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb new file mode 100644 index 00000000000..f24698cc2d7 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb @@ -0,0 +1,38 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + + Partial Friend NotInheritable Class NativeTypes + + + Friend NotInheritable Class SECURITY_ATTRIBUTES +#Enable Warning CA1812 + Implements IDisposable + + Friend Sub New() + nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) + End Sub + + Public nLength As Integer + Public lpSecurityDescriptor As IntPtr + Public bInheritHandle As Boolean + + Public Overloads Sub Dispose() Implements IDisposable.Dispose + If lpSecurityDescriptor <> IntPtr.Zero Then + UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) + lpSecurityDescriptor = IntPtr.Zero + End If + GC.SuppressFinalize(Me) + End Sub + + Protected Overrides Sub Finalize() + Dispose() + MyBase.Finalize() + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb new file mode 100644 index 00000000000..66ca8a8d2f5 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb @@ -0,0 +1,91 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices + +Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + +#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. + ' Handle Values + Friend Shared ReadOnly s_invalidHandle As New IntPtr(-1) + ''' + ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead + ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() + ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would + ''' and we got memory corruption problems detectable while running AppVerifier. + ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. + ''' as String so that the memory will get cleaned up. + ''' + + Friend NotInheritable Class STARTUPINFO + Implements IDisposable + + Public cb As Integer + Public lpReserved As IntPtr = IntPtr.Zero 'not string - see summary + Public lpDesktop As IntPtr = IntPtr.Zero 'not string - see summary + Public lpTitle As IntPtr = IntPtr.Zero 'not string - see summary + Public dwX As Integer + Public dwY As Integer + Public dwXSize As Integer + Public dwYSize As Integer + Public dwXCountChars As Integer + Public dwYCountChars As Integer + Public dwFillAttribute As Integer + Public dwFlags As Integer + Public wShowWindow As Short + Public cbReserved2 As Short + Public lpReserved2 As IntPtr = IntPtr.Zero + Public hStdInput As IntPtr = IntPtr.Zero + Public hStdOutput As IntPtr = IntPtr.Zero + Public hStdError As IntPtr = IntPtr.Zero + + Friend Sub New() + End Sub + + ' To detect redundant calls. Default initialize = False. + Private _hasBeenDisposed As Boolean + + Protected Overrides Sub Finalize() + Dispose(False) + End Sub + + ' IDisposable + Private Sub Dispose(disposing As Boolean) + If Not _hasBeenDisposed Then + If disposing Then + _hasBeenDisposed = True + + ' 256 Defined in windows.h + Const STARTF_USESTDHANDLES As Integer = 256 + If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then + If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdInput) + hStdInput = s_invalidHandle + End If + + If hStdOutput <> IntPtr.Zero AndAlso hStdOutput <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdOutput) + hStdOutput = s_invalidHandle + End If + + If hStdError <> IntPtr.Zero AndAlso hStdError <> s_invalidHandle Then + NativeMethods.CloseHandle(hStdError) + hStdError = s_invalidHandle + End If + End If 'Me.dwFlags and STARTF_USESTDHANDLES + + End If + End If + End Sub + + ' This code correctly implements the disposable pattern. + Friend Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 200e0386e27..cb16fae7137 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -1,164 +1,23 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Runtime.InteropServices -Imports Microsoft.Win32.SafeHandles - Namespace Microsoft.VisualBasic.CompilerServices Partial Friend NotInheritable Class NativeTypes -#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. - Friend Const GW_CHILD As Integer = 5 - ' GetWindow() Constants Friend Const GW_HWNDFIRST As Integer = 0 - Friend Const GW_HWNDLAST As Integer = 1 - Friend Const GW_HWNDNEXT As Integer = 2 - Friend Const GW_HWNDPREV As Integer = 3 - - Friend Const GW_MAX As Integer = 5 - Friend Const GW_OWNER As Integer = 4 + Friend Const GW_MAX As Integer = 5 + Friend Const GW_CHILD As Integer = 5 Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 Friend Const STARTF_USESHOWWINDOW As Integer = 1 - ' Handle Values - Friend Shared ReadOnly s_invalidHandle As New IntPtr(-1) - - ''' - ''' Inherits , with additional InitialSetHandle method. - ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. - ''' - Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid - Inherits SafeHandleZeroOrMinusOneIsInvalid - - Friend Sub New() - MyBase.New(True) - End Sub - - Protected Overrides Function ReleaseHandle() As Boolean - Return NativeMethods.CloseHandle(handle) <> 0 - End Function - - Friend Sub InitialSetHandle(h As IntPtr) - Debug.Assert(IsInvalid, "Safe handle should only be set once.") - SetHandle(h) - End Sub - - End Class - - - Friend NotInheritable Class SECURITY_ATTRIBUTES -#Enable Warning CA1812 - Implements IDisposable - - Friend Sub New() - nLength = Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES)) - End Sub - - Public nLength As Integer - Public lpSecurityDescriptor As IntPtr - Public bInheritHandle As Boolean - - Public Overloads Sub Dispose() Implements IDisposable.Dispose - If lpSecurityDescriptor <> IntPtr.Zero Then - UnsafeNativeMethods.LocalFree(lpSecurityDescriptor) - lpSecurityDescriptor = IntPtr.Zero - End If - GC.SuppressFinalize(Me) - End Sub - - Protected Overrides Sub Finalize() - Dispose() - MyBase.Finalize() - End Sub - - End Class - - ''' - ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead - ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() - ''' which doesn't expect the memory for the strings to be freed. But because the strings were previously defined as type String, the marshaller would - ''' and we got memory corruption problems detectable while running AppVerifier. - ''' If you use this structure with an API like CreateProcess() then you are supplying the strings so you'll need another version of this class that defines lpReserved, etc. - ''' as String so that the memory will get cleaned up. - ''' - - Friend NotInheritable Class STARTUPINFO - Implements IDisposable - - Public cb As Integer - Public lpReserved As IntPtr = IntPtr.Zero 'not string - see summary - Public lpDesktop As IntPtr = IntPtr.Zero 'not string - see summary - Public lpTitle As IntPtr = IntPtr.Zero 'not string - see summary - Public dwX As Integer - Public dwY As Integer - Public dwXSize As Integer - Public dwYSize As Integer - Public dwXCountChars As Integer - Public dwYCountChars As Integer - Public dwFillAttribute As Integer - Public dwFlags As Integer - Public wShowWindow As Short - Public cbReserved2 As Short - Public lpReserved2 As IntPtr = IntPtr.Zero - Public hStdInput As IntPtr = IntPtr.Zero - Public hStdOutput As IntPtr = IntPtr.Zero - Public hStdError As IntPtr = IntPtr.Zero - - Friend Sub New() - End Sub - - ' To detect redundant calls. Default initialize = False. - Private _hasBeenDisposed As Boolean - - Protected Overrides Sub Finalize() - Dispose(False) - End Sub - - ' IDisposable - Private Sub Dispose(disposing As Boolean) - If Not _hasBeenDisposed Then - If disposing Then - _hasBeenDisposed = True - - ' 256 Defined in windows.h - Const STARTF_USESTDHANDLES As Integer = 256 - If (dwFlags And STARTF_USESTDHANDLES) <> 0 Then - If hStdInput <> IntPtr.Zero AndAlso hStdInput <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdInput) - hStdInput = s_invalidHandle - End If - - If hStdOutput <> IntPtr.Zero AndAlso hStdOutput <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdOutput) - hStdOutput = s_invalidHandle - End If - - If hStdError <> IntPtr.Zero AndAlso hStdError <> s_invalidHandle Then - NativeMethods.CloseHandle(hStdError) - hStdError = s_invalidHandle - End If - End If 'Me.dwFlags and STARTF_USESTDHANDLES - - End If - End If - End Sub - - ' This code correctly implements the disposable pattern. - Friend Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. - Dispose(True) - GC.SuppressFinalize(Me) - End Sub - - End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index f90c91f527d..2e304bf9bb6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -9,17 +9,16 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Module SafeNativeMethods - Friend Declare Function _ - IsWindowEnabled _ - Lib "user32" (hwnd As IntPtr) As Boolean + + Friend Declare Function IsWindowEnabled Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - IsWindowVisible _ - Lib "user32" (hwnd As IntPtr) As Boolean + + Friend Declare Function IsWindowVisible Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - GetWindowThreadProcessId _ - Lib "user32" (hwnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer + + Friend Declare Function GetWindowThreadProcessId Lib "user32" ( + hwnd As IntPtr, + ByRef lpdwProcessId As Integer) As Integer End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index a87ae3e3aeb..3ca9f054080 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -38,7 +38,11 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The amount of free space on the disk. ''' True if function succeeds in getting info otherwise False. - Friend Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean + Friend Function GetDiskFreeSpaceEx( + Directory As String, + ByRef UserSpaceFree As Long, + ByRef TotalUserSpace As Long, + ByRef TotalFreeSpace As Long) As Boolean End Function End Module From a5249e7dce751a1129702cedd036a9944bf615f2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:52:06 -0700 Subject: [PATCH 260/342] Merge NativeTypes --- ...LateInitSafeHandleZeroOrMinusOneIsInvalid.vb | 11 ++++++----- .../Helpers/NativeTypes.PROCESS_INFORMATION.vb | 3 ++- .../Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb | 2 +- .../Helpers/NativeTypes.STARTUPINFO.vb | 2 +- .../VisualBasic/Helpers/NativeTypes.vb | 4 +--- .../VisualBasic/Helpers/SafeNativeMethods.vb | 17 ++++++++--------- .../VisualBasic/Helpers/UnsafeNativeMethods.vb | 6 +++++- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb index 2f2005c658a..acaec66680e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid.vb @@ -4,7 +4,9 @@ Imports Microsoft.Win32.SafeHandles Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + ''' ''' Inherits , with additional InitialSetHandle method. ''' This is required because call to constructor of SafeHandle is not allowed in constrained region. @@ -16,16 +18,15 @@ Namespace Microsoft.VisualBasic.CompilerServices MyBase.New(True) End Sub + Protected Overrides Function ReleaseHandle() As Boolean + Return NativeMethods.CloseHandle(handle) <> 0 + End Function + Friend Sub InitialSetHandle(h As IntPtr) Debug.Assert(IsInvalid, "Safe handle should only be set once.") SetHandle(h) End Sub - Protected Overrides Function ReleaseHandle() As Boolean - Return NativeMethods.CloseHandle(handle) <> 0 - End Function - End Class - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb index c216590b4d6..885793b7380 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.PROCESS_INFORMATION.vb @@ -4,7 +4,9 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes + ''' ''' Represent Win32 PROCESS_INFORMATION structure. IMPORTANT: Copy the handles to a SafeHandle before use them. ''' @@ -25,6 +27,5 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub End Class - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb index df95f5a712a..f24698cc2d7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb @@ -4,9 +4,9 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes -#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. Friend NotInheritable Class SECURITY_ATTRIBUTES #Enable Warning CA1812 diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb index ea272c3d5eb..668731fc629 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb @@ -8,7 +8,7 @@ Namespace Microsoft.VisualBasic.CompilerServices Partial Friend NotInheritable Class NativeTypes ' Handle Values - Friend Shared ReadOnly s_invalidHandle As IntPtr = New IntPtr(-1) + Friend Shared ReadOnly s_invalidHandle As New IntPtr(-1) ''' ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb index 8f3d6cd56be..cb16fae7137 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb @@ -6,8 +6,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Partial Friend NotInheritable Class NativeTypes -#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. - ' GetWindow() Constants Friend Const GW_HWNDFIRST As Integer = 0 Friend Const GW_HWNDLAST As Integer = 1 @@ -17,9 +15,9 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Const GW_MAX As Integer = 5 Friend Const GW_CHILD As Integer = 5 - Friend Const NORMAL_PRIORITY_CLASS As Integer = &H20 Friend Const STARTF_USESHOWWINDOW As Integer = 1 + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb index f90c91f527d..2e304bf9bb6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/SafeNativeMethods.vb @@ -9,17 +9,16 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend Module SafeNativeMethods - Friend Declare Function _ - IsWindowEnabled _ - Lib "user32" (hwnd As IntPtr) As Boolean + + Friend Declare Function IsWindowEnabled Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - IsWindowVisible _ - Lib "user32" (hwnd As IntPtr) As Boolean + + Friend Declare Function IsWindowVisible Lib "user32" (hwnd As IntPtr) As Boolean - Friend Declare Function _ - GetWindowThreadProcessId _ - Lib "user32" (hwnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer + + Friend Declare Function GetWindowThreadProcessId Lib "user32" ( + hwnd As IntPtr, + ByRef lpdwProcessId As Integer) As Integer End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb index a87ae3e3aeb..3ca9f054080 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb @@ -38,7 +38,11 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The amount of free space on the disk. ''' True if function succeeds in getting info otherwise False. - Friend Function GetDiskFreeSpaceEx(Directory As String, ByRef UserSpaceFree As Long, ByRef TotalUserSpace As Long, ByRef TotalFreeSpace As Long) As Boolean + Friend Function GetDiskFreeSpaceEx( + Directory As String, + ByRef UserSpaceFree As Long, + ByRef TotalUserSpace As Long, + ByRef TotalFreeSpace As Long) As Boolean End Function End Module From ee80004de529aabb042ab1096570ae7efc2387d5 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:55:13 -0700 Subject: [PATCH 261/342] Cleanup formatting for NativeTypes --- .../Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb index 66ca8a8d2f5..668731fc629 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.STARTUPINFO.vb @@ -4,11 +4,12 @@ Imports System.Runtime.InteropServices Namespace Microsoft.VisualBasic.CompilerServices + Partial Friend NotInheritable Class NativeTypes -#Disable Warning CA1812 ' Supress warning as this is a type used in PInvoke and shouldn't be changed. ' Handle Values Friend Shared ReadOnly s_invalidHandle As New IntPtr(-1) + ''' ''' Important! This class should be used where the API being called has allocated the strings. That is why lpReserved, etc. are declared as IntPtrs instead ''' of Strings - so that the marshaling layer won't release the memory. This caused us problems in the shell() functions. We would call GetStartupInfo() From 0faca92d992224ade8b3ea48e956ca664d3d4d92 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 20 Jul 2024 01:59:07 -0700 Subject: [PATCH 262/342] Use "As New" where possible --- .../VisualBasic/Helpers/VBInputBox.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 2 +- .../FileLogTraceListener.ReferencedStream.vb | 2 +- .../MyServices/Internal/ProgressDialog.vb | 2 +- .../MyServices/Internal/WebClientCopy.vb | 110 +++++++++--------- 5 files changed, 58 insertions(+), 60 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 1cf59377f70..a2e78f58b76 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -40,7 +40,7 @@ Namespace Microsoft.VisualBasic.CompilerServices End Sub Private Sub InitializeComponent() - Dim resources As ComponentResourceManager = New ComponentResourceManager(GetType(VBInputBox)) + Dim resources As New ComponentResourceManager(GetType(VBInputBox)) OKButton = New Button MyCancelButton = New Button TextBox = New TextBox diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index fd94def4305..23ea4248dbc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -302,7 +302,7 @@ Namespace Microsoft.VisualBasic End Function Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String - Dim box As VBInputBox = New VBInputBox(prompt, title, defaultResponse, xPos, yPos) + Dim box As New VBInputBox(prompt, title, defaultResponse, xPos, yPos) box.ShowDialog(parentWindow) InternalInputBox = box.Output diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb index eeb859cad7e..6ef1b91e1b8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.ReferencedStream.vb @@ -11,7 +11,7 @@ Namespace Microsoft.VisualBasic.Logging Implements IDisposable ' Used for synchronizing writing and reference counting - Private ReadOnly _syncObject As Object = New Object + Private ReadOnly _syncObject As New Object ' Indicates whether or not the object has been disposed Private _disposed As Boolean diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index af6629a7d86..c21f4b4d595 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -194,7 +194,7 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' Used to signal when the dialog is in a closable state. The dialog is in a closable ' state when it has been activated or when it has been flagged to be closed before ' ShowDialog has been called - Private _formClosableSemaphore As ManualResetEvent = New ManualResetEvent(False) + Private _formClosableSemaphore As New ManualResetEvent(False) ' Indicates CloseDialog has been called Private _closeDialogInvoked As Boolean diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 73cf87c32da..4ee2b6e27f8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -12,6 +12,21 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Friend NotInheritable Class WebClientCopy + ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. + Private WithEvents m_ProgressDialog As ProgressDialog + + ' The WebClient performs the downloading or uploading operations for us + Private WithEvents m_WebClient As WebClient + + 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread + Private _exceptionEncounteredDuringFileTransfer As Exception + + ' The percentage of the operation completed + Private _percentage As Integer + + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + ''' ''' Creates an instance of a WebClientCopy, used to download or upload a file. ''' @@ -27,27 +42,19 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Uploads a file. + ''' Posts a message to close the progress dialog. ''' - ''' The name and path of the source file. - ''' The address to which the file is uploaded. - Public Sub UploadFile(sourceFileName As String, address As Uri) - Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") - Debug.Assert(address IsNot Nothing, "No address") - Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - - ' If we have a dialog we need to set up an async download + Private Sub CloseProgressDialog() + ' Don't invoke unless dialog is up and running If m_ProgressDialog IsNot Nothing Then - m_WebClient.UploadFileAsync(address, sourceFileName) - m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled - Else - m_WebClient.UploadFile(address, sourceFileName) - End If + m_ProgressDialog.IndicateClosing() - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. - If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then - If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then - Throw _exceptionEncounteredDuringFileTransfer + If m_ProgressDialog.IsHandleCreated Then + m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) + Else + ' Ensure dialog is closed. If we get here it means the file was copied before the handle for + ' the progress dialog was created. + m_ProgressDialog.Close() End If End If End Sub @@ -73,25 +80,17 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Posts a message to close the progress dialog. + ''' If the user clicks cancel on the Progress dialog, we need to cancel + ''' the current async file transfer operation. ''' - Private Sub CloseProgressDialog() - ' Don't invoke unless dialog is up and running - If m_ProgressDialog IsNot Nothing Then - m_ProgressDialog.IndicateClosing() - - If m_ProgressDialog.IsHandleCreated Then - m_ProgressDialog.BeginInvoke(New MethodInvoker(AddressOf m_ProgressDialog.CloseDialog)) - Else - ' Ensure dialog is closed. If we get here it means the file was copied before the handle for - ' the progress dialog was created. - m_ProgressDialog.Close() - End If - End If + ''' + ''' Note that we don't want to close the progress dialog here. Wait until + ''' the actual file transfer cancel event comes through and do it there. + ''' + Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel + m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. End Sub - - ''' ''' Handles the WebClient's UploadFileCompleted event. ''' @@ -124,31 +123,30 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' If the user clicks cancel on the Progress dialog, we need to cancel - ''' the current async file transfer operation. + ''' Uploads a file. ''' - ''' - ''' Note that we don't want to close the progress dialog here. Wait until - ''' the actual file transfer cancel event comes through and do it there. - ''' - Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. - End Sub - - ' The WebClient performs the downloading or uploading operations for us - Private WithEvents m_WebClient As WebClient - - ' Dialog shown if user wants to see progress UI. Allows the user to cancel the file transfer. - Private WithEvents m_ProgressDialog As ProgressDialog - - 'Keeps track of the error that happened during upload/download so we can throw it once we can guarantee we are back on the main thread - Private _exceptionEncounteredDuringFileTransfer As Exception + ''' The name and path of the source file. + ''' The address to which the file is uploaded. + Public Sub UploadFile(sourceFileName As String, address As Uri) + Debug.Assert(m_WebClient IsNot Nothing, "No WebClient") + Debug.Assert(address IsNot Nothing, "No address") + Debug.Assert((Not String.IsNullOrWhiteSpace(sourceFileName)) AndAlso File.Exists(sourceFileName), "Invalid file") - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) + ' If we have a dialog we need to set up an async download + If m_ProgressDialog IsNot Nothing Then + m_WebClient.UploadFileAsync(address, sourceFileName) + m_ProgressDialog.ShowProgressDialog() 'returns when the download sequence is over, whether due to success, error, or being canceled + Else + m_WebClient.UploadFile(address, sourceFileName) + End If - ' The percentage of the operation completed - Private _percentage As Integer + 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then + If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then + Throw _exceptionEncounteredDuringFileTransfer + End If + End If + End Sub End Class End Namespace From 7589b9ce8ba8ce59e90b27ebb8ae22a2f1be616a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:37:08 +0000 Subject: [PATCH 263/342] [main] Update dependencies from dotnet/arcade (#11738) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++---- eng/Versions.props | 6 +- .../job/source-index-stage1.yml | 6 +- eng/common/native/init-compiler.sh | 56 +++++++------------ global.json | 6 +- 5 files changed, 42 insertions(+), 56 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dfe5daafb82..aae19951ea5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -187,29 +187,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 diff --git a/eng/Versions.props b/eng/Versions.props index 249f048beec..24f6e470289 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,9 +55,9 @@ - 9.0.0-beta.24368.9 - 9.0.0-beta.24368.9 - 9.0.0-beta.24368.9 + 9.0.0-beta.24372.7 + 9.0.0-beta.24372.7 + 9.0.0-beta.24372.7 17.4.0-preview-20220707-01 diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 945c1c19e82..205fb5b3a39 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -34,10 +34,12 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - image: windows.vs2022.amd64.open + image: 1es-windows-2022-open + os: windows ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) - image: windows.vs2022.amd64 + image: 1es-windows-2022 + os: windows steps: - ${{ if eq(parameters.is1ESPipeline, '') }}: diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 62900e12b21..14175343cc6 100755 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -19,11 +19,9 @@ case "$compiler" in # clangx.y or clang-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" - if [ -z "$minorVersion" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -le 6 ]; then - minorVersion=0; - fi + # LLVM based on v18 released in early 2024, with two releases per year + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))" compiler=clang ;; @@ -31,7 +29,9 @@ case "$compiler" in # gccx.y or gcc-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" + + # GCC based on v14 released in early 2024, with one release per year + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))" compiler=gcc ;; esac @@ -49,12 +49,10 @@ check_version_exists() { desired_version=-1 # Set up the environment to be used for building with the desired compiler. - if command -v "$compiler-$1.$2" > /dev/null; then - desired_version="-$1.$2" - elif command -v "$compiler$1$2" > /dev/null; then - desired_version="$1$2" - elif command -v "$compiler-$1$2" > /dev/null; then - desired_version="-$1$2" + if command -v "$compiler-$1" > /dev/null; then + desired_version="-$1" + elif command -v "$compiler$1" > /dev/null; then + desired_version="$1" fi echo "$desired_version" @@ -75,7 +73,7 @@ set_compiler_version_from_CC() { fi # gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments. - IFS=. read -r majorVersion minorVersion _ < /dev/null; then - echo "Error: No usable version of $compiler found." + echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables." exit 1 fi CC="$(command -v "$compiler" 2> /dev/null)" CXX="$(command -v "$cxxCompiler" 2> /dev/null)" set_compiler_version_from_CC - else - if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ] && { [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; }; then - # If a major version was provided explicitly, and it was too old, find a newer compiler instead - if ! command -v "$compiler" > /dev/null; then - echo "Error: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." - exit 1 - fi - - CC="$(command -v "$compiler" 2> /dev/null)" - CXX="$(command -v "$cxxCompiler" 2> /dev/null)" - set_compiler_version_from_CC - fi fi else - desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" + desired_version="$(check_version_exists "$majorVersion")" if [ "$desired_version" = "-1" ]; then - echo "Error: Could not find specific version of $compiler: $majorVersion $minorVersion." + echo "Error: Could not find specific version of $compiler: $majorVersion." exit 1 fi fi diff --git a/global.json b/global.json index 73551518a1b..a59b280e4f0 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24368.9", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24368.9", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24368.9", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24372.7", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24372.7", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24372.7", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24371.6" }, From 0119a8cc593eb4cbaf574c4c0c3c65d297205a37 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:37:25 +0000 Subject: [PATCH 264/342] [main] Update dependencies from dotnet/runtime (#11739) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index aae19951ea5..f3249431d3c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b - + https://github.com/dotnet/runtime - db32911d71075a81b50ad07bfcf10194212bda20 + dc5a4a16c05dc5ab78c5c128766727eb6bce717b diff --git a/eng/Versions.props b/eng/Versions.props index 24f6e470289..15b2cedac16 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,36 +13,36 @@ - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 5.0.0-preview.7.20320.5 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 6.0.0 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 - 9.0.0-preview.7.24371.6 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24372.7 diff --git a/global.json b/global.json index a59b280e4f0..79626cee90b 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24372.7", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24372.7", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24371.6" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24372.7" }, "native-tools": { "cmake": "latest" From cfb1cf0db1fe7932c8f1abeaa38465a7043a3301 Mon Sep 17 00:00:00 2001 From: Loni Tra Date: Tue, 23 Jul 2024 11:11:10 -0700 Subject: [PATCH 265/342] Update to RC1 (#11729) * update to rc1 * update milestone --- .github/policies/resourceManagement.yml | 2 +- eng/Versions.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index f7f722816b1..00cff24219b 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -194,7 +194,7 @@ configuration: isRegex: False then: - addMilestone: - milestone: 9.0 Preview7 + milestone: 9.0 RC1 description: Apply milestone to PRs on the main branch triggerOnOwnActions: true - if: diff --git a/eng/Versions.props b/eng/Versions.props index 15b2cedac16..674c26f9114 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -5,8 +5,8 @@ 0 0 - preview - 7 + rc + 1 $(MajorVersion).$(MinorVersion).$(PatchVersion) false release From 8b0150c6c4ef8028ce2e782845f5e77464847275 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:46:10 +0000 Subject: [PATCH 266/342] [main] Update dependencies from dotnet/runtime (#11744) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f3249431d3c..42662468249 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d - + https://github.com/dotnet/runtime - dc5a4a16c05dc5ab78c5c128766727eb6bce717b + 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d diff --git a/eng/Versions.props b/eng/Versions.props index 674c26f9114..9033061bb76 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,36 +13,36 @@ - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 5.0.0-preview.7.20320.5 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 6.0.0 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 - 9.0.0-preview.7.24372.7 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 diff --git a/global.json b/global.json index 79626cee90b..beef8bc793a 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24372.7", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24372.7", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24372.7" + "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24373.8" }, "native-tools": { "cmake": "latest" From 691108028564ebc5ddd85ee028cc0877a9cc4f52 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 24 Jul 2024 22:01:59 +0200 Subject: [PATCH 267/342] Switch to System.Formats.Nrbf (#11745) * install System.Formats.Nrbf (TODO: don't hardcode the version in project file) * introduce a set of extensions that don't use BinaryFormattedObject at all, simply the SerializationRecord from System.Formats.Nrbf * remove everything that is not related to writing the records, but to parsing and deserialization (not needed anymore) * remove related tests (keep only the writer tests) * reference the package in a nice way * fix the tests * fix last failing test? --- eng/Versions.props | 1 + .../src/System.Private.Windows.Core.csproj | 1 + .../Windows/Core/BinaryFormat/ArrayInfo.cs | 7 - .../Windows/Core/BinaryFormat/ArrayRecord.cs | 45 - .../BinaryFormat/ArrayRecordExtensions.cs | 57 - .../Core/BinaryFormat/ArraySingleObject.cs | 6 +- .../Core/BinaryFormat/ArraySinglePrimitive.cs | 11 - .../Core/BinaryFormat/ArraySingleString.cs | 6 +- .../Windows/Core/BinaryFormat/BinaryArray.cs | 150 -- .../Core/BinaryFormat/BinaryArrayObject.cs | 29 - .../Core/BinaryFormat/BinaryArrayPrimitive.cs | 27 - .../Core/BinaryFormat/BinaryArrayType.cs | 32 - .../BinaryFormattedObject.IParseState.cs | 18 - .../BinaryFormattedObject.ITypeResolver.cs | 21 - .../BinaryFormattedObject.Options.cs | 38 - .../BinaryFormattedObject.ParseState.cs | 26 - .../BinaryFormattedObject.TypeResolver.cs | 161 -- .../BinaryFormat/BinaryFormattedObject.cs | 113 -- .../BinaryFormattedObjectExtensions.cs | 479 ------ .../Core/BinaryFormat/BinaryLibrary.cs | 5 +- .../Core/BinaryFormat/BinaryObjectString.cs | 5 +- .../Windows/Core/BinaryFormat/ClassInfo.cs | 14 - .../Windows/Core/BinaryFormat/ClassRecord.cs | 36 - .../BinaryFormat/ClassRecordExtensions.cs | 78 - .../Core/BinaryFormat/ClassTypeInfo.cs | 4 - .../Windows/Core/BinaryFormat/ClassWithId.cs | 26 +- .../Core/BinaryFormat/ClassWithMembers.cs | 51 - .../BinaryFormat/ClassWithMembersAndTypes.cs | 16 +- .../Deserializer/ArrayRecordDeserializer.cs | 113 -- .../BinaryFormat/Deserializer/ArrayUpdater.cs | 21 - .../Deserializer/ClassRecordDeserializer.cs | 104 -- .../ClassRecordFieldInfoDeserializer.cs | 102 -- ...lassRecordSerializationInfoDeserializer.cs | 86 -- .../Deserializer.PendingUpdates.cs | 132 -- .../BinaryFormat/Deserializer/Deserializer.cs | 324 ---- .../Deserializer/FieldValueUpdater.cs | 22 - .../Deserializer/IDeserializer.cs | 81 - .../Deserializer/ObjectRecordDeserializer.cs | 100 -- .../Deserializer/PendingSerializationInfo.cs | 84 -- .../SerializationInfoValueUpdater.cs | 24 - .../BinaryFormat/Deserializer/ValueUpdater.cs | 25 - .../Windows/Core/BinaryFormat/IBinaryArray.cs | 47 - .../BinaryFormat/IBinaryFormatParseable.cs | 15 - .../Core/BinaryFormat/MemberPrimitiveTyped.cs | 12 +- .../Core/BinaryFormat/MemberReference.cs | 5 +- .../Core/BinaryFormat/MemberTypeInfo.cs | 91 -- .../Windows/Core/BinaryFormat/MessageEnd.cs | 5 +- .../NullRecord.ObjectNullMultiple.cs | 7 +- .../NullRecord.ObjectNullMultiple256.cs | 6 +- .../Windows/Core/BinaryFormat/ObjectNull.cs | 5 +- .../Windows/Core/BinaryFormat/Record.cs | 142 -- .../Core/BinaryFormat/SerializationHeader.cs | 11 +- .../Support/SerializationEvents.cs | 107 -- .../Support/SerializationExtensions.cs | 77 - .../Support/SerializationInfoExtensions.cs | 19 - .../Core/BinaryFormat/Support/TypeInfo.cs | 72 - .../BinaryFormat/SystemClassWithMembers.cs | 40 - .../SystemClassWithMembersAndTypes.cs | 15 +- .../Nrbf/SerializationRecordExtensions.cs | 374 +++++ .../FormatTests/Common/ArrayTests.cs | 169 --- .../FormatTests/Common/BasicObjectTests.cs | 82 -- .../FormatTests/Common/ComparerTests.cs | 33 - .../FormatTests/Common/CorruptedTests.cs | 145 -- .../FormatTests/Common/CycleTests.cs | 142 -- .../FormatTests/Common/DelegateBinder.cs | 12 - .../FormatTests/Common/EventOrderTests.cs | 1166 --------------- .../FormatTests/Common/EventTests.cs | 132 -- .../FormatTests/Common/FieldTests.cs | 69 - .../FormatTests/Common/ISerializer.cs | 36 - .../FormatTests/Common/JaggedArrayTests.cs | 37 - .../FormatTests/Common/ManualParser.cs | 44 - .../Common/MultidimensionalArrayTests.cs | 118 -- .../FormatTests/Common/NullRecordTests.cs | 255 ---- .../Common/ObjectReferenceTests.cs | 128 -- .../FormatTests/Common/PrimitiveTests.cs | 18 - .../FormatTests/Common/SerializationTest.cs | 85 +- .../FormatTests/Common/StressTests.cs | 29 - .../FormatTests/Common/SurrogateTests.cs | 118 -- .../FormatTests/Common/SystemDrawingTests.cs | 33 - .../TestTypes/BasicISerializableObject.cs | 39 - .../Common/TestTypes/BinaryTreeNode.cs | 12 - .../TestTypes/BinaryTreeNodeISerializable.cs | 26 - .../TestTypes/BinaryTreeNodeWithEvents.cs | 49 - .../TestTypes/BinaryTreeNodeWithEventsBase.cs | 6 - .../BinaryTreeNodeWithEventsISerializable.cs | 47 - .../TestTypes/ClassWithValueISerializable.cs | 24 - ...lizableWithNonPublicDeserializationCtor.cs | 13 - .../Common/TestTypes/NodeStruct.cs | 58 - .../Common/TestTypes/NodeWithNodeStruct.cs | 11 - .../TestTypes/NodeWithValueISerializable.cs | 27 - .../Common/TestTypes/NonSerializablePair.cs | 10 - .../TestTypes/NonSerializablePairSurrogate.cs | 24 - .../TestTypes/ObjectReferenceISerializable.cs | 34 - .../Common/TestTypes/SimpleNode.cs | 10 - .../StructWithArrayReferenceISerializable.cs | 26 - .../StructWithReferenceISerializable.cs | 26 - ...ructWithSelfArrayReferenceISerializable.cs | 27 - .../FormatTests/Common/TestTypes/ValueType.cs | 23 - .../Common/TestTypes/ValueTypeBase.cs | 13 - .../TestTypes/ValueTypeISerializable.cs | 31 - .../FormatTests/FormattedObject/ArrayTests.cs | 102 -- .../FormattedObject/BasicObjectTests.cs | 50 - .../BinaryFormatWriterTests.cs | 42 +- .../BinaryFormattedObjectTests.cs | 394 ----- .../FormattedObject/ClassInfoTests.cs | 80 - .../FormattedObject/ComparerTests.cs | 8 - .../FormattedObject/CorruptedTests.cs | 21 - .../FormatTests/FormattedObject/CycleTests.cs | 8 - .../FormattedObject/EventOrderTests.cs | 8 - .../FormatTests/FormattedObject/EventTests.cs | 8 - .../FormattedObject/ExceptionTests.cs | 66 - .../FormattedObject/ExtensionTests.cs | 42 - .../FormatTests/FormattedObject/FieldTests.cs | 8 - .../FormattedObjectSerializer.cs | 30 - .../FormattedObject/HashTableTests.cs | 33 +- .../FormattedObject/JaggedArrayTests.cs | 8 - .../FormatTests/FormattedObject/ListTests.cs | 124 +- .../FormattedObject/MemberTypeInfoTests.cs | 71 - .../MultidimensionalArrayTests.cs | 8 - .../FormattedObject/NullRecordTests.cs | 101 +- .../FormattedObject/ObjectReferenceTests.cs | 8 - .../FormattedObject/PrimitiveTests.cs | 8 - .../FormattedObject/PrimitiveTypeTests.cs | 43 +- .../FormattedObject/StressTests.cs | 8 - .../FormattedObject/SurrogateTests.cs | 8 - .../FormattedObject/SystemDrawingTests.cs | 55 - .../FormatTests/Formatter/ArrayTests.cs | 8 - .../FormatTests/Formatter/BasicObjectTests.cs | 9 - .../Formatter/BinaryFormatterSerializer.cs | 29 - .../FormatTests/Formatter/ComparerTests.cs | 8 - .../FormatTests/Formatter/CorruptedTests.cs | 25 - .../FormatTests/Formatter/CycleTests.cs | 15 - .../FormatTests/Formatter/EventOrderTests.cs | 8 - .../FormatTests/Formatter/EventTests.cs | 8 - .../FormatTests/Formatter/FieldTests.cs | 8 - .../FormatTests/Formatter/JaggedArrayTests.cs | 8 - .../Formatter/MultidimensionalArrayTests.cs | 8 - .../FormatTests/Formatter/NullRecordTests.cs | 37 - .../Formatter/ObjectReferenceTests.cs | 8 - .../FormatTests/Formatter/PrimitiveTests.cs | 8 - .../FormatTests/Formatter/StressTests.cs | 8 - .../FormatTests/Formatter/SurrogateTests.cs | 8 - .../Formatter/SystemDrawingTests.cs | 8 - .../FormatTests/Legacy/AdminHelpers.cs | 68 - .../Legacy/BinaryFormatterHelpers.cs | 136 -- .../Legacy/BinaryFormatterTestData.cs | 1305 ----------------- .../Legacy/BinaryFormatterTests.cs | 422 ------ .../FormatTests/Legacy/EqualityExtensions.cs | 1279 ---------------- .../Legacy/PlatformDetection.Windows.cs | 12 - .../FormatTests/Legacy/PlatformDetection.cs | 35 - .../FormatTests/Legacy/PlatformExtensions.cs | 31 - .../FormatTests/Legacy/SerializationTypes.cs | 451 ------ .../Legacy/TargetFrameworkMoniker.cs | 16 - .../Legacy/TypeSerializableValue.cs | 18 - .../Legacy/TypeWithoutNamespace.cs | 7 - .../tests/BinaryFormatTests/GlobalUsings.cs | 1 - .../BinaryFormatTestExtensions.cs | 7 +- .../src/System/Resources/ResXDataNode.cs | 7 +- .../Forms/ActiveX/AxHost.PropertyBagStream.cs | 10 +- .../Control.ActiveXImpl.PropertyBagStream.cs | 6 +- .../Forms/ActiveX/Control.ActiveXImpl.cs | 9 +- ...WinFormsBinaryFormattedObjectExtensions.cs | 63 - .../WinFormsSerializationRecordExtensions.cs | 63 + .../Forms/OLE/DataObject.BitmapBinder.cs | 3 +- ...ect.Composition.NativeToWinFormsAdapter.cs | 5 +- .../WinFormsBinaryFormattedObjectTests.cs | 44 +- 166 files changed, 596 insertions(+), 12073 deletions(-) delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecordExtensions.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArray.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayObject.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayPrimitive.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayType.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.IParseState.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ITypeResolver.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.Options.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ParseState.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.TypeResolver.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecordExtensions.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembers.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayRecordDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayUpdater.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordFieldInfoDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordSerializationInfoDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.PendingUpdates.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/FieldValueUpdater.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/IDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ObjectRecordDeserializer.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/PendingSerializationInfo.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/SerializationInfoValueUpdater.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ValueUpdater.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryArray.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryFormatParseable.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationEvents.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationInfoExtensions.cs delete mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembers.cs create mode 100644 src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/BasicObjectTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ComparerTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CorruptedTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CycleTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/DelegateBinder.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventOrderTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/FieldTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ISerializer.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/JaggedArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ManualParser.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/MultidimensionalArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/NullRecordTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ObjectReferenceTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/PrimitiveTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/StressTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SurrogateTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SystemDrawingTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BasicISerializableObject.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNode.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEvents.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsBase.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ClassWithValueISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/DerivedISerializableWithNonPublicDeserializationCtor.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeStruct.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithNodeStruct.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithValueISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePair.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePairSurrogate.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ObjectReferenceISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/SimpleNode.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithArrayReferenceISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithReferenceISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithSelfArrayReferenceISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueType.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeBase.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeISerializable.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BasicObjectTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormattedObjectTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ClassInfoTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ComparerTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CorruptedTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CycleTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventOrderTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExceptionTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExtensionTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FieldTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FormattedObjectSerializer.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/JaggedArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MemberTypeInfoTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MultidimensionalArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ObjectReferenceTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/StressTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SurrogateTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SystemDrawingTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BasicObjectTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BinaryFormatterSerializer.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ComparerTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CorruptedTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CycleTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventOrderTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/FieldTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/JaggedArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/MultidimensionalArrayTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/NullRecordTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ObjectReferenceTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/PrimitiveTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/StressTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SurrogateTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SystemDrawingTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/AdminHelpers.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterHelpers.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTestData.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTests.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/EqualityExtensions.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.Windows.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformExtensions.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/SerializationTypes.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TargetFrameworkMoniker.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeSerializableValue.cs delete mode 100644 src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeWithoutNamespace.cs delete mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectExtensions.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Nrbf/WinFormsSerializationRecordExtensions.cs diff --git a/eng/Versions.props b/eng/Versions.props index 9033061bb76..4552d42da3b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,6 +16,7 @@ 9.0.0-preview.7.24373.8 9.0.0-preview.7.24373.8 9.0.0-preview.7.24373.8 + 9.0.0-preview.7.24373.8 9.0.0-preview.7.24373.8 9.0.0-preview.7.24373.8 9.0.0-preview.7.24373.8 diff --git a/src/System.Private.Windows.Core/src/System.Private.Windows.Core.csproj b/src/System.Private.Windows.Core/src/System.Private.Windows.Core.csproj index 9e817ce9969..ad70123bc15 100644 --- a/src/System.Private.Windows.Core/src/System.Private.Windows.Core.csproj +++ b/src/System.Private.Windows.Core/src/System.Private.Windows.Core.csproj @@ -28,6 +28,7 @@ + diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayInfo.cs index 8af4d1ddc34..20b7108e959 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayInfo.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayInfo.cs @@ -24,13 +24,6 @@ public ArrayInfo(Id objectId, Count length) ObjectId = objectId; } - public static Id Parse(BinaryReader reader, out Count length) - { - Id id = reader.ReadInt32(); - length = reader.ReadInt32(); - return id; - } - public readonly void Write(BinaryWriter writer) { writer.Write(ObjectId); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecord.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecord.cs index d72ba76a5d8..1d566cad435 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecord.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecord.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; -using System.Runtime.Serialization; namespace System.Private.Windows.Core.BinaryFormat; @@ -36,50 +35,6 @@ internal abstract class ArrayRecord : ObjectRecord, IEnumerable IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); private protected abstract IEnumerator GetEnumerator(); - - /// - /// Reads records, expanding null records into individual entries. - /// - private protected static IReadOnlyList ReadObjectArrayValues(BinaryFormattedObject.IParseState state, Count count) - => ReadObjectArrayValues(state, new(BinaryType.Object, null), count); - - /// - /// Reads a count of object member values of . - /// - private protected static IReadOnlyList ReadObjectArrayValues( - BinaryFormattedObject.IParseState state, - MemberTypeInfo memberTypeInfo, - int count) - { - if (count == 0) - { - return []; - } - - ArrayBuilder memberValues = new(count); - for (int i = 0; i < count; i++) - { - object value = ReadValue(state, memberTypeInfo); - if (value is not NullRecord nullRecord) - { - memberValues.Add(value); - continue; - } - - i = checked(i + nullRecord.NullCount - 1); - if (i >= count) - { - throw new SerializationException(); - } - - for (int j = 0; j < nullRecord.NullCount; j++) - { - memberValues.Add(null); - } - } - - return memberValues.ToArray(); - } } /// diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecordExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecordExtensions.cs deleted file mode 100644 index 4f76c442ca1..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArrayRecordExtensions.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat; - -internal static class ArrayRecordExtensions -{ - internal static Array GetPrimitiveArray(this IPrimitiveTypeRecord primitiveArray) => primitiveArray.PrimitiveType switch - { - PrimitiveType.Boolean => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Byte => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Char => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Decimal => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Double => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Int16 => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Int32 => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Int64 => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.SByte => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.Single => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.TimeSpan => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.DateTime => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.UInt16 => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.UInt32 => ((ArrayRecord)primitiveArray).AsArray(), - PrimitiveType.UInt64 => ((ArrayRecord)primitiveArray).AsArray(), - _ => throw new SerializationException($"Unexpected primitive array type: '{primitiveArray.PrimitiveType}'") - }; - - /// - /// Convert the source to an array, if it is not already an array. - /// - private static Array AsArray(this ArrayRecord record) where T : unmanaged - { - if (record.ArrayObjects is not T[] rawArray) - { - Debug.Fail("Should not have any primitive arrays that are not already arrays."); - throw new InvalidOperationException(); - } - - if (record is not IBinaryArray binaryArray || binaryArray.ArrayType is BinaryArrayType.Single or BinaryArrayType.Jagged) - { - return rawArray; - } - - if (binaryArray.ArrayType is not BinaryArrayType.Rectangular) - { - // This should not be possible. - throw new NotSupportedException(); - } - - Array array = Array.CreateInstance(typeof(T), binaryArray.Lengths.ToArray()); - Span flatSpan = array.GetArrayData(); - rawArray.AsSpan().CopyTo(flatSpan); - return array; - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleObject.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleObject.cs index 3db21d730b6..44003d05ac3 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleObject.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleObject.cs @@ -15,8 +15,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// internal sealed class ArraySingleObject : ArrayRecord, - IRecord, - IBinaryFormatParseable + IRecord { public static RecordType RecordType => RecordType.ArraySingleObject; @@ -26,9 +25,6 @@ public ArraySingleObject(Id objectId, IReadOnlyList arrayObjects) public override BinaryType ElementType => BinaryType.Object; - static ArraySingleObject IBinaryFormatParseable.Parse(BinaryFormattedObject.IParseState state) => - new(ArrayInfo.Parse(state.Reader, out Count length), ReadObjectArrayValues(state, length)); - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySinglePrimitive.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySinglePrimitive.cs index c49b37417de..1296f45ecb2 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySinglePrimitive.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySinglePrimitive.cs @@ -15,7 +15,6 @@ namespace System.Private.Windows.Core.BinaryFormat; /// internal sealed class ArraySinglePrimitive : ArrayRecord, - IBinaryFormatParseable, IRecord>, IPrimitiveTypeRecord where T : unmanaged @@ -32,16 +31,6 @@ public ArraySinglePrimitive(Id objectId, IReadOnlyList arrayObjects) PrimitiveType = TypeInfo.GetPrimitiveType(typeof(T)); } - static ArrayRecord IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - Id id = ArrayInfo.Parse(state.Reader, out Count length); - PrimitiveType primitiveType = (PrimitiveType)state.Reader.ReadByte(); - Debug.Assert(typeof(T) == primitiveType.GetPrimitiveTypeType()); - - return new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)); - } - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleString.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleString.cs index a595d8a5cbc..12bec5316ab 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleString.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ArraySingleString.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed partial class ArraySingleString : ArrayRecord, IRecord, IBinaryFormatParseable +internal sealed partial class ArraySingleString : ArrayRecord, IRecord { public static RecordType RecordType => RecordType.ArraySingleString; @@ -27,10 +27,6 @@ internal ArraySingleString(Id objectId, IReadOnlyList arrayObjects, IRe public override BinaryType ElementType => BinaryType.String; - static ArraySingleString IBinaryFormatParseable.Parse(BinaryFormattedObject.IParseState state) => new( - ArrayInfo.Parse(state.Reader, out Count length), - ReadObjectArrayValues(state, length), state.RecordMap); - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArray.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArray.cs deleted file mode 100644 index 21fd4177a44..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArray.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Array of objects. -/// -/// -/// -/// -/// [MS-NRBF] 2.4.3.1 -/// -/// -/// -internal static partial class BinaryArray -{ - private const int MaxRanks = 32; - - public static RecordType RecordType => RecordType.BinaryArray; - - internal static IBinaryArray Parse(BinaryFormattedObject.IParseState state) - { - Id objectId = state.Reader.ReadInt32(); - BinaryArrayType arrayType = (BinaryArrayType)state.Reader.ReadByte(); - - if (arrayType is not (BinaryArrayType.Single or BinaryArrayType.Rectangular or BinaryArrayType.Jagged)) - { - // Values: https://learn.microsoft.com/openspecs/windows_protocols/ms-nrbf/4dbbf3a8-6bc4-4dfc-aa7e-36a35be6ff58 - if ((int)arrayType is 3 or 4 or 5) - { - throw new NotSupportedException("Offset arrays are not supported."); - } - - throw new SerializationException("Invalid array type."); - } - - int rank = state.Reader.ReadInt32(); - - if (arrayType is BinaryArrayType.Single or BinaryArrayType.Jagged) - { - // Jagged array is an array of arrays, there should always be one rank - // for the "outer" array. - if (rank != 1) - { - throw new SerializationException("Invalid array rank."); - } - } - else if (arrayType is BinaryArrayType.Rectangular) - { - // Multidimensional array - if (rank is < 2 or > MaxRanks) - { - throw new SerializationException("Invalid array rank."); - } - } - - int[] lengths = new int[rank]; - int length; - - if (arrayType is not BinaryArrayType.Rectangular) - { - length = state.Reader.ReadInt32(); - if (length < 0) - { - throw new SerializationException("Invalid array length."); - } - - lengths[0] = length; - } - else - { - length = 1; - - for (int i = 0; i < rank; i++) - { - int rankLength = state.Reader.ReadInt32(); - if (rankLength < 0) - { - throw new SerializationException("Invalid array length."); - } - - // Rectangular (multidimensional) length is product of lengths. - // - // It is technically possible to have multidimensional arrays with - // a total length over int.MaxValue. Even with just bytes this would - // be a very large array (2GB). To constrain this reader we'll reject - // anything that goes over this. - length = checked(length * rankLength); - lengths[i] = rankLength; - } - } - - MemberTypeInfo typeInfo = MemberTypeInfo.Parse(state.Reader); - - IBinaryArray array = typeInfo.Type is not BinaryType.Primitive - ? new BinaryArrayObject(rank, arrayType, lengths, new(objectId, length), typeInfo, state) - : (PrimitiveType)typeInfo.Info! switch - { - PrimitiveType.Boolean => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Byte => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.SByte => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Char => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Int16 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.UInt16 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Int32 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.UInt32 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Int64 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.UInt64 => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Single => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Double => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.Decimal => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.DateTime => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - PrimitiveType.TimeSpan => new BinaryArrayPrimitive(rank, arrayType, lengths, new(objectId, length), typeInfo, state.Reader), - _ => throw new SerializationException($"Invalid primitive type '{(PrimitiveType)typeInfo.Info}'"), - }; - - return array; - } -} - -internal abstract partial class BinaryArray : ArrayRecord, IRecord, IBinaryArray -{ - private readonly MemberTypeInfo _memberTypeInfo; - - public Count Rank { get; } - public BinaryArrayType ArrayType { get; } - public IReadOnlyList Lengths { get; } - - public override BinaryType ElementType => _memberTypeInfo.Type; - - public object? ElementTypeInfo => _memberTypeInfo.Info; - - internal BinaryArray( - Count rank, - BinaryArrayType arrayType, - IReadOnlyList lengths, - ArrayInfo arrayInfo, - MemberTypeInfo typeInfo, - IReadOnlyList values) - : base(arrayInfo, values) - { - Rank = rank; - ArrayType = arrayType; - _memberTypeInfo = typeInfo; - Lengths = lengths; - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayObject.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayObject.cs deleted file mode 100644 index 6c8cbb087ca..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayObject.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// of objects. -/// -/// -internal sealed class BinaryArrayObject : BinaryArray -{ - internal BinaryArrayObject( - Count rank, - BinaryArrayType arrayType, - IReadOnlyList lengths, - ArrayInfo arrayInfo, - MemberTypeInfo typeInfo, - BinaryFormattedObject.IParseState state) : base( - rank, - arrayType, - lengths, - arrayInfo, - typeInfo, - ReadObjectArrayValues(state, typeInfo, arrayInfo.Length)) - { - } - - private protected override void Write(BinaryWriter writer) => throw new NotSupportedException(); -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayPrimitive.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayPrimitive.cs deleted file mode 100644 index b6670fa131a..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayPrimitive.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// of primitive values. -/// -/// -internal sealed class BinaryArrayPrimitive : BinaryArray, IRecord>, IPrimitiveTypeRecord where T : unmanaged -{ - public PrimitiveType PrimitiveType { get; } - - internal BinaryArrayPrimitive( - Count rank, - BinaryArrayType arrayType, - IReadOnlyList lengths, - ArrayInfo arrayInfo, - MemberTypeInfo typeInfo, - BinaryReader reader) - : base(rank, arrayType, lengths, arrayInfo, typeInfo, reader.ReadPrimitiveArray(arrayInfo.Length)) - { - PrimitiveType = (PrimitiveType)typeInfo.Info!; - } - - private protected override void Write(BinaryWriter writer) => throw new NotSupportedException(); -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayType.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayType.cs deleted file mode 100644 index 278a717fa48..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryArrayType.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Binary array type. -/// -/// -/// -/// -/// [MS-NRBF] 2.4.1.1 -/// -/// -/// -internal enum BinaryArrayType : byte -{ - /// - /// A single-dimensional array. - /// - Single = 0, - - /// - /// An array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. - /// - Jagged = 1, - - /// - /// A multi-dimensional rectangular array. - /// - Rectangular = 2 -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.IParseState.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.IParseState.cs deleted file mode 100644 index afd778e3ce9..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.IParseState.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -internal sealed partial class BinaryFormattedObject -{ - /// - /// Parsing state. - /// - internal interface IParseState - { - BinaryReader Reader { get; } - RecordMap RecordMap { get; } - Options Options { get; } - ITypeResolver TypeResolver { get; } - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ITypeResolver.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ITypeResolver.cs deleted file mode 100644 index 9085e4230ec..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ITypeResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -internal sealed partial class BinaryFormattedObject -{ - /// - /// Resolver for types. - /// - internal interface ITypeResolver - { - /// - /// Resolves the given type name against the specified library. - /// - /// The library id, or for the "system" assembly. - [RequiresUnreferencedCode("Calls System.Reflection.Assembly.GetType(String)")] - [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] - Type GetType(string typeName, Id libraryId); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.Options.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.Options.cs deleted file mode 100644 index d0e6825907f..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.Options.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; - -namespace System.Private.Windows.Core.BinaryFormat; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -internal sealed partial class BinaryFormattedObject -{ - internal sealed class Options - { - /// - /// How exactly assembly names need to match for deserialization. - /// - - public FormatterAssemblyStyle AssemblyMatching { get; set; } = FormatterAssemblyStyle.Simple; - - /// - /// Type name binder. - /// - public SerializationBinder? Binder { get; set; } - - /// - /// Optional type provider. - /// - public ISurrogateSelector? SurrogateSelector { get; set; } - - /// - /// Streaming context. - /// - public StreamingContext StreamingContext { get; set; } = new(StreamingContextStates.All); - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ParseState.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ParseState.cs deleted file mode 100644 index f2fe5fe818e..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.ParseState.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -internal sealed partial class BinaryFormattedObject -{ - /// - /// Parsing state for . - /// - internal sealed class ParseState : IParseState - { - private readonly BinaryFormattedObject _format; - - public ParseState(BinaryReader reader, BinaryFormattedObject format) - { - Reader = reader; - _format = format; - } - - public BinaryReader Reader { get; } - public RecordMap RecordMap => _format._recordMap; - public Options Options => _format._options; - public ITypeResolver TypeResolver => _format.TypeResolver; - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.TypeResolver.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.TypeResolver.cs deleted file mode 100644 index 942b0b4ddac..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.TypeResolver.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -namespace System.Private.Windows.Core.BinaryFormat; - -internal sealed partial class BinaryFormattedObject -{ - internal sealed class DefaultTypeResolver : ITypeResolver - { - private readonly FormatterAssemblyStyle _assemblyMatching; - private readonly SerializationBinder? _binder; - private readonly IReadOnlyRecordMap _recordMap; - - // This has to be Id as we use Id.Null for mscorlib types. - private readonly Dictionary _assemblies = []; - private readonly Dictionary<(string TypeName, Id LibraryId), Type> _types = []; - - private string? _lastTypeName; - private Id _lastLibraryId; - - [AllowNull] - private Type _lastType; - - internal DefaultTypeResolver(Options options, IReadOnlyRecordMap recordMap) - { - _assemblyMatching = options.AssemblyMatching; - _binder = options.Binder; - _assemblies[Id.Null] = TypeInfo.MscorlibAssembly; - _recordMap = recordMap; - } - - /// - /// Resolves the given type name against the specified library. - /// - /// The library id, or for the "system" assembly. - [RequiresUnreferencedCode("Calls System.Reflection.Assembly.GetType(String)")] - [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] - Type ITypeResolver.GetType(string typeName, Id libraryId) - { - if (libraryId == _lastLibraryId && string.Equals(typeName, _lastTypeName)) - { - Debug.Assert(_lastType is not null); - return _lastType; - } - - _lastLibraryId = libraryId; - _lastTypeName = typeName; - - if (_types.TryGetValue((typeName, libraryId), out Type? cachedType)) - { - _lastType = cachedType; - return cachedType; - } - - string libraryName = libraryId.IsNull - ? TypeInfo.MscorlibAssemblyName - : ((BinaryLibrary)_recordMap[libraryId]).LibraryName; - - if (_binder?.BindToType(libraryName, typeName) is Type binderType) - { - // BinaryFormatter is inconsistent about what caching behavior you get with binders. - // It would always cache the last item from the binder, but wouldn't put the result - // in the type cache. This could lead to inconsistent results if the binder didn't - // always return the same result for a given set of strings. Choosing to always cache - // for performance. - - _types[(typeName, libraryId)] = binderType; - _lastType = binderType; - return binderType; - } - - if (!_assemblies.TryGetValue(libraryId, out Assembly? assembly)) - { - Debug.Assert(!libraryId.IsNull); - - AssemblyName assemblyName = new(libraryName); - try - { - assembly = Assembly.Load(assemblyName); - } - catch - { - if (_assemblyMatching != FormatterAssemblyStyle.Simple) - { - throw; - } - - assembly = Assembly.Load(assemblyName.Name!); - } - - _assemblies.Add(libraryId, assembly); - } - - Type? type = _assemblyMatching != FormatterAssemblyStyle.Simple - ? assembly.GetType(typeName) - : GetSimplyNamedTypeFromAssembly(assembly, typeName); - - _types[(typeName, libraryId)] = type ?? throw new SerializationException($"Could not find type '{typeName}'."); - _lastType = type; - return _lastType; - } - - [RequiresUnreferencedCode("Calls System.Reflection.Assembly.GetType(String, Boolean, Boolean)")] - private static Type? GetSimplyNamedTypeFromAssembly(Assembly assembly, string typeName) - { - // Catching any exceptions that could be thrown from a failure on assembly load - // This is necessary, for example, if there are generic parameters that are qualified - // with a version of the assembly that predates the one available. - - try - { - return assembly.GetType(typeName, throwOnError: false, ignoreCase: false); - } - catch (TypeLoadException) { } - catch (FileNotFoundException) { } - catch (FileLoadException) { } - catch (BadImageFormatException) { } - - return Type.GetType(typeName, ResolveSimpleAssemblyName, new TopLevelAssemblyTypeResolver(assembly).ResolveType, throwOnError: false); - - static Assembly? ResolveSimpleAssemblyName(AssemblyName assemblyName) - { - try - { - return Assembly.Load(assemblyName); - } - catch { } - - try - { - return Assembly.Load(assemblyName.Name!); - } - catch { } - - return null; - } - } - - private sealed class TopLevelAssemblyTypeResolver - { - private readonly Assembly _topLevelAssembly; - - public TopLevelAssemblyTypeResolver(Assembly topLevelAssembly) => _topLevelAssembly = topLevelAssembly; - - [RequiresUnreferencedCode("Calls System.Reflection.Assembly.GetType(String, Boolean, Boolean)")] - public Type? ResolveType(Assembly? assembly, string simpleTypeName, bool ignoreCase) - { - assembly ??= _topLevelAssembly; - return assembly.GetType(simpleTypeName, throwOnError: false, ignoreCase); - } - } - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.cs deleted file mode 100644 index b771915e7d4..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObject.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.ExceptionServices; -using System.Runtime.Serialization; -using System.Text; - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Object model for the binary format put out by BinaryFormatter. It parses and creates a model but does not -/// instantiate any reference types outside of string. -/// -/// -/// -/// This is useful for explicitly controlling the rehydration of binary formatted data. -/// -/// -/// NOTE: Multidimensional and jagged arrays are not yet implemented. -/// -/// -internal sealed partial class BinaryFormattedObject -{ -#pragma warning disable SYSLIB0050 // Type or member is obsolete - internal static FormatterConverter DefaultConverter { get; } = new(); -#pragma warning restore SYSLIB0050 - - private static readonly Options s_defaultOptions = new(); - private readonly Options _options; - - private readonly RecordMap _recordMap = new(); - - private ITypeResolver? _typeResolver; - private ITypeResolver TypeResolver => _typeResolver ??= new DefaultTypeResolver(_options, _recordMap); - - private readonly Id _rootRecord; - - /// - /// Creates by parsing . - /// - public BinaryFormattedObject(Stream stream, Options? options = null) - { - ArgumentNullException.ThrowIfNull(stream); - using BinaryReader reader = new(stream, Encoding.UTF8, leaveOpen: true); - - _options = options ?? s_defaultOptions; - - ParseState state = new(reader, this); - - IRecord? currentRecord; - - try - { - currentRecord = Record.ReadBinaryFormatRecord(state); - if (currentRecord is not SerializationHeader header) - { - throw new SerializationException("Did not find serialization header."); - } - - _rootRecord = header.RootId; - - do - { - currentRecord = Record.ReadBinaryFormatRecord(state); - } - while (currentRecord is not MessageEnd); - } - catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) - { - // Make the exception easier to catch, but retain the original stack trace. - throw ex.ConvertToSerializationException(); - } - catch (TargetInvocationException ex) - { - throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException(); - } - } - - /// - /// Deserializes the back to an object. - /// - [RequiresUnreferencedCode("Ultimately calls Assembly.GetType for type names in the data.")] - public object Deserialize() - { - try - { - return Deserializer.Deserializer.Deserialize(RootRecord.Id, _recordMap, TypeResolver, _options); - } - catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) - { - // Make the exception easier to catch, but retain the original stack trace. - throw ex.ConvertToSerializationException(); - } - catch (TargetInvocationException ex) - { - throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException(); - } - } - - /// - /// The Id of the root record of the object graph. - /// - public IRecord RootRecord => _recordMap[_rootRecord]; - - /// - /// Gets a record by it's identifier. Not all records have identifiers, only ones that - /// can be referenced by other records. - /// - public IRecord this[Id id] => _recordMap[id]; - - public IReadOnlyRecordMap RecordMap => _recordMap; -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObjectExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObjectExtensions.cs index c3542d5695b..f8b01e43566 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObjectExtensions.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryFormattedObjectExtensions.cs @@ -1,489 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections; -using System.Drawing; -using System.Runtime.CompilerServices; - namespace System.Private.Windows.Core.BinaryFormat; internal static class BinaryFormattedObjectExtensions { - /// - /// Type names for that are raw primitives. - /// - private static bool IsPrimitiveTypeClassName(ReadOnlySpan typeName) - => TypeInfo.GetPrimitiveType(typeName) switch - { - PrimitiveType.Boolean => true, - PrimitiveType.Byte => true, - PrimitiveType.Char => true, - PrimitiveType.Double => true, - PrimitiveType.Int32 => true, - PrimitiveType.Int64 => true, - PrimitiveType.SByte => true, - PrimitiveType.Single => true, - PrimitiveType.Int16 => true, - PrimitiveType.UInt16 => true, - PrimitiveType.UInt32 => true, - PrimitiveType.UInt64 => true, - _ => false, - }; - - internal delegate bool TryGetDelegate(BinaryFormattedObject format, [NotNullWhen(true)] out object? value); - - internal static bool TryGet(TryGetDelegate get, BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - try - { - return get(format, out value); - } - catch (Exception ex) when (ex is KeyNotFoundException or InvalidCastException) - { - // This should only really happen with corrupted data. - Debug.Fail(ex.Message); - value = default; - return false; - } - } - - /// - /// Tries to get this object as a . - /// - public static bool TryGetPointF(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - return TryGet(Get, format, out value); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - value = default; - - if (format.RootRecord is not ClassWithMembersAndTypes classInfo - || format[classInfo.LibraryId] is not BinaryLibrary binaryLibrary - || binaryLibrary.LibraryName != TypeInfo.SystemDrawingAssemblyName - || classInfo.Name != typeof(PointF).FullName - || classInfo.MemberValues.Count != 2) - { - return false; - } - - value = new PointF((float)classInfo["x"]!, (float)classInfo["y"]!); - - return true; - } - } - - /// - /// Tries to get this object as a . - /// - public static bool TryGetRectangleF(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - return TryGet(Get, format, out value); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - value = default; - - if (format.RootRecord is not ClassWithMembersAndTypes classInfo - || format[classInfo.LibraryId] is not BinaryLibrary binaryLibrary - || binaryLibrary.LibraryName != TypeInfo.SystemDrawingAssemblyName - || classInfo.Name != typeof(RectangleF).FullName - || classInfo.MemberValues.Count != 4) - { - return false; - } - - value = new RectangleF( - (float)classInfo["x"]!, - (float)classInfo["y"]!, - (float)classInfo["width"]!, - (float)classInfo["height"]!); - - return true; - } - } - - /// - /// Tries to get this object as a primitive type or string. - /// - /// if this represented a primitive type or string. - public static bool TryGetPrimitiveType(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - return TryGet(Get, format, out value); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - value = default; - - if (format.RootRecord is BinaryObjectString binaryString) - { - value = binaryString.Value; - return true; - } - - if (format.RootRecord is not SystemClassWithMembersAndTypes systemClass) - { - return false; - } - - if (IsPrimitiveTypeClassName(systemClass.Name) && systemClass.MemberTypeInfo[0].Type == BinaryType.Primitive) - { - value = systemClass.MemberValues[0]!; - return true; - } - - if (systemClass.Name == typeof(TimeSpan).FullName) - { - value = new TimeSpan((long)systemClass.MemberValues[0]!); - return true; - } - - switch (systemClass.Name) - { - case TypeInfo.TimeSpanType: - value = new TimeSpan((long)systemClass.MemberValues[0]!); - return true; - case TypeInfo.DateTimeType: - ulong ulongValue = (ulong)systemClass["dateData"]!; - value = Unsafe.As(ref ulongValue); - return true; - case TypeInfo.DecimalType: - ReadOnlySpan bits = - [ - (int)systemClass["lo"]!, - (int)systemClass["mid"]!, - (int)systemClass["hi"]!, - (int)systemClass["flags"]! - ]; - - value = new decimal(bits); - return true; - case TypeInfo.IntPtrType: - // Rehydrating still throws even though casting doesn't any more - value = checked((nint)(long)systemClass.MemberValues[0]!); - return true; - case TypeInfo.UIntPtrType: - value = checked((nuint)(ulong)systemClass.MemberValues[0]!); - return true; - default: - return false; - } - } - } - - /// - /// Tries to get this object as a of . - /// - public static bool TryGetPrimitiveList(this BinaryFormattedObject format, [NotNullWhen(true)] out object? list) - { - return TryGet(Get, format, out list); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? list) - { - list = null; - - const string ListTypeName = "System.Collections.Generic.List`1[["; - - if (format.RootRecord is not SystemClassWithMembersAndTypes classInfo - || !classInfo.Name.StartsWith(ListTypeName, StringComparison.Ordinal) - || classInfo["_items"] is not MemberReference reference - || format[reference] is not ArrayRecord array) - { - return false; - } - - int commaIndex = classInfo.Name.IndexOf(','); - if (commaIndex == -1) - { - return false; - } - - ReadOnlySpan typeName = classInfo.Name.AsSpan()[ListTypeName.Length..commaIndex]; - PrimitiveType primitiveType = TypeInfo.GetPrimitiveType(typeName); - - int size; - try - { - // Lists serialize the entire backing array. - if ((size = (int)classInfo["_size"]!) > array.Length) - { - return false; - } - } - catch (KeyNotFoundException) - { - return false; - } - - switch (primitiveType) - { - case default(PrimitiveType): - return false; - case PrimitiveType.String: - if (array is ArraySingleString stringArray) - { - List stringList = new(size); - stringList.AddRange(stringArray); - list = stringList; - return true; - } - - return false; - } - - if (array is not IPrimitiveTypeRecord primitiveArray || primitiveArray.PrimitiveType != primitiveType) - { - return false; - } - - // BinaryFormatter serializes the entire backing array, so we need to trim it down to the size of the list. - list = primitiveType switch - { - PrimitiveType.Boolean => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Byte => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Char => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Decimal => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Double => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Int16 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Int32 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Int64 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.SByte => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.Single => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.TimeSpan => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.DateTime => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.UInt16 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.UInt32 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - PrimitiveType.UInt64 => ((ArrayRecord)array).ArrayObjects.CreateTrimmedList(size), - _ => throw new InvalidOperationException() - }; - - return true; - } - } - - /// - /// Tries to get this object as a of values. - /// - public static bool TryGetPrimitiveArrayList(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - return TryGet(Get, format, out value); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - value = null; - - if (format.RootRecord is not SystemClassWithMembersAndTypes classInfo - || classInfo.Name != typeof(ArrayList).FullName - || format[2] is not ArraySingleObject array) - { - return false; - } - - int size; - try - { - // Lists serialize the entire backing array. - if ((size = (int)classInfo["_size"]!) > array.Length) - { - return false; - } - } - catch (KeyNotFoundException) - { - return false; - } - - ArrayList arrayList = new(size); - for (int i = 0; i < size; i++) - { - if (!format.TryGetPrimitiveRecordValueOrNull((IRecord)array[i]!, out object? item)) - { - return false; - } - - arrayList.Add(item); - } - - value = arrayList; - return true; - } - } - - /// - /// Tries to get this object as an of primitive types. - /// - public static bool TryGetPrimitiveArray(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - return TryGet(Get, format, out value); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? value) - { - value = null; - if (format.RootRecord is not ArrayRecord array) - { - return false; - } - - if (array is ArraySingleString stringArray) - { - value = stringArray.ToArray(); - return true; - } - - if (array is not IPrimitiveTypeRecord primitiveArray) - { - return false; - } - - value = primitiveArray.PrimitiveType switch - { - PrimitiveType.Boolean => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Byte => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Char => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Decimal => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Double => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Int16 => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Int32 => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Int64 => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.SByte => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.Single => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.TimeSpan => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.DateTime => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.UInt16 => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.UInt32 => ((ArrayRecord)primitiveArray).ArrayObjects, - PrimitiveType.UInt64 => ((ArrayRecord)primitiveArray).ArrayObjects, - _ => null - }; - - return value is not null; - } - } - - /// - /// Tries to get this object as a binary formatted of keys and values. - /// - public static bool TryGetPrimitiveHashtable(this BinaryFormattedObject format, [NotNullWhen(true)] out Hashtable? hashtable) - { - bool success = format.TryGetPrimitiveHashtable(out object? value); - hashtable = (Hashtable?)value; - return success; - } - - /// - /// Tries to get this object as a binary formatted of keys and values. - /// - public static bool TryGetPrimitiveHashtable(this BinaryFormattedObject format, [NotNullWhen(true)] out object? hashtable) - { - return TryGet(Get, format, out hashtable); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? hashtable) - { - hashtable = null; - - // Note that hashtables with custom comparers and/or hash code providers will have that information before - // the value pair arrays. - if (format.RootRecord is not SystemClassWithMembersAndTypes classInfo - || classInfo.Name != TypeInfo.HashtableType - || format[2] is not ArraySingleObject keys - || format[3] is not ArraySingleObject values - || keys.Length != values.Length) - { - return false; - } - - Hashtable temp = new(keys.Length); - for (int i = 0; i < keys.Length; i++) - { - if (!format.TryGetPrimitiveRecordValue((IRecord?)keys[i], out object? key) - || !format.TryGetPrimitiveRecordValueOrNull((IRecord?)values[i], out object? value)) - { - return false; - } - - temp[key] = value; - } - - hashtable = temp; - return true; - } - } - - /// - /// Tries to get the value for the given if it represents a - /// that isn't . - /// - public static bool TryGetPrimitiveRecordValue( - this BinaryFormattedObject format, - IRecord? record, - [NotNullWhen(true)] out object? value) - { - format.TryGetPrimitiveRecordValueOrNull(record, out value); - return value is not null; - } - - /// - /// Tries to get the value for the given if it represents a . - /// - public static bool TryGetPrimitiveRecordValueOrNull( - this BinaryFormattedObject format, - IRecord? record, - out object? value) - { - value = null; - if (record is ObjectNull or null) - { - return true; - } - - value = format.RecordMap.Dereference(record) switch - { - BinaryObjectString valueString => valueString.Value, - MemberPrimitiveTyped primitive => primitive.Value, - _ => null, - }; - - return value is not null; - } - - /// - /// Tries to get this object as a binary formatted . - /// - public static bool TryGetNotSupportedException( - this BinaryFormattedObject format, - out object? exception) - { - return TryGet(Get, format, out exception); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? exception) - { - exception = null; - - if (format.RootRecord is not SystemClassWithMembersAndTypes classInfo - || classInfo.Name != TypeInfo.NotSupportedExceptionType) - { - return false; - } - - exception = new NotSupportedException(classInfo["Message"]!.ToString()); - return true; - } - } - - /// - /// Try to get a supported .NET type object (not WinForms). - /// - public static bool TryGetFrameworkObject( - this BinaryFormattedObject format, - [NotNullWhen(true)] out object? value) - => format.TryGetPrimitiveType(out value) - || format.TryGetPrimitiveList(out value) - || format.TryGetPrimitiveArray(out value) - || format.TryGetPrimitiveArrayList(out value) - || format.TryGetPrimitiveHashtable(out value) - || format.TryGetRectangleF(out value) - || format.TryGetPointF(out value) - || format.TryGetNotSupportedException(out value); - /// /// Dereferences records. /// diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryLibrary.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryLibrary.cs index 88d6d965c27..9767198f77d 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryLibrary.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryLibrary.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class BinaryLibrary : IRecord, IBinaryFormatParseable +internal sealed class BinaryLibrary : IRecord { public Id LibraryId { get; } public string LibraryName { get; } @@ -27,9 +27,6 @@ public BinaryLibrary(Id libraryId, string libraryName) public static RecordType RecordType => RecordType.BinaryLibrary; - static BinaryLibrary IBinaryFormatParseable.Parse(BinaryFormattedObject.IParseState state) => - new(state.Reader.ReadInt32(), state.Reader.ReadString()); - public void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryObjectString.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryObjectString.cs index 47fc65006ac..446ed63d182 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryObjectString.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/BinaryObjectString.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class BinaryObjectString : IWritableRecord, IRecord, IBinaryFormatParseable +internal sealed class BinaryObjectString : IWritableRecord, IRecord { public Id ObjectId { get; } public string Value { get; } @@ -27,9 +27,6 @@ public BinaryObjectString(Id objectId, string value) Value = value; } - static BinaryObjectString IBinaryFormatParseable.Parse(BinaryFormattedObject.IParseState state) => - new(state.Reader.ReadInt32(), state.Reader.ReadString()); - void IWritableRecord.Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassInfo.cs index fc14551a3de..6b552bbd170 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassInfo.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassInfo.cs @@ -26,20 +26,6 @@ public ClassInfo(Id objectId, string name, IReadOnlyList memberNames) MemberNames = memberNames; } - public static ClassInfo Parse(BinaryReader reader, out Count memberCount) - { - Id objectId = reader.ReadInt32(); - string name = reader.ReadString(); - memberCount = reader.ReadInt32(); - ArrayBuilder memberNames = new(memberCount); - for (int i = 0; i < memberCount; i++) - { - memberNames.Add(reader.ReadString()); - } - - return new(objectId, name, memberNames.ToArray()); - } - public void Write(BinaryWriter writer) { writer.Write(ObjectId); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecord.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecord.cs index 177189fea46..c73c1e142f1 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecord.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecord.cs @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Serialization; - namespace System.Private.Windows.Core.BinaryFormat; /// @@ -55,40 +53,6 @@ private protected ClassRecord( MemberTypeInfo = memberTypeInfo; } - /// - /// Reads object member values using . - /// - private protected static IReadOnlyList ReadObjectMemberValues( - BinaryFormattedObject.IParseState state, - IReadOnlyList memberTypeInfo) - { - int count = memberTypeInfo.Count; - if (count == 0) - { - return []; - } - - ArrayBuilder memberValues = new(count); - foreach (MemberTypeInfo info in memberTypeInfo) - { - object value = ReadValue(state, info); - if (value is not ObjectNull nullValue) - { - memberValues.Add(value); - continue; - } - - if (nullValue.NullCount != 1) - { - throw new SerializationException("Member values can only have one null assigned."); - } - - memberValues.Add(null); - } - - return memberValues.ToArray(); - } - /// /// Writes as specified by the /// diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecordExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecordExtensions.cs deleted file mode 100644 index ba22e709d31..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassRecordExtensions.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace System.Private.Windows.Core.BinaryFormat; - -internal static class ClassRecordExtensions -{ - private static bool IsPrimitiveType(this SystemClassWithMembersAndTypes systemClass) => - systemClass.IsPrimitiveTypeClassName() && systemClass.MemberTypeInfo[0].Type == BinaryType.Primitive; - - private static bool IsPrimitiveTypeClassName(this SystemClassWithMembersAndTypes systemClass) => TypeInfo.GetPrimitiveType(systemClass.Name) switch - { - PrimitiveType.Boolean => true, - PrimitiveType.Byte => true, - PrimitiveType.Char => true, - PrimitiveType.Double => true, - PrimitiveType.Int32 => true, - PrimitiveType.Int64 => true, - PrimitiveType.SByte => true, - PrimitiveType.Single => true, - PrimitiveType.Int16 => true, - PrimitiveType.UInt16 => true, - PrimitiveType.UInt32 => true, - PrimitiveType.UInt64 => true, - _ => false, - }; - - internal static bool TryGetSystemPrimitive(this SystemClassWithMembersAndTypes systemClass, [NotNullWhen(true)] out object? value) - { - value = null; - - if (systemClass.IsPrimitiveType()) - { - value = systemClass.MemberValues[0]; - Debug.Assert(value is not null); - return true; - } - - if (systemClass.Name == typeof(TimeSpan).FullName) - { - value = new TimeSpan((long)systemClass.MemberValues[0]!); - return true; - } - - switch (systemClass.Name) - { - case TypeInfo.TimeSpanType: - value = new TimeSpan((long)systemClass.MemberValues[0]!); - return true; - case TypeInfo.DateTimeType: - ulong ulongValue = (ulong)systemClass["dateData"]!; - value = Unsafe.As(ref ulongValue); - return true; - case TypeInfo.DecimalType: - ReadOnlySpan bits = - [ - (int)systemClass["lo"]!, - (int)systemClass["mid"]!, - (int)systemClass["hi"]!, - (int)systemClass["flags"]! - ]; - - value = new decimal(bits); - return true; - case TypeInfo.IntPtrType: - // Rehydrating still throws even though casting doesn't any more - value = checked((nint)(long)systemClass.MemberValues[0]!); - return true; - case TypeInfo.UIntPtrType: - value = checked((nuint)(ulong)systemClass.MemberValues[0]!); - return true; - default: - return false; - } - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassTypeInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassTypeInfo.cs index 333994a315f..58c285b402c 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassTypeInfo.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassTypeInfo.cs @@ -24,10 +24,6 @@ public ClassTypeInfo(string typeName, Id libraryId) LibraryId = libraryId; } - public static ClassTypeInfo Parse(BinaryReader reader) => new( - reader.ReadString(), - reader.ReadInt32()); - public void Write(BinaryWriter writer) { writer.Write(TypeName); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithId.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithId.cs index 68f25775209..51f4708ee2c 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithId.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithId.cs @@ -15,7 +15,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class ClassWithId : ClassRecord, IRecord, IBinaryFormatParseable +internal sealed class ClassWithId : ClassRecord, IRecord { private readonly ClassRecord _metadataClass; @@ -23,8 +23,8 @@ internal sealed class ClassWithId : ClassRecord, IRecord, IBinaryFo public override Id LibraryId { get; } /// - /// The ObjectId of a prior , , - /// , or . + /// The ObjectId of a prior + /// or . /// public Id MetadataId { get; } @@ -44,23 +44,6 @@ public ClassWithId(Id id, ClassRecord metadataClass, params object?[] memberValu public static RecordType RecordType => RecordType.ClassWithId; - static ClassWithId IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - Id objectId = state.Reader.ReadInt32(); - Id metadataId = state.Reader.ReadInt32(); - - if (state.RecordMap[metadataId] is not ClassRecord referencedRecord) - { - throw new SerializationException("Invalid referenced record type."); - } - - return new( - objectId, - referencedRecord, - ReadObjectMemberValues(state, referencedRecord.MemberTypeInfo)); - } - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); @@ -75,9 +58,6 @@ private protected override void Write(BinaryWriter writer) case SystemClassWithMembersAndTypes systemClassWithMembersAndTypes: WriteValuesFromMemberTypeInfo(writer, systemClassWithMembersAndTypes.MemberTypeInfo, MemberValues); break; - case ClassWithMembers or SystemClassWithMembers: - WriteRecords(writer, MemberValues, coalesceNulls: false); - break; default: throw new SerializationException(); } diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembers.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembers.cs deleted file mode 100644 index 1d2ba9cff71..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembers.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Class information with the source library. -/// -/// -/// -/// -/// [MS-NRBF] 2.3.2.2 -/// -/// -/// -internal sealed class ClassWithMembers : ClassRecord, IRecord, IBinaryFormatParseable -{ - public override Id LibraryId { get; } - - private ClassWithMembers( - ClassInfo classInfo, - Id libraryId, - IReadOnlyList memberTypeInfo, - IReadOnlyList memberValues) - : base(classInfo, memberTypeInfo, memberValues) - { - LibraryId = libraryId; - } - - public static RecordType RecordType => RecordType.ClassWithMembers; - - static ClassWithMembers IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - ClassInfo classInfo = ClassInfo.Parse(state.Reader, out _); - Id libraryId = state.Reader.ReadInt32(); - IReadOnlyList memberTypeInfo = BinaryFormat.MemberTypeInfo.CreateFromClassInfoAndLibrary(state, classInfo, libraryId); - return new( - classInfo, - libraryId, - memberTypeInfo, - ReadObjectMemberValues(state, memberTypeInfo)); - } - - private protected override void Write(BinaryWriter writer) - { - // Really shouldn't be writing this record type. It isn't as safe as the typed variant - // and saves very little space. - throw new NotSupportedException(); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembersAndTypes.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembersAndTypes.cs index 5523fceb5bf..f27b22fbeaf 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembersAndTypes.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ClassWithMembersAndTypes.cs @@ -15,8 +15,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// internal sealed class ClassWithMembersAndTypes : ClassRecord, - IRecord, - IBinaryFormatParseable + IRecord { public override Id LibraryId { get; } @@ -41,19 +40,6 @@ public ClassWithMembersAndTypes( public static RecordType RecordType => RecordType.ClassWithMembersAndTypes; - static ClassWithMembersAndTypes IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - ClassInfo classInfo = ClassInfo.Parse(state.Reader, out Count memberCount); - IReadOnlyList memberTypeInfo = BinaryFormat.MemberTypeInfo.Parse(state.Reader, memberCount); - - return new( - classInfo, - state.Reader.ReadInt32(), - memberTypeInfo, - ReadObjectMemberValues(state, memberTypeInfo)); - } - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayRecordDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayRecordDeserializer.cs deleted file mode 100644 index 99ceeb2fad6..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayRecordDeserializer.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal sealed class ArrayRecordDeserializer : ObjectRecordDeserializer -{ - private readonly ArrayRecord _arrayRecord; - private readonly BinaryArrayType _arrayType; - private readonly Type _elementType; - private readonly Array _array; - private int _index; - private bool _hasFixups; - - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.BinaryFormattedObject.TypeResolver.GetType(String, Id)")] - internal ArrayRecordDeserializer(ArrayRecord arrayRecord, IDeserializer deserializer) - : base(arrayRecord, deserializer) - { - _arrayRecord = arrayRecord; - - if (arrayRecord is not IBinaryArray binaryArray) - { - // Other array types are handled directly (ArraySinglePrimitive and ArraySingleString). - Debug.Assert(arrayRecord is ArraySingleObject); - _elementType = typeof(object); - _arrayType = BinaryArrayType.Single; - _array = Array.CreateInstance(_elementType, arrayRecord.Length); - } - else - { - object? info = binaryArray.ElementTypeInfo; - - _elementType = arrayRecord.ElementType switch - { - BinaryType.SystemClass => info is Type type - ? type - : deserializer.TypeResolver.GetType((string)info!, Id.Null), - BinaryType.Class => info is Type type - ? type - : deserializer.TypeResolver.GetType( - ((ClassTypeInfo)info!).TypeName, - ((ClassTypeInfo)info!).LibraryId), - BinaryType.String => typeof(string), - // Jagged array - BinaryType.PrimitiveArray => ((PrimitiveType)info!).GetArrayPrimitiveTypeType(), - _ => throw new SerializationException($"Unexpected BinaryArray type: {_elementType}") - }; - - _arrayType = binaryArray.ArrayType; - if (_arrayType is not (BinaryArrayType.Single or BinaryArrayType.Jagged or BinaryArrayType.Rectangular)) - { - throw new NotSupportedException("Only arrays with zero offsets are supported."); - } - - _array = _arrayType is BinaryArrayType.Rectangular - ? Array.CreateInstance(_elementType, binaryArray.Lengths.ToArray()) - : Array.CreateInstance(_elementType, arrayRecord.Length); - } - - Object = _array; - } - - internal override Id Continue() - { - while (_index < _arrayRecord.Length) - { - (object? memberValue, Id reference) = UnwrapMemberValue(_arrayRecord.ArrayObjects[_index]); - - if (s_missingValueSentinel == memberValue) - { - // Record has not been encountered yet, need to pend iteration. - return reference; - } - - if (memberValue is not null && DoesValueNeedUpdated(memberValue, reference)) - { - // Need to track a fixup for this index. - _hasFixups = true; - Deserializer.PendValueUpdater(new ArrayUpdater(_arrayRecord.ObjectId, reference, _index)); - } - - if (memberValue is null && !_elementType.IsValueType) - { - // No point in setting a null. If we're a value type, let it flow to throw when setting. - _index++; - continue; - } - - if (_elementType.IsValueType) - { - _array.SetArrayValueByFlattenedIndex(memberValue, _index); - } - else - { - Span flatSpan = _array.GetArrayData(); - flatSpan[_index] = memberValue; - } - - _index++; - } - - // No more missing member refs. - - if (!_hasFixups) - { - Deserializer.CompleteObject(_arrayRecord.ObjectId); - } - - return Id.Null; - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayUpdater.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayUpdater.cs deleted file mode 100644 index 3507ba9dd78..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ArrayUpdater.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal sealed class ArrayUpdater : ValueUpdater -{ - private readonly int _index; - - internal ArrayUpdater(int objectId, int valueId, int index) : base(objectId, valueId) - { - _index = index; - } - - internal override void UpdateValue(IDictionary objects) - { - object value = objects[ValueId]; - Array array = (Array)objects[ObjectId]; - array.SetArrayValueByFlattenedIndex(value, _index); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordDeserializer.cs deleted file mode 100644 index 38b54b6dacd..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordDeserializer.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// Base class for deserializing s. -/// -internal abstract class ClassRecordDeserializer : ObjectRecordDeserializer -{ - private readonly bool _onlyAllowPrimitives; - - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] - private readonly Type _type; - - private protected ClassRecordDeserializer( - ClassRecord classRecord, - object @object, - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - IDeserializer deserializer) - : base(classRecord, deserializer) - { - Object = @object; - _type = type; - - // We want to be able to complete IObjectReference without having to evaluate their dependencies - // for circular references. See ValidateNewMemberObjectValue below for more. - _onlyAllowPrimitives = @object is IObjectReference; - } - - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.BinaryFormattedObject.TypeResolver.GetType(String, Id)")] - internal static ObjectRecordDeserializer Create(ClassRecord classRecord, IDeserializer deserializer) - { - Type type = deserializer.TypeResolver.GetType(classRecord.Name, classRecord.LibraryId); - Id id = classRecord.ObjectId; - - ISerializationSurrogate? surrogate = deserializer.GetSurrogate(type); - - if (!type.IsSerializable && surrogate is null) - { - // SurrogateSelectors allow populating types that are not marked as serializable. - throw new SerializationException($"Type '{type}' is not marked as serializable."); - } - - object @object = RuntimeHelpers.GetUninitializedObject(type); - - // Invoke any OnDeserializing methods. - SerializationEvents.GetOnDeserializingForType(type, @object)?.Invoke(deserializer.Options.StreamingContext); - - ObjectRecordDeserializer? recordDeserializer; - - if (surrogate is not null || typeof(ISerializable).IsAssignableFrom(type)) - { - recordDeserializer = new ClassRecordSerializationInfoDeserializer(classRecord, @object, type, surrogate, deserializer); - } - else - { - // Directly set fields for non-ISerializable types. - recordDeserializer = new ClassRecordFieldInfoDeserializer(classRecord, @object, type, deserializer); - } - - return recordDeserializer; - } - - private protected override void ValidateNewMemberObjectValue(object value) - { - if (!_onlyAllowPrimitives) - { - return; - } - - // The goal with this restriction is to know definitively that we can complete the contianing object when we - // finish with it's members, even if it is going to be replaced with another instance (as IObjectReference does). - // If there are no reference types we know that there is no way for references to this object getting it in an - // in an unconverted state or converted with uncompleted state (due to some direct or indirect reference from - // this object). - // - // If we wanted support to be fully open-ended we would have queue completion along with pending SerializationInfo - // objects to rehydrate in the proper order (depth-first) and reject any case where the object is involved in - // a cycle. - - Type type = value.GetType(); - if (type.IsArray) - { - type = type.GetElementType()!; - } - - bool primitive = type.IsPrimitive || type.IsEnum || type == typeof(string); - if (!primitive) - { - throw new SerializationException($"IObjectReference type '{type}' can only have primitive member data."); - } - } - - private protected void RegisterCompleteEvents() => Deserializer.RegisterCompleteEvents(_type, Object); -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete - diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordFieldInfoDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordFieldInfoDeserializer.cs deleted file mode 100644 index 697dd6a47be..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordFieldInfoDeserializer.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// Deserializer for s that directly set fields. -/// -internal sealed class ClassRecordFieldInfoDeserializer : ClassRecordDeserializer -{ - private readonly ClassRecord _classRecord; - private readonly MemberInfo[] _fieldInfo; - private int _currentFieldIndex; - private readonly bool _isValueType; - private bool _hasFixups; - - internal ClassRecordFieldInfoDeserializer( - ClassRecord classRecord, - object @object, - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] - Type type, - IDeserializer deserializer) - : base(classRecord, @object, type, deserializer) - { - _classRecord = classRecord; - _fieldInfo = FormatterServices.GetSerializableMembers(type); - _isValueType = type.IsValueType; - } - - internal override Id Continue() - { - // When directly setting fields we need to populate fields with primitive types before we - // can add the object to the deserialized object list to handle value types. This ensures - // partialially filled boxed value types in the collection are assigned (and unboxed) in - // this path (non-ISerializable) with nothing directly pending other than reference types. - - Debug.Assert(_fieldInfo is not null); - - // Note that while fields must have member data, fields are not required for all member data. - - while (_currentFieldIndex < _fieldInfo.Length) - { - // FormatterServices *never* returns anything but fields. - FieldInfo field = (FieldInfo)_fieldInfo[_currentFieldIndex]; - object? rawValue; - try - { - rawValue = _classRecord[field.Name]; - } - catch (KeyNotFoundException) - { - if (Deserializer.Options.AssemblyMatching == FormatterAssemblyStyle.Simple - || field.GetCustomAttribute() is not null) - { - _currentFieldIndex++; - continue; - } - - throw new SerializationException($"Could not find field '{field.Name}' data for type '{field.DeclaringType!.Name}'."); - } - - (object? memberValue, Id reference) = UnwrapMemberValue(rawValue); - if (s_missingValueSentinel == memberValue) - { - // Record has not been encountered yet, need to pend iteration. - return reference; - } - - field.SetValue(Object, memberValue); - - if (memberValue is not null && DoesValueNeedUpdated(memberValue, reference)) - { - // Need to track a fixup for this field. - _hasFixups = true; - Deserializer.PendValueUpdater(new FieldValueUpdater(_classRecord.ObjectId, reference, field)); - } - - _currentFieldIndex++; - } - - // Register after all members are parsed, to ensure that completion events are triggered in depth-first order. - RegisterCompleteEvents(); - - if (!_hasFixups || !_isValueType) - { - // We can be used for completion even with fixups if we're not a value type as our fixups won't need to be - // copied to propogate them. Note that surrogates cannot replace our created instance for reference types. - Deserializer.CompleteObject(_classRecord.ObjectId); - } - - // No more missing member refs. - return Id.Null; - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordSerializationInfoDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordSerializationInfoDeserializer.cs deleted file mode 100644 index c8675fd8a13..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ClassRecordSerializationInfoDeserializer.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// Deserializer for s that use to initialize class state. -/// -/// -/// -/// This is used either because the class implements or because a surrogate was used. -/// -/// -internal sealed class ClassRecordSerializationInfoDeserializer : ClassRecordDeserializer -{ - private readonly ClassRecord _classRecord; - private readonly SerializationInfo _serializationInfo; - private readonly ISerializationSurrogate? _surrogate; - private int _currentMemberIndex; - - internal ClassRecordSerializationInfoDeserializer( - ClassRecord classRecord, - object @object, - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - ISerializationSurrogate? surrogate, - IDeserializer deserializer) : base(classRecord, @object, type, deserializer) - { - _classRecord = classRecord; - _surrogate = surrogate; - _serializationInfo = new(type, BinaryFormattedObject.DefaultConverter); - } - - internal override Id Continue() - { - // There is no benefit to changing order here so we can keep the same order as the serialized data. - while (_currentMemberIndex < _classRecord.MemberNames.Count) - { - string memberName = _classRecord.MemberNames[_currentMemberIndex]; - (object? memberValue, Id reference) = UnwrapMemberValue(_classRecord.MemberValues[_currentMemberIndex]); - - if (s_missingValueSentinel == memberValue) - { - // Record has not been encountered yet, need to pend iteration. - return reference; - } - - if (memberValue is not null && DoesValueNeedUpdated(memberValue, reference)) - { - Deserializer.PendValueUpdater(new SerializationInfoValueUpdater( - _classRecord.ObjectId, - reference, - _serializationInfo, - memberName)); - } - - _serializationInfo.AddValue(memberName, memberValue); - _currentMemberIndex++; - } - - // Register after all members are parsed, to ensure that completion events are triggered in depth-first order. - RegisterCompleteEvents(); - - // We can't complete these in the same way we do with direct field sets as user code can dereference the - // reference type members from the SerializationInfo that aren't fully completed (due to cycles). With direct - // field sets it doesn't matter if the referenced object isn't fully completed. Waiting until the graph is - // fully parsed to allow cycles the best chance to resolve as much as possible without having to walk the - // entire graph from this point to make a determination. - // - // The same issue applies to "complete" events, which is why we pend them as well. - // - // If we were confident that there were no cycles in the graph to this point we could apply directly - // if there were no pending value types (which should also not happen if there are no cycles). - - PendingSerializationInfo pending = new(_classRecord.ObjectId, _serializationInfo, _surrogate); - Deserializer.PendSerializationInfo(pending); - - // No more missing member refs. - return Id.Null; - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.PendingUpdates.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.PendingUpdates.cs deleted file mode 100644 index 20b52c4e6d9..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.PendingUpdates.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal sealed partial class Deserializer -{ - /// - /// Encapsulates updates that need applied to objects in the graph after initial deserialization. - /// - private class PendingUpdates - { - // Queue of SerializationInfo objects that need to be applied. These are in depth first order, - // if there are no cycles in the graph this ensures that all objects are available when the - // SerializationInfo is applied. - // - // We also keep a hashset for quickly checking to make sure we do not complete objects before we - // actually apply the SerializationInfo. While we could mark them in the incomplete dependencies - // dictionary, to do so we'd need to know if any referenced object is going to get to this state - // even if it hasn't finished parsing, which isn't easy to do with cycles involved. - private Queue? _pendingSerializationInfo; - private HashSet? _pendingSerializationInfoIds; - - // For a given object id, the set of ids that it is waiting on to complete. - private Dictionary>? _incompleteDependencies; - - // The pending value updaters. Scanned each time an object is completed. - private HashSet? _pendingValueUpdates; - - private readonly IDictionary _deserializedObjects; - - internal PendingUpdates(IDictionary deserializedObjects) => _deserializedObjects = deserializedObjects; - - /// - /// Number of pending updates, if any. - /// - internal int PendingValueUpdatesCount => _pendingValueUpdates?.Count ?? 0; - - internal void Add(ValueUpdater updater) - { - _pendingValueUpdates ??= []; - _pendingValueUpdates.Add(updater); - - _incompleteDependencies ??= []; - - if (_incompleteDependencies.TryGetValue(updater.ObjectId, out HashSet? dependencies)) - { - dependencies.Add(updater.ValueId); - } - else - { - _incompleteDependencies.Add(updater.ObjectId, [updater.ValueId]); - } - } - - internal bool HasIncompleteDependencies(int id) => _incompleteDependencies?.ContainsKey(id) ?? false; - - internal void RemoveIncompleteDependency(int id) => _incompleteDependencies?.Remove(id); - - internal void Enqueue(PendingSerializationInfo pending) - { - _pendingSerializationInfo ??= new(); - _pendingSerializationInfo.Enqueue(pending); - - _pendingSerializationInfoIds ??= []; - _pendingSerializationInfoIds.Add(pending.ObjectId); - } - - internal bool TryDequeuePendingSerializationInfo([NotNullWhen(true)] out PendingSerializationInfo? pending) - { - if (_pendingSerializationInfo is not null && _pendingSerializationInfo.TryDequeue(out pending)) - { - _pendingSerializationInfoIds?.Remove(pending.ObjectId); - return true; - } - - pending = null; - return false; - } - - internal bool ContainsPendingSerializationInfo(int id) => _pendingSerializationInfoIds?.Contains(id) ?? false; - - internal int PendingSerializationInfoCount => _pendingSerializationInfo?.Count ?? 0; - - internal bool TryGetIncompleteDependencies(int id, [NotNullWhen(true)] out HashSet? dependencies) - { - if (_incompleteDependencies is not null) - { - return _incompleteDependencies.TryGetValue(id, out dependencies); - } - - dependencies = null; - return false; - } - - internal IEnumerable CompleteDependencies(int completedId) - { - if (_incompleteDependencies is null) - { - yield break; - } - - foreach ((int incompleteId, HashSet dependencies) in _incompleteDependencies) - { - if (!dependencies.Remove(completedId)) - { - continue; - } - - // Search for fixups that need to be applied for this dependency. - int removals = _pendingValueUpdates!.RemoveWhere((ValueUpdater updater) => - { - if (updater.ValueId != completedId) - { - return false; - } - - updater.UpdateValue(_deserializedObjects); - return true; - }); - - if (dependencies.Count != 0) - { - continue; - } - - // No more dependencies, enqueue for completion - yield return incompleteId; - } - } - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.cs deleted file mode 100644 index b031389b01f..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/Deserializer.cs +++ /dev/null @@ -1,324 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// General binary format deserializer. -/// -/// -/// -/// This has some constraints over the BinaryFormatter. Notably it does not support all -/// usages or surrogates that replace object instances. This greatly simplifies the deserialization. It also does not -/// allow offset arrays (arrays that have lower bounds other than zero) or multidimensional arrays that have more -/// than elements. -/// -/// -/// This deserializer ensures that all value types are assigned to fields or populated in -/// callbacks with their final state, throwing if that is impossible to attain due to graph cycles or data corruption. -/// The value type instance may contain references to uncompleted reference types when there are cycles in the graph. -/// In general it is risky to dereference reference types in constructors or in -/// call backs if there is any risk of the objects enabling a cycle. -/// -/// -/// If you need to dereference reference types in waiting for final state by -/// implementing or is the safer way to -/// do so. This deserializer does not fire completed events until the entire graph has been deserialized. If a -/// surrogate () needs to dereference with potential cycles it would require -/// tracking instances by stashing them in a provided to handle after invoking the -/// deserializer. -/// -/// -/// -/// makes deserializing difficult as you don't know the final type until you've finished -/// populating the serialized type. If is involved and you have a cycle you may never -/// be able to complete the deserialization as the reference type values in the can't -/// get the final object. -/// -/// is really the only practical way to represent singletons. A common pattern is to -/// nest an object in an object. Specifying the nested -/// type when is called by invoking -/// will get that type info serialized into the stream. -/// -internal sealed partial class Deserializer : IDeserializer -{ - private readonly IReadOnlyRecordMap _recordMap; - private readonly BinaryFormattedObject.ITypeResolver _typeResolver; - BinaryFormattedObject.ITypeResolver IDeserializer.TypeResolver => _typeResolver; - - /// - private BinaryFormattedObject.Options Options { get; } - BinaryFormattedObject.Options IDeserializer.Options => Options; - - /// - private readonly Dictionary _deserializedObjects = []; - IDictionary IDeserializer.DeserializedObjects => _deserializedObjects; - - // Surrogate cache. - private readonly Dictionary? _surrogates; - - // Keeping a separate stack for ids for fast infinite loop checks. - private readonly Stack _parserStack = []; - - /// - private readonly HashSet _incompleteObjects = []; - public IReadOnlySet IncompleteObjects => _incompleteObjects; - - private readonly PendingUpdates _pending; - - // Kept as a field to avoid allocating a new one every time we complete objects. - private readonly Queue _pendingCompletions = []; - - private readonly Id _rootId; - - // We group individual object events here to fire them all when we complete the graph. - private event Action? OnDeserialization; - private event Action? OnDeserialized; - - private Deserializer( - Id rootId, - IReadOnlyRecordMap recordMap, - BinaryFormattedObject.ITypeResolver typeResolver, - BinaryFormattedObject.Options options) - { - _rootId = rootId; - _recordMap = recordMap; - _typeResolver = typeResolver; - Options = options; - _pending = new(_deserializedObjects); - - if (Options.SurrogateSelector is not null) - { - _surrogates = []; - } - } - - /// - /// Deserializes the object graph for the given and . - /// - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.Deserializer.Deserializer.Deserialize()")] - internal static object Deserialize( - Id rootId, - IReadOnlyRecordMap recordMap, - BinaryFormattedObject.ITypeResolver typeResolver, - BinaryFormattedObject.Options options) - { - var deserializer = new Deserializer(rootId, recordMap, typeResolver, options); - return deserializer.Deserialize(); - } - - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.Deserializer.Deserializer.DeserializeRoot(Id)")] - private object Deserialize() - { - DeserializeRoot(_rootId); - - // Complete all pending SerializationInfo objects. - int pendingCount = _pending.PendingSerializationInfoCount; - while (_pending.TryDequeuePendingSerializationInfo(out PendingSerializationInfo? pending)) - { - // Using pendingCount to only requeue on the first pass. - if (--pendingCount >= 0 - && _pending.PendingSerializationInfoCount != 0 - && _pending.TryGetIncompleteDependencies(pending.ObjectId, out HashSet? dependencies)) - { - // We can get here with nested ISerializable value types. - - // Hopefully another pass will complete this. - if (dependencies.Count > 0) - { - _pending.Enqueue(pending); - continue; - } - - Debug.Fail("Completed dependencies should have been removed from the dictionary."); - } - - // All _pendingSerializationInfo objects are considered incomplete. - pending.Populate(_deserializedObjects, Options.StreamingContext); - ((IDeserializer)this).CompleteObject(pending.ObjectId); - } - - if (_incompleteObjects.Count > 0 || _pending.PendingValueUpdatesCount > 0) - { - // This should never happen outside of corrupted data. - throw new SerializationException("Objects could not be deserialized completely."); - } - - // Notify [OnDeserialized] instance methods for all relevant deserialized objects, - // then callback IDeserializationCallback on all objects that implement it. - OnDeserialized?.Invoke(Options.StreamingContext); - OnDeserialization?.Invoke(null); - - return _deserializedObjects[_rootId]; - } - - [RequiresUnreferencedCode("Calls DeserializeNew(Id)")] - private void DeserializeRoot(Id rootId) - { - object root = DeserializeNew(rootId); - if (root is not ObjectRecordDeserializer parser) - { - return; - } - - _parserStack.Push(parser); - - while (_parserStack.TryPop(out ObjectRecordDeserializer? currentParser)) - { - Id requiredId; - while (!(requiredId = currentParser.Continue()).IsNull) - { - // A record is required to complete the current parser. Get it. - object requiredObject = DeserializeNew(requiredId); - Debug.Assert(requiredObject is not IRecord); - - if (requiredObject is ObjectRecordDeserializer requiredParser) - { - // Push our current parser. - _parserStack.Push(currentParser); - - // Push the required parser so we can complete it. - _parserStack.Push(requiredParser); - - break; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.Deserializer.ObjectRecordParser.Create(Id, IRecord, IDeserializer)")] - object DeserializeNew(Id id) - { - // Strings, string arrays, and primitive arrays can be completed without creating a - // parser object. Single primitives don't normally show up as records unless they are top - // level or are boxed into an interface reference. Checking for these requires costly - // string matches and as such we'll just create the parser object. - - IRecord record = _recordMap[id]; - if (record is BinaryObjectString binaryString) - { - _deserializedObjects.Add(id, binaryString.Value); - return binaryString.Value; - } - - if (record is ArrayRecord arrayRecord) - { - Array? values = arrayRecord switch - { - ArraySingleString stringArray => stringArray.ToArray(), - IPrimitiveTypeRecord primitiveArray => primitiveArray.GetPrimitiveArray(), - _ => null - }; - - if (values is not null) - { - _deserializedObjects.Add(arrayRecord.ObjectId, values); - return values; - } - } - - // Not a simple case, need to do a full deserialization of the record. - if (!_incompleteObjects.Add(id)) - { - // All objects should be available before they're asked for a second time. - throw new SerializationException("Unexpected parser cycle."); - } - - var deserializer = ObjectRecordDeserializer.Create(id, record, this); - - // Add the object as soon as possible to support circular references. - _deserializedObjects.Add(id, deserializer.Object); - return deserializer; - } - } - - ISerializationSurrogate? IDeserializer.GetSurrogate(Type type) - { - // If we decide not to cache, this method could be moved to the callsite. - - if (_surrogates is null) - { - return null; - } - - Debug.Assert(Options.SurrogateSelector is not null); - - if (!_surrogates.TryGetValue(type, out ISerializationSurrogate? surrogate)) - { - surrogate = Options.SurrogateSelector.GetSurrogate(type, Options.StreamingContext, out _); - _surrogates[type] = surrogate; - } - - return surrogate; - } - - void IDeserializer.PendSerializationInfo(PendingSerializationInfo pending) => _pending.Enqueue(pending); - - void IDeserializer.PendValueUpdater(ValueUpdater updater) => _pending.Add(updater); - - [UnconditionalSuppressMessage( - "Trimming", - "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", - Justification = "The type is already in the cache of the TypeResolver, no need to mark this one again.")] - void IDeserializer.RegisterCompleteEvents( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - object @object) - { - OnDeserialized += SerializationEvents.GetOnDeserializedForType(type, @object); - - if (@object is IDeserializationCallback callback) - { - OnDeserialization += callback.OnDeserialization; - } - } - - void IDeserializer.CompleteObject(Id id) - { - // Need to use a queue as Completion is recursive. - - _pendingCompletions.Enqueue(id); - bool recursed = false; - - while (_pendingCompletions.TryDequeue(out int completedId)) - { - _incompleteObjects.Remove(completedId); - - // When we've recursed, we've done so because there are no more dependencies for the current id, so we can - // remove it from the dictionary. We have to pend as we can't remove while we're iterating the dictionary. - if (recursed) - { - _pending.RemoveIncompleteDependency(completedId); - - if (_pending.ContainsPendingSerializationInfo(completedId)) - { - // We came back for an object that has no remaining direct dependencies, but still has - // PendingSerializationInfo. As such it cannot be considered completed yet. - continue; - } - } - - if (_recordMap[completedId] is ClassRecord classRecord && !_pending.HasIncompleteDependencies(completedId)) - { - // There are no remaining dependencies. Get the real object if it's an IObjectReference. - if (_deserializedObjects[completedId] is IObjectReference objectReference) - { - _deserializedObjects[completedId] = objectReference.GetRealObject(Options.StreamingContext); - } - } - - foreach (int dependentCompletion in _pending.CompleteDependencies(completedId)) - { - _pendingCompletions.Enqueue(dependentCompletion); - } - - recursed = true; - } - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/FieldValueUpdater.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/FieldValueUpdater.cs deleted file mode 100644 index 3d5d46dc9e3..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/FieldValueUpdater.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal sealed class FieldValueUpdater : ValueUpdater -{ - private readonly FieldInfo _field; - - internal FieldValueUpdater(int objectId, int valueId, FieldInfo field) : base(objectId, valueId) - { - _field = field; - } - - internal override void UpdateValue(IDictionary objects) - { - object newValue = objects[ValueId]; - _field.SetValue(objects[ObjectId], newValue); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/IDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/IDeserializer.cs deleted file mode 100644 index ee4d2d22b42..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/IDeserializer.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// Interface for deserialization used to define the coupling between the main -/// and its s. -/// -internal interface IDeserializer -{ - /// - /// The current deserialization options. - /// - BinaryFormattedObject.Options Options { get; } - - /// - /// The set of object record ids that are not considered "complete" yet. - /// - /// - /// - /// Objects are considered incomplete if they contain references to value or types - /// that need completed or if they have not yet finished evaluating all of their member data. They are also - /// considered incomplete if they implement or have a surrogate and the - /// has not yet been applied. - /// - /// - IReadOnlySet IncompleteObjects { get; } - - /// - /// The set of objects that have been deserialized, indexed by record id. - /// - /// - /// - /// Objects may not be fully filled out. If they are not in , they are - /// guaranteed to have their reference type members created (this is not transitive- their members may not - /// be ready if there are cycles in the object graph). - /// - /// - IDictionary DeserializedObjects { get; } - - /// - /// Resolver for types. - /// - BinaryFormattedObject.ITypeResolver TypeResolver { get; } - - /// - /// Pend the given value updater to be run when it's value type dependency is complete. - /// - void PendValueUpdater(ValueUpdater updater); - - /// - /// Pend a to be applied when the graph is fully parsed. - /// - void PendSerializationInfo(PendingSerializationInfo pending); - - /// - /// Mark the object id as complete. This will check dependencies and resolve relevant s. - /// - void CompleteObject(Id id); - - /// - /// Check for a surrogate for the given type. If none exists, returns . - /// - ISerializationSurrogate? GetSurrogate(Type type); - - /// - /// Register the deserialization complete events for the given object. - /// - void RegisterCompleteEvents( - // The only way to preserve base, non-public methods is to use All. - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] - Type type, - object @object); -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ObjectRecordDeserializer.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ObjectRecordDeserializer.cs deleted file mode 100644 index 4b531ad67a0..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ObjectRecordDeserializer.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -/// -/// Base class for deserialization. -/// -internal abstract partial class ObjectRecordDeserializer -{ - // Used to indicate that the value is missing from the deserialized objects. - private protected static object s_missingValueSentinel = new(); - - internal ObjectRecord ObjectRecord { get; } - - [AllowNull] - internal object Object { get; private protected set; } - - private protected IDeserializer Deserializer { get; } - - private protected ObjectRecordDeserializer(ObjectRecord objectRecord, IDeserializer deserializer) - { - Deserializer = deserializer; - ObjectRecord = objectRecord; - } - - /// - /// Continue parsing. - /// - /// The id that is necessary to complete parsing or if complete. - internal abstract Id Continue(); - - /// - /// Gets the actual object for a member value primitive or record. Returns if - /// the object record has not been encountered yet. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private protected (object? value, Id id) UnwrapMemberValue(object? memberValue) - { - return memberValue switch - { - // String - BinaryObjectString binaryString => (binaryString.Value, Id.Null), - // Inline record - ObjectRecord objectRecord => TryGetObject(objectRecord.ObjectId), - // Record reference - MemberReference memberReference => TryGetObject(memberReference.IdRef), - // Prmitive type record - MemberPrimitiveTyped memberPrimitiveTyped => (memberPrimitiveTyped.Value, Id.Null), - // Null - ObjectNull or null => (null, Id.Null), - // At this point should be an inline primitive - _ => TypeInfo.GetPrimitiveType(memberValue.GetType()) != default - ? (memberValue, Id.Null) - : throw new SerializationException($"Unexpected member type '{memberValue.GetType()}'."), - }; - - (object? value, Id id) TryGetObject(Id id) - { - if (!Deserializer.DeserializedObjects.TryGetValue(id, out object? value)) - { - return (s_missingValueSentinel, id); - } - - ValidateNewMemberObjectValue(value); - return (value, id); - } - } - - /// - /// Called for new non-primitive reference types. - /// - private protected virtual void ValidateNewMemberObjectValue(object value) { } - - /// - /// Returns if the given record's value needs an updater applied. - /// - private protected bool DoesValueNeedUpdated(object value, Id valueRecord) => - // Null Id is a primitive of some sort. - !valueRecord.IsNull - // IObjectReference is going to have it's object replaced. - && (value is IObjectReference - // Value types that aren't "complete" need to be reapplied. - || (Deserializer.IncompleteObjects.Contains(valueRecord) && value.GetType().IsValueType)); - - [RequiresUnreferencedCode("Calls System.Private.Windows.Core.BinaryFormat.Deserializer.ClassRecordParser.Create(ClassRecord, IDeserializer)")] - internal static ObjectRecordDeserializer Create(Id id, IRecord record, IDeserializer deserializer) => record switch - { - ClassRecord classRecord => ClassRecordDeserializer.Create(classRecord, deserializer), - ArrayRecord arrayRecord => new ArrayRecordDeserializer(arrayRecord, deserializer), - _ => throw new SerializationException($"Unexpected record type for {id}.") - }; -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/PendingSerializationInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/PendingSerializationInfo.cs deleted file mode 100644 index 7d94f14782e..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/PendingSerializationInfo.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - -internal sealed class PendingSerializationInfo -{ - internal int ObjectId { get; } - private readonly ISerializationSurrogate? _surrogate; - private readonly SerializationInfo _info; - - internal PendingSerializationInfo( - int objectId, - SerializationInfo info, - ISerializationSurrogate? surrogate) - { - ObjectId = objectId; - _surrogate = surrogate; - _info = info; - } - - [UnconditionalSuppressMessage( - "ReflectionAnalysis", - "IL2072:UnrecognizedReflectionPattern", - Justification = "Not sure how to attribute this.")] - internal void Populate(IDictionary objects, StreamingContext context) - { - object @object = objects[ObjectId]; - Type type = @object.GetType(); - - if (_surrogate is not null) - { - object populated = _surrogate.SetObjectData(@object, _info, context, selector: null); - if (populated is null) - { - // Sort of odd to allow returning null to ignore setting the returned value back, - // but that is the way this worked in the BinaryFormatter. - return; - } - - // Don't use == on reference types as we are dependent on the instance in the objects - // dictionary never changing. Value types can be modified but this is ok as any usages - // of this object will have a pending fixup that will reapply the value. - // - // BinaryFormatter would allow this to change as long as you didn't wrap the surrogate - // in FormaterServices.GetSurrogateForCyclicalReference. We break here on value types - // as they can never be observed in an unfinished state. - if (!type.IsValueType && !ReferenceEquals(populated, @object)) - { - throw new SerializationException("Surrogate must return the same object that was provided in the 'obj' parameter."); - } - - objects[ObjectId] = populated; - return; - } - - ConstructorInfo constructor = GetDeserializationConstructor(type); - constructor.Invoke(@object, [_info, context]); - } - - private static ConstructorInfo GetDeserializationConstructor( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) - { - foreach (ConstructorInfo constructor in type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) - { - ParameterInfo[] parameters = constructor.GetParameters(); - if (parameters.Length == 2 - && parameters[0].ParameterType == typeof(SerializationInfo) - && parameters[1].ParameterType == typeof(StreamingContext)) - { - return constructor; - } - } - - throw new SerializationException($"The constructor to deserialize an object of type '{type.FullName}' was not found."); - } -} - -#pragma warning restore SYSLIB0050 // Type or member is obsolete diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/SerializationInfoValueUpdater.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/SerializationInfoValueUpdater.cs deleted file mode 100644 index 86f86715f49..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/SerializationInfoValueUpdater.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal sealed class SerializationInfoValueUpdater : ValueUpdater -{ - private readonly SerializationInfo _info; - private readonly string _name; - - internal SerializationInfoValueUpdater(int objectId, int valueId, SerializationInfo info, string name) : base(objectId, valueId) - { - _info = info; - _name = name; - } - - internal override void UpdateValue(IDictionary objects) - { - object newValue = objects[ValueId]; - _info.UpdateValue(_name, newValue, newValue.GetType()); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ValueUpdater.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ValueUpdater.cs deleted file mode 100644 index f203932bf68..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Deserializer/ValueUpdater.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat.Deserializer; - -internal abstract class ValueUpdater -{ - /// - /// The value id that needs to be reapplied. - /// - internal int ValueId { get; } - - /// - /// The object id that is dependent on . - /// - internal int ObjectId { get; } - - private protected ValueUpdater(int objectId, int valueId) - { - ObjectId = objectId; - ValueId = valueId; - } - - internal abstract void UpdateValue(IDictionary objects); -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryArray.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryArray.cs deleted file mode 100644 index 0f155081cd0..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryArray.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Binary array record. -/// -/// -internal interface IBinaryArray : IRecord -{ - /// - /// Rank (dimensions) of the array. - /// - Count Rank { get; } - - /// - /// Type of the array. - /// - BinaryArrayType ArrayType { get; } - - /// - /// Lengths of the array (for each dimension). - /// - IReadOnlyList Lengths { get; } - - /// - /// Additional array element type information. Varies with . - /// - /// - /// - /// For this will either be the or the - /// type name string. - /// - /// - /// For this will either be the or a tuple - /// of the type name string and the library . - /// - /// - /// For this will be the . - /// - /// - /// For all other types, this is . - /// - /// - object? ElementTypeInfo { get; } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryFormatParseable.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryFormatParseable.cs deleted file mode 100644 index ab5d62c0d64..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/IBinaryFormatParseable.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// Specifies that the given record type can be created from a . -/// -internal interface IBinaryFormatParseable where T : IRecord -{ - /// - /// Creates the type utilizaing the given . - /// - static abstract T Parse(BinaryFormattedObject.IParseState state); -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberPrimitiveTyped.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberPrimitiveTyped.cs index 43cebea9dbe..96c3c73e4b1 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberPrimitiveTyped.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberPrimitiveTyped.cs @@ -16,8 +16,7 @@ namespace System.Private.Windows.Core.BinaryFormat; internal sealed class MemberPrimitiveTyped : Record, IRecord, - IPrimitiveTypeRecord, - IBinaryFormatParseable + IPrimitiveTypeRecord { public PrimitiveType PrimitiveType { get; } public object Value { get; } @@ -43,15 +42,6 @@ internal MemberPrimitiveTyped(object value) public static RecordType RecordType => RecordType.MemberPrimitiveTyped; - static MemberPrimitiveTyped IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - PrimitiveType primitiveType = (PrimitiveType)state.Reader.ReadByte(); - return new( - primitiveType, - ReadPrimitiveType(state.Reader, primitiveType)); - } - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberReference.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberReference.cs index 61da18ad1f2..88a2b702eaf 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberReference.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberReference.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class MemberReference : Record, IRecord, IBinaryFormatParseable +internal sealed class MemberReference : Record, IRecord { public Id IdRef { get; } @@ -21,9 +21,6 @@ internal sealed class MemberReference : Record, IRecord, IBinar public static RecordType RecordType => RecordType.MemberReference; - static MemberReference IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) => new(state.Reader.ReadInt32()); - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberTypeInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberTypeInfo.cs index 8e161ceaf57..83556b5d1ae 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberTypeInfo.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MemberTypeInfo.cs @@ -1,10 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - namespace System.Private.Windows.Core.BinaryFormat; /// @@ -29,93 +25,6 @@ internal MemberTypeInfo(BinaryType type, object? info) Info = info; } - internal static MemberTypeInfo Parse(BinaryReader reader) - { - BinaryType type = (BinaryType)reader.ReadByte(); - return new(type, GetInfo(reader, type)); - } - - [SkipLocalsInit] - internal static IReadOnlyList Parse(BinaryReader reader, int expectedCount) - { - // Expected count is guarded by the member parser. - MemberTypeInfo[] info = new MemberTypeInfo[expectedCount]; - - using BufferScope buffer = new(stackalloc byte[64], expectedCount); - - if (reader.Read(buffer.Slice(0, expectedCount)) < expectedCount) - { - throw new EndOfStreamException(); - } - - // Check for more clarifying information - for (int i = 0; i < expectedCount; i++) - { - BinaryType type = (BinaryType)buffer[i]; - info[i] = new(type, GetInfo(reader, type)); - } - - return info; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static object? GetInfo(BinaryReader reader, BinaryType type) => type switch - { - BinaryType.Primitive or BinaryType.PrimitiveArray => (PrimitiveType)reader.ReadByte(), - BinaryType.SystemClass => reader.ReadString(), - BinaryType.Class => ClassTypeInfo.Parse(reader), - // Other types have no additional data. - BinaryType.String or BinaryType.ObjectArray or BinaryType.StringArray or BinaryType.Object => null, - _ => throw new SerializationException("Unexpected binary type."), - }; - - [UnconditionalSuppressMessage( - "Trimming", - "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", - Justification = """ - Incoming type names are coming off of the formatted stream. There is no way for user code to pass compile - time context for preserialized data. If a type can't be found on deserialization it won't matter any more - than any other case where the type can't be found (e.g. a missing assembly). The deserializer will fail - with information on the missing type that can be used to attribute to keep said type. - """)] - internal static IReadOnlyList CreateFromClassInfoAndLibrary(BinaryFormattedObject.IParseState state, ClassInfo classInfo, Id libraryId) - { - Type type = state.TypeResolver.GetType(classInfo.Name, libraryId); - - if (typeof(ISerializable).IsAssignableFrom(type) - || state.Options.SurrogateSelector?.GetSurrogate(type, state.Options.StreamingContext, out _) is not null) - { - throw new SerializationException("Cannot intuit type information for ISerializable types."); - } - -#pragma warning disable SYSLIB0050 // Type or member is obsolete - MemberInfo[] memberInfo = FormatterServices.GetSerializableMembers(type); -#pragma warning restore SYSLIB0050 - - IReadOnlyList memberNames = classInfo.MemberNames; - MemberTypeInfo[] info = new MemberTypeInfo[memberInfo.Length]; - - for (int i = 0; i < memberNames.Count; i++) - { - // FormatterServices never returns anything other than FieldInfo. - FieldInfo? field = (FieldInfo?)memberInfo.FirstOrDefault(m => m.Name == memberNames[i]) - ?? throw new SerializationException($"Could not find member '{memberNames[i]}' on type '{classInfo.Name}'."); - - BinaryType binaryType = TypeInfo.GetBinaryType(field.FieldType); - - info[i] = new(binaryType, binaryType switch - { - BinaryType.PrimitiveArray => TypeInfo.GetPrimitiveArrayType(field.FieldType), - BinaryType.Primitive => TypeInfo.GetPrimitiveType(field.FieldType), - BinaryType.SystemClass => field.FieldType, - BinaryType.Class => field.FieldType, - _ => null - }); - } - - return info; - } - private string DebuggerDisplay => Info switch { null => Type.ToString()!, diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MessageEnd.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MessageEnd.cs index 99dd000badd..05e28d88af1 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MessageEnd.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/MessageEnd.cs @@ -6,7 +6,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// Record that marks the end of the binary format stream. /// -internal sealed class MessageEnd : IRecord, IBinaryFormatParseable +internal sealed class MessageEnd : IRecord { public static MessageEnd Instance { get; } = new(); @@ -14,8 +14,5 @@ private MessageEnd() { } public static RecordType RecordType => RecordType.MessageEnd; - static MessageEnd IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) => Instance; - internal static void Write(BinaryWriter writer) => writer.Write((byte)RecordType); } diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple.cs index 6380df4d5cf..69eb0130382 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple.cs @@ -17,17 +17,12 @@ internal abstract partial class NullRecord /// internal sealed class ObjectNullMultiple : NullRecord, - IRecord, - IBinaryFormatParseable + IRecord { public static RecordType RecordType => RecordType.ObjectNullMultiple; public ObjectNullMultiple(Count count) => NullCount = count; - static ObjectNullMultiple IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - => new(state.Reader.ReadInt32()); - public void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple256.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple256.cs index 655c43ca3d3..6229ec47a39 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple256.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/NullRecord.ObjectNullMultiple256.cs @@ -17,16 +17,12 @@ internal abstract partial class NullRecord /// internal sealed class ObjectNullMultiple256 : NullRecord, - IRecord, - IBinaryFormatParseable + IRecord { public static RecordType RecordType => RecordType.ObjectNullMultiple256; public ObjectNullMultiple256(Count count) => NullCount = count; - static ObjectNullMultiple256 IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) => new(state.Reader.ReadByte()); - public void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ObjectNull.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ObjectNull.cs index 6d245eaba7c..f1269dbad19 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ObjectNull.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/ObjectNull.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class ObjectNull : NullRecord, IRecord, IBinaryFormatParseable +internal sealed class ObjectNull : NullRecord, IRecord { public static ObjectNull Instance { get; } = new(); @@ -23,9 +23,6 @@ private ObjectNull() { } public static RecordType RecordType => RecordType.ObjectNull; - static ObjectNull IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) => Instance; - internal static void Write(BinaryWriter writer) => writer.Write((byte)RecordType); public override bool Equals(object? obj) => obj is ObjectNull; diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Record.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Record.cs index 5c8e0028910..79ff06237d3 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Record.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Record.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; -using System.Runtime.Serialization; namespace System.Private.Windows.Core.BinaryFormat; @@ -18,30 +17,6 @@ private protected Record() { } private protected virtual Id Id => Id.Null; - /// - /// Reads a primitive of from the given . - /// - private protected static object ReadPrimitiveType(BinaryReader reader, PrimitiveType primitiveType) => primitiveType switch - { - PrimitiveType.Boolean => reader.ReadBoolean(), - PrimitiveType.Byte => reader.ReadByte(), - PrimitiveType.SByte => reader.ReadSByte(), - PrimitiveType.Char => reader.ReadChar(), - PrimitiveType.Int16 => reader.ReadInt16(), - PrimitiveType.UInt16 => reader.ReadUInt16(), - PrimitiveType.Int32 => reader.ReadInt32(), - PrimitiveType.UInt32 => reader.ReadUInt32(), - PrimitiveType.Int64 => reader.ReadInt64(), - PrimitiveType.UInt64 => reader.ReadUInt64(), - PrimitiveType.Single => reader.ReadSingle(), - PrimitiveType.Double => reader.ReadDouble(), - PrimitiveType.Decimal => decimal.Parse(reader.ReadString(), CultureInfo.InvariantCulture), - PrimitiveType.DateTime => reader.ReadDateTime(), - PrimitiveType.TimeSpan => new TimeSpan(reader.ReadInt64()), - // String is handled with a record, never on it's own - _ => throw new SerializationException($"Failure trying to read primitive '{primitiveType}'"), - }; - /// /// Writes as to the given . /// @@ -102,90 +77,6 @@ private protected static unsafe void WritePrimitiveType(BinaryWriter writer, Pri } } - /// - /// Reads the next record. - /// - /// Found a multidimensional array. - /// Found a remote method invocation record. - /// Unknown or corrupted data. - internal static IRecord ReadBinaryFormatRecord(BinaryFormattedObject.IParseState state) - { - RecordType recordType = (RecordType)state.Reader.ReadByte(); - - IRecord record = recordType switch - { - RecordType.SerializedStreamHeader => ReadSpecificRecord(state), - RecordType.ClassWithId => ReadSpecificRecord(state), - RecordType.SystemClassWithMembers => ReadSpecificRecord(state), - RecordType.ClassWithMembers => ReadSpecificRecord(state), - RecordType.SystemClassWithMembersAndTypes => ReadSpecificRecord(state), - RecordType.ClassWithMembersAndTypes => ReadSpecificRecord(state), - RecordType.BinaryObjectString => ReadSpecificRecord(state), - RecordType.BinaryArray => BinaryArray.Parse(state), - RecordType.MemberPrimitiveTyped => ReadSpecificRecord(state), - RecordType.MemberReference => ReadSpecificRecord(state), - RecordType.ObjectNull => ReadSpecificRecord(state), - RecordType.MessageEnd => ReadSpecificRecord(state), - RecordType.BinaryLibrary => ReadSpecificRecord(state), - RecordType.ObjectNullMultiple256 => ReadSpecificRecord(state), - RecordType.ObjectNullMultiple => ReadSpecificRecord(state), - RecordType.ArraySinglePrimitive => ReadArraySinglePrimitive(state), - RecordType.ArraySingleObject => ReadSpecificRecord(state), - RecordType.ArraySingleString => ReadSpecificRecord(state), - // RecordType.MethodCall => throw new NotSupportedException(), - // RecordType.MethodReturn => throw new NotSupportedException(), - _ => throw new SerializationException("Invalid record type."), - }; - - // BinaryLibrary records can be dumped in front of most records, add them and continue. - if (record is BinaryLibrary library) - { - do - { - state.RecordMap.AddRecord(library); - record = ReadBinaryFormatRecord(state); - } - while (record is BinaryLibrary); - - return record; - } - - state.RecordMap.AddRecord(record); - return record; - - static IRecord ReadArraySinglePrimitive(BinaryFormattedObject.IParseState state) - { - // Special casing to avoid excessive boxing/unboxing. - Id id = ArrayInfo.Parse(state.Reader, out Count length); - PrimitiveType primitiveType = (PrimitiveType)state.Reader.ReadByte(); - - IRecord record = primitiveType switch - { - PrimitiveType.Boolean => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Byte => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.SByte => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Char => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Int16 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.UInt16 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Int32 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.UInt32 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Int64 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.UInt64 => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Single => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Double => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.Decimal => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.DateTime => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - PrimitiveType.TimeSpan => new ArraySinglePrimitive(id, state.Reader.ReadPrimitiveArray(length)), - _ => throw new SerializationException($"Invalid primitive type '{primitiveType}'"), - }; - - return record; - } - - static TRecord ReadSpecificRecord(BinaryFormattedObject.IParseState state) - where TRecord : class, IRecord, IBinaryFormatParseable => TRecord.Parse(state); - } - /// /// Writes records, coalescing null records into single entries. /// @@ -231,39 +122,6 @@ private protected static void WriteRecords(BinaryWriter writer, IReadOnlyList - /// Reads an object member value of . - /// - private protected static object ReadValue( - BinaryFormattedObject.IParseState state, - MemberTypeInfo memberType) - { - if (memberType.Type == BinaryType.Primitive) - { - return ReadPrimitiveType(state.Reader, (PrimitiveType)memberType.Info!); - } - - if (memberType.Type == BinaryType.String) - { - IRecord stringRecord = ReadBinaryFormatRecord(state); - - return stringRecord is not (BinaryObjectString or ObjectNull or MemberReference) - ? throw new SerializationException($"Expected string record, found {stringRecord.GetType().Name}") - : (object)stringRecord; - } - - return memberType.Type switch - { - BinaryType.Object - or BinaryType.StringArray - or BinaryType.PrimitiveArray - or BinaryType.Class - or BinaryType.SystemClass - or BinaryType.ObjectArray => ReadBinaryFormatRecord(state), - _ => throw new SerializationException($"Invalid binary type {memberType.Type}."), - }; - } - private protected abstract void Write(BinaryWriter writer); void IWritableRecord.Write(BinaryWriter writer) => Write(writer); } diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SerializationHeader.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SerializationHeader.cs index 0ae0a42020d..855efd165bc 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SerializationHeader.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SerializationHeader.cs @@ -13,7 +13,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// /// /// -internal sealed class SerializationHeader : IRecord, IBinaryFormatParseable +internal sealed class SerializationHeader : IRecord { /// /// The id of the root object record. @@ -44,15 +44,6 @@ internal sealed class SerializationHeader : IRecord, IBinar HeaderId = -1, }; - static SerializationHeader IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) => new() - { - RootId = state.Reader.ReadInt32(), - HeaderId = state.Reader.ReadInt32(), - MajorVersion = state.Reader.ReadInt32(), - MinorVersion = state.Reader.ReadInt32() - }; - public void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationEvents.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationEvents.cs deleted file mode 100644 index 3b919e82d16..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationEvents.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Concurrent; -using System.Reflection; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat; - -internal sealed class SerializationEvents -{ - private static readonly ConcurrentDictionary s_cache = new(); - - private static readonly SerializationEvents s_noEvents = new(); - - private readonly List? _onDeserializingMethods; - private readonly List? _onDeserializedMethods; - - private SerializationEvents() { } - - private SerializationEvents( - List? onDeserializingMethods, - List? onDeserializedMethods) - { - _onDeserializingMethods = onDeserializingMethods; - _onDeserializedMethods = onDeserializedMethods; - } - - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:UnrecognizedReflectionPattern", - Justification = "The Type is annotated correctly, it just can't pass through the lambda method.")] - private static SerializationEvents GetSerializationEventsForType( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t) => - s_cache.GetOrAdd(t, CreateSerializationEvents); - - private static SerializationEvents CreateSerializationEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) - { - List? onDeserializingMethods = GetMethodsWithAttribute(typeof(OnDeserializingAttribute), type); - List? onDeserializedMethods = GetMethodsWithAttribute(typeof(OnDeserializedAttribute), type); - - return onDeserializingMethods is null && onDeserializedMethods is null - ? s_noEvents - : new SerializationEvents(onDeserializingMethods, onDeserializedMethods); - } - - private static List? GetMethodsWithAttribute( - Type attribute, - // Currently the only way to preserve base, non-public methods is to use All - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? type) - { - List? attributedMethods = null; - - // Traverse the hierarchy to find all methods with the specified attribute. - Type? baseType = type; - while (baseType is not null && baseType != typeof(object)) - { - MethodInfo[] methods = baseType.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - foreach (MethodInfo method in methods) - { - if (method.IsDefined(attribute, inherit: false)) - { - attributedMethods ??= []; - attributedMethods.Add(method); - } - } - - baseType = baseType.BaseType; - } - - // We should invoke the methods starting from base. - attributedMethods?.Reverse(); - - return attributedMethods; - } - - internal static Action? GetOnDeserializingForType( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - object obj) => - GetSerializationEventsForType(type).GetOnDeserializing(obj); - - internal static Action? GetOnDeserializedForType( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - object obj) => - GetSerializationEventsForType(type).GetOnDeserialized(obj); - - private Action? GetOnDeserialized(object obj) => - AddOnDelegate(obj, _onDeserializedMethods); - - private Action? GetOnDeserializing(object obj) => - AddOnDelegate(obj, _onDeserializingMethods); - - /// Add all methods to a delegate. - private static Action? AddOnDelegate(object obj, List? methods) - { - Action? handler = null; - - if (methods is not null) - { - foreach (MethodInfo method in methods) - { - Action onDeserialized = method.CreateDelegate>(obj); - handler += onDeserialized; - } - } - - return handler; - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationExtensions.cs index 2ae9a056e13..873d52b206c 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationExtensions.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationExtensions.cs @@ -1,9 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Runtime.InteropServices; using System.Runtime.Serialization; namespace System.Private.Windows.Core.BinaryFormat; @@ -14,78 +11,4 @@ internal static class SerializationExtensions /// Get a typed value. Hard casts. /// public static T? GetValue(this SerializationInfo info, string name) => (T?)info.GetValue(name, typeof(T)); - - /// - /// Converts the given exception to a if needed, nesting the original exception - /// and assigning the original stack trace. - /// - public static SerializationException ConvertToSerializationException(this Exception ex) - => ex is SerializationException serializationException - ? serializationException - : (SerializationException)ExceptionDispatchInfo.SetRemoteStackTrace( - new SerializationException(ex.Message, ex), - ex.StackTrace ?? string.Empty); - - /// - /// Gets a span over any array, including multi-dimensional arrays. - /// - public static Span GetArrayData(this Array array) - { - if (array.GetType().UnderlyingSystemType.IsAssignableFrom(typeof(T))) - { - throw new InvalidCastException($"Cannot cast array of type {array.GetType().UnderlyingSystemType} to {typeof(T)}."); - } - - Span data = MemoryMarshal.CreateSpan(ref Unsafe.As( - ref MemoryMarshal.GetArrayDataReference(array)), - checked((int)array.LongLength)); - - return data; - } - - /// - /// Sets a value in an array by its flattened index. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void SetArrayValueByFlattenedIndex(this Array array, object? value, int flattenedIndex) - { - // Fast path - int ranks = array.Rank; - if (ranks == 1) - { - array.SetValue(value, flattenedIndex); - return; - } - - SetArrayValueByFlattenedIndex(array, flattenedIndex, value); - - static void SetArrayValueByFlattenedIndex(Array array, int flattenedIndex, object? value) - { - int ranks = array.Rank; - - if (ranks == 2) - { - int length = array.GetLength(1); - (int index1, int index2) = int.DivRem(flattenedIndex, length); - array.SetValue(value, index1, index2); - return; - } - - Span rankProducts = stackalloc int[ranks]; - rankProducts[ranks - 1] = 1; - for (int i = ranks - 2; i >= 0; i--) - { - rankProducts[i] = array.GetLength(i + 1) * rankProducts[i + 1]; - } - - Span indices = stackalloc int[ranks]; - for (int i = 0; i < ranks; i++) - { - indices[i] = flattenedIndex / rankProducts[i]; - flattenedIndex -= indices[i] * rankProducts[i]; - } - - array.SetValue(value, indices.ToArray()); - } - } } diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationInfoExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationInfoExtensions.cs deleted file mode 100644 index dbe71b7698b..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/SerializationInfoExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.Serialization; - -namespace System.Private.Windows.Core.BinaryFormat; - -internal static class SerializationInfoExtensions -{ - private static readonly Action s_updateValue = - typeof(SerializationInfo) - .GetMethod("UpdateValue", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)! - .CreateDelegate>(); - - [DynamicDependency(DynamicallyAccessedMemberTypes.NonPublicMethods, typeof(SerializationInfo))] - internal static void UpdateValue(this SerializationInfo si, string name, object value, Type type) => - s_updateValue(si, name, value, type); -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/TypeInfo.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/TypeInfo.cs index 5394cb72c10..0bcb7b09e7d 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/TypeInfo.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/Support/TypeInfo.cs @@ -44,30 +44,6 @@ public const string SystemDrawingAssemblyName internal static Assembly CorelibAssembly { get; } = typeof(string).Assembly; internal static string CorelibAssemblyString { get; } = CorelibAssembly.FullName!; - /// - /// Returns the for the given . - /// - internal static PrimitiveType GetPrimitiveType(ReadOnlySpan typeName) => typeName switch - { - BooleanType => PrimitiveType.Boolean, - CharType => PrimitiveType.Char, - SByteType => PrimitiveType.SByte, - ByteType => PrimitiveType.Byte, - Int16Type => PrimitiveType.Int16, - UInt16Type => PrimitiveType.UInt16, - Int32Type => PrimitiveType.Int32, - UInt32Type => PrimitiveType.UInt32, - Int64Type => PrimitiveType.Int64, - UInt64Type => PrimitiveType.UInt64, - SingleType => PrimitiveType.Single, - DoubleType => PrimitiveType.Double, - DecimalType => PrimitiveType.Decimal, - DateTimeType => PrimitiveType.DateTime, - StringType => PrimitiveType.String, - TimeSpanType => PrimitiveType.TimeSpan, - _ => default, - }; - /// /// Returns the for the given . /// @@ -139,52 +115,4 @@ internal static BinaryType GetBinaryType(Type type) return BinaryType.Primitive; } } - - /// - /// Returns the for the given . - /// - internal static Type GetPrimitiveTypeType(this PrimitiveType primitiveType) => primitiveType switch - { - PrimitiveType.Boolean => typeof(bool), - PrimitiveType.Char => typeof(char), - PrimitiveType.SByte => typeof(sbyte), - PrimitiveType.Byte => typeof(byte), - PrimitiveType.Int16 => typeof(short), - PrimitiveType.UInt16 => typeof(ushort), - PrimitiveType.Int32 => typeof(int), - PrimitiveType.UInt32 => typeof(uint), - PrimitiveType.Int64 => typeof(long), - PrimitiveType.UInt64 => typeof(ulong), - PrimitiveType.Single => typeof(float), - PrimitiveType.Double => typeof(double), - PrimitiveType.Decimal => typeof(decimal), - PrimitiveType.DateTime => typeof(DateTime), - PrimitiveType.String => typeof(string), - PrimitiveType.TimeSpan => typeof(TimeSpan), - _ => throw new NotSupportedException(), - }; - - /// - /// Returns the for the given . - /// - internal static Type GetArrayPrimitiveTypeType(this PrimitiveType primitiveType) => primitiveType switch - { - PrimitiveType.Boolean => typeof(bool[]), - PrimitiveType.Char => typeof(char[]), - PrimitiveType.SByte => typeof(sbyte[]), - PrimitiveType.Byte => typeof(byte[]), - PrimitiveType.Int16 => typeof(short[]), - PrimitiveType.UInt16 => typeof(ushort[]), - PrimitiveType.Int32 => typeof(int[]), - PrimitiveType.UInt32 => typeof(uint[]), - PrimitiveType.Int64 => typeof(long[]), - PrimitiveType.UInt64 => typeof(ulong[]), - PrimitiveType.Single => typeof(float[]), - PrimitiveType.Double => typeof(double[]), - PrimitiveType.Decimal => typeof(decimal[]), - PrimitiveType.DateTime => typeof(DateTime[]), - PrimitiveType.String => typeof(string[]), - PrimitiveType.TimeSpan => typeof(TimeSpan[]), - _ => throw new NotSupportedException(), - }; } diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembers.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembers.cs deleted file mode 100644 index 6da1dbd469b..00000000000 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembers.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Private.Windows.Core.BinaryFormat; - -/// -/// System class information. -/// -/// -/// -/// -/// [MS-NRBF] 2.3.2.4 -/// -/// -/// -internal sealed class SystemClassWithMembers : ClassRecord, IRecord, IBinaryFormatParseable -{ - private SystemClassWithMembers(ClassInfo classInfo, IReadOnlyList memberTypeInfo, IReadOnlyList memberValues) - : base(classInfo, memberTypeInfo, memberValues) { } - - public static RecordType RecordType => RecordType.SystemClassWithMembers; - - static SystemClassWithMembers IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - ClassInfo classInfo = ClassInfo.Parse(state.Reader, out _); - IReadOnlyList memberTypeInfo = BinaryFormat.MemberTypeInfo.CreateFromClassInfoAndLibrary(state, classInfo, Id.Null); - return new( - classInfo, - memberTypeInfo, - ReadObjectMemberValues(state, memberTypeInfo)); - } - - private protected override void Write(BinaryWriter writer) - { - // Really shouldn't be writing this record type. It isn't as safe as the typed variant - // and saves very little space. - throw new NotSupportedException(); - } -} diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembersAndTypes.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembersAndTypes.cs index 308c2608068..3207f1f616d 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembersAndTypes.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/BinaryFormat/SystemClassWithMembersAndTypes.cs @@ -15,8 +15,7 @@ namespace System.Private.Windows.Core.BinaryFormat; /// internal sealed class SystemClassWithMembersAndTypes : ClassRecord, - IRecord, - IBinaryFormatParseable + IRecord { public SystemClassWithMembersAndTypes( ClassInfo classInfo, @@ -36,18 +35,6 @@ public SystemClassWithMembersAndTypes( public static RecordType RecordType => RecordType.SystemClassWithMembersAndTypes; - static SystemClassWithMembersAndTypes IBinaryFormatParseable.Parse( - BinaryFormattedObject.IParseState state) - { - ClassInfo classInfo = ClassInfo.Parse(state.Reader, out Count memberCount); - IReadOnlyList memberTypeInfo = BinaryFormat.MemberTypeInfo.Parse(state.Reader, memberCount); - - return new( - classInfo, - memberTypeInfo, - ReadObjectMemberValues(state, memberTypeInfo)); - } - private protected override void Write(BinaryWriter writer) { writer.Write((byte)RecordType); diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs new file mode 100644 index 00000000000..53615e269b2 --- /dev/null +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs @@ -0,0 +1,374 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.Drawing; +using System.Formats.Nrbf; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Runtime.Serialization; + +namespace System.Windows.Forms.Nrbf; + +internal static class SerializationRecordExtensions +{ + /// + /// Converts the given exception to a if needed, nesting the original exception + /// and assigning the original stack trace. + /// + private static SerializationException ConvertToSerializationException(this Exception ex) + => ex is SerializationException serializationException + ? serializationException + : (SerializationException)ExceptionDispatchInfo.SetRemoteStackTrace( + new SerializationException(ex.Message, ex), + ex.StackTrace ?? string.Empty); + + internal static SerializationRecord Decode(this Stream stream) + { + try + { + return NrbfDecoder.Decode(stream, leaveOpen: true); + } + catch (Exception ex) when(ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) + { + // Make the exception easier to catch, but retain the original stack trace. + throw ex.ConvertToSerializationException(); + } + catch (TargetInvocationException ex) + { + throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException(); + } + } + + internal delegate bool TryGetDelegate(SerializationRecord record, [NotNullWhen(true)] out object? value); + + internal static bool TryGet(TryGetDelegate get, SerializationRecord record, [NotNullWhen(true)] out object? value) + { + try + { + return get(record, out value); + } + catch (Exception ex) when (ex is KeyNotFoundException or InvalidCastException) + { + // This should only really happen with corrupted data. + Debug.Fail(ex.Message); + value = default; + return false; + } + } + + /// + /// Tries to get this object as a . + /// + public static bool TryGetPointF(this SerializationRecord record, [NotNullWhen(true)] out object? value) + { + return TryGet(Get, record, out value); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? value) + { + value = default; + + if (record is not ClassRecord classInfo + || !classInfo.TypeNameMatches(typeof(PointF)) + || !classInfo.HasMember("x") + || !classInfo.HasMember("y")) + { + return false; + } + + value = new PointF(classInfo.GetSingle("x"), classInfo.GetSingle("y")); + + return true; + } + } + + /// + /// Tries to get this object as a . + /// + public static bool TryGetRectangleF(this SerializationRecord record, [NotNullWhen(true)] out object? value) + { + return TryGet(Get, record, out value); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? value) + { + value = default; + + if (record is not ClassRecord classInfo + || !classInfo.TypeNameMatches(typeof(RectangleF)) + || !classInfo.HasMember("x") + || !classInfo.HasMember("y") + || !classInfo.HasMember("width") + || !classInfo.HasMember("height")) + { + return false; + } + + value = new RectangleF( + classInfo.GetSingle("x"), + classInfo.GetSingle("y"), + classInfo.GetSingle("width"), + classInfo.GetSingle("height")); + + return true; + } + } + + /// + /// Tries to get this object as a primitive type or string. + /// + /// if this represented a primitive type or string. + public static bool TryGetPrimitiveType(this SerializationRecord record, [NotNullWhen(true)] out object? value) + { + return TryGet(Get, record, out value); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? value) + { + if (record.RecordType is SerializationRecordType.BinaryObjectString) + { + value = ((PrimitiveTypeRecord)record).Value; + return true; + } + else if (record.RecordType is SerializationRecordType.MemberPrimitiveTyped) + { + value = GetMemberPrimitiveTypedValue(record); + return true; + } + + value = null; + return false; + } + } + + internal static object GetMemberPrimitiveTypedValue(this SerializationRecord record) + { + Debug.Assert(record.RecordType is SerializationRecordType.MemberPrimitiveTyped); + return ((PrimitiveTypeRecord)record).Value; + } + + /// + /// Tries to get this object as a of . + /// + public static bool TryGetPrimitiveList(this SerializationRecord record, [NotNullWhen(true)] out object? list) + { + return TryGet(Get, record, out list); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? list) + { + list = null; + + if (record is not ClassRecord classInfo + || !classInfo.HasMember("_items") + || !classInfo.HasMember("_size") + || classInfo.GetRawValue("_size") is not int size + || !classInfo.TypeName.IsConstructedGenericType + || classInfo.TypeName.GetGenericTypeDefinition().Name != typeof(List<>).Name + || classInfo.TypeName.GetGenericArguments().Length != 1 + || classInfo.GetRawValue("_items") is not ArrayRecord arrayRecord + || !IsPrimitiveArrayRecord(arrayRecord)) + { + return false; + } + + // BinaryFormatter serializes the entire backing array, so we need to trim it down to the size of the list. + list = arrayRecord switch + { + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + SZArrayRecord ar => ar.GetArray().CreateTrimmedList(size), + _ => throw new InvalidOperationException() + }; + + return true; + } + } + + /// + /// Tries to get this object as a of values. + /// + public static bool TryGetPrimitiveArrayList(this SerializationRecord record, [NotNullWhen(true)] out object? value) + { + return TryGet(Get, record, out value); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? value) + { + value = null; + + if (record is not ClassRecord classInfo + || !classInfo.TypeNameMatches(typeof(ArrayList)) + || !classInfo.HasMember("_items") + || !classInfo.HasMember("_size") + || classInfo.GetRawValue("_size") is not int size + || classInfo.GetRawValue("_items") is not SZArrayRecord arrayRecord + || size > arrayRecord.Length) + { + return false; + } + + ArrayList arrayList = new(size); + object?[] array = arrayRecord.GetArray(); + for (int i = 0; i < size; i++) + { + if (array[i] is SerializationRecord) + { + return false; + } + + arrayList.Add(array[i]); + } + + value = arrayList; + return true; + } + } + + /// + /// Tries to get this object as an of primitive types. + /// + public static bool TryGetPrimitiveArray(this SerializationRecord record, [NotNullWhen(true)] out object? value) + { + return TryGet(Get, record, out value); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? value) + { + if (!IsPrimitiveArrayRecord(record)) + { + value = null; + return false; + } + + value = record switch + { + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + SZArrayRecord ar => ar.GetArray(), + _ => throw new InvalidOperationException() + }; + + return value is not null; + } + } + + /// + /// Tries to get this object as a binary formatted of keys and values. + /// + public static bool TryGetPrimitiveHashtable(this SerializationRecord record, [NotNullWhen(true)] out Hashtable? hashtable) + { + bool success = record.TryGetPrimitiveHashtable(out object? value); + hashtable = (Hashtable?)value; + return success; + } + + /// + /// Tries to get this object as a binary formatted of keys and values. + /// + public static bool TryGetPrimitiveHashtable(this SerializationRecord record, [NotNullWhen(true)] out object? hashtable) + { + return TryGet(Get, record, out hashtable); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? hashtable) + { + hashtable = null; + + if (record.RecordType != SerializationRecordType.SystemClassWithMembersAndTypes + || record is not ClassRecord classInfo + || !classInfo.TypeNameMatches(typeof(Hashtable)) + || !classInfo.HasMember("Keys") + || !classInfo.HasMember("Values") + // Note that hashtables with custom comparers and/or hash code providers will have non null Comparer + || classInfo.GetSerializationRecord("Comparer") is not null + || classInfo.GetSerializationRecord("Keys") is not SZArrayRecord keysRecord + || classInfo.GetSerializationRecord("Values") is not SZArrayRecord valuesRecord + || keysRecord.Length != valuesRecord.Length) + { + return false; + } + + Hashtable temp = new(keysRecord.Length); + object?[] keys = keysRecord.GetArray(); + object?[] values = valuesRecord.GetArray(); + for (int i = 0; i < keys.Length; i++) + { + object? key = keys[i]; + object? value = values[i]; + + if (key is null or SerializationRecord || value is SerializationRecord) + { + return false; + } + + temp[key] = value; + } + + hashtable = temp; + return true; + } + } + + /// + /// Tries to get this object as a binary formatted . + /// + public static bool TryGetNotSupportedException( + this SerializationRecord record, + out object? exception) + { + return TryGet(Get, record, out exception); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? exception) + { + exception = null; + + if (record is not ClassRecord classInfo + || !classInfo.TypeNameMatches(typeof(NotSupportedException))) + { + return false; + } + + exception = new NotSupportedException(classInfo.GetString("Message")); + return true; + } + } + + /// + /// Try to get a supported .NET type object (not WinForms). + /// + public static bool TryGetFrameworkObject( + this SerializationRecord record, + [NotNullWhen(true)] out object? value) + => record.TryGetPrimitiveType(out value) + || record.TryGetPrimitiveList(out value) + || record.TryGetPrimitiveArray(out value) + || record.TryGetPrimitiveArrayList(out value) + || record.TryGetPrimitiveHashtable(out value) + || record.TryGetRectangleF(out value) + || record.TryGetPointF(out value) + || record.TryGetNotSupportedException(out value); + + private static bool IsPrimitiveArrayRecord(SerializationRecord serializationRecord) + => serializationRecord.RecordType is SerializationRecordType.ArraySingleString or SerializationRecordType.ArraySinglePrimitive; +} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ArrayTests.cs deleted file mode 100644 index c026f6c4003..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ArrayTests.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.Common; - -public abstract class ArrayTests : SerializationTest where T : ISerializer -{ - [Fact] - public virtual void Roundtrip_ArrayContainingArrayAtNonZeroLowerBound() - { - // Not supported by BinaryFormattedObject - RoundTrip(Array.CreateInstance(typeof(uint[]), [5], [1])); - } - - [Fact] - public void ArraySerializableValueType() - { - nint[] nints = [42, 43, 44]; - object deserialized = Deserialize(Serialize(nints)); - deserialized.Should().BeEquivalentTo(nints); - } - - [Fact] - public void SameObjectRepeatedInArray() - { - object o = new(); - object[] arr = [o, o, o, o, o]; - object[] result = (object[])Deserialize(Serialize(arr)); - - Assert.Equal(arr.Length, result.Length); - Assert.NotSame(arr, result); - Assert.NotSame(arr[0], result[0]); - for (int i = 1; i < result.Length; i++) - { - Assert.Same(result[0], result[i]); - } - } - - [Theory] - [InlineData(-1, (byte)RecordType.ArraySingleObject)] - [InlineData(int.MinValue, (byte)RecordType.ArraySingleObject)] - [InlineData(-1, (byte)RecordType.ArraySinglePrimitive)] - [InlineData(int.MinValue, (byte)RecordType.ArraySinglePrimitive)] - [InlineData(-1, (byte)RecordType.ArraySingleString)] - [InlineData(int.MinValue, (byte)RecordType.ArraySingleString)] - public void NegativeLength(int length, byte recordType) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write(recordType); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(length); - } - - stream.Position = 0; - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Theory] - [InlineData(-1, (byte)BinaryArrayType.Single)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Single)] - [InlineData(-1, (byte)BinaryArrayType.Rectangular)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Rectangular)] - [InlineData(-1, (byte)BinaryArrayType.Jagged)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Jagged)] - public void BinaryArray_NegativeLength(int length, byte arrayType) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.BinaryArray); - - // Id - scope.Writer.Write(1); - scope.Writer.Write(arrayType); - - // Rank - scope.Writer.Write(1); - - // Length - scope.Writer.Write(length); - } - - stream.Position = 0; - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Theory] - [InlineData(0, (byte)BinaryArrayType.Single)] - [InlineData(0, (byte)BinaryArrayType.Rectangular)] - [InlineData(0, (byte)BinaryArrayType.Jagged)] - [InlineData(-1, (byte)BinaryArrayType.Single)] - [InlineData(-1, (byte)BinaryArrayType.Rectangular)] - [InlineData(-1, (byte)BinaryArrayType.Jagged)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Single)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Rectangular)] - [InlineData(int.MinValue, (byte)BinaryArrayType.Jagged)] - [InlineData(33, (byte)BinaryArrayType.Rectangular)] - public void BinaryArray_InvalidRank(int rank, byte arrayType) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.BinaryArray); - - // Id - scope.Writer.Write(1); - scope.Writer.Write(arrayType); - - // Rank - scope.Writer.Write(rank); - - // Lengths - int lengths = rank > 0 ? rank : 1; - for (int i = 0; i < lengths; i++) - { - scope.Writer.Write(0); - } - - scope.Writer.Write((byte)BinaryType.Object); - } - - stream.Position = 0; - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Theory] - [InlineData(2, (byte)BinaryArrayType.Single)] - [InlineData(2, (byte)BinaryArrayType.Jagged)] - public virtual void BinaryArray_InvalidRank_Positive(int rank, byte arrayType) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.BinaryArray); - - // Id - scope.Writer.Write(1); - scope.Writer.Write(arrayType); - - // Rank - scope.Writer.Write(rank); - - // Lengths - int lengths = rank > 0 ? rank : 1; - for (int i = 0; i < lengths; i++) - { - scope.Writer.Write(0); - } - - scope.Writer.Write((byte)BinaryType.Object); - } - - // BinaryFormatter doesn't reject these outright. - stream.Position = 0; - Deserialize(stream); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/BasicObjectTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/BasicObjectTests.cs deleted file mode 100644 index bbb5cec034c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/BasicObjectTests.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization.Formatters; -using BinaryFormatTests; -using BinaryFormatTests.FormatterTests; - -namespace FormatTests.Common; - -public abstract class BasicObjectTests : SerializationTest where T : ISerializer -{ - private protected abstract bool SkipOffsetArrays { get; } - - [Theory] - [MemberData(nameof(SerializableObjects))] - public void DeserializeStoredObjects(object value, TypeSerializableValue[] serializedData) - { - _ = value; - - int platformIndex = serializedData.GetPlatformIndex(); - for (int i = 0; i < serializedData.Length; i++) - for (FormatterAssemblyStyle assemblyMatching = 0; assemblyMatching <= FormatterAssemblyStyle.Full; assemblyMatching++) - { - object deserialized = DeserializeFromBase64Chars(serializedData[i].Base64Blob, assemblyMatching: assemblyMatching); - - if (deserialized is StringComparer) - { - // StringComparer derived classes are not public and they don't serialize the actual type. - value.Should().BeAssignableTo(); - } - else - { - deserialized.Should().BeOfType(value.GetType()); - } - - bool isSamePlatform = i == platformIndex; - EqualityExtensions.CheckEquals(value, deserialized, isSamePlatform); - } - } - - [Theory] - [MemberData(nameof(BasicObjectsRoundtrip_MemberData))] - public void BasicObjectsRoundtrip( - object value, - FormatterAssemblyStyle assemblyMatching, - FormatterTypeStyle typeStyle) - { - object deserialized = RoundTrip(value, typeStyle: typeStyle, assemblyMatching: assemblyMatching); - - // string.Empty and DBNull are both singletons - if (!ReferenceEquals(value, string.Empty) - && value is not DBNull - && value is Array array - && array.Length > 0) - { - deserialized.Should().NotBeSameAs(value); - } - - EqualityExtensions.CheckEquals(value, deserialized, isSamePlatform: true); - } - - public static EnumerableTupleTheoryData SerializableObjects() - { - // Can add a .Skip() to get to the failing scenario easier when debugging. - return new(( - // Explicitly not supporting offset arrays - from value in BinaryFormatterTests.RawSerializableObjects() - where value.Item1 is not Array array || array.GetLowerBound(0) == 0 - select value).ToArray()); - } - - public static EnumerableTupleTheoryData BasicObjectsRoundtrip_MemberData() - { - return new(( - // Explicitly not supporting offset arrays - from value in BinaryFormatterTests.RawSerializableObjects() - from FormatterAssemblyStyle assemblyFormat in new[] { FormatterAssemblyStyle.Full, FormatterAssemblyStyle.Simple } - from FormatterTypeStyle typeFormat in new[] { FormatterTypeStyle.TypesAlways, FormatterTypeStyle.TypesWhenNeeded, FormatterTypeStyle.XsdString } - where value.Item1 is not Array array || array.GetLowerBound(0) == 0 - select (value.Item1, assemblyFormat, typeFormat)).ToArray()); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ComparerTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ComparerTests.cs deleted file mode 100644 index bb223dc9a88..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ComparerTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using static BinaryFormatTests.FormatterTests.BinaryFormatterTests; - -namespace FormatTests.Common; - -public abstract class ComparerTests : SerializationTest where T : ISerializer -{ - public static TheoryData NullableComparersTestData => new() - { - { "NullableEqualityComparer`1", EqualityComparer.Default }, - { "NullableEqualityComparer`1", EqualityComparer.Default }, - { "NullableEqualityComparer`1", EqualityComparer.Default }, - { "NullableEqualityComparer`1", EqualityComparer.Default }, // implements IEquatable<> - { "ObjectEqualityComparer`1", EqualityComparer.Default }, // doesn't implement IEquatable<> - { "ObjectEqualityComparer`1", EqualityComparer.Default }, - { "NullableComparer`1", Comparer.Default }, - { "NullableComparer`1", Comparer.Default }, - { "NullableComparer`1", Comparer.Default }, - { "NullableComparer`1", Comparer.Default }, - { "ObjectComparer`1", Comparer.Default }, - { "ObjectComparer`1", Comparer.Default } - }; - - [Theory] - [MemberData(nameof(NullableComparersTestData))] - public void NullableComparers_Roundtrip(string expectedType, object obj) - { - object roundTrip = RoundTrip(obj); - roundTrip.GetType().Name.Should().Be(expectedType); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CorruptedTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CorruptedTests.cs deleted file mode 100644 index d5ee54aec22..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CorruptedTests.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using FormatTests.Common.TestTypes; -using System.Runtime.Serialization; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.Common; - -public abstract class CorruptedTests : SerializationTest where T : ISerializer -{ - [Fact] - public void ValueTypeReferencesSelf() - { - MemoryStream stream = new(); - - using (BinaryFormatWriterScope writer = new(stream)) - { - new BinaryLibrary(2, typeof(NodeStruct).Assembly.FullName!).Write(writer); - - new ClassWithMembersAndTypes( - new ClassInfo(1, typeof(NodeStruct).FullName!, ["Node"]), - 2, - new MemberTypeInfo[] - { - new(BinaryType.Class, new ClassTypeInfo(typeof(NodeWithNodeStruct).FullName!, 2)) - }, - new MemberReference(1)).Write(writer); - } - - stream.Position = 0; - - // This fails in the SerializationConstructor in BinaryFormattedObject's deserializer because the - // type isn't convertible to NodeWithNodeStruct. In BinaryFormatter it fails with fixups. - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Fact] - public virtual void ValueTypeReferencesSelf2() - { - MemoryStream stream = new(); - - using (BinaryFormatWriterScope writer = new(stream)) - { - new BinaryLibrary(2, typeof(StructWithObject).Assembly.FullName!).Write(writer); - - new ClassWithMembersAndTypes( - new ClassInfo(1, typeof(StructWithObject).FullName!, ["Value"]), - 2, - new MemberTypeInfo[] - { - new(BinaryType.Class, new ClassTypeInfo(typeof(StructWithObject).FullName!, 2)) - }, - new MemberReference(1)).Write(writer); - } - - stream.Position = 0; - Deserialize(stream); - } - - [Fact] - public virtual void ValueTypeReferencesSelf3() - { - MemoryStream stream = new(); - - using (BinaryFormatWriterScope writer = new(stream)) - { - new BinaryLibrary(2, typeof(StructWithTwoObjects).Assembly.FullName!).Write(writer); - - new ClassWithMembersAndTypes( - new ClassInfo(1, typeof(StructWithTwoObjects).FullName!, ["Value", "Value2"]), - 2, - new MemberTypeInfo[] - { - new(BinaryType.Object, null), - new(BinaryType.Object, null) - }, - new MemberReference(1), - new MemberReference(1)).Write(writer); - } - - // Both deserializers create this where every boxed struct is the exact same boxed instance. - stream.Position = 0; - Deserialize(stream); - } - - [Fact] - public virtual void ValueTypeReferencesSelf4() - { - MemoryStream stream = new(); - - using (BinaryFormatWriterScope writer = new(stream)) - { - new BinaryLibrary(2, typeof(StructWithTwoObjectsISerializable).Assembly.FullName!).Write(writer); - - new ClassWithMembersAndTypes( - new ClassInfo(1, typeof(StructWithTwoObjectsISerializable).FullName!, ["Value", "Value2"]), - 2, - new MemberTypeInfo[] - { - new(BinaryType.Object, null), - new(BinaryType.Object, null) - }, - new MemberReference(1), - new MemberReference(1)).Write(writer); - } - - stream.Position = 0; - Deserialize(stream); - } - - [Fact] - public virtual void ValueTypeReferencesSelf5() - { - MemoryStream stream = new(); - - using (BinaryFormatWriterScope writer = new(stream)) - { - new BinaryLibrary(2, typeof(StructWithTwoObjectsISerializable).Assembly.FullName!).Write(writer); - - ClassWithMembersAndTypes root = new( - new ClassInfo(1, typeof(StructWithTwoObjectsISerializable).FullName!, ["Value", "Value2"]), - 2, - new MemberTypeInfo[] - { - new(BinaryType.Object, null), - new(BinaryType.Object, null) - }, - new MemberReference(3), - new MemberReference(3)); - - root.Write(writer); - - new ClassWithId( - 3, - root, - new MemberReference(1), - new MemberReference(3)).Write(writer); - } - - stream.Position = 0; - Deserialize(stream); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CycleTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CycleTests.cs deleted file mode 100644 index e6fe2f13394..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/CycleTests.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using FormatTests.Common.TestTypes; - -namespace FormatTests.Common; - -public abstract class CycleTests : SerializationTest where T : ISerializer -{ - [Fact] - public void SelfReferencingISerializableObject() - { - NodeWithValueISerializable node = new() - { - Value = 42 - }; - - node.Node = node; - - Stream stream = Serialize(node); - - var deserialized = (NodeWithValueISerializable)Deserialize(stream); - - deserialized.Value.Should().Be(42); - deserialized.Node.Should().BeSameAs(deserialized); - } - - [Fact] - public void SimpleLoopingISerializableObjects() - { - NodeWithValueISerializable node1 = new() - { - Value = 42 - }; - - NodeWithValueISerializable node2 = new() - { - Value = 43 - }; - - node1.Node = node2; - node2.Node = node1; - - Stream stream = Serialize(node1); - - var deserialized = (NodeWithValueISerializable)Deserialize(stream); - deserialized.Value.Should().Be(42); - deserialized.Node!.Value.Should().Be(43); - deserialized.Node.Node.Should().BeSameAs(deserialized); - } - - [Fact] - public virtual void BackPointerToISerializableClass() - { - ClassWithValueISerializable> @object = new(); - StructWithReferenceISerializable structValue = new() { Value = 42, Reference = @object }; - @object.Value = structValue; - - Stream stream = Serialize(@object); - - // BinaryFormatter doesn't handle this round trip. - var deserialized = (ClassWithValueISerializable>)Deserialize(stream); - deserialized.Value.Value.Should().Be(42); - deserialized.Value.Reference.Should().BeSameAs(deserialized); - } - - [Fact] - public void BackPointerToArray() - { - var nints = new StructWithSelfArrayReferenceISerializable[3]; - nints[0] = new() { Value = 42, Array = nints }; - nints[1] = new() { Value = 43, Array = nints }; - nints[2] = new() { Value = 44, Array = nints }; - - Stream stream = Serialize(nints); - var deserialized = (StructWithSelfArrayReferenceISerializable[])Deserialize(stream); - - deserialized[0].Value.Should().Be(42); - deserialized[1].Value.Should().Be(43); - deserialized[2].Value.Should().Be(44); - deserialized[0].Array.Should().BeSameAs(deserialized); - } - - [Fact] - public void BackPointerFromNestedStruct() - { - NodeWithNodeStruct node = new() { Value = "Root" }; - node.NodeStruct = new NodeStruct { Node = node }; - - NodeWithNodeStruct deserialized = (NodeWithNodeStruct)Deserialize(Serialize(node)); - - deserialized.NodeStruct.Node.Should().BeSameAs(deserialized); - deserialized.Value.Should().Be("Root"); - } - - [Fact] - public void IndirectBackPointerFromNestedStruct() - { - NodeWithNodeStruct node = new() { Value = "Root" }; - NodeWithNodeStruct node2 = new() { Value = "Node2" }; - node.NodeStruct = new() { Node = node2 }; - node2.NodeStruct = new() { Node = node }; - - NodeWithNodeStruct deserialized = (NodeWithNodeStruct)Deserialize(Serialize(node)); - - deserialized.Value.Should().Be("Root"); - deserialized.NodeStruct.Node!.NodeStruct.Node.Should().BeSameAs(deserialized); - deserialized.NodeStruct.Node!.Value.Should().Be("Node2"); - } - - [Fact] - public void BinaryTreeCycles() - { - BinaryTreeNode root = new(); - root.Left = root; - - BinaryTreeNode deserialized = (BinaryTreeNode)Deserialize(Serialize(root)); - deserialized.Left.Should().BeSameAs(deserialized); - deserialized.Right.Should().BeNull(); - - root.Right = root.Left; - deserialized = (BinaryTreeNode)Deserialize(Serialize(root)); - deserialized.Left.Should().BeSameAs(deserialized); - deserialized.Right.Should().BeSameAs(deserialized); - } - - [Fact] - public void BinaryTreeCycles_ISerializable() - { - BinaryTreeNodeISerializable root = new(); - root.Left = root; - - var deserialized = (BinaryTreeNodeISerializable)Deserialize(Serialize(root)); - deserialized.Left.Should().BeSameAs(deserialized); - deserialized.Right.Should().BeNull(); - - root.Right = root.Left; - deserialized = (BinaryTreeNodeISerializable)Deserialize(Serialize(root)); - deserialized.Left.Should().BeSameAs(deserialized); - deserialized.Right.Should().BeSameAs(deserialized); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/DelegateBinder.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/DelegateBinder.cs deleted file mode 100644 index 8a349e826b2..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/DelegateBinder.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common; - -internal class DelegateBinder : SerializationBinder -{ - public Func? BindToTypeDelegate; - public override Type? BindToType(string assemblyName, string typeName) => BindToTypeDelegate?.Invoke(assemblyName, typeName); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventOrderTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventOrderTests.cs deleted file mode 100644 index 6fe9bd27d40..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventOrderTests.cs +++ /dev/null @@ -1,1166 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using FormatTests.Common.TestTypes; -using ValueType = FormatTests.Common.TestTypes.ValueType; - -namespace FormatTests.Common; - -[Collection("Sequential")] -public abstract class EventOrderTests : SerializationTest where T : ISerializer -{ - #region Depth0 - #region NoCycle - [Fact] - public void Depth0_NoCycle_ObjectReference_AsRoot() - { - ObjectReferenceISerializable root = new(); - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("objects", "objectp", "objecti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "rootp", "rooti", "objecti"] - : ["objects", "objectp", "rootp", "objecti", "rooti"]; - BinaryTreeNodeWithEvents root = new() { Name = "root", ObjectReference = new ObjectReferenceISerializable() }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ISerializable_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "roots", "rootp", "rooti", "objecti"] - : ["objects", "roots", "objectp", "rootp", "objecti", "rooti"]; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", ObjectReference = new ObjectReferenceISerializable() }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ISerializable() - { - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root" }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("roots", "rootp", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "roots", "valuep", "valuei", "rooti"] - : ["roots", "valuep", "rootp", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ISerializable_WithValueTypeISerializable() - { - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("values", "roots", "valuep", "rootp", "valuei", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle() - { - BinaryTreeNodeWithEvents root = new() { Name = "root" }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("rootp", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_Surrogate() - { - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents root = new() { Name = "root" }; - - try - { - Stream stream = Serialize(root); - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("roots", "rootp", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["rootp", "valuep", "valuei", "rooti"] - : ["valuep", "rootp", "valuei", "rooti"]; - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_WithValueTypeISerializable() - { - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("values", "valuep", "rootp", "valuei", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ValueTypeWithSurrogate() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "roots", "valuep", "valuei", "rooti"] - : ["roots", "valuep", "rootp", "valuei", "rooti"]; - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueType() { Name = "value" } }; - - try - { - Stream stream = Serialize(root); - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_NoCycle_ValueTypeISerializableWithSurrogate() - {; - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Stream stream = Serialize(root); - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("values", "roots", "valuep", "rootp", "valuei", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - #endregion NoCycle - - #region Cycle - [Fact] - public void Depth0_SelfCycle_ISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "roots", "rooti"] - : ["roots", "rootp", "rooti"]; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root" }; - root.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "roots", "valuep", "valuei", "rooti"] - : ["roots", "valuep", "rootp", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Value = new ValueType() { Name = "value" } }; - root.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle_ISerializable_WithValueTypeISerializable() - { - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Value = new ValueTypeISerializable() { Name = "value" } }; - root.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("values", "roots", "valuep", "rootp", "valuei", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle() - { - BinaryTreeNodeWithEvents root = new() { Name = "root" }; - root.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("rootp", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle_Surrogate() - { - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents root = new() { Name = "root" }; - root.Left = root; - - try - { - Stream stream = Serialize(root); - if (IsBinaryFormatterDeserializer) - { - Action action = () => Deserialize(stream, surrogateSelector: selector); - } - else - { - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("roots", "rootp", "rooti"); - } - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["rootp", "valuep", "valuei", "rooti"] - : ["valuep", "rootp", "valuei", "rooti"]; - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueType() { Name = "value" } }; - root.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth0_SelfCycle_WithValueTypeISerializable() - { - BinaryTreeNodeWithEvents root = new() { Name = "root", Value = new ValueTypeISerializable() { Name = "value" } }; - root.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("values", "valuep", "rootp", "valuei", "rooti"); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - #endregion Cycle - #endregion Depth0 - - #region Depth1 - #region NoCycle - [Fact] - public void Depth1_NoCycle_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "rootp", "childp", "rooti", "childi", "objecti"] - : ["objects", "objectp", "childp", "rootp", "objecti", "childi", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child", ObjectReference = new ObjectReferenceISerializable() }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_ISerializable_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "childs", "roots", "rootp", "childp", "rooti", "childi", "objecti"] - : ["objects", "childs", "roots", "objectp", "childp", "rootp", "objecti", "childi", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child", ObjectReference = new ObjectReferenceISerializable() }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_ISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "roots", "rootp", "rooti", "childi"] - : ["childs", "roots", "childp", "rootp", "childi", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child" }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "roots", "valuep", "rootp", "valuei", "rooti", "childi"] - : ["childs", "roots", "childp", "valuep", "rootp", "childi", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child" }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child, Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_ISerializable_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "values", "childs", "roots", "valuep", "rootp", "valuei", "rooti", "childi"] - : ["childs", "values", "roots", "childp", "valuep", "rootp", "childi", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child" }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child, Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_ISerializable_WithValueTypeISerializable_WithReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "values", "roots", "valuep", "rootp", "valuei", "rooti", "childi"] - : ["childs", "values", "roots", "childp", "valuep", "rootp", "childi", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child" }; - BinaryTreeNodeWithEventsISerializable root = new() - { - Name = "root", - Left = child, - Value = new ValueTypeISerializable() { Name = "value", Reference = child } - }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["childp", "rootp", "rooti", "childi"] - : ["childp", "rootp", "childi", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_Surrogate() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "roots", "rootp", "rooti", "childi"] - : ["childs", "roots", "childp", "rootp", "childi", "rooti"]; - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child }; - - try - { - Stream stream = Serialize(root); - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["childp", "valuep", "rootp", "valuei", "rooti", "childi"] - : ["childp", "valuep", "rootp", "childi", "valuei", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child, Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_NoCycle_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["childp", "values", "valuep", "rootp", "valuei", "rooti", "childi"] - : ["values", "childp", "valuep", "rootp", "childi", "valuei", "rooti" ]; - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child, Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - #endregion NoCycle - - #region Cycle - [Fact] - public void Depth1_Cycle_ISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "roots", "rootp", "rooti", "childi"] - : ["childs", "roots", "childp", "rootp", "childi", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child" }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child }; - child.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "childs", "roots", "value2p", "rootp", "value1p", "value2i", "rooti", "value1i", "childi"] - : ["childs", "roots", "value1p", "childp", "value2p", "rootp", "value1i", "childi", "value2i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child", Value = new ValueType() { Name = "value1" } }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child, Value = new ValueType() { Name = "value2" } }; - child.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle_ISerializable_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["value2s", "value1s", "childs", "roots", "value2p", "rootp", "value1p", "childp", "value2i", "rooti", "value1i", "childi"] - : ["value1s", "childs", "value2s", "roots", "value1p", "childp", "value2p", "rootp", "value1i", "childi", "value2i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child = new() { Name = "child", Value = new ValueTypeISerializable() { Name = "value1" } }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child, Value = new ValueTypeISerializable() { Name = "value2" } }; - child.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["childp", "rootp", "rooti", "childi"] - : ["childp", "rootp", "childi", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child }; - child.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle_Surrogate() - { - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents child = new() { Name = "child" }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child }; - child.Left = root; - - try - { - Stream stream = Serialize(root); - if (IsBinaryFormatterDeserializer) - { - Action action = () => Deserialize(stream, surrogateSelector: selector); - action.Should().Throw(); - } - else - { - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("childs", "roots", "childp", "rootp", "childi", "rooti"); - } - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["childp", "value2p", "rootp", "value1p", "value2i", "rooti", "value1i", "childi"] - : ["value1p", "childp", "value2p", "rootp", "value1i", "childi", "value2i", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child", Value = new ValueType() { Name = "value1" } }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child, Value = new ValueType() { Name = "value2" } }; - child.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth1_Cycle_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["value2s", "value1s", "value2p", "rootp", "value1p", "childp", "value2i", "rooti", "value1i", "childi"] - : ["value1s", "value2s", "value1p", "childp", "value2p", "rootp", "value1i", "childi", "value2i", "rooti"]; - BinaryTreeNodeWithEvents child = new() { Name = "child", Value = new ValueTypeISerializable() { Name = "value1" } }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child, Value = new ValueTypeISerializable() { Name = "value2" } }; - child.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - #endregion Cycle - #endregion Depth1 - - #region Depth2 - #region NoCycle - [Fact] - public void Depth2_NoCycle_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "rootp", "child1p", "child2p", "rooti", "child1i", "child2i", "objecti"] - : ["objects", "objectp", "child2p", "child1p", "rootp", "objecti", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2", ObjectReference = new ObjectReferenceISerializable() }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1 }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_ISerializable_ObjectReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["objectp", "objects", "child2s", "child1s", "roots", "rootp", "child1p", "child2p", "rooti", "child1i", "child2i", "objecti"] - : ["objects", "child2s", "child1s", "roots", "objectp", "child2p", "child1p", "rootp", "objecti", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2", ObjectReference = new ObjectReferenceISerializable() }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1 }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_ISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "child1s", "roots", "rootp", "child1p", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "roots", "child2p", "child1p", "rootp", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1 }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "child1s", "roots", "valuep", "rootp", "child1p", "valuei", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "roots", "child2p", "child1p", "valuep", "rootp", "child2i", "child1i", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1, Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_ISerializable_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "values", "child2s", "child1s", "roots", "valuep", "rootp", "child1p", "valuei", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "values", "roots", "child2p", "child1p", "valuep", "rootp", "child2i", "child1i", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1, Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_ISerializable_WithValueTypeISerializable_WithReference() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "values", "child1s", "roots", "valuep", "rootp", "child1p", "valuei", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "values", "roots", "child2p", "child1p", "valuep", "rootp", "child2i", "child1i", "valuei", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() - { - Name = "root", - Left = child1, - Value = new ValueTypeISerializable() { Name = "value", Reference = child2 } - }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["child2p", "rootp", "child1p", "rooti", "child1i", "child2i"] - : ["child2p", "child1p", "rootp", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1 }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_Surrogate() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "child1s", "roots", "rootp", "child1p", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "roots", "child2p", "child1p", "rootp", "child2i", "child1i", "rooti"]; - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1 }; - - try - { - Stream stream = Serialize(root); - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["child2p", "valuep", "rootp", "child1p", "valuei", "rooti", "child1i", "child2i"] - : ["child2p", "child1p", "valuep", "rootp", "child2i", "child1i", "valuei", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1, Value = new ValueType() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_NoCycle_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["child2p", "values", "valuep", "rootp", "child1p", "valuei", "rooti", "child1i", "child2i"] - : ["values", "child2p", "child1p", "valuep", "rootp", "child2i", "child1i", "valuei", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1, Value = new ValueTypeISerializable() { Name = "value" } }; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - #endregion NoCycle - - #region Cycle - [Fact] - public void Depth2_Cycle_ISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "child1s", "roots", "rootp", "child1p", "rooti", "child1i", "child2i"] - : ["child2s", "child1s", "roots", "child2p", "child1p", "rootp", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1 }; - child2.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle_ISerializable_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["p", "child2s", "child1s", "roots", "value3p", "rootp", "value2p", "child1p", "value1p", "value3i", "rooti", "value2i", "child1i", "value1i", "child2i"] - : ["child2s", "child1s", "roots", "value1p", "child2p", "value2p", "child1p", "value3p", "rootp", "value1i", "child2i", "value2i", "child1i", "value3i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2", Value = new ValueType() { Name = "value1" } }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2, Value = new ValueType() { Name = "value2" } }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1, Value = new ValueType() { Name = "value3" } }; - child2.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle_ISerializable_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["value3s", "value2s", "value1s", "child2s", "child1s", "roots", "value3p", "rootp", "value2p", "child1p", "value1p", "child2p", "value3i", "rooti", "value2i", "child1i", "value1i", "child2i" ] - : ["value1s", "child2s", "value2s", "child1s", "value3s", "roots", "value1p", "child2p", "value2p", "child1p", "value3p", "rootp", "value1i", "child2i", "value2i", "child1i", "value3i", "rooti"]; - BinaryTreeNodeWithEventsISerializable child2 = new() { Name = "child2", Value = new ValueTypeISerializable() { Name = "value1" } }; - BinaryTreeNodeWithEventsISerializable child1 = new() { Name = "child1", Left = child2, Value = new ValueTypeISerializable() { Name = "value2" } }; - BinaryTreeNodeWithEventsISerializable root = new() { Name = "root", Left = child1, Value = new ValueTypeISerializable() { Name = "value3" } }; - child2.Left = root; - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["child2p", "rootp", "child1p", "rooti", "child1i", "child2i"] - : ["child2p", "child1p", "rootp", "child2i", "child1i", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1 }; - child2.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle_Surrogate() - { - SurrogateSelector selector = CreateSurrogateSelector(new BinaryTreeNodeWithEventsSurrogate()); - BinaryTreeNodeWithEvents child2 = new() { Name = "child2" }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2 }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1 }; - child2.Left = root; - - try - { - Stream stream = Serialize(root); - if (IsBinaryFormatterDeserializer) - { - Action action = () => Deserialize(stream, surrogateSelector: selector); - action.Should().Throw(); - } - else - { - Deserialize(stream, surrogateSelector: selector); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal("child2s", "child1s", "roots", "child2p", "child1p", "rootp", "child2i", "child1i", "rooti"); - } - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle_WithValueType() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["child2p", "value3p", "rootp", "value2p", "child1p", "value1p", "value3i", "rooti", "value2i", "child1i", "value1i", "child2i"] - : ["value1p", "child2p", "value2p", "child1p", "value3p", "rootp", "value1i", "child2i", "value2i", "child1i", "value3i", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2", Value = new ValueType() { Name = "value1" } }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2, Value = new ValueType() { Name = "value2" } }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1, Value = new ValueType() { Name = "value3" } }; - child2.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - - [Fact] - public void Depth2_Cycle_WithValueTypeISerializable() - { - string[] expected = IsBinaryFormatterDeserializer - ? ["value3s", "value2s", "value1s", "value3p", "rootp", "value2p", "child1p", "value1p", "child2p", "value3i", "rooti", "value2i", "child1i", "value1i", "child2i"] - : ["value1s", "value2s", "value3s", "value1p", "child2p", "value2p", "child1p", "value3p", "rootp", "value1i", "child2i", "value2i", "child1i", "value3i", "rooti"]; - BinaryTreeNodeWithEvents child2 = new() { Name = "child2", Value = new ValueTypeISerializable() { Name = "value1" } }; - BinaryTreeNodeWithEvents child1 = new() { Name = "child1", Left = child2, Value = new ValueTypeISerializable() { Name = "value2" } }; - BinaryTreeNodeWithEvents root = new() { Name = "root", Left = child1, Value = new ValueTypeISerializable() { Name = "value3" } }; - child2.Left = root; - - try - { - Deserialize(Serialize(root)); - List deserializeOrder = BinaryTreeNodeWithEventsTracker.DeserializationOrder; - deserializeOrder.Should().Equal(expected); - } - finally - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Clear(); - } - } - #endregion Cycle - #endregion Depth2 -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventTests.cs deleted file mode 100644 index 7a832205c30..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/EventTests.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common; - -public abstract class EventTests : SerializationTest where T : ISerializer -{ - [Fact] - public void SerializationEvents_FireAsExpected() - { - IncrementCountsDuringRoundtrip obj = new (null); - - Assert.Equal(0, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - - Stream stream = Serialize(obj); - - Assert.Equal(1, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - - var result = (IncrementCountsDuringRoundtrip)Deserialize(stream); - - Assert.Equal(1, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - - Assert.Equal(1, result.IncrementedDuringOnSerializingMethod); - Assert.Equal(0, result.IncrementedDuringOnSerializedMethod); - Assert.Equal(1, result.IncrementedDuringOnDeserializingMethod); - Assert.Equal(1, result.IncrementedDuringOnDeserializedMethod); - } - - [Fact] - public void SerializationEvents_DerivedTypeWithEvents_FireAsExpected() - { - DerivedIncrementCountsDuringRoundtrip obj = new(null); - - Assert.Equal(0, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnSerializingMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializedMethod); - - Stream stream = Serialize(obj); - - Assert.Equal(1, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - Assert.Equal(1, obj._derivedIncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj._derivedIncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializedMethod); - - var result = (DerivedIncrementCountsDuringRoundtrip)Deserialize(stream); - - Assert.Equal(1, obj.IncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj.IncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj.IncrementedDuringOnDeserializedMethod); - Assert.Equal(1, obj._derivedIncrementedDuringOnSerializingMethod); - Assert.Equal(1, obj._derivedIncrementedDuringOnSerializedMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializingMethod); - Assert.Equal(0, obj._derivedIncrementedDuringOnDeserializedMethod); - - Assert.Equal(1, result.IncrementedDuringOnSerializingMethod); - Assert.Equal(0, result.IncrementedDuringOnSerializedMethod); - Assert.Equal(1, result.IncrementedDuringOnDeserializingMethod); - Assert.Equal(1, result.IncrementedDuringOnDeserializedMethod); - Assert.Equal(1, result._derivedIncrementedDuringOnSerializingMethod); - Assert.Equal(0, result._derivedIncrementedDuringOnSerializedMethod); - Assert.Equal(1, result._derivedIncrementedDuringOnDeserializingMethod); - Assert.Equal(1, result._derivedIncrementedDuringOnDeserializedMethod); - } - - [Serializable] - public class IncrementCountsDuringRoundtrip - { - public int IncrementedDuringOnSerializingMethod; - public int IncrementedDuringOnSerializedMethod; - [NonSerialized] public int IncrementedDuringOnDeserializingMethod; - public int IncrementedDuringOnDeserializedMethod; - - // non-default ctor so that we can observe changes from OnDeserializing - public IncrementCountsDuringRoundtrip(string? ignored) { _ = ignored; } - - [OnSerializing] - private void OnSerializingMethod(StreamingContext context) => IncrementedDuringOnSerializingMethod++; - - [OnSerialized] - private void OnSerializedMethod(StreamingContext context) => IncrementedDuringOnSerializedMethod++; - - [OnDeserializing] - private void OnDeserializingMethod(StreamingContext context) => IncrementedDuringOnDeserializingMethod++; - - [OnDeserialized] - private void OnDeserializedMethod(StreamingContext context) => IncrementedDuringOnDeserializedMethod++; - } - - [Serializable] - public sealed class DerivedIncrementCountsDuringRoundtrip : IncrementCountsDuringRoundtrip - { - internal int _derivedIncrementedDuringOnSerializingMethod; - internal int _derivedIncrementedDuringOnSerializedMethod; - [NonSerialized] internal int _derivedIncrementedDuringOnDeserializingMethod; - internal int _derivedIncrementedDuringOnDeserializedMethod; - - public DerivedIncrementCountsDuringRoundtrip(string? ignored) : base(ignored) { } - - [OnSerializing] - private void OnSerializingMethod(StreamingContext context) => _derivedIncrementedDuringOnSerializingMethod++; - - [OnSerialized] - private void OnSerializedMethod(StreamingContext context) => _derivedIncrementedDuringOnSerializedMethod++; - - [OnDeserializing] - private void OnDeserializingMethod(StreamingContext context) => _derivedIncrementedDuringOnDeserializingMethod++; - - [OnDeserialized] - private void OnDeserializedMethod(StreamingContext context) => _derivedIncrementedDuringOnDeserializedMethod++; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/FieldTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/FieldTests.cs deleted file mode 100644 index b4717545485..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/FieldTests.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; - -namespace FormatTests.Common; - -public abstract class FieldTests : SerializationTest where T : ISerializer -{ - [Theory] - [InlineData(FormatterAssemblyStyle.Simple, false)] - [InlineData(FormatterAssemblyStyle.Full, true)] - public void MissingField_FailsWithAppropriateStyle(FormatterAssemblyStyle assemblyMatching, bool exceptionExpected) - { - Stream stream = Serialize(new Version1ClassWithoutField()); - - var binder = new DelegateBinder - { - BindToTypeDelegate = (_, _) => typeof(Version2ClassWithoutOptionalField) - }; - - if (exceptionExpected) - { - Assert.Throws(() => Deserialize(stream, binder, assemblyMatching)); - } - else - { - var result = (Version2ClassWithoutOptionalField)Deserialize(stream, binder, assemblyMatching); - Assert.NotNull(result); - Assert.Null(result.Value); - } - } - - [Theory] - [InlineData(FormatterAssemblyStyle.Simple)] - [InlineData(FormatterAssemblyStyle.Full)] - public void OptionalField_Missing_Success(FormatterAssemblyStyle assemblyMatching) - { - Stream stream = Serialize(new Version1ClassWithoutField()); - - var binder = new DelegateBinder - { - BindToTypeDelegate = (_, _) => typeof(Version2ClassWithOptionalField) - }; - - var result = (Version2ClassWithOptionalField)Deserialize(stream, binder, assemblyMatching); - Assert.NotNull(result); - Assert.Null(result.Value); - } - - [Serializable] - public class Version1ClassWithoutField - { - } - - [Serializable] - public class Version2ClassWithoutOptionalField - { - public object? Value; - } - - [Serializable] - public class Version2ClassWithOptionalField - { - [OptionalField(VersionAdded = 2)] - public object? Value; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ISerializer.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ISerializer.cs deleted file mode 100644 index 8e3dd30732f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ISerializer.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Runtime.Serialization.Formatters.Binary; - -namespace FormatTests.Common; - -public interface ISerializer -{ - static virtual Stream Serialize( - object value, - SerializationBinder? binder = null, - ISurrogateSelector? surrogateSelector = null, - FormatterTypeStyle typeStyle = FormatterTypeStyle.TypesAlways) - { - MemoryStream stream = new(); - BinaryFormatter formatter = new() - { - SurrogateSelector = surrogateSelector, - TypeFormat = typeStyle, - Binder = binder - }; - - formatter.Serialize(stream, value); - stream.Position = 0; - return stream; - } - - static abstract object Deserialize( - Stream stream, - SerializationBinder? binder = null, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple, - ISurrogateSelector? surrogateSelector = null); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/JaggedArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/JaggedArrayTests.cs deleted file mode 100644 index b1a2bec121f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/JaggedArrayTests.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common; - -public abstract class JaggedArrayTests : SerializationTest where T : ISerializer -{ - [Fact] - public void IntegerArraysTwoLevels() - { - int[][] jaggedArray = [[0, 1], [10, 11]]; - - Stream stream = Serialize(jaggedArray); - object deserialized = Deserialize(stream); - - deserialized.Should().BeEquivalentTo(jaggedArray); - } - - [Fact] - public void IntegerArraysThreeLevels() - { - int[][][] jaggedArray = [[[0, 1], [10, 11]], [[100, 101], [110, 111]]]; - - Stream stream = Serialize(jaggedArray); - object deserialized = Deserialize(stream); - deserialized.Should().BeEquivalentTo(jaggedArray); - } - - [Fact] - public void JaggedEmpty() - { - int[][] jaggedEmpty = new int[1][]; - - object deserialized = Deserialize(Serialize(jaggedEmpty)); - deserialized.Should().BeEquivalentTo(jaggedEmpty); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ManualParser.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ManualParser.cs deleted file mode 100644 index 3e273512f27..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ManualParser.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization.Formatters.Binary; -using System.Private.Windows.Core.BinaryFormat; -using Record = System.Private.Windows.Core.BinaryFormat.Record; - -namespace FormatTests.Common; - -/// -/// Helper for manually looking through records. -/// -public sealed class ManualParser : BinaryFormattedObject.IParseState, IDisposable -{ - private readonly RecordMap _recordMap; - private readonly BinaryFormattedObject.Options _options = new(); - - /// - /// Creates a parse - /// - /// - public ManualParser(object @object) - { - BinaryFormatter formatter = new(); - MemoryStream stream = new(); - formatter.Serialize(stream, @object); - stream.Position = 0; - Reader = new(stream); - - _recordMap = new(); - } - - public BinaryReader Reader { get; } - - RecordMap BinaryFormattedObject.IParseState.RecordMap => _recordMap; - - BinaryFormattedObject.Options BinaryFormattedObject.IParseState.Options => _options; - - BinaryFormattedObject.ITypeResolver BinaryFormattedObject.IParseState.TypeResolver => throw new NotSupportedException(); - - internal IRecord ReadRecord() => Record.ReadBinaryFormatRecord(this); - - public void Dispose() => Reader.Dispose(); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/MultidimensionalArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/MultidimensionalArrayTests.cs deleted file mode 100644 index 52110a39600..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/MultidimensionalArrayTests.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.Common; - -public abstract class MultidimensionalArrayTests : SerializationTest where T : ISerializer -{ - [Fact] - public void StringArrays() - { - string[,] twoDimensions = new string[2, 2]; - twoDimensions[0, 0] = "00"; - twoDimensions[0, 1] = "01"; - twoDimensions[1, 0] = "10"; - twoDimensions[1, 1] = "11"; - - // Raw data will be 0, 1, 10, 11 in memory and in the binary stream - Stream stream = Serialize(twoDimensions); - - object deserialized = Deserialize(stream); - deserialized.Should().BeEquivalentTo(twoDimensions); - } - - [Fact] - public void IntegerArrays_Basic() - { - int[,] twoDimensions = new int[2, 2]; - twoDimensions[0, 0] = 0; - twoDimensions[0, 1] = 1; - twoDimensions[1, 0] = 10; - twoDimensions[1, 1] = 11; - - // Raw data will be 0, 1, 10, 11 in memory and in the binary stream - object deserialized = Deserialize(Serialize(twoDimensions)); - - deserialized.Should().BeEquivalentTo(twoDimensions); - - int[,,] threeDimensions = new int[2, 2, 2]; - threeDimensions[0, 0, 0] = 888; - threeDimensions[0, 0, 1] = 881; - threeDimensions[0, 1, 0] = 810; - threeDimensions[0, 1, 1] = 811; - threeDimensions[1, 0, 0] = 100; - threeDimensions[1, 0, 1] = 101; - threeDimensions[1, 1, 0] = 110; - threeDimensions[1, 1, 1] = 111; - - deserialized = Deserialize(Serialize(threeDimensions)); - deserialized.Should().BeEquivalentTo(threeDimensions); - } - - [Fact] - public void EmptyDimensions() - { - // Didn't even know this was possible. - int[,] twoDimensionOneEmpty = new int[1, 0]; - object deserialized = Deserialize(Serialize(twoDimensionOneEmpty)); - deserialized.Should().BeEquivalentTo(twoDimensionOneEmpty); - - int[,] twoDimensionEmptyOne = new int[0, 1]; - deserialized = Deserialize(Serialize(twoDimensionEmptyOne)); - deserialized.Should().BeEquivalentTo(twoDimensionEmptyOne); - - int[,] twoDimensionEmpty = new int[0, 0]; - deserialized = Deserialize(Serialize(twoDimensionEmpty)); - deserialized.Should().BeEquivalentTo(twoDimensionEmpty); - - int[,,] threeDimension = new int[1, 0, 1]; - deserialized = Deserialize(Serialize(threeDimension)); - deserialized.Should().BeEquivalentTo(threeDimension); - } - - [Theory] - [MemberData(nameof(DimensionLengthsTestData))] - public void IntegerArrays(int[] lengths) - { - Array array = Array.CreateInstance(typeof(int), lengths); - - for (int i = 0; i < array.LongLength; i++) - { - array.SetArrayValueByFlattenedIndex(i, i); - } - - Array deserialized = (Array)Deserialize(Serialize(array)); - deserialized.Should().BeEquivalentTo(deserialized); - } - - public static TheoryData DimensionLengthsTestData { get; } = new() - { - new int[] { 2, 2 }, - new int[] { 3, 2 }, - new int[] { 2, 3 }, - new int[] { 3, 3, 3 }, - new int[] { 2, 3, 4 }, - new int[] { 4, 3, 2 }, - new int[] { 2, 3, 4, 5 } - }; - - [Fact] - public void MaxDimensions() - { - int[] lengths = new int[32]; - - // Even at 2 in every dimension it would be uint.MaxValue in LongLength and 16GB of memory. - lengths.AsSpan().Fill(1); - Array array = Array.CreateInstance(typeof(int), lengths); - - for (int i = 0; i < array.LongLength; i++) - { - array.SetArrayValueByFlattenedIndex(i, i); - } - - Array deserialized = (Array)Deserialize(Serialize(array)); - deserialized.Should().BeEquivalentTo(deserialized); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/NullRecordTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/NullRecordTests.cs deleted file mode 100644 index c457909b509..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/NullRecordTests.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.Common; - -public abstract class NullRecordTests : SerializationTest where T : ISerializer -{ - [Theory] - // One over, with ObjectNullMultiple256 - [InlineData(11)] - // ObjectNullMultiple - [InlineData(256)] - public void NullObjectArray_CorruptedNullCount(int nullCount) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(10); - - NullRecord.Write(scope, nullCount); - } - - stream.Position = 0; - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Fact] - public virtual void NullObjectArray_NotEnoughNulls() - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(10); - - NullRecord.Write(scope, 9); - } - - stream.Position = 0; - object deserialized = Deserialize(stream); - } - - [Theory] - [InlineData(-1)] - [InlineData(-2)] - [InlineData(int.MinValue)] - public void NullRecord_Negative(int count) - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(1); - - scope.Writer.Write((byte)RecordType.ObjectNullMultiple); - scope.Writer.Write(count); - } - - stream.Position = 0; - - // BinaryFormattedObject blocks before it creates any objects - Action action = () => Deserialize(stream); - action.Should().Throw(); - } - - [Fact] - public virtual void NullRecord_ZeroByte() - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(1); - - scope.Writer.Write((byte)RecordType.ObjectNullMultiple256); - scope.Writer.Write((byte)0); - } - - stream.Position = 0; - - object deserialized = Deserialize(stream); - } - - [Theory] - [InlineData(0)] - [InlineData(2)] - public virtual void NullRecord_WrongLength_WithTuple(int nullCount) - { - Tuple tuple = new(null); - Stream stream = Serialize(tuple); - BinaryFormattedObject format = new(stream); - - stream.Position = 0; - - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(2); - - // Write a member reference to the tuple, followed by a null record with zero length. - new MemberReference(2).Write(scope); - scope.Writer.Write((byte)RecordType.ObjectNullMultiple256); - scope.Writer.Write((byte)nullCount); - - // Write the Tuple out with an updated Id - scope.Writer.Write((byte)RecordType.SystemClassWithMembersAndTypes); - var record = (SystemClassWithMembersAndTypes)format[(Id)1]; - ClassInfo classInfo = record.ClassInfo; - new ClassInfo(2, classInfo.Name, classInfo.MemberNames).Write(scope); - scope.Writer.Write(record.MemberTypeInfo); - NullRecord.Write(scope, 1); - } - - stream.Position = 0; - - object deserialized = Deserialize(stream); - } - - [Fact] - public virtual void NullRecord_ZeroInt() - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.ArraySingleObject); - - // Id - scope.Writer.Write(1); - - // Length - scope.Writer.Write(1); - - scope.Writer.Write((byte)RecordType.ObjectNullMultiple); - scope.Writer.Write(0); - } - - stream.Position = 0; - - object deserialized = Deserialize(stream); - } - - [Fact] - public virtual void NullRecord_FollowingReferenceable() - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - new ArraySingleObject(1, [null]).Write(scope); - NullRecord.Write(scope, 1); - } - - stream.Position = 0; - - // Not technically valid, the BinaryFormatter gets a null ref that it turns into SerializationException. - // (According to the specification you shouldn't have null records that don't follow object or array records.) - object deserialized = Deserialize(stream); - - deserialized.Should().BeEquivalentTo(new object?[1]); - } - - [Fact] - public virtual void NullRecord_BeforeReferenceable() - { - MemoryStream stream = new(); - using (BinaryFormatWriterScope scope = new(stream)) - { - NullRecord.Write(scope, 1); - new ArraySingleObject(1, [null]).Write(scope); - } - - stream.Position = 0; - - // Not technically valid, the BinaryFormatter gets a null ref that it turns into SerializationException. - // (According to the specification you shouldn't have null records that don't follow object or array records.) - object deserialized = Deserialize(stream); - - deserialized.Should().BeEquivalentTo(new object?[1]); - } - - [Fact] - public virtual void Tuple_WithMultipleNullCount() - { - Tuple tuple = new(null); - Stream stream = Serialize(tuple); - BinaryFormattedObject format = new(stream); - - stream.Position = 0; - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.SystemClassWithMembersAndTypes); - var record = (SystemClassWithMembersAndTypes)format[(Id)1]; - record.ClassInfo.Write(scope); - scope.Writer.Write(record.MemberTypeInfo); - NullRecord.Write(scope, 2); - } - - stream.Position = 0; - - object deserialized = Deserialize(stream); - } - - [Fact] - public virtual void Tuple_WithZeroNullCount() - { - Tuple tuple = new(null); - Stream stream = Serialize(tuple); - BinaryFormattedObject format = new(stream); - - stream.Position = 0; - using (BinaryFormatWriterScope scope = new(stream)) - { - scope.Writer.Write((byte)RecordType.SystemClassWithMembersAndTypes); - var record = (SystemClassWithMembersAndTypes)format[(Id)1]; - record.ClassInfo.Write(scope); - scope.Writer.Write(record.MemberTypeInfo); - - scope.Writer.Write((byte)RecordType.ObjectNullMultiple); - scope.Writer.Write(0); - } - - stream.Position = 0; - - object deserialized = Deserialize(stream); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ObjectReferenceTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ObjectReferenceTests.cs deleted file mode 100644 index 953a814c744..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/ObjectReferenceTests.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; -using System.Text; - -namespace FormatTests.Common; - -public abstract class ObjectReferenceTests : SerializationTest where T : ISerializer -{ - [Fact] - public void DBNull_Deserialize() - { - object deserialized = RoundTrip(DBNull.Value); - deserialized.Should().BeSameAs(DBNull.Value); - } - - [Theory] - [MemberData(nameof(SupportedTypesTestData))] - public void SupportedTypes_Deserialize(object value) - { - object deserialized = RoundTrip(value); - deserialized.Should().NotBeNull(); - } - - public static TheoryData SupportedTypesTestData { get; } = new() - { - ObjectReferenceNoFields.Value, - new SerializableWithNestedSurrogate { Message = "Hello"} - }; - - [Fact] - public void Singleton_NoFields_Deserialize() - { - // Representing singletons is the most common pattern for IObjectReference. - object deserialized = RoundTrip(ObjectReferenceNoFields.Value); - deserialized.Should().BeSameAs(ObjectReferenceNoFields.Value); - } - - [Serializable] - public sealed class ObjectReferenceNoFields : IObjectReference - { - public static ObjectReferenceNoFields Value { get; } = new(); - - private ObjectReferenceNoFields() { } - - object IObjectReference.GetRealObject(StreamingContext context) => Value; - } - - [Fact] - public void NestedSurrogate_Deserialize() - { - object deserialized = RoundTrip(new SerializableWithNestedSurrogate { Message = "Hello" }); - deserialized.Should().BeOfType().Which.Message.Should().Be("Hello"); - } - - [Serializable] -#pragma warning disable CA2229 // Implement serialization constructors - public sealed class SerializableWithNestedSurrogate : ISerializable -#pragma warning restore CA2229 - { - public string Message { get; set; } = string.Empty; - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue(nameof(Message), Encoding.UTF8.GetBytes(Message)); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - private readonly byte[] _bytes; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _bytes = (byte[])(info.GetValue(nameof(Message), typeof(byte[])) ?? throw new InvalidOperationException()); - } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) => - throw new InvalidOperationException(); - - object IObjectReference.GetRealObject(StreamingContext context) - => new SerializableWithNestedSurrogate() { Message = Encoding.UTF8.GetString(_bytes) }; - } - } - - [Fact] - public void NestedSurrogate_NullableEnum_Deserialize() - { - object deserialized = RoundTrip(new SerializableWithNestedSurrogate_NullableEnum()); - deserialized.Should().BeOfType().Which.Day.Should().BeNull(); - - deserialized = RoundTrip(new SerializableWithNestedSurrogate_NullableEnum { Day = DayOfWeek.Monday }); - deserialized.Should().BeOfType().Which.Day.Should().Be(DayOfWeek.Monday); - } - - [Serializable] -#pragma warning disable CA2229 // Implement serialization constructors - public sealed class SerializableWithNestedSurrogate_NullableEnum : ISerializable -#pragma warning restore CA2229 - { - public DayOfWeek? Day { get; set; } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue(nameof(Day), Day); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - private readonly DayOfWeek? _day; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _day = (DayOfWeek?)(info.GetValue(nameof(Day), typeof(DayOfWeek?))); - } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) => - throw new InvalidOperationException(); - - object IObjectReference.GetRealObject(StreamingContext context) - => new SerializableWithNestedSurrogate_NullableEnum() { Day = _day }; - } - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/PrimitiveTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/PrimitiveTests.cs deleted file mode 100644 index 38c56966ecb..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/PrimitiveTests.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization.Formatters; - -namespace FormatTests.Common; - -public abstract class PrimitiveTests : SerializationTest where T : ISerializer -{ - [Fact] - public void TypesWhenNeeded_Integer() - { - int value = 42; - Stream stream = Serialize(value, typeStyle: FormatterTypeStyle.TypesWhenNeeded); - object deserialized = Deserialize(stream); - deserialized.Should().Be(42); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SerializationTest.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SerializationTest.cs index f90730775d0..0cf5b3936ab 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SerializationTest.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SerializationTest.cs @@ -1,89 +1,30 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Buffers; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; -using FormatTests.Formatter; +using System.Runtime.Serialization.Formatters.Binary; namespace FormatTests.Common; -public abstract class SerializationTest where TSerializer : ISerializer +public abstract class SerializationTest { - public static TheoryData FormatterOptions => new() - { - // XsdString always writes strings inline (never as a record). Despite FormatterTypeStyle - // not having [Flags] it is treated as flags in the serializer. If you don't explicitly set - // TypesAlways, TypesWhenNeeded is the default. - { FormatterTypeStyle.TypesWhenNeeded, FormatterAssemblyStyle.Full }, - { FormatterTypeStyle.TypesWhenNeeded, FormatterAssemblyStyle.Simple }, - { FormatterTypeStyle.TypesAlways, FormatterAssemblyStyle.Full }, - { FormatterTypeStyle.TypesAlways, FormatterAssemblyStyle.Simple }, - { FormatterTypeStyle.TypesAlways | FormatterTypeStyle.XsdString, FormatterAssemblyStyle.Full }, - { FormatterTypeStyle.TypesAlways | FormatterTypeStyle.XsdString, FormatterAssemblyStyle.Simple }, - { FormatterTypeStyle.TypesWhenNeeded | FormatterTypeStyle.XsdString, FormatterAssemblyStyle.Full }, - { FormatterTypeStyle.TypesWhenNeeded | FormatterTypeStyle.XsdString, FormatterAssemblyStyle.Simple }, - }; - private protected static Stream Serialize( object value, SerializationBinder? binder = null, ISurrogateSelector? surrogateSelector = null, - FormatterTypeStyle typeStyle = FormatterTypeStyle.TypesAlways) => - TSerializer.Serialize(value, binder, surrogateSelector, typeStyle); - - private protected static object Deserialize( - Stream stream, - SerializationBinder? binder = null, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple, - ISurrogateSelector? surrogateSelector = null) => - TSerializer.Deserialize(stream, binder, assemblyMatching, surrogateSelector); - - private protected static TObject RoundTrip( - TObject value, - SerializationBinder? binder = null, - ISurrogateSelector? surrogateSelector = null, - FormatterTypeStyle typeStyle = FormatterTypeStyle.TypesAlways, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple) where TObject : notnull + FormatterTypeStyle typeStyle = FormatterTypeStyle.TypesAlways) { - // TODO: Use array pool - return (TObject)Deserialize(Serialize(value, binder, surrogateSelector, typeStyle), binder, assemblyMatching, surrogateSelector); - } - - private protected static object DeserializeFromBase64Chars( - ReadOnlySpan chars, - SerializationBinder? binder = null, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple, - ISurrogateSelector? surrogateSelector = null) - { - byte[] buffer = ArrayPool.Shared.Rent(chars.Length); - if (!Convert.TryFromBase64Chars(chars, buffer, out _)) - { - throw new InvalidOperationException(); - } - - MemoryStream stream = new(buffer); - try + MemoryStream stream = new(); + BinaryFormatter formatter = new() { - return Deserialize(stream, binder, assemblyMatching, surrogateSelector); - } - finally - { - stream.Dispose(); - ArrayPool.Shared.Return(buffer); - } + SurrogateSelector = surrogateSelector, + TypeFormat = typeStyle, + Binder = binder + }; + + formatter.Serialize(stream, value); + stream.Position = 0; + return stream; } - - private protected static SurrogateSelector CreateSurrogateSelector(ISerializationSurrogate surrogate) - { - SurrogateSelector selector = new(); - selector.AddSurrogate( - typeof(TSurrogated), - new StreamingContext(StreamingContextStates.All), - surrogate); - - return selector; - } - - public static bool IsBinaryFormatterDeserializer => typeof(TSerializer) == typeof(BinaryFormatterSerializer); } diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/StressTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/StressTests.cs deleted file mode 100644 index 82ff4755ce5..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/StressTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using FormatTests.Common.TestTypes; - -namespace FormatTests.Common; - -public abstract class StressTests : SerializationTest where T : ISerializer -{ - [Theory] - [InlineData(1000)] - [InlineData(10000)] - // This takes a few seconds - // [InlineData(100000)] - public void GraphDepth(int depth) - { - SimpleNode root = new(); - SimpleNode current = root; - for (int i = 1; i < depth; i++) - { - current.Next = new(); - current = current.Next; - } - - SimpleNode deserialized = (SimpleNode)Deserialize(Serialize(root)); - deserialized.Next.Should().NotBeNull(); - deserialized.Next.Should().NotBeSameAs(deserialized); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SurrogateTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SurrogateTests.cs deleted file mode 100644 index 8c24f278a8d..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SurrogateTests.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Drawing; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using FormatTests.Common.TestTypes; - -namespace FormatTests.Common; - -public abstract class SurrogateTests : SerializationTest where T : ISerializer -{ - [Fact] - public void SerializePointWithSurrogate_NonRefChange() - { - Point point = new(42, 43); - - // Surrogates cannot change the equality of types that they change. BinaryFormattedObject would allow this - // unless you wrap the selector by calling FormatterServices.GetSurrogateForCyclicalReference. Ours always - // allows value types to change as they are always applied as a fixup. - SurrogateSelector selector = CreateSurrogateSelector(new PointSerializationSurrogate(refUnbox: false)); - - Stream stream = Serialize(point); - Deserialize(stream, surrogateSelector: selector); - } - - [Fact] - public void SerializePointWithSurrogate_RefChange() - { - Point point = new(42, 43); - - Stream stream = Serialize(point); - - // Surrogates can change the equality of the structs they are passed - // if they unbox as ref (using Unsafe). - SurrogateSelector selector = CreateSurrogateSelector(new PointSerializationSurrogate(refUnbox: true)); - - Point deserialized = (Point)Deserialize(stream, surrogateSelector: selector); - deserialized.Should().Be(point); - } - - public class PointSerializationSurrogate : ISerializationSurrogate - { - private readonly bool _refUnbox; - - public PointSerializationSurrogate(bool refUnbox) => _refUnbox = refUnbox; - - public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) => - throw new NotImplementedException(); - - public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector? selector) - { - if (_refUnbox) - { - ref Point pointRef = ref Unsafe.Unbox(obj); - pointRef.X = info.GetInt32("x"); - pointRef.Y = info.GetInt32("y"); - return obj; - } - - Point point = (Point)obj; - point.X = info.GetInt32("x"); - point.Y = info.GetInt32("y"); - return point; - } - } - - [Fact] - public void SerializePointWithNullSurrogate() - { - Point point = new(42, 43); - - Stream stream = Serialize(point); - - // Not sure why one would want to do this, but returning null will skip setting the value back. - SurrogateSelector selector = CreateSurrogateSelector(new NullSurrogate()); - Point deserialized = (Point)Deserialize(stream, surrogateSelector: selector); - - deserialized.X.Should().Be(0); - deserialized.Y.Should().Be(0); - } - - public class NullSurrogate : ISerializationSurrogate - { - public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) => - throw new NotImplementedException(); - - public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector? selector) => - null!; - } - - public class EqualsButDifferentSurrogate : ISerializationSurrogate - { - public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) => - throw new NotImplementedException(); - - public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector? selector) - { - return null!; - } - } - - [Fact] - public void SerializeNonSerializableTypeWithSurrogate() - { - NonSerializablePair pair = new() { Value1 = 1, Value2 = "2" }; - pair.GetType().IsSerializable.Should().BeFalse(); - Action action = () => Serialize(pair); - action.Should().Throw(); - - SurrogateSelector selector = CreateSurrogateSelector>(new NonSerializablePairSurrogate()); - - var deserialized = RoundTrip(pair, surrogateSelector: selector); - deserialized.Should().NotBeSameAs(pair); - deserialized.Value1.Should().Be(pair.Value1); - deserialized.Value2.Should().Be(pair.Value2); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SystemDrawingTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SystemDrawingTests.cs deleted file mode 100644 index 25ad5ff770d..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/SystemDrawingTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Drawing; -using System.Runtime.Serialization.Formatters; -using System.Runtime.Versioning; - -namespace FormatTests.Common; - -public abstract class SystemDrawingTests : SerializationTest where T : ISerializer -{ - [Theory] - [MemberData(nameof(FormatterOptions))] - [SupportedOSPlatform("windows")] - public void Bitmap_RoundTrip(FormatterTypeStyle typeStyle, FormatterAssemblyStyle assemblyMatching) - { - using Bitmap bitmap = new(10, 10); - using var deserialized = RoundTrip(bitmap, typeStyle: typeStyle, assemblyMatching: assemblyMatching); - deserialized.Size.Should().Be(bitmap.Size); - } - - [Theory] - [MemberData(nameof(FormatterOptions))] - [SupportedOSPlatform("windows")] - public void Png_RoundTrip(FormatterTypeStyle typeStyle, FormatterAssemblyStyle assemblyMatching) - { - byte[] rawInlineImageBytes = Convert.FromBase64String(TestResources.TestPng); - using Bitmap bitmap = new(new MemoryStream(rawInlineImageBytes)); - using var deserialized = RoundTrip(bitmap, typeStyle: typeStyle, assemblyMatching: assemblyMatching); - deserialized.Size.Should().Be(bitmap.Size); - deserialized.RawFormat.Should().Be(bitmap.RawFormat); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BasicISerializableObject.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BasicISerializableObject.cs deleted file mode 100644 index 218d4cd8d0d..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BasicISerializableObject.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class BasicISerializableObject : ISerializable -{ - private readonly NonSerializablePair _data; - - public BasicISerializableObject(int value1, string value2) - { - _data = new NonSerializablePair { Value1 = value1, Value2 = value2 }; - } - - protected BasicISerializableObject(SerializationInfo info, StreamingContext context) - { - _data = new NonSerializablePair { Value1 = info.GetInt32("Value1"), Value2 = info.GetString("Value2")! }; - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("Value1", _data.Value1); - info.AddValue("Value2", _data.Value2); - } - - public override bool Equals(object? obj) - { - if (obj is not BasicISerializableObject o) - return false; - if (_data is null || o._data is null) - return _data == o._data; - return _data.Value1 == o._data.Value1 && _data.Value2 == o._data.Value2; - } - - public override int GetHashCode() => 1; -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNode.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNode.cs deleted file mode 100644 index 1d8b96d3a03..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNode.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class BinaryTreeNode -{ - public BinaryTreeNode? Left { get; set; } - public BinaryTreeNode? Right { get; set; } - public string? Value { get; set; } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeISerializable.cs deleted file mode 100644 index e8f4ae3f390..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeISerializable.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class BinaryTreeNodeISerializable : BinaryTreeNode, ISerializable -{ - public BinaryTreeNodeISerializable() { } - - protected BinaryTreeNodeISerializable(SerializationInfo info, StreamingContext context) - { - Value = info.GetString(nameof(Value)); - Left = (BinaryTreeNode)info.GetValue(nameof(Left), typeof(BinaryTreeNode))!; - Right = (BinaryTreeNode)info.GetValue(nameof(Right), typeof(BinaryTreeNode))!; - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("Value", Value); - info.AddValue("Left", Left, typeof(BinaryTreeNode)); - info.AddValue("Right", Right, typeof(BinaryTreeNode)); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEvents.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEvents.cs deleted file mode 100644 index fb679da1f8b..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEvents.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class BinaryTreeNodeWithEvents : IDeserializationCallback, BinaryTreeNodeWithEventsBase -{ - public string Name { get; set; } = string.Empty; - public BinaryTreeNodeWithEvents? Left { get; set; } - public BinaryTreeNodeWithEvents? Right { get; set; } - public ValueTypeBase? Value { get; set; } - public object? ObjectReference { get; set; } - - public BinaryTreeNodeWithEvents() { } - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}p"); - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Name), Name); - info.AddValue(nameof(Left), Left); - info.AddValue(nameof(Right), Right); - info.AddValue(nameof(Value), Value); - info.AddValue(nameof(ObjectReference), ObjectReference); - } - - public void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}i"); -} - -public class BinaryTreeNodeWithEventsSurrogate : ISerializationSurrogate -{ - public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) => throw new NotImplementedException(); - public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector? selector) - { - BinaryTreeNodeWithEvents node = (BinaryTreeNodeWithEvents)obj; - node.Name = info.GetString("k__BackingField")!; - node.Left = (BinaryTreeNodeWithEvents)info.GetValue("k__BackingField", typeof(BinaryTreeNodeWithEvents))!; - node.Right = (BinaryTreeNodeWithEvents)info.GetValue("k__BackingField", typeof(BinaryTreeNodeWithEvents))!; - node.Value = (ValueTypeBase)info.GetValue("k__BackingField", typeof(ValueTypeBase))!; - node.ObjectReference = info.GetValue("k__BackingField", typeof(object))!; - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{node.Name}s"); - - return node; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsBase.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsBase.cs deleted file mode 100644 index c6e755252e4..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsBase.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common.TestTypes; - -public interface BinaryTreeNodeWithEventsBase { } diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsISerializable.cs deleted file mode 100644 index 14a235473a7..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/BinaryTreeNodeWithEventsISerializable.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class BinaryTreeNodeWithEventsISerializable : ISerializable, IDeserializationCallback, BinaryTreeNodeWithEventsBase -{ - public string Name { get; set; } = string.Empty; - public BinaryTreeNodeWithEventsISerializable? Left { get; set; } - public BinaryTreeNodeWithEventsISerializable? Right { get; set; } - public ValueTypeBase? Value { get; set; } - public object? ObjectReference { get; set; } - - public BinaryTreeNodeWithEventsISerializable() { } - - protected BinaryTreeNodeWithEventsISerializable(SerializationInfo serializationInfo, StreamingContext streamingContext) - { - Name = serializationInfo.GetString(nameof(Name))!; - Left = (BinaryTreeNodeWithEventsISerializable?)serializationInfo.GetValue(nameof(Left), typeof(BinaryTreeNodeWithEventsISerializable)); - Right = (BinaryTreeNodeWithEventsISerializable?)serializationInfo.GetValue(nameof(Right), typeof(BinaryTreeNodeWithEventsISerializable)); - Value = (ValueTypeBase?)serializationInfo.GetValue(nameof(Value), typeof(ValueTypeBase)); - ObjectReference = serializationInfo.GetValue(nameof(ObjectReference), typeof(object)); - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}s"); - } - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}p"); - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Name), Name); - info.AddValue(nameof(Left), Left); - info.AddValue(nameof(Right), Right); - info.AddValue(nameof(Value), Value); - info.AddValue(nameof(ObjectReference), ObjectReference); - } - - public void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}i"); -} - -public class BinaryTreeNodeWithEventsTracker -{ - public static List DeserializationOrder { get; } = new(); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ClassWithValueISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ClassWithValueISerializable.cs deleted file mode 100644 index fc22ccd5684..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ClassWithValueISerializable.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class ClassWithValueISerializable : ISerializable -{ - public T? Value { get; set; } - - public ClassWithValueISerializable() { } - - protected ClassWithValueISerializable(SerializationInfo info, StreamingContext context) - { - Value = (T)info.GetValue(nameof(Value), typeof(T))!; - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Value), Value); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/DerivedISerializableWithNonPublicDeserializationCtor.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/DerivedISerializableWithNonPublicDeserializationCtor.cs deleted file mode 100644 index b5e9849096c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/DerivedISerializableWithNonPublicDeserializationCtor.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public sealed class DerivedISerializableWithNonPublicDeserializationCtor : BasicISerializableObject -{ - public DerivedISerializableWithNonPublicDeserializationCtor(int value1, string value2) : base(value1, value2) { } - private DerivedISerializableWithNonPublicDeserializationCtor(SerializationInfo info, StreamingContext context) : base(info, context) { } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeStruct.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeStruct.cs deleted file mode 100644 index 710008eb78c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeStruct.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct StructWithObject -{ - public object? Value; -} - -[Serializable] -public struct StructWithTwoObjects -{ - public object? Value; - public object? Value2; -} - -[Serializable] -public struct StructWithTwoObjectsISerializable : ISerializable -{ - public object? Value; - public object? Value2; - - public StructWithTwoObjectsISerializable() { } - - private StructWithTwoObjectsISerializable(SerializationInfo info, StreamingContext context) - { - Value = info.GetValue(nameof(Value), typeof(object)); - Value2 = info.GetValue(nameof(Value2), typeof(object)); - } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Value), typeof(object)); - info.AddValue(nameof(Value2), typeof(object)); - } -} - -[Serializable] -public struct NodeStruct : ISerializable -{ - public NodeStruct() { } - - private NodeStruct(SerializationInfo info, StreamingContext context) - { - Node = (NodeWithNodeStruct)info.GetValue(nameof(Node), typeof(NodeWithNodeStruct))!; - } - - public NodeWithNodeStruct? Node { get; set; } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Node), Node, typeof(NodeWithNodeStruct)); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithNodeStruct.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithNodeStruct.cs deleted file mode 100644 index 39ed9d423b3..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithNodeStruct.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class NodeWithNodeStruct -{ - public string? Value { get; set; } - public NodeStruct NodeStruct { get; set; } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithValueISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithValueISerializable.cs deleted file mode 100644 index 526c8aa4720..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NodeWithValueISerializable.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class NodeWithValueISerializable : ISerializable -{ - public NodeWithValueISerializable() { } - - protected NodeWithValueISerializable(SerializationInfo info, StreamingContext context) - { - Node = (NodeWithValueISerializable?)info.GetValue(nameof(Node), typeof(NodeWithValueISerializable)); - Value = info.GetInt32(nameof(Value)); - } - - public NodeWithValueISerializable? Node { get; set; } - public int Value { get; set; } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Node), Node); - info.AddValue(nameof(Value), Value); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePair.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePair.cs deleted file mode 100644 index f51b74e85e0..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePair.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common.TestTypes; - -internal sealed class NonSerializablePair -{ - public T1? Value1; - public T2? Value2; -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePairSurrogate.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePairSurrogate.cs deleted file mode 100644 index 6c7bc373dca..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/NonSerializablePairSurrogate.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -internal sealed class NonSerializablePairSurrogate : ISerializationSurrogate -{ - public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) - { - var pair = (NonSerializablePair)obj; - info.AddValue("Value1", pair.Value1); - info.AddValue("Value2", pair.Value2); - } - - public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector? selector) - { - var pair = (NonSerializablePair)obj; - pair.Value1 = info.GetInt32("Value1"); - pair.Value2 = info.GetString("Value2")!; - return pair; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ObjectReferenceISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ObjectReferenceISerializable.cs deleted file mode 100644 index ff483ef18e2..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ObjectReferenceISerializable.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class ObjectReferenceISerializable : ISerializable, IObjectReference, IDeserializationCallback -{ - public ObjectReferenceISerializable() { } - - protected ObjectReferenceISerializable(SerializationInfo serializationInfo, StreamingContext streamingContext) - { - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"objects"); - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) { } - - public object GetRealObject(StreamingContext context) => new InnerObject(); - - public void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"objecti"); - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"objectp"); -} - -public class InnerObject : IDeserializationCallback -{ - public void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"inneri"); - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"innerp"); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/SimpleNode.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/SimpleNode.cs deleted file mode 100644 index 0977273ed28..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/SimpleNode.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public class SimpleNode -{ - public SimpleNode? Next { get; set; } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithArrayReferenceISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithArrayReferenceISerializable.cs deleted file mode 100644 index 85e3af807f6..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithArrayReferenceISerializable.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct StructWithArrayReferenceISerializable : ISerializable - where T : class -{ - public nint Value { get; set; } - public T[]? Reference { get; set; } - - private StructWithArrayReferenceISerializable(SerializationInfo info, StreamingContext context) - { - Reference = (T[]?)info.GetValue(nameof(Reference), typeof(T)); - Value = (nint)info.GetValue(nameof(Value), typeof(nint))!; - } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Reference), Reference); - info.AddValue(nameof(Value), Value, typeof(nint)); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithReferenceISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithReferenceISerializable.cs deleted file mode 100644 index 4975d54c9b9..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithReferenceISerializable.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct StructWithReferenceISerializable : ISerializable - where T : class -{ - public nint Value { get; set; } - public T? Reference { get; set; } - - private StructWithReferenceISerializable(SerializationInfo info, StreamingContext context) - { - Reference = (T?)info.GetValue(nameof(Reference), typeof(T)); - Value = (nint)info.GetValue(nameof(Value), typeof(nint))!; - } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Reference), Reference); - info.AddValue(nameof(Value), Value, typeof(nint)); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithSelfArrayReferenceISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithSelfArrayReferenceISerializable.cs deleted file mode 100644 index 71eae078211..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/StructWithSelfArrayReferenceISerializable.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct StructWithSelfArrayReferenceISerializable : ISerializable -{ - public nint Value { get; set; } - public StructWithSelfArrayReferenceISerializable[]? Array { get; set; } - - public StructWithSelfArrayReferenceISerializable() { } - - private StructWithSelfArrayReferenceISerializable(SerializationInfo info, StreamingContext context) - { - Array = (StructWithSelfArrayReferenceISerializable[]?)info.GetValue(nameof(Array), typeof(StructWithSelfArrayReferenceISerializable[]))!; - Value = (nint)info.GetValue(nameof(Value), typeof(nint))!; - } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Array), Array); - info.AddValue(nameof(Value), Value, typeof(nint)); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueType.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueType.cs deleted file mode 100644 index 41eb785d9a1..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueType.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct ValueType : ValueTypeBase -{ - public ValueType() - { - } - - public string Name { get; set; } = string.Empty; - - public BinaryTreeNodeWithEventsBase? Reference { get; set; } - - public readonly void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}i"); - - [OnDeserialized] - private readonly void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}p"); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeBase.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeBase.cs deleted file mode 100644 index 4603c3b3c37..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -public interface ValueTypeBase : IDeserializationCallback -{ - public string Name { get; set; } - - public BinaryTreeNodeWithEventsBase? Reference { get; set; } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeISerializable.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeISerializable.cs deleted file mode 100644 index 75f4c80802d..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Common/TestTypes/ValueTypeISerializable.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Common.TestTypes; - -[Serializable] -public struct ValueTypeISerializable : ISerializable, ValueTypeBase -{ - public string Name { get; set; } = string.Empty; - - public BinaryTreeNodeWithEventsBase? Reference { get; set; } - - private ValueTypeISerializable(SerializationInfo serializationInfo, StreamingContext streamingContext) - { - Name = serializationInfo.GetString(nameof(Name))!; - Reference = (BinaryTreeNodeWithEventsISerializable?)serializationInfo.GetValue(nameof(Reference), typeof(BinaryTreeNodeWithEventsISerializable)); - BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}s"); - } - - public readonly void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue(nameof(Name), Name); - info.AddValue(nameof(Reference), Reference); - } - - [OnDeserialized] - private readonly void OnDeserialized(StreamingContext context) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}p"); - public readonly void OnDeserialization(object? sender) => BinaryTreeNodeWithEventsTracker.DeserializationOrder.Add($"{Name}i"); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ArrayTests.cs deleted file mode 100644 index aa88c1c6cf6..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ArrayTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Drawing; -using System.Runtime.Serialization; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class ArrayTests : Common.ArrayTests -{ - public override void Roundtrip_ArrayContainingArrayAtNonZeroLowerBound() - { - Action action = base.Roundtrip_ArrayContainingArrayAtNonZeroLowerBound; - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(ArrayInfo_ParseSuccessData))] - public void ArrayInfo_Parse_Success(Stream stream, int expectedId, int expectedLength) - { - using BinaryReader reader = new(stream); - Id id = ArrayInfo.Parse(reader, out Count length); - id.Should().Be((Id)expectedId); - length.Should().Be(expectedLength); - length.Should().Be(expectedLength); - } - - public static TheoryData ArrayInfo_ParseSuccessData => new() - { - { new MemoryStream([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), 0, 0 }, - { new MemoryStream([0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00]), 1, 1 }, - { new MemoryStream([0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00]), 2, 1 }, - { new MemoryStream([0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F]), int.MaxValue, int.MaxValue } - }; - - [Theory] - [MemberData(nameof(ArrayInfo_ParseNegativeData))] - public void ArrayInfo_Parse_Negative(Stream stream, Type expectedException) - { - using BinaryReader reader = new(stream); - Assert.Throws(expectedException, () => ArrayInfo.Parse(reader, out Count length)); - } - - public static TheoryData ArrayInfo_ParseNegativeData => new() - { - // Not enough data - { new MemoryStream([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), typeof(EndOfStreamException) }, - { new MemoryStream([0x00, 0x00, 0x00]), typeof(EndOfStreamException) }, - // Negative numbers - { new MemoryStream([0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF]), typeof(ArgumentOutOfRangeException) } - }; - - [Theory] - [MemberData(nameof(StringArray_Parse_Data))] - public void StringArray_Parse(string?[] strings) - { - BinaryFormattedObject format = new(Serialize(strings)); - ArraySingleString array = (ArraySingleString)format.RootRecord; - array.Should().BeEquivalentTo(strings); - } - - public static TheoryData StringArray_Parse_Data => new() - { - new string?[] { "one", "two" }, - new string?[] { "yes", "no", null }, - new string?[] { "same", "same", "same" } - }; - - [Theory] - [MemberData(nameof(PrimitiveArray_Parse_Data))] - public void PrimitiveArray_Parse(Array array) - { - BinaryFormattedObject format = new(Serialize(array)); - ArrayRecord arrayRecord = (ArrayRecord)format.RootRecord; - arrayRecord.Should().BeEquivalentTo((IEnumerable)array); - } - - public static TheoryData PrimitiveArray_Parse_Data => new() - { - new int[] { 1, 2, 3 }, - new int[] { 1, 2, 1 }, - new float[] { 1.0f, float.NaN, float.PositiveInfinity }, - new DateTime[] { DateTime.MaxValue } - }; - - public static IEnumerable Array_TestData => StringArray_Parse_Data.Concat(PrimitiveArray_Parse_Data); - - public static TheoryData Array_UnsupportedTestData => new() - { - new Point[] { new() }, - new object[] { new() }, - }; - - public override void BinaryArray_InvalidRank_Positive(int rank, byte arrayType) - { - // BinaryFormatter doesn't throw on these. - Action action = () => base.BinaryArray_InvalidRank_Positive(rank, arrayType); - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BasicObjectTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BasicObjectTests.cs deleted file mode 100644 index ecb5217808f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BasicObjectTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using BinaryFormatTests; -using System.Runtime.Serialization.Formatters.Binary; -using System.Security.Cryptography; - -namespace FormatTests.FormattedObject; - -public class BasicObjectTests : Common.BasicObjectTests -{ - private static readonly SHA256 s_md5 = SHA256.Create(); - - private protected override bool SkipOffsetArrays => true; - - [Theory] - [MemberData(nameof(SerializableObjects))] - public void BasicObjectsRoundTripAndMatch(object value, TypeSerializableValue[] _) - { - // We need to round trip through the BinaryFormatter as a few objects in tests remove - // serialized data on deserialization. - BinaryFormatter formatter = new(); - MemoryStream serialized = new(); - formatter.Serialize(serialized, value); - serialized.Position = 0; - object bfdeserialized = formatter.Deserialize(serialized); - serialized.Position = 0; - serialized.SetLength(0); - formatter.Serialize(serialized, bfdeserialized); - serialized.Position = 0; - - // Now deserialize with BinaryFormattedObject - object deserialized = Deserialize(serialized); - - // And reserialize what we serialized with the BinaryFormatter - MemoryStream deserializedSerialized = new(); - formatter.Serialize(deserializedSerialized, deserialized); - - deserializedSerialized.Position = 0; - serialized.Position = 0; - - // Now compare the two streams to ensure they are identical - deserializedSerialized.Length.Should().Be(serialized.Length); - - byte[] firstHash = s_md5.ComputeHash(serialized); - byte[] secondHash = s_md5.ComputeHash(deserializedSerialized); - - firstHash.Should().BeEquivalentTo(secondHash); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormatWriterTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormatWriterTests.cs index a5937163a7b..8c334f8477b 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormatWriterTests.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormatWriterTests.cs @@ -4,6 +4,9 @@ using System.Collections; using System.Runtime.Serialization.Formatters.Binary; using System.Private.Windows.Core.BinaryFormat; +using System.Formats.Nrbf; +using System.Windows.Forms.Nrbf; +using System.Drawing; namespace FormatTests.FormattedObject; @@ -69,8 +72,8 @@ public void BinaryFormatWriter_TryWriteObject_SupportedObjects_RoundTrip(object BinaryFormatWriter.TryWriteFrameworkObject(stream, value).Should().BeTrue(); stream.Position = 0; - BinaryFormattedObject format = new(stream); - format.TryGetFrameworkObject(out object? deserialized).Should().BeTrue(); + SerializationRecord rootRecord = NrbfDecoder.Decode(stream); + rootRecord.TryGetFrameworkObject(out object? deserialized).Should().BeTrue(); if (value is Hashtable hashtable) { @@ -105,12 +108,41 @@ public void BinaryFormatWriter_TryWriteObject_UnsupportedObjects_RoundTrip(objec ListTests.PrimitiveLists_TestData).Concat( ListTests.ArrayLists_TestData).Concat( PrimitiveTypeTests.Primitive_Data).Concat( - SystemDrawingTests.SystemDrawing_TestData).Concat( - ArrayTests.Array_TestData).Skip(9); + SystemDrawing_TestData).Concat( + Array_TestData).Skip(9); public static IEnumerable TryWriteObject_UnsupportedObjects_TestData => HashtableTests.Hashtables_UnsupportedTestData.Concat( ListTests.Lists_UnsupportedTestData).Concat( ListTests.ArrayLists_UnsupportedTestData).Concat( - ArrayTests.Array_UnsupportedTestData); + Array_UnsupportedTestData); + + public static TheoryData SystemDrawing_TestData => new() + { + new PointF(), + new RectangleF() + }; + + public static TheoryData StringArray_Parse_Data => new() + { + new string?[] { "one", "two" }, + new string?[] { "yes", "no", null }, + new string?[] { "same", "same", "same" } + }; + + public static TheoryData PrimitiveArray_Parse_Data => new() + { + new int[] { 1, 2, 3 }, + new int[] { 1, 2, 1 }, + new float[] { 1.0f, float.NaN, float.PositiveInfinity }, + new DateTime[] { DateTime.MaxValue } + }; + + public static IEnumerable Array_TestData => StringArray_Parse_Data.Concat(PrimitiveArray_Parse_Data); + + public static TheoryData Array_UnsupportedTestData => new() + { + new Point[] { new() }, + new object[] { new() }, + }; } diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormattedObjectTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormattedObjectTests.cs deleted file mode 100644 index 47439a70a4c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/BinaryFormattedObjectTests.cs +++ /dev/null @@ -1,394 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Private.Windows.Core.BinaryFormat; -using FormatTests.Common; - -namespace FormatTests.FormattedObject; - -public class BinaryFormattedObjectTests : SerializationTest -{ - [Fact] - public void ReadHeader() - { - BinaryFormattedObject format = new(Serialize("Hello World.")); - format.RootRecord.Id.Should().Be(1); - } - - [Theory] - [InlineData("Hello there.")] - [InlineData("")] - [InlineData("Embedded\0 Null.")] - public void ReadBinaryObjectString(string testString) - { - BinaryFormattedObject format = new(Serialize(testString)); - BinaryObjectString stringRecord = (BinaryObjectString)format[1]; - stringRecord.ObjectId.Should().Be(1); - stringRecord.Value.Should().Be(testString); - } - - [Fact] - public void ReadEmptyHashTable() - { - BinaryFormattedObject format = new(Serialize(new Hashtable())); - - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - systemClass.ObjectId.Should().Be(1); - systemClass.Name.Should().Be("System.Collections.Hashtable"); - systemClass.MemberNames.Should().BeEquivalentTo( - [ - "LoadFactor", - "Version", - "Comparer", - "HashCodeProvider", - "HashSize", - "Keys", - "Values" - ]); - - systemClass.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.SystemClass, "System.Collections.IComparer"), - new(BinaryType.SystemClass, "System.Collections.IHashCodeProvider"), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.ObjectArray, null), - new(BinaryType.ObjectArray, null) - }); - - systemClass.MemberValues.Should().BeEquivalentTo(new object?[] - { - 0.72f, - 0, - null, - null, - 3, - new MemberReference(2), - new MemberReference(3) - }); - - ArraySingleObject array = (ArraySingleObject)format[2]; - array.ObjectId.Should().Be(2); - array.Length.Should().Be(0); - - array = (ArraySingleObject)format[3]; - array.ObjectId.Should().Be(3); - array.Length.Should().Be(0); - } - - [Fact] - public void ReadHashTableWithStringPair() - { - BinaryFormattedObject format = new(Serialize(new Hashtable() - { - { "This", "That" } - })); - - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - - systemClass.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.SystemClass, "System.Collections.IComparer"), - new(BinaryType.SystemClass, "System.Collections.IHashCodeProvider"), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.ObjectArray, null), - new(BinaryType.ObjectArray, null) - }); - - systemClass.MemberValues.Should().BeEquivalentTo(new object?[] - { - 0.72f, - 1, - null, - null, - 3, - new MemberReference(2), - new MemberReference(3) - }); - - ArraySingleObject array = (ArraySingleObject)format[2]; - array.ObjectId.Should().Be(2); - array.Length.Should().Be(1); - BinaryObjectString value = (BinaryObjectString)array.ArrayObjects[0]!; - value.ObjectId.Should().Be(4); - value.Value.Should().Be("This"); - - array = (ArraySingleObject)format[3]; - array.ObjectId.Should().Be(3); - array.Length.Should().Be(1); - value = (BinaryObjectString)array.ArrayObjects[0]!; - value.ObjectId.Should().Be(5); - value.Value.Should().Be("That"); - } - - [Fact] - public void ReadHashTableWithRepeatedStrings() - { - BinaryFormattedObject format = new(Serialize(new Hashtable() - { - { "This", "That" }, - { "TheOther", "This" }, - { "That", "This" } - })); - - // The collections themselves get ids first before the strings do. - // Everything in the second array is a string reference. - ArraySingleObject array = (ArraySingleObject)format[3]; - array.ObjectId.Should().Be(3); - array[0].Should().BeOfType(); - array[1].Should().BeOfType(); - array[2].Should().BeOfType(); - } - - [Fact] - public void ReadHashTableWithNullValues() - { - BinaryFormattedObject format = new(Serialize(new Hashtable() - { - { "Yowza", null }, - { "Youza", null }, - { "Meeza", null } - })); - - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - - systemClass.MemberValues.Should().BeEquivalentTo(new object?[] - { - 0.72f, - 4, - null, - null, - 7, - new MemberReference(2), - new MemberReference(3) - }); - - ArrayRecord array = (ArrayRecord)format[(MemberReference)systemClass.MemberValues[5]!]; - - array.ObjectId.Should().Be(2); - array.Length.Should().Be(3); - BinaryObjectString value = (BinaryObjectString)array.ArrayObjects[0]; - value.ObjectId.Should().Be(4); - value.Value.Should().BeOneOf("Yowza", "Youza", "Meeza"); - - array = (ArrayRecord)format[(MemberReference)systemClass["Values"]!]; - array.ObjectId.Should().Be(3); - array.Length.Should().Be(3); - array.ArrayObjects[0].Should().BeNull(); - } - - [Fact] - public void ReadObject() - { - BinaryFormattedObject format = new(Serialize(new object())); - format[1].Should().BeOfType(); - } - - [Fact] - public void ReadStruct() - { - ValueTuple tuple = new(355); - BinaryFormattedObject format = new(Serialize(tuple)); - format[1].Should().BeOfType(); - } - - [Fact] - public void ReadSimpleSerializableObject() - { - BinaryFormattedObject format = new(Serialize(new SimpleSerializableObject())); - - ClassWithMembersAndTypes @class = (ClassWithMembersAndTypes)format.RootRecord; - @class.ObjectId.Should().Be(1); - @class.Name.Should().Be(typeof(SimpleSerializableObject).FullName); - @class.MemberNames.Should().BeEmpty(); - @class.LibraryId.Should().Be(2); - @class.MemberTypeInfo.Should().BeEmpty(); - - format[@class.LibraryId].Should().BeOfType() - .Which.LibraryName.Should().Be(typeof(BinaryFormattedObjectTests).Assembly.FullName); - } - - [Fact] - public void ReadNestedSerializableObject() - { - BinaryFormattedObject format = new(Serialize(new NestedSerializableObject())); - - ClassWithMembersAndTypes @class = (ClassWithMembersAndTypes)format.RootRecord; - @class.ObjectId.Should().Be(1); - @class.Name.Should().Be(typeof(NestedSerializableObject).FullName); - @class.MemberNames.Should().BeEquivalentTo(["_object", "_meaning"]); - @class.LibraryId.Should().Be(2); - @class.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Class, new ClassTypeInfo(typeof(SimpleSerializableObject).FullName!, 2)), - new(BinaryType.Primitive, PrimitiveType.Int32) - }); - - @class.MemberValues.Should().BeEquivalentTo(new object?[] - { - new MemberReference(3), - 42 - }); - - @class = (ClassWithMembersAndTypes)format[3]; - @class.ObjectId.Should().Be(3); - @class.Name.Should().Be(typeof(SimpleSerializableObject).FullName); - @class.MemberNames.Should().BeEmpty(); - @class.LibraryId.Should().Be(2); - @class.MemberTypeInfo.Should().BeEmpty(); - } - - [Fact] - public void ReadTwoIntObject() - { - BinaryFormattedObject format = new(Serialize(new TwoIntSerializableObject())); - - ClassWithMembersAndTypes @class = (ClassWithMembersAndTypes)format.RootRecord; - @class.ObjectId.Should().Be(1); - @class.Name.Should().Be(typeof(TwoIntSerializableObject).FullName); - @class.MemberNames.Should().BeEquivalentTo(["_value", "_meaning"]); - @class.LibraryId.Should().Be(2); - @class.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.Primitive, PrimitiveType.Int32) - }); - - @class.MemberValues.Should().BeEquivalentTo(new object?[] - { - 1970, - 42 - }); - } - - [Fact] - public void ReadRepeatedNestedObject() - { - BinaryFormattedObject format = new(Serialize(new RepeatedNestedSerializableObject())); - ClassWithMembersAndTypes firstClass = (ClassWithMembersAndTypes)format[3]; - ClassWithId classWithId = (ClassWithId)format[4]; - classWithId.MetadataId.Should().Be(firstClass.ObjectId); - classWithId.MemberValues.Should().BeEquivalentTo(new object[] { 1970, 42 }); - } - - [Fact] - public void ReadPrimitiveArray() - { - BinaryFormattedObject format = new(Serialize(new int[] { 10, 9, 8, 7 })); - - ArraySinglePrimitive array = (ArraySinglePrimitive)format[1]; - array.Length.Should().Be(4); - array.PrimitiveType.Should().Be(PrimitiveType.Int32); - array.ArrayObjects.Should().BeEquivalentTo(new object[] { 10, 9, 8, 7 }); - } - - [Fact] - public void ReadStringArray() - { - BinaryFormattedObject format = new(Serialize(new string[] { "Monday", "Tuesday", "Wednesday" })); - ArraySingleString array = (ArraySingleString)format[1]; - array.ObjectId.Should().Be(1); - array.Length.Should().Be(3); - array.ArrayObjects[0].Should().Be("Monday"); - } - - [Fact] - public void ReadStringArrayWithNulls() - { - BinaryFormattedObject format = new(Serialize(new string?[] { "Monday", null, "Wednesday", null, null, null })); - ArraySingleString array = (ArraySingleString)format[1]; - array.ObjectId.Should().Be(1); - array.Length.Should().Be(6); - array.ArrayObjects.Should().BeEquivalentTo(new object?[] - { - "Monday", - null, - "Wednesday", - null, - null, - null - }); - } - - [Fact] - public void ReadDuplicatedStringArray() - { - BinaryFormattedObject format = new(Serialize(new string[] { "Monday", "Tuesday", "Monday" })); - ArraySingleString array = (ArraySingleString)format[1]; - array.ObjectId.Should().Be(1); - array.Length.Should().Be(3); - array.ArrayObjects[0].Should().BeSameAs(array.ArrayObjects[2]); - } - - [Fact] - public void ReadObjectWithNullableObjects() - { - BinaryFormattedObject format = new(Serialize(new ObjectWithNullableObjects())); - ClassWithMembersAndTypes classRecord = (ClassWithMembersAndTypes)format.RootRecord; - format[classRecord.LibraryId].Should().BeOfType(); - } - - [Fact] - public void ReadNestedObjectWithNullableObjects() - { - BinaryFormattedObject format = new(Serialize(new NestedObjectWithNullableObjects())); - ClassWithMembersAndTypes classRecord = (ClassWithMembersAndTypes)format.RootRecord; - format[classRecord.LibraryId].Should().BeOfType(); - } - - [Serializable] - private class SimpleSerializableObject - { - } - -#pragma warning disable IDE0052 // Remove unread private members -#pragma warning disable IDE0051 // Remove unused private members -#pragma warning disable CS0414 // Field is assigned but its value is never used -#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value null -#pragma warning disable CA1823 // Avoid unused private fields - [Serializable] - private class ObjectWithNullableObjects - { - public object? First; - public object? Second; - public object? Third; - } - - [Serializable] - private class NestedObjectWithNullableObjects - { - public ObjectWithNullableObjects? First; - public ObjectWithNullableObjects? Second; - public ObjectWithNullableObjects? Third = new(); - } - - [Serializable] - private class NestedSerializableObject - { - private readonly SimpleSerializableObject _object = new(); - private readonly int _meaning = 42; - } - - [Serializable] - private class TwoIntSerializableObject - { - private readonly int _value = 1970; - private readonly int _meaning = 42; - } - - [Serializable] - private class RepeatedNestedSerializableObject - { - private readonly TwoIntSerializableObject _first = new(); - private readonly TwoIntSerializableObject _second = new(); - } -#pragma warning restore IDE0052 // Remove unread private members -#pragma warning restore IDE0051 // Remove unused private members -#pragma warning restore CS0414 // Field is assigned but its value is never used -#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value null -#pragma warning restore CA1823 // Avoid unused private fields -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ClassInfoTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ClassInfoTests.cs deleted file mode 100644 index c8edd3bfe4e..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ClassInfoTests.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class ClassInfoTests -{ - private static readonly byte[] s_hashtableClassInfo = - [ - 0x01, 0x00, 0x00, 0x00, 0x1c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, - 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, - 0x72, 0x10, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x08, 0x48, 0x61, 0x73, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x04, 0x4b, 0x65, 0x79, 0x73, - 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73 - ]; - - [Fact] - public void ClassInfo_ReadHashtable() - { - using BinaryReader reader = new(new MemoryStream(s_hashtableClassInfo)); - ClassInfo info = ClassInfo.Parse(reader, out Count memberCount); - - memberCount.Should().Be(7); - info.ObjectId.Should().Be(1); - info.Name.Should().Be("System.Collections.Hashtable"); - info.MemberNames.Should().BeEquivalentTo( - [ - "LoadFactor", - "Version", - "Comparer", - "HashCodeProvider", - "HashSize", - "Keys", - "Values" - ]); - } - - [Fact] - public void ClassInfo_Hashtable_RoundTrip() - { - using BinaryReader reader = new(new MemoryStream(s_hashtableClassInfo)); - ClassInfo info = ClassInfo.Parse(reader, out Count memberCount); - - MemoryStream stream = new(); - BinaryWriter writer = new(stream); - info.Write(writer); - stream.Position = 0; - - using BinaryReader reader2 = new(stream); - info = ClassInfo.Parse(reader2, out memberCount); - - memberCount.Should().Be(7); - info.ObjectId.Should().Be(1); - info.Name.Should().Be("System.Collections.Hashtable"); - info.MemberNames.Should().BeEquivalentTo( - [ - "LoadFactor", - "Version", - "Comparer", - "HashCodeProvider", - "HashSize", - "Keys", - "Values" - ]); - } - - [Fact] - public void MemberTypeInfo_ReadHashtable_TooShort() - { - MemoryStream stream = new(s_hashtableClassInfo); - stream.SetLength(stream.Length - 1); - using BinaryReader reader = new(stream); - Action action = () => ClassInfo.Parse(reader, out _); - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ComparerTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ComparerTests.cs deleted file mode 100644 index 233eef86cc7..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ComparerTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class ComparerTests : Common.ComparerTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CorruptedTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CorruptedTests.cs deleted file mode 100644 index 24125ba567e..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CorruptedTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.FormattedObject; - -public class CorruptedTests : Common.CorruptedTests -{ - public override void ValueTypeReferencesSelf2() - { - Action action = base.ValueTypeReferencesSelf2; - action.Should().Throw(); - } - - public override void ValueTypeReferencesSelf3() - { - Action action = base.ValueTypeReferencesSelf3; - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CycleTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CycleTests.cs deleted file mode 100644 index 1beca414bed..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/CycleTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class CycleTests : Common.CycleTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventOrderTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventOrderTests.cs deleted file mode 100644 index ba6cab259cb..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventOrderTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class EventOrderTests : Common.EventOrderTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventTests.cs deleted file mode 100644 index 544b9b5f93b..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/EventTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class EventTests : Common.EventTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExceptionTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExceptionTests.cs deleted file mode 100644 index 336abeb3054..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExceptionTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Private.Windows.Core.BinaryFormat; -using FormatTests.Common; - -namespace FormatTests.FormattedObject; - -public class ExceptionTests : SerializationTest -{ - [Fact] - public void NotSupportedException_Parse() - { - BinaryFormattedObject format = new(Serialize(new NotSupportedException())); - var systemClass = (SystemClassWithMembersAndTypes)format.RootRecord; - systemClass.Name.Should().Be(typeof(NotSupportedException).FullName); - systemClass.MemberNames.Should().BeEquivalentTo( - [ - "ClassName", - "Message", - "Data", - "InnerException", - "HelpURL", - "StackTraceString", - "RemoteStackTraceString", - "RemoteStackIndex", - "ExceptionMethod", - "HResult", - "Source", - "WatsonBuckets" - ]); - - systemClass.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.String, null), - new(BinaryType.String, null), - new(BinaryType.SystemClass, typeof(IDictionary).FullName), - new(BinaryType.SystemClass, typeof(Exception).FullName), - new(BinaryType.String, null), - new(BinaryType.String, null), - new(BinaryType.String, null), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.String, null), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.String, null), - new(BinaryType.PrimitiveArray, PrimitiveType.Byte) - }); - - systemClass.MemberValues.Should().BeEquivalentTo(new object?[] - { - new BinaryObjectString(2, "System.NotSupportedException"), - new BinaryObjectString(3, "Specified method is not supported."), - null, - null, - null, - null, - null, - 0, - null, - unchecked((int)0x80131515), - null, - null - }); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExtensionTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExtensionTests.cs deleted file mode 100644 index 732c322eff9..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ExtensionTests.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class ExtensionTests -{ - [Theory] - [MemberData(nameof(FlattenedArrayTestData))] - public void SetArrayValueByFlattenedIndex_MultiDimensionalArray(int[] lengths) - { - Array array = Array.CreateInstance(typeof(int), lengths); - - for (int i = 0; i < array.LongLength; i++) - { - array.SetArrayValueByFlattenedIndex(i, i); - } - - int[] flattened = array.GetArrayData().ToArray(); - - int[] expected = new int[array.LongLength]; - for (int i = 0; i < expected.Length; i++) - { - expected[i] = i; - } - - flattened.Should().BeEquivalentTo(expected); - } - - public static TheoryData FlattenedArrayTestData { get; } = new() - { - new int[] { 2, 2 }, - new int[] { 3, 2 }, - new int[] { 2, 3 }, - new int[] { 3, 3, 3 }, - new int[] { 2, 3, 4 }, - new int[] { 4, 3, 2 }, - new int[] { 2, 3, 4, 5 } - }; -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FieldTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FieldTests.cs deleted file mode 100644 index 1e8c4326e05..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FieldTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class FieldTests : Common.FieldTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FormattedObjectSerializer.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FormattedObjectSerializer.cs deleted file mode 100644 index ae5b602b6f7..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/FormattedObjectSerializer.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using FormatTests.Common; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class FormattedObjectSerializer : ISerializer -{ - public static object Deserialize( - Stream stream, - SerializationBinder? binder = null, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple, - ISurrogateSelector? surrogateSelector = null) - { - BinaryFormattedObject format = new( - stream, - new() - { - Binder = binder, - SurrogateSelector = surrogateSelector, - AssemblyMatching = assemblyMatching - }); - - return format.Deserialize(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/HashTableTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/HashTableTests.cs index 7a459b3e5ea..e93eebcc298 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/HashTableTests.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/HashTableTests.cs @@ -7,12 +7,14 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Private.Windows.Core.BinaryFormat; using FormatTests.Common; +using System.Formats.Nrbf; +using System.Windows.Forms.Nrbf; namespace FormatTests.FormattedObject; #pragma warning disable CS0618 // Type or member is obsolete -public class HashtableTests : SerializationTest +public class HashtableTests : SerializationTest { [Fact] public void HashTable_GetObjectData() @@ -58,23 +60,6 @@ public void HashTable_GetObjectData() enumerator.Current.Value.Should().BeEquivalentTo(new object[] { "That" }); } - [Fact] - public void HashTable_CustomComparer() - { - Hashtable hashtable = new(new CustomHashCodeProvider(), StringComparer.OrdinalIgnoreCase) - { - { "This", "That" } - }; - - BinaryFormattedObject format = new(Serialize(hashtable)); - SystemClassWithMembersAndTypes systemClass = format.RootRecord.Should().BeOfType().Subject; - systemClass.Name.Should().Be("System.Collections.Hashtable"); - format[(MemberReference)systemClass["Comparer"]!].Should().BeOfType().Which.Name.Should().Be("System.OrdinalComparer"); - format[(MemberReference)systemClass["HashCodeProvider"]!].Should().BeOfType().Which.Name.Should().Be("FormatTests.FormattedObject.HashtableTests+CustomHashCodeProvider"); - format[(MemberReference)systemClass["Keys"]!].Should().BeOfType(); - format[(MemberReference)systemClass["Values"]!].Should().BeOfType(); - } - [Fact] public void HashTable_CustomComparer_DoesNotRead() { @@ -83,8 +68,8 @@ public void HashTable_CustomComparer_DoesNotRead() { "This", "That" } }; - BinaryFormattedObject format = new(Serialize(hashtable)); - format.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeFalse(); + SerializationRecord rootRecord = NrbfDecoder.Decode(Serialize(hashtable)); + rootRecord.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeFalse(); deserialized.Should().BeNull(); } @@ -141,8 +126,8 @@ public void BinaryFormatWriter_WriteUnsupportedHashtables(Hashtable hashtable) [MemberData(nameof(Hashtables_TestData))] public void BinaryFormattedObjectExtensions_TryGetPrimitiveHashtable(Hashtable hashtable) { - BinaryFormattedObject format = new(Serialize(hashtable)); - format.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeTrue(); + SerializationRecord rootRecord = NrbfDecoder.Decode(Serialize(hashtable)); + rootRecord.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeTrue(); deserialized!.Count.Should().Be(hashtable.Count); foreach (object? key in hashtable.Keys) @@ -159,8 +144,8 @@ public void RoundTripHashtables(Hashtable hashtable) BinaryFormatWriter.WritePrimitiveHashtable(stream, hashtable); stream.Position = 0; - BinaryFormattedObject format = new(stream); - format.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeTrue(); + SerializationRecord rootRecord = NrbfDecoder.Decode(stream); + rootRecord.TryGetPrimitiveHashtable(out Hashtable? deserialized).Should().BeTrue(); deserialized!.Count.Should().Be(hashtable.Count); foreach (object? key in hashtable.Keys) { diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/JaggedArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/JaggedArrayTests.cs deleted file mode 100644 index 07552d7822e..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/JaggedArrayTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class JaggedArrayTests : Common.JaggedArrayTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ListTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ListTests.cs index 3378aff632f..a6154c02efa 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ListTests.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ListTests.cs @@ -6,82 +6,13 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Private.Windows.Core.BinaryFormat; using FormatTests.Common; +using System.Formats.Nrbf; +using System.Windows.Forms.Nrbf; namespace FormatTests.FormattedObject; -public class ListTests : SerializationTest +public class ListTests : SerializationTest { - [Fact] - public void BinaryFormattedObject_ParseEmptyArrayList() - { - BinaryFormattedObject format = new(Serialize(new ArrayList())); - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - - systemClass.Name.Should().Be(typeof(ArrayList).FullName); - systemClass.MemberNames.Should().BeEquivalentTo(["_items", "_size", "_version"]); - systemClass.MemberTypeInfo[0].Should().Be(new MemberTypeInfo(BinaryType.ObjectArray, null)); - - format[2].Should().BeOfType(); - } - - [Theory] - [MemberData(nameof(ArrayList_Primitive_Data))] - public void BinaryFormattedObject_ParsePrimitivesArrayList(object value) - { - BinaryFormattedObject format = new(Serialize(new ArrayList() - { - value - })); - - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - - systemClass.Name.Should().Be(typeof(ArrayList).FullName); - systemClass.MemberNames.Should().BeEquivalentTo(["_items", "_size", "_version"]); - systemClass.MemberTypeInfo[0].Should().Be(new MemberTypeInfo(BinaryType.ObjectArray, null)); - - ArraySingleObject array = (ArraySingleObject)format[2]; - MemberPrimitiveTyped primitve = (MemberPrimitiveTyped)array[0]!; - primitve.Value.Should().Be(value); - } - - [Fact] - public void BinaryFormattedObject_ParseStringArrayList() - { - BinaryFormattedObject format = new(Serialize(new ArrayList() - { - "JarJar" - })); - - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - - systemClass.Name.Should().Be(typeof(ArrayList).FullName); - systemClass.MemberNames.Should().BeEquivalentTo(["_items", "_size", "_version"]); - systemClass.MemberTypeInfo[0].Should().Be(new MemberTypeInfo(BinaryType.ObjectArray, null)); - - ArraySingleObject array = (ArraySingleObject)format[2]; - BinaryObjectString binaryString = (BinaryObjectString)array[0]!; - binaryString.Value.Should().Be("JarJar"); - } - - public static TheoryData ArrayList_Primitive_Data => new() - { - int.MaxValue, - uint.MaxValue, - long.MaxValue, - ulong.MaxValue, - short.MaxValue, - ushort.MaxValue, - byte.MaxValue, - sbyte.MaxValue, - true, - float.MaxValue, - double.MaxValue, - char.MaxValue, - TimeSpan.MaxValue, - DateTime.MaxValue, - decimal.MaxValue, - }; - public static TheoryData ArrayLists_TestData => new() { new ArrayList(), @@ -120,51 +51,6 @@ public void BinaryFormattedObject_ParseStringArrayList() } }; - [Fact] - public void BinaryFormattedObject_ParseEmptyIntList() - { - BinaryFormattedObject format = new(Serialize(new List())); - SystemClassWithMembersAndTypes classInfo = (SystemClassWithMembersAndTypes)format[1]; - - // Note that T types are serialized as the mscorlib type. - classInfo.Name.Should().Be( - "System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"); - - classInfo.ClassInfo.MemberNames.Should().BeEquivalentTo( - [ - "_items", - // This is something that wouldn't be needed if List implemented ISerializable. If we format - // we can save any extra unused array spots. - "_size", - // It is a bit silly that _version gets serialized, it's only use is as a check to see if - // the collection is modified while it is being enumerated. - "_version" - ]); - - classInfo.MemberTypeInfo[0].Should().Be(new MemberTypeInfo(BinaryType.PrimitiveArray, PrimitiveType.Int32)); - classInfo.MemberTypeInfo[1].Should().Be(new MemberTypeInfo(BinaryType.Primitive, PrimitiveType.Int32)); - classInfo.MemberTypeInfo[2].Should().Be(new MemberTypeInfo(BinaryType.Primitive, PrimitiveType.Int32)); - classInfo["_items"].Should().BeOfType(); - classInfo["_size"].Should().Be(0); - classInfo["_version"].Should().Be(0); - - ArraySinglePrimitive array = (ArraySinglePrimitive)format[2]; - array.Length.Should().Be(0); - } - - [Fact] - public void BinaryFormattedObject_ParseEmptyStringList() - { - BinaryFormattedObject format = new(Serialize(new List())); - SystemClassWithMembersAndTypes classInfo = (SystemClassWithMembersAndTypes)format[1]; - classInfo.ClassInfo.Name.Should().StartWith("System.Collections.Generic.List`1[[System.String,"); - classInfo.MemberTypeInfo[0].Should().Be(new MemberTypeInfo(BinaryType.StringArray, null)); - classInfo["_items"].Should().BeOfType(); - - ArraySingleString array = (ArraySingleString)format[2]; - array.Length.Should().Be(0); - } - [Theory] [MemberData(nameof(PrimitiveLists_TestData))] public void BinaryFormatWriter_TryWritePrimitiveList(IList list) @@ -194,8 +80,8 @@ public void BinaryFormatWriter_TryWritePrimitiveList_Unsupported(IList list) [MemberData(nameof(PrimitiveLists_TestData))] public void BinaryFormattedObjectExtensions_TryGetPrimitiveList(IList list) { - BinaryFormattedObject format = new(Serialize(list)); - format.TryGetPrimitiveList(out object? deserialized).Should().BeTrue(); + SerializationRecord rootRecord = NrbfDecoder.Decode(Serialize(list)); + rootRecord.TryGetPrimitiveList(out object? deserialized).Should().BeTrue(); deserialized.Should().BeEquivalentTo(list); } diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MemberTypeInfoTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MemberTypeInfoTests.cs deleted file mode 100644 index d64f966096c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MemberTypeInfoTests.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class MemberTypeInfoTests -{ - private static readonly byte[] s_hashtableMemberInfo = - [ - 0x00, 0x00, 0x03, 0x03, 0x00, 0x05, 0x05, 0x0b, 0x08, 0x1c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x43, 0x6f, - 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x24, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x48, 0x61, 0x73, 0x68, 0x43, - 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x08 - ]; - - [Fact] - public void MemberTypeInfo_ReadHashtable() - { - using BinaryReader reader = new(new MemoryStream(s_hashtableMemberInfo)); - var info = MemberTypeInfo.Parse(reader, 7); - - info.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.SystemClass, "System.Collections.IComparer"), - new(BinaryType.SystemClass, "System.Collections.IHashCodeProvider"), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.ObjectArray, null), - new(BinaryType.ObjectArray, null) - }); - } - - [Fact] - public void MemberTypeInfo_HashtableRoundTrip() - { - using BinaryReader reader = new(new MemoryStream(s_hashtableMemberInfo)); - var info = MemberTypeInfo.Parse(reader, 7); - - MemoryStream stream = new(); - BinaryWriter writer = new(stream); - writer.Write(info); - stream.Position = 0; - - using BinaryReader reader2 = new(stream); - info = MemberTypeInfo.Parse(reader2, 7); - info.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.SystemClass, "System.Collections.IComparer"), - new(BinaryType.SystemClass, "System.Collections.IHashCodeProvider"), - new(BinaryType.Primitive, PrimitiveType.Int32), - new(BinaryType.ObjectArray, null), - new(BinaryType.ObjectArray, null) - }); - } - - [Fact] - public void MemberTypeInfo_ReadHashtable_TooShort() - { - MemoryStream stream = new(s_hashtableMemberInfo); - stream.SetLength(stream.Length - 1); - using BinaryReader reader = new(stream); - Action action = () => MemberTypeInfo.Parse(reader, 7); - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MultidimensionalArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MultidimensionalArrayTests.cs deleted file mode 100644 index 8bb7c04e1b9..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/MultidimensionalArrayTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class MultidimensionalArrayTests : Common.MultidimensionalArrayTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/NullRecordTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/NullRecordTests.cs index 4370d6b87e6..5069024d21e 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/NullRecordTests.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/NullRecordTests.cs @@ -1,111 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Serialization; using System.Private.Windows.Core.BinaryFormat; -using FormatTests.Common; namespace FormatTests.FormattedObject; -public class NullRecordTests : NullRecordTests +public class NullRecordTests { - [Fact] - public void NullObjectArrayRecords_MultipleSerializedAs() - { - object?[] items = new object?[10]; - using ManualParser parser = new(items); - - IRecord record = parser.ReadRecord(); - record.Should().BeOfType(); - - RecordType recordType = (RecordType)parser.Reader.ReadByte(); - recordType.Should().Be(RecordType.ArraySingleObject); - Id id = ArrayInfo.Parse(parser.Reader, out Count length); - id.Should().Be(1); - length.Should().Be(items.Length); - - record = parser.ReadRecord(); - record.Should().BeOfType() - .Subject.NullCount.Should().Be(items.Length); - } - - [Fact] - public void TupleWithNull_SerializedAs() - { - Tuple tuple = new(null); - using ManualParser parser = new(tuple); - - IRecord record = parser.ReadRecord(); - record.Should().BeOfType(); - - RecordType recordType = (RecordType)parser.Reader.ReadByte(); - recordType.Should().Be(RecordType.SystemClassWithMembersAndTypes); - ClassInfo classInfo = ClassInfo.Parse(parser.Reader, out Count memberCount); - var memberTypeInfo = MemberTypeInfo.Parse(parser.Reader, memberCount); - - recordType = (RecordType)parser.Reader.ReadByte(); - recordType.Should().Be(RecordType.ObjectNull); - } - - [Fact] - public void TupleWithTwoNulls_SerializedAs() - { - Tuple tuple = new(null, null); - using ManualParser parser = new(tuple); - - IRecord record = parser.ReadRecord(); - record.Should().BeOfType(); - - RecordType recordType = (RecordType)parser.Reader.ReadByte(); - recordType.Should().Be(RecordType.SystemClassWithMembersAndTypes); - ClassInfo classInfo = ClassInfo.Parse(parser.Reader, out Count memberCount); - var memberTypeInfo = MemberTypeInfo.Parse(parser.Reader, memberCount); - - recordType = (RecordType)parser.Reader.ReadByte(); - recordType.Should().Be(RecordType.ObjectNull); - } - - public override void NullRecord_ZeroByte() - { - // BinaryFormattedObject blocks before it creates any objects - Action action = base.NullRecord_ZeroByte; - action.Should().Throw(); - } - - public override void NullRecord_ZeroInt() - { - // BinaryFormattedObject blocks before it creates any objects - Action action = base.NullRecord_ZeroInt; - action.Should().Throw(); - } - - public override void NullObjectArray_NotEnoughNulls() - { - Action action = base.NullObjectArray_NotEnoughNulls; - action.Should().Throw(); - } - - public override void Tuple_WithMultipleNullCount() - { - // While it is ok per spec to write out multiple null count records for members, this is never done by the - // BinaryFormatter and it greatly complicates the deserialization logic. BinaryFormattedObject rejects this. - // (But does allow multiple null records for arrays, where they do normally occur.) - Action action = base.Tuple_WithMultipleNullCount; - action.Should().Throw(); - } - - public override void Tuple_WithZeroNullCount() - { - Action action = base.Tuple_WithZeroNullCount; - action.Should().Throw(); - } - - public override void NullRecord_WrongLength_WithTuple(int nullCount) - { - Action action = () => base.NullRecord_WrongLength_WithTuple(nullCount); - action.Should().Throw(); - } - [Fact] public void ObjectNullMultiple256_ThrowsOverflowOnWrite() { diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ObjectReferenceTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ObjectReferenceTests.cs deleted file mode 100644 index e9d4ff02b86..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/ObjectReferenceTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class ObjectReferenceTests : Common.ObjectReferenceTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTests.cs deleted file mode 100644 index f4e3f638d91..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class PrimitiveTests : Common.PrimitiveTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTypeTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTypeTests.cs index 4834e959d11..80b096493fc 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTypeTests.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/PrimitiveTypeTests.cs @@ -6,10 +6,14 @@ using System.Private.Windows.Core.BinaryFormat; using FormatTests.Common; using Record = System.Private.Windows.Core.BinaryFormat.Record; +using System.Formats.Nrbf; +using System.Windows.Forms.Nrbf; +using System.Globalization; +using System.Runtime.Serialization; namespace FormatTests.FormattedObject; -public class PrimitiveTypeTests : SerializationTest +public class PrimitiveTypeTests : SerializationTest { [Theory] [MemberData(nameof(RoundTrip_Data))] @@ -82,16 +86,6 @@ public void WriteReadPrimitiveValue_RoundTrip(byte type, object value) { (byte)PrimitiveType.DateTime, DateTime.MaxValue }, }; - [Theory] - [MemberData(nameof(Primitive_Data))] - public void PrimitiveTypeMemberName(object value) - { - BinaryFormattedObject format = new(Serialize(value)); - SystemClassWithMembersAndTypes systemClass = (SystemClassWithMembersAndTypes)format[1]; - systemClass.MemberNames[0].Should().Be("m_value"); - systemClass.MemberValues.Count.Should().Be(1); - } - [Theory] [MemberData(nameof(Primitive_Data))] [MemberData(nameof(Primitive_ExtendedData))] @@ -114,8 +108,8 @@ public void BinaryFormatWriter_WritePrimitive(object value) [MemberData(nameof(Primitive_ExtendedData))] public void BinaryFormattedObject_ReadPrimitive(object value) { - BinaryFormattedObject formattedObject = new(Serialize(value)); - formattedObject.TryGetPrimitiveType(out object? deserialized).Should().BeTrue(); + SerializationRecord rootRecord = NrbfDecoder.Decode(Serialize(value)); + rootRecord.TryGetPrimitiveType(out object? deserialized).Should().BeTrue(); deserialized.Should().Be(value); } @@ -150,8 +144,27 @@ internal class TestRecord : Record public static void WritePrimitiveValue(BinaryWriter writer, PrimitiveType type, object value) => WritePrimitiveType(writer, type, value); - public static object ReadPrimitiveValue(BinaryReader reader, PrimitiveType type) - => ReadPrimitiveType(reader, type); + public static object ReadPrimitiveValue(BinaryReader reader, PrimitiveType primitiveType) + => primitiveType switch + { + PrimitiveType.Boolean => reader.ReadBoolean(), + PrimitiveType.Byte => reader.ReadByte(), + PrimitiveType.SByte => reader.ReadSByte(), + PrimitiveType.Char => reader.ReadChar(), + PrimitiveType.Int16 => reader.ReadInt16(), + PrimitiveType.UInt16 => reader.ReadUInt16(), + PrimitiveType.Int32 => reader.ReadInt32(), + PrimitiveType.UInt32 => reader.ReadUInt32(), + PrimitiveType.Int64 => reader.ReadInt64(), + PrimitiveType.UInt64 => reader.ReadUInt64(), + PrimitiveType.Single => reader.ReadSingle(), + PrimitiveType.Double => reader.ReadDouble(), + PrimitiveType.Decimal => decimal.Parse(reader.ReadString(), CultureInfo.InvariantCulture), + PrimitiveType.DateTime => reader.ReadDateTime(), + PrimitiveType.TimeSpan => new TimeSpan(reader.ReadInt64()), + // String is handled with a record, never on it's own + _ => throw new SerializationException($"Failure trying to read primitive '{primitiveType}'"), + }; private protected override void Write(BinaryWriter writer) { diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/StressTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/StressTests.cs deleted file mode 100644 index cfe7158836e..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/StressTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class StressTests : Common.StressTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SurrogateTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SurrogateTests.cs deleted file mode 100644 index 3aa3afd06b0..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SurrogateTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.FormattedObject; - -public class SurrogateTests : Common.SurrogateTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SystemDrawingTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SystemDrawingTests.cs deleted file mode 100644 index f3a7c9e8251..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/FormattedObject/SystemDrawingTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Drawing; -using System.Private.Windows.Core.BinaryFormat; - -namespace FormatTests.FormattedObject; - -public class SystemDrawingTests : Common.SystemDrawingTests -{ - [Fact] - public void PointF_Parse() - { - BinaryFormattedObject format = new(Serialize(new PointF())); - - ClassWithMembersAndTypes classInfo = (ClassWithMembersAndTypes)format.RootRecord; - classInfo.ObjectId.Should().Be(1); - classInfo.Name.Should().Be("System.Drawing.PointF"); - classInfo.MemberNames.Should().BeEquivalentTo(["x", "y"]); - classInfo.MemberValues.Should().BeEquivalentTo(new object[] { 0.0f, 0.0f }); - classInfo.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Single) - }); - - format[classInfo.LibraryId].Should().BeOfType() - .Which.LibraryName.Should().Be("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); - } - - [Fact] - public void RectangleF_Parse() - { - BinaryFormattedObject format = new(Serialize(new RectangleF())); - - ClassWithMembersAndTypes classInfo = (ClassWithMembersAndTypes)format.RootRecord; - classInfo.ObjectId.Should().Be(1); - classInfo.Name.Should().Be("System.Drawing.RectangleF"); - classInfo.MemberNames.Should().BeEquivalentTo(["x", "y", "width", "height"]); - classInfo.MemberValues.Should().BeEquivalentTo(new object[] { 0.0f, 0.0f, 0.0f, 0.0f }); - classInfo.MemberTypeInfo.Should().BeEquivalentTo(new MemberTypeInfo[] - { - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Single), - new(BinaryType.Primitive, PrimitiveType.Single) - }); - } - - public static TheoryData SystemDrawing_TestData => new() - { - new PointF(), - new RectangleF() - }; -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ArrayTests.cs deleted file mode 100644 index 258ad7d2817..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ArrayTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class ArrayTests : Common.ArrayTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BasicObjectTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BasicObjectTests.cs deleted file mode 100644 index 868158c039f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BasicObjectTests.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class BasicObjectTests : Common.BasicObjectTests -{ - private protected override bool SkipOffsetArrays => false; -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BinaryFormatterSerializer.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BinaryFormatterSerializer.cs deleted file mode 100644 index 6873e63f351..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/BinaryFormatterSerializer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using FormatTests.Common; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Runtime.Serialization.Formatters.Binary; - -namespace FormatTests.Formatter; - -public class BinaryFormatterSerializer : ISerializer -{ - private static readonly StreamingContext s_context = new(StreamingContextStates.All, null); - - public static object Deserialize( - Stream stream, - SerializationBinder? binder, - FormatterAssemblyStyle assemblyMatching = FormatterAssemblyStyle.Simple, - ISurrogateSelector? surrogateSelector = null) - { - BinaryFormatter formatter = new(surrogateSelector, s_context) - { - Binder = binder, - AssemblyFormat = assemblyMatching - }; - - return formatter.Deserialize(stream); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ComparerTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ComparerTests.cs deleted file mode 100644 index 5d7da43d41f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ComparerTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class ComparerTests : Common.ComparerTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CorruptedTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CorruptedTests.cs deleted file mode 100644 index 2c568bbe542..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CorruptedTests.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Formatter; - -public class CorruptedTests : Common.CorruptedTests -{ - public override void ValueTypeReferencesSelf4() - { - Action action = base.ValueTypeReferencesSelf4; - - // "The ObjectManager found an invalid number of fixups." - action.Should().Throw(); - } - - public override void ValueTypeReferencesSelf5() - { - Action action = base.ValueTypeReferencesSelf5; - - // "The ObjectManager found an invalid number of fixups." - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CycleTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CycleTests.cs deleted file mode 100644 index d258bf50a71..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/CycleTests.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Formatter; - -public class CycleTests : Common.CycleTests -{ - public override void BackPointerToISerializableClass() - { - Action action = () => base.BackPointerToISerializableClass(); - action.Should().Throw(); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventOrderTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventOrderTests.cs deleted file mode 100644 index c45b0698e9c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventOrderTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class EventOrderTests : Common.EventOrderTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventTests.cs deleted file mode 100644 index 9248aa8ee22..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/EventTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class EventTests : Common.EventTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/FieldTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/FieldTests.cs deleted file mode 100644 index 2d5fb30d5b8..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/FieldTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class FieldTests : Common.FieldTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/JaggedArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/JaggedArrayTests.cs deleted file mode 100644 index 02fe9697c9c..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/JaggedArrayTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class JaggedArrayTests : Common.JaggedArrayTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/MultidimensionalArrayTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/MultidimensionalArrayTests.cs deleted file mode 100644 index 81ef9eedb79..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/MultidimensionalArrayTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class MultidimensionalArrayTests : Common.MultidimensionalArrayTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/NullRecordTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/NullRecordTests.cs deleted file mode 100644 index 09674b4a8da..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/NullRecordTests.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.Serialization; - -namespace FormatTests.Formatter; - -public class NullRecordTests : Common.NullRecordTests -{ - public override void NullRecord_FollowingReferenceable() - { - // Not technically valid, the BinaryFormatter gets a null ref that it turns into SerializationException. - Action action = base.NullRecord_FollowingReferenceable; - action.Should().Throw(); - } - - public override void NullRecord_BeforeReferenceable() - { - // Not technically valid, the BinaryFormatter gets a null ref that it turns into SerializationException. - Action action = base.NullRecord_BeforeReferenceable; - action.Should().Throw(); - } - - public override void NullRecord_WrongLength_WithTuple(int nullCount) - { - Action action = () => base.NullRecord_WrongLength_WithTuple(nullCount); - - if (nullCount == 0) - { - action(); - } - else - { - action.Should().Throw(); - } - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ObjectReferenceTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ObjectReferenceTests.cs deleted file mode 100644 index 63b781511f5..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/ObjectReferenceTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class ObjectReferenceTests : Common.ObjectReferenceTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/PrimitiveTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/PrimitiveTests.cs deleted file mode 100644 index af08bc59429..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/PrimitiveTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class PrimitiveTests : Common.PrimitiveTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/StressTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/StressTests.cs deleted file mode 100644 index 696cf5d1186..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/StressTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class StressTests : Common.StressTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SurrogateTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SurrogateTests.cs deleted file mode 100644 index 72e2fb63efa..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SurrogateTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class SurrogateTests : Common.SurrogateTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SystemDrawingTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SystemDrawingTests.cs deleted file mode 100644 index a155b1a24f3..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Formatter/SystemDrawingTests.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace FormatTests.Formatter; - -public class SystemDrawingTests : Common.SystemDrawingTests -{ -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/AdminHelpers.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/AdminHelpers.cs deleted file mode 100644 index 4bda33341ef..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/AdminHelpers.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; - -namespace System; - -public static class AdminHelpers -{ - /// - /// Runs the given command as sudo (for Unix). - /// - /// The command line to run as sudo - /// Returns the process exit code (0 typically means it is successful) - public static int RunAsSudo(string commandLine) - { - ProcessStartInfo startInfo = new() - { - FileName = "sudo", - Arguments = commandLine - }; - - using Process process = Process.Start(startInfo)!; - Assert.True(process.WaitForExit(30000)); - return process.ExitCode; - } - - public static unsafe bool IsProcessElevated() - { - // Browser does not have the concept of an elevated process - if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))) - { - return false; - } - - throw new NotImplementedException(); - -#if TODO - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - uint userId = Interop.Sys.GetEUid(); - return(userId == 0); - } - - SafeTokenHandle token; - if (!Interop.Advapi32.OpenProcessToken(Interop.Kernel32.GetCurrentProcess(), (int)TokenAccessLevels.Read, out token)) - { - throw new Win32Exception(Marshal.GetLastWin32Error(), "Open process token failed"); - } - - using (token) - { - Interop.Advapi32.TOKEN_ELEVATION elevation = new Interop.Advapi32.TOKEN_ELEVATION(); - uint ignore; - if (!Interop.Advapi32.GetTokenInformation( - token, - Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenElevation, - &elevation, - (uint)sizeof(Interop.Advapi32.TOKEN_ELEVATION), - out ignore)) - { - throw new Win32Exception(Marshal.GetLastWin32Error(), "Get token information failed"); - } - return elevation.TokenIsElevated != Interop.BOOL.FALSE; - } -#endif - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterHelpers.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterHelpers.cs deleted file mode 100644 index c6dc7cf80db..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterHelpers.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Runtime.Serialization.Formatters.Binary; - -namespace BinaryFormatTests; - -public static class BinaryFormatterHelpers -{ - internal static T Clone(T obj, - ISerializationSurrogate? surrogate = null, - FormatterAssemblyStyle assemblyFormat = FormatterAssemblyStyle.Full, - FormatterTypeStyle typeFormat = FormatterTypeStyle.TypesAlways) - { - ArgumentNullException.ThrowIfNull(obj); - - BinaryFormatter f; - if (surrogate is null) - { - f = new BinaryFormatter(); - } - else - { - var c = new StreamingContext(); - var s = new SurrogateSelector(); - s.AddSurrogate(obj.GetType(), c, surrogate); - f = new BinaryFormatter(s, c); - } - - f.AssemblyFormat = assemblyFormat; - f.TypeFormat = typeFormat; - - using (var s = new MemoryStream()) - { - f.Serialize(s, obj); - Assert.NotEqual(0, s.Position); - s.Position = 0; - return (T)f.Deserialize(s); - } - } - - public static void AssertExceptionDeserializationFails() where T : Exception - { - AssertExceptionDeserializationFails(typeof(T)); - } - - public static void AssertExceptionDeserializationFails(Type exceptionType) - { - // .NET Core and .NET Native throw PlatformNotSupportedExceptions when deserializing many exceptions. - // The .NET Framework supports full deserialization. - if (PlatformDetection.IsNetFramework) - { - return; - } - - // Construct a valid serialization payload. This is necessary as most constructors call - // the base constructor before throwing a PlatformNotSupportedException, and the base - // constructor validates the SerializationInfo passed. - var info = new SerializationInfo(exceptionType, new FormatterConverter()); - info.AddValue("ClassName", "ClassName"); - info.AddValue("Message", "Message"); - info.AddValue("InnerException", null); - info.AddValue("HelpURL", null); - info.AddValue("StackTraceString", null); - info.AddValue("RemoteStackTraceString", null); - info.AddValue("RemoteStackIndex", 5); - info.AddValue("HResult", 5); - info.AddValue("Source", null); - info.AddValue("ExceptionMethod", null); - - // Serialization constructors are of the form .ctor(SerializationInfo, StreamingContext). - ConstructorInfo? constructor = null; - foreach (ConstructorInfo c in exceptionType.GetTypeInfo().DeclaredConstructors) - { - ParameterInfo[] parameters = c.GetParameters(); - if (parameters.Length == 2 && parameters[0].ParameterType == typeof(SerializationInfo) && parameters[1].ParameterType == typeof(StreamingContext)) - { - constructor = c; - break; - } - } - - // .NET Native prevents reflection on private constructors on non-serializable types. - if (constructor is null) - { - return; - } - - Exception ex = Assert.Throws(() => constructor.Invoke([info, new StreamingContext()])); - Assert.IsType(ex.InnerException); - } - - public static byte[] ToByteArray( - object obj, - FormatterAssemblyStyle assemblyStyle = FormatterAssemblyStyle.Full) - { - BinaryFormatter bf = new() - { - AssemblyFormat = assemblyStyle - }; - - using MemoryStream ms = new(); - bf.Serialize(ms, obj); - return ms.ToArray(); - } - - public static string ToBase64String( - object obj, - FormatterAssemblyStyle assemblyStyle = FormatterAssemblyStyle.Full) - { - byte[] raw = ToByteArray(obj, assemblyStyle); - return Convert.ToBase64String(raw); - } - - public static object FromByteArray(byte[] raw, - FormatterAssemblyStyle assemblyStyle = FormatterAssemblyStyle.Full) - { - BinaryFormatter binaryFormatter = new() - { - AssemblyFormat = assemblyStyle - }; - - using var serializedStream = new MemoryStream(raw); - return binaryFormatter.Deserialize(serializedStream); - } - - public static object FromBase64String(string base64Str, - FormatterAssemblyStyle assemblyStyle = FormatterAssemblyStyle.Full) - { - byte[] raw = Convert.FromBase64String(base64Str); - return FromByteArray(raw, assemblyStyle); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTestData.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTestData.cs deleted file mode 100644 index dc668b51a14..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTestData.cs +++ /dev/null @@ -1,1305 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.Design; -using System.Data; -using System.Data.SqlTypes; -using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Globalization; -using System.Net; -using System.Net.NetworkInformation; -using System.Net.Sockets; -using System.Net.WebSockets; -using System.Numerics; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; -using System.Security.Authentication; -using System.Security.Cryptography; -using System.Text; -using System.Text.RegularExpressions; -using System.Transactions; -using System.Xml; -using System.Xml.Schema; -using System.Xml.XPath; -using System.Xml.Xsl; -using Microsoft.CSharp.RuntimeBinder; -using System.Reflection.Metadata; -using System.Runtime.Serialization; -using System.Runtime; -using System.Runtime.Serialization.Formatters; -using FormatTests.Common.TestTypes; -using System.Text.Json; - -namespace BinaryFormatTests.FormatterTests; - -#pragma warning disable CA2201 // Do not raise reserved exception types - -public partial class BinaryFormatterTests -{ - private static readonly DateTime s_fixedTimestamp = DateTime.Parse("11/3/1989 04:50:29 AM", CultureInfo.InvariantCulture.DateTimeFormat); - // *** AUTO UPDATED BLOBS *** - - private static (object, TypeSerializableValue[])[]? s_serializableObjects; - - public static IEnumerable<(object, TypeSerializableValue[])> RawSerializableObjects() - { - if (s_serializableObjects is null) - { - // Save old culture and set a fixed culture for object instantiation - using (new ThreadCultureChange(CultureInfo.InvariantCulture, CultureInfo.InvariantCulture)) - { - s_serializableObjects = SerializableObjects().ToArray(); - } - } - - return s_serializableObjects; - } - - private static TheoryData? s_serializableObjects_MemberData; - - public static TheoryData SerializableObjects_MemberData => - s_serializableObjects_MemberData ??= RawSerializableObjects().ToTheoryData(); - - public static TheoryData SerializableEqualityComparers_MemberData => SerializableEqualityComparers().ToTheoryData(); - - /// - /// To update hashes execute UpdateTestData test -- only update the blobs whenever needed, randomly updating it could lead to test failures. - /// - private static IEnumerable<(object, TypeSerializableValue[])> SerializableEqualityComparers() - { - // Internal specialized equality comparers - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALgBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5VSW50MzJFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALgBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5VSW50MzJFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5JbnQ2NEVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5JbnQ2NEVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALgBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5VSW50NjRFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALgBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5VSW50NjRFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TQnl0ZUVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TQnl0ZUVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5JbnQxNkVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALcBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5JbnQxNkVudW0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - } - - /// - /// To update hashes execute UpdateTestData test -- only update the blobs whenever needed, randomly updating it could lead to test failures. - /// - private static IEnumerable<(object, TypeSerializableValue[])> SerializableObjects() - { - // Primitive types - yield return (byte.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQnl0ZQEAAAAHbV92YWx1ZQACAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQnl0ZQEAAAAHbV92YWx1ZQACAAs=", TargetFrameworkMoniker.netfx461) } ); - yield return (byte.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQnl0ZQEAAAAHbV92YWx1ZQAC/ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQnl0ZQEAAAAHbV92YWx1ZQAC/ws=", TargetFrameworkMoniker.netfx461) } ); - yield return (sbyte.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uU0J5dGUBAAAAB21fdmFsdWUACoAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uU0J5dGUBAAAAB21fdmFsdWUACoAL", TargetFrameworkMoniker.netfx461) } ); - yield return (sbyte.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uU0J5dGUBAAAAB21fdmFsdWUACn8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uU0J5dGUBAAAAB21fdmFsdWUACn8L", TargetFrameworkMoniker.netfx461) } ); - yield return (short.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MTYBAAAAB21fdmFsdWUABwCACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MTYBAAAAB21fdmFsdWUABwCACw==", TargetFrameworkMoniker.netfx461) } ); - yield return (short.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MTYBAAAAB21fdmFsdWUAB/9/Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MTYBAAAAB21fdmFsdWUAB/9/Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (ushort.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDE2AQAAAAdtX3ZhbHVlAA4AAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDE2AQAAAAdtX3ZhbHVlAA4AAAs=", TargetFrameworkMoniker.netfx461) } ); - yield return (ushort.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDE2AQAAAAdtX3ZhbHVlAA7//ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDE2AQAAAAdtX3ZhbHVlAA7//ws=", TargetFrameworkMoniker.netfx461) } ); - yield return (int.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAAAAIAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAAAAIAL", TargetFrameworkMoniker.netfx461) } ); - yield return (int.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACP///38L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACP///38L", TargetFrameworkMoniker.netfx461) } ); - yield return (uint.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDMyAQAAAAdtX3ZhbHVlAA8AAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDMyAQAAAAdtX3ZhbHVlAA8AAAAACw==", TargetFrameworkMoniker.netfx461) } ); - yield return (uint.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDMyAQAAAAdtX3ZhbHVlAA//////Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDMyAQAAAAdtX3ZhbHVlAA//////Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (long.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50NjQBAAAAB21fdmFsdWUACQAAAAAAAACACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50NjQBAAAAB21fdmFsdWUACQAAAAAAAACACw==", TargetFrameworkMoniker.netfx461) } ); - yield return (long.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50NjQBAAAAB21fdmFsdWUACf////////9/Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50NjQBAAAAB21fdmFsdWUACf////////9/Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (ulong.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDY0AQAAAAdtX3ZhbHVlABAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDY0AQAAAAdtX3ZhbHVlABAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) } ); - yield return (ulong.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDY0AQAAAAdtX3ZhbHVlABD//////////ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uVUludDY0AQAAAAdtX3ZhbHVlABD//////////ws=", TargetFrameworkMoniker.netfx461) } ); - yield return (char.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQ2hhcgEAAAAHbV92YWx1ZQADAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQ2hhcgEAAAAHbV92YWx1ZQADAAs=", TargetFrameworkMoniker.netfx461) } ); - yield return (char.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQ2hhcgEAAAAHbV92YWx1ZQAD77+/Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uQ2hhcgEAAAAHbV92YWx1ZQAD77+/Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (float.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uU2luZ2xlAQAAAAdtX3ZhbHVlAAv//3//Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uU2luZ2xlAQAAAAdtX3ZhbHVlAAv//3//Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (float.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uU2luZ2xlAQAAAAdtX3ZhbHVlAAv//39/Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uU2luZ2xlAQAAAAdtX3ZhbHVlAAv//39/Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (double.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uRG91YmxlAQAAAAdtX3ZhbHVlAAb////////v/ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uRG91YmxlAQAAAAdtX3ZhbHVlAAb////////v/ws=", TargetFrameworkMoniker.netfx461) } ); - yield return (double.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uRG91YmxlAQAAAAdtX3ZhbHVlAAb////////vfws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uRG91YmxlAQAAAAdtX3ZhbHVlAAb////////vfws=", TargetFrameworkMoniker.netfx461) } ); - yield return (decimal.MinValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAACA////////////////Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAACA////////////////Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (decimal.MaxValue, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAAAA////////////////Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAAAA////////////////Cw==", TargetFrameworkMoniker.netfx461) } ); - yield return (decimal.MinusOne, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAACAAAAAAAEAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uRGVjaW1hbAQAAAAFZmxhZ3MCaGkCbG8DbWlkAAAAAAgICAgAAACAAAAAAAEAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) } ); - yield return (true, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uQm9vbGVhbgEAAAAHbV92YWx1ZQABAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uQm9vbGVhbgEAAAAHbV92YWx1ZQABAQs=", TargetFrameworkMoniker.netfx461) } ); - yield return (false, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uQm9vbGVhbgEAAAAHbV92YWx1ZQABAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uQm9vbGVhbgEAAAAHbV92YWx1ZQABAAs=", TargetFrameworkMoniker.netfx461) } ); - yield return ("", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAAAL", TargetFrameworkMoniker.netfx461) } ); - yield return ("c", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAAFjCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAAFjCw==", TargetFrameworkMoniker.netfx461) } ); - yield return ("\u4F60\u597D", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAAbkvaDlpb0L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAAbkvaDlpb0L", TargetFrameworkMoniker.netfx461) } ); - yield return ("some\0data\0with\0null\0chars", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAABlzb21lAGRhdGEAd2l0aABudWxsAGNoYXJzCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAABlzb21lAGRhdGEAd2l0aABudWxsAGNoYXJzCw==", TargetFrameworkMoniker.netfx461) } ); - yield return ("<>&\"\'", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAAU8PiYiJws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAAU8PiYiJws=", TargetFrameworkMoniker.netfx461) } ); - yield return (" < ", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAAMgPCAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAAMgPCAL", TargetFrameworkMoniker.netfx461) } ); - yield return ($"minchar{char.MinValue}minchar", new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAGAQAAAA9taW5jaGFyAG1pbmNoYXIL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAGAQAAAA9taW5jaGFyAG1pbmNoYXIL", TargetFrameworkMoniker.netfx461) }); - - // Exceptions - var exception = new Exception("message", new Exception("Inner exception message")); - - yield return (PopulateException(exception), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAEFN5c3RlbS5FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5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A4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAABBQAAAAEAAAAJAgAAAAYMAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYNAAAABnNlY3JldAgBAQkOAAAAAQ4AAAAKAAAACAgBAAAABg8AAAADb25lCgs=", TargetFrameworkMoniker.netfx461) }); - - var aggregateException = new AggregateException("message", new Exception("Exception message", new Exception("Inner exception message"))); - yield return (PopulateException(aggregateException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABlTeXN0ZW0uQWdncmVnYXRlRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMPSW5uZXJFeGNlcHRpb25zAQEDAwEBAQABAAEHAylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCElN5c3RlbS5FeGNlcHRpb25bXQYCAAAAGVN5c3RlbS5BZ2dyZWdhdGVFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwA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WNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBx5TeXN0ZW0uQ29sbGVjdGlvbnMuSURpY3Rpb25hcnkQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24GDQAAABFFeGNlcHRpb24gbWVzc2FnZQoJDgAAAAoKCgAAAAAKABUTgAoKBwoAAAAAAQAAAAEAAAADEFN5c3RlbS5FeGNlcHRpb24JBQAAAAQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYQAAAABnNlY3JldAgBAQkRAAAAAQ4AAAAFAAAACQwAAAAGEwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBEQAAAAsAAAAICAEAAAAGFAAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var abandonedMutexException = new AbandonedMutexException("message", exception); - yield return (PopulateException(abandonedMutexException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAChTeXN0ZW0uVGhyZWFkaW5nLkFiYW5kb25lZE11dGV4RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25z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pb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var accessViolationException = new AccessViolationException("message", exception); - yield return (PopulateException(accessViolationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAA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AF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var ambiguousMatchException = new AmbiguousMatchException("message", exception); - yield return (PopulateException(ambiguousMatchException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAClTeXN0ZW0uUmVmbGVjdGlvbi5BbWJpZ3VvdXNNYXRjaEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAAClTeXN0ZW0uUmVmbGVjdGlvbi5BbWJpZ3VvdXNNYXRjaEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtE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DAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var appDomainUnloadedException = new AppDomainUnloadedException("message", exception); - yield return (PopulateException(appDomainUnloadedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACFTeXN0ZW0uQXBwRG9tYWluVW5sb2FkZWRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAhU3lzdGVtLkFwcERvbWFpblVubG9hZGVkRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAA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pbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var applicationException = new ApplicationException("message", exception); - yield return (PopulateException(applicationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQXBwbGljYXRpb25FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMB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sZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var argumentException = new ArgumentException("message", "paramName", exception); - yield return (PopulateException(argumentException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQXJndW1lbnRFeGNlcHRpb24NAAA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YWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var argumentNullException = new ArgumentNullException("message", exception); - yield return (PopulateException(argumentNullException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQXJndW1lbnROdWxsRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMJUGFyYW1OYW1lAQEDAwEBAQABAAEHASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAcU3lzdGVtLkFyZ3VtZW50TnVsbEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDA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uTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var argumentNullException2 = new ArgumentNullException("paramName", "message"); - yield return (PopulateException(argumentNullException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQXJndW1lbnROdWxsRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMJUGFyYW1OYW1lAQEDAwEBAQABAAEHASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAcU3lzdGVtLkFyZ3VtZW50TnVsbEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAoGBQAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgYAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GBwAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDA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cuLi4GBwAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCAAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoGCQAAAAlwYXJhbU5hbWUEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgsAAAAGc2VjcmV0CAEBCQwAAAABDAAAAAoAAAAICAEAAAAGDQAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var argumentOutOfRangeException = new ArgumentOutOfRangeException("message", exception); - yield return (PopulateException(argumentOutOfRangeException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uQXJndW1lbnRPdXRPZlJhbmdlRXhjZXB0aW9uDgAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMJUGFyYW1OYW1lC0FjdHVhbFZhbHVlAQEDAwEBAQABAAEHAQIpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4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lvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var argumentOutOfRangeException2 = new ArgumentOutOfRangeException("paramName", 4, "message"); - yield return (PopulateException(argumentOutOfRangeException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uQXJndW1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zhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netfx461) }); - - var arithmeticException = new ArithmeticException("message", exception); - yield return (PopulateException(arithmeticException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABpTeXN0ZW0uQXJpdGhtZXRpY0V4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAABpTeXN0ZW0uQXJpdGhtZXRpY0V4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeG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lvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var arrayTypeMismatchException = new ArrayTypeMismatchException("message", exception); - yield return (PopulateException(arrayTypeMismatchException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACFTeXN0ZW0uQXJyYXlUeXBlTWlzbWF0Y2hFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAhU3lzdGVtLkFycmF5VHlwZU1pc21hdGNoRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGN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dXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var authenticationException = new AuthenticationException("message", exception); - yield return (PopulateException(authenticationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA2U3lzdGVtLlNlY3VyaXR5LkF1dGhlbnRpY2F0aW9uLkF1dGhlbnRpY2F0aW9uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZX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AAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var badImageFormatException = new BadImageFormatException("message", "path.md", exception); - yield return (PopulateException(badImageFormatException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uQmFkSW1hZ2VGb3JtYXRFeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxdCYWRJbWFnZUZvcm1hdF9GaWxlTmFtZRhCYWRJbWFnZUZvcm1hdF9GdXNpb25Mb2cBAQMDAQEBAAEAAQcBASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLkJhZEltYWdlRm9ybWF0RXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoGCgAAAAdwYXRoLm1kCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkN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lY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkOAAAACQ8AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABAAAAAkWAAAAAgAAAAIAAAABDwAAAAUAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var barrierPostPhaseException = new BarrierPostPhaseException("message", exception); - yield return (PopulateException(barrierPostPhaseException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAqU3lzdGVtLlRocmVhZGluZy5CYXJyaWVyUG9zdFBoYXNlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2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A29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var cOMException = new COMException("message", exception); - yield return (PopulateException(cOMException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACtTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuQ09NRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAK1N5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcy5DT01FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhj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m5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var cOMException2 = new COMException("message", 0); - yield return (PopulateException(cOMException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACtTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuQ09NRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAK1N5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcy5DT01FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAKBgUAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYGAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgcAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABggAAAAXRXhj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AAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABggAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQkAAAACAAAAAgAAAAQJAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYKAAAABnNlY3JldAgBAQkLAAAAAQsAAAAJAAAACAgBAAAABgwAAAADb25lCgs=", TargetFrameworkMoniker.netfx461) }); - - var cannotUnloadAppDomainException = new CannotUnloadAppDomainException("message", exception); - yield return (PopulateException(cannotUnloadAppDomainException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACVTeXN0ZW0uQ2Fubm90VW5sb2FkQXBwRG9tYWluRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAJVN5c3RlbS5DYW5ub3RVbmxvYWRBcH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AABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var checkoutException = new CheckoutException("message", exception); - yield return (PopulateException(checkoutException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAuU3lzdGVt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dmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var checkoutException2 = new CheckoutException("message", 0); - yield return (PopulateException(checkoutException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAuU3lzdGVtLkNvbXBvbmVudE1vZGVsLkRlc2lnbi5DaGVja291dEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAuU3lzdGVtLkNvbXBvbmVudE1vZGVsLkRlc2lnbi5DaGVja291dEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAoGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZS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RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAuU3lzdGVtLkNvbXBvbmVudE1vZGVsLkRlc2lnbi5DaGVja291dEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAoGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgsAAAAGc2VjcmV0CAEBCQwAAAABDAAAAAoAAAAICAEAAAAGDQAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var imageFormatLimitationException = new ImageFormatLimitationException("message", exception); - yield return (PopulateException(imageFormatLimitationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAF1TeXN0ZW0uUmVmbGVjdGlvbi5NZXRhZGF0YSwgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAADlTeXN0ZW0uUmVmbGVjdGlvbi5NZXRhZGF0YS5JbWFnZUZvcm1hdExpbWl0YXRpb25FeGN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3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - // System.Runtime.Serialization - var invalidDataContractException = new InvalidDataContractException("message", exception); - yield return (PopulateException(invalidDataContractException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAF9TeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAOVN5c3RlbS5SdW50aW1lLlNlcmlhbGl6YXRpb24uSW52YWxpZERhdGFDb250cmFjdEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAA5U3lzdGVtLlJ1bnRpbWUuU2VyaWFsaXphdGlvbi5JbnZhbGlkRGF0YUNvbn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ransactionAbortedException("message", exception); - yield return (PopulateException(transactionAbortedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFZTeXN0ZW0uVHJhbnNhY3Rpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAL1N5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25BYm9ydGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAAC9TeXN0ZW0uVHJhbnNhY3Rpb25zLlRyYW5zYWN0aW9uQWJvcnRlZEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQsAAAACAAAAAgAAAA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29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var transactionException = new TransactionException("message", exception); - yield return (PopulateException(transactionException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFZTeXN0ZW0uVHJhbnNhY3Rpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAKFN5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwE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AA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var transactionInDoubtException = new TransactionInDoubtException("message", exception); - yield return (PopulateException(transactionInDoubtException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFZTeXN0ZW0uVHJhbnNhY3Rpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAL1N5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25JbkRvdWJ0RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAAC9TeXN0ZW0uVHJhbnNhY3Rpb25zLlRyYW5zYWN0aW9uSW5Eb3VidEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3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UmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var transactionManagerCommunicationException = new TransactionManagerCommunicationException("message", exception); - yield return (PopulateException(transactionManagerCommunicationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFZTeXN0ZW0uVHJhbnNhY3Rpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAPFN5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25NYW5hZ2VyQ29tbXVuaWNhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ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Xh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var transactionPromotionException = new TransactionPromotionException("message", exception); - yield return (PopulateException(transactionPromotionException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFZTeXN0ZW0uVHJhbnNhY3Rpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAMVN5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25Qcm9tb3Rpb25FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAMVN5c3RlbS5UcmFuc2FjdGlvbnMuVHJhbnNhY3Rpb25Qcm9tb3Rpb25FeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jv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Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAEBgAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JBAAAAAkOAAAACQ8AAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - // System.Xml - var xPathException = new XPathException("message", exception); - yield return (PopulateException(xPathException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQu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hAAAAAHbWVzc2FnZQkRAAAACRIAAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoRDAAAAAEAAAAJEAAAAAQOAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYYAAAABnNlY3JldAgBAQkZAAAAAREAAAAFAAAACRoAAAACAAAAAgAAAAESAAAABgAAAAkPAAAABhwAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARkAAAAOAAAACAgBAAAABh0AAAADb25lCgEaAAAADgAAAAkYAAAACAEBCR8AAAABHwAAAA4AAAAICAEAAAAJHQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var xmlException = new XmlException("message", exception, 1, 1); - yield return (PopulateException(xmlException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAF1N5c3RlbS5YbWwuWG1sRXhjZXB0aW9uEgAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMDcmVzBGFyZ3MKbGluZU51bWJlcgxsaW5lUG9zaXRpb24Jc291cmNlVXJpB3ZlcnNpb24BAQMDAQEBAAEAAQcBBgAAAgEpU3lzdGVtLkNvbG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GljdGlvbmFyeU5vZGUGGAAAAAZzZWNyZXQIAQEJGQAAAAERAAAABQAAAAkaAAAAAgAAAAIAAAABEgAAAAYAAAAJDwAAAAYcAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEZAAAADgAAAAgIAQAAAAYdAAAAA29uZQoBGgAAAA4AAAAJGAAAAAgBAQkfAAAAAR8AAAAOAAAACAgBAAAACR0AAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var xmlSchemaException = new XmlSchemaException("message", exception, 1, 1); - yield return (PopulateException(xmlSchemaException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAJFN5c3RlbS5YbWwuU2NoZW1hLlhtbFNjaGVtYUV4Y2VwdGlvbhIAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzA3JlcwRhcmdzCXNvdXJjZVVyaQpsaW5lTnVtYmVyDGxpbmVQb3NpdGlvbgd2ZXJzaW9uAQEDAwEBAQABAAEHAQYCAAABKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIICAIAAAAGAwAAACRTeXN0ZW0uWG1sLlNjaGVtYS5YbWxTY2hlbWFFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAA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AAAAOAAAACAgBAAAACR0AAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var xmlSchemaInferenceException = new XmlSchemaInferenceException("message", exception, 1, 1); - yield return (PopulateException(xmlSchemaInferenceException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAALVN5c3RlbS5YbWwuU2NoZW1hLlhtbFNjaGVtYUluZmVyZW5jZUV4Y2VwdGlvbhIAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzA3JlcwRhcmdzCXNvdXJjZVVyaQpsaW5lTnVtYmVyDGxpbmVQb3NpdGlvbgd2ZXJzaW9uAQEDAwEBAQABAAEHAQYCAAABKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIICAIAAAAGAwAAAC1TeXN0ZW0uWG1sLlNjaGVtYS5YbWxTY2hlbWFJbmZlcmVuY2VFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgYLAAAAA3swfQkMAAAACgEAAAABAAAABg0AAAADMi4wBAUAAAApU3lzdGVtLkN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b25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQ4AAAACAAAAAgAAAAQGAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBg8AAAAQU3lzdGVtLkV4Y2VwdGlvbgYQAAAAB21lc3NhZ2UJEQAAAAkSAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKEQwAAAABAAAACRAAAAAEDgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGGAAAAAZzZWNyZXQIAQEJGQAAAAERAAAABQAAAAkaAAAAAgAAAAIAAAABEgAAAAYAAAAJDwAAAAYcAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEZAAAADgAAAAgIAQAAAAYdAAAAA29uZQoBGgAAAA4AAAAJGAAAAAgBAQkfAAAAAR8AAAAOAAAACAgBAAAACR0AAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var xmlSchemaValidationException = new XmlSchemaValidationException("message", exception, 1, 1); - yield return (PopulateException(xmlSchemaValidationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1T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JpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDwAAABBTeXN0ZW0uRXhjZXB0aW9uBhAAAAAHbWVzc2FnZQkRAAAACRIAAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoRDAAAAAEAAAAJEAAAAAQOAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYYAAAABnNlY3JldAgBAQkZAAAAAREAAAAFAAAACRoAAAACAAAAAgAAAAESAAAABgAAAAkPAAAABhwAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARkAAAAOAAAACAgBAAAABh0AAAADb25lCgEaAAAADgAAAAkYAAAACAEBCR8AAAABHwAAAA4AAAAICAEAAAAJHQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var xsltCompileException = new XsltCompileException(exception, "///file", 1, 1); - yield return (PopulateException(xsltCompileException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAI1N5c3RlbS5YbWwuWHNsLlhzbHRDb21waWxlRXhjZXB0aW9uEgAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDkl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REYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYPAAAAEFN5c3RlbS5FeGNlcHRpb24GEAAAAAdtZXNzYWdlCREAAAAJEgAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQOAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYXAAAABnNlY3JldAgBAQkYAAAAAREAAAAFAAAACRkAAAACAAAAAgAAAAESAAAABgAAAAkPAAAABhsAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARgAAAAOAAAACAgBAAAABhwAAAADb25lCgEZAAAADgAAAAkXAAAACAEBCR4AAAABHgAAAA4AAAAICAEAAAAJHAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var xsltException = new XsltException("message", exception); - yield return (PopulateException(xsltException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE1TeXN0ZW0uWG1sLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAHFN5c3RlbS5YbWwuWHNsLlhzbHRFeGNlcHRpb24SAAAACUNsYXNzTmFtZQdNZXN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AkKAAAACgQNAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYWAAAABnNlY3JldAgBAQkXAAAAARAAAAAFAAAACRgAAAACAAAAAgAAAAERAAAABgAAAAkOAAAABhoAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARcAAAANAAAACAgBAAAABhsAAAADb25lCgEYAAAADQAAAAkWAAAACAEBCR0AAAABHQAAAA0AAAAICAEAAAAJGwAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var validationException = new ValidationException("message", exception); - yield return (PopulateException(validationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAGhTeXN0ZW0uQ29tcG9uZW50TW9kZWwuRGF0YUFubm90YXRpb25zLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49MzFiZjM4NTZhZDM2NGUzNQUBAAAAOVN5c3RlbS5Db21wb25lbnRNb2RlbC5EYXRhQW5ub3RhdGlvbnMuVmFsaWRhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAA5U3lz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wAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var constraintException = new ConstraintException("message", exception); - yield return (PopulateException(constraintException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5Db25zdHJhaW50RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAAB9TeXN0ZW0uRGF0YS5Db25zdHJhaW50RXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAYAAAAQU3lzdGVtLkV4Y2Vw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0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var contextMarshalException = new ContextMarshalException("message", exception); - yield return (PopulateException(contextMarshalException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uQ29udGV4dE1hcnNoYWxFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLkNvbnRleHRNYXJzaGFsRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tB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bmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - Exception contractException = (Exception)Type.GetType("System.Diagnostics.Contracts.ContractException", throwOnError: true)! - .GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, [typeof(ContractFailureKind), typeof(string), typeof(string), typeof(string), typeof(Exception)], null)! - .Invoke([ContractFailureKind.Invariant, "failure", "userMessage", "condition", exception]); - yield return (PopulateException(contractException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC5TeXN0ZW0uRGlhZ25vc3RpY3MuQ29udHJhY3RzLkNvbnRyYWN0RXhjZXB0aW9uDwAAAAlDbGFzc05hbWUHTWVzc2FnZQRE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Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYOAAAAEFN5c3RlbS5FeGNlcHRpb24GDwAAAAdtZXNzYWdlCRAAAAAJEQAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQNAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYWAAAABnNlY3JldAgBAQkXAAAAARAAAAAEAAAACRgAAAACAAAAAgAAAAERAAAABQAAAAkOAAAABhoAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARcAAAANAAAACAgBAAAABhsAAAADb25lCgEYAAAADQAAAAkWAAAACAEBCR0AAAABHQAAAA0AAAAICAEAAAAJGwAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var cookieException = new CookieException(); - yield return (PopulateException(cookieException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAaU3lzdGVtLk5ldC5Db29raWVFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwM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icException = new CryptographicException("message", exception); - yield return (PopulateException(cryptographicException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADNTeXN0ZW0uU2VjdXJpdHkuQ3J5cHRvZ3JhcGh5LkNyeXB0b2dyYXBoaWNFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAzU3lzdGVtLlNlY3VyaXR5LkNyeXB0b2dyYXBoeS5DcnlwdG9ncmFwaGljRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3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YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var cryptographicUnexpectedOperationException = new CryptographicUnexpectedOperationException("message", exception); - yield return (PopulateException(cryptographicUnexpectedOperationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAEZTeXN0ZW0uU2VjdXJpdHkuQ3J5cHRvZ3JhcGh5LkNyeXB0b2dyYXBoaWNVbmV4cGVjdGVkT3BlcmF0aW9uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAARlN5c3RlbS5TZWN1cml0eS5DcnlwdG9ncmFwaHkuQ3J5cHRvZ3JhcGhpY1VuZXhwZWN0ZWRPcGVyYXRpb25FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmlu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W9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var cultureNotFoundException = new CultureNotFoundException("message", exception); - yield return (PopulateException(cultureNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC1TeXN0ZW0uR2xvYmFsaXphdGlvbi5DdWx0dXJlTm90Rm91bmRFeGNlcHRpb24PAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBT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aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var customAttributeFormatException = new CustomAttributeFormatException("message", exception); - yield return (PopulateException(customAttributeFormatException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADBTeXN0ZW0uUmVmbGVjdGlvbi5DdXN0b21BdHRyaWJ1dGVGb3JtYXRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAwU3lzdGVtLlJlZmxlY3Rpb24uQ3VzdG9tQXR0cmlidXRlRm9ybWF0RX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IAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var dBConcurrencyException = new DBConcurrencyException("message", exception); - yield return (PopulateException(dBConcurrencyException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MT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5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var dataException = new DataException("message", exception); - yield return (PopulateException(dataException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABlTeXN0ZW0uRGF0YS5EYXRhRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAABlTeXN0ZW0uRGF0YS5EYXRhRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRp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JpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var dataMisalignedException = new DataMisalignedException("message", exception); - yield return (PopulateException(dataMisalignedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uRGF0YU1pc2FsaWduZWRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29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aW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var decoderFallbackException = new DecoderFallbackException("message", exception); - // DecoderFallbackException sets its HResult itself therefore we pass setHResult as false. - yield return (PopulateException(decoderFallbackException, setHResult: false), new T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lBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var decoderFallbackException2 = new DecoderFallbackException("message", [1, 2], 0); - // DecoderFallbackException sets its HResult itself therefore we pass setHResult as false. - yield return (PopulateException(decoderFallbackException2, setHResult: false), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACRTeXN0ZW0uVGV4dC5EZWNvZGVyRmFsbGJhY2tFeGNlcHRpb24NAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwlQYXJhbU5hbWUBAQMDAQEBAAEAAQcBKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAACRTeXN0ZW0uVGV4dC5EZWNvZGVyRmFsbGJhY2tFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAKBgUAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYGAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgcAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAApXAAeABggAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFye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MKCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkJAAAAAgAAAAIAAAAECQAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCgAAAAZzZWNyZXQIAQEJCwAAAAELAAAACQAAAAgIAQAAAAYMAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var deletedRowInaccessibleException = new DeletedRowInaccessibleException("message", exception); - yield return (PopulateException(deletedRowInaccessibleException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACtTeXN0ZW0uRGF0YS5EZWxldGVkUm93SW5hY2Nlc3NpYmxlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwA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lvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAYAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var divideByZeroException = new DivideByZeroException("message", exception); - yield return (PopulateException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AAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var dllNotFoundException = new DllNotFoundException("message", exception); - yield return (PopulateException(dllNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uRGxsTm90Rm91bmRFeGNlcHRpb24QAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxFUeXBlTG9hZENsYXNzTmFtZRRUeXBlTG9hZEFzc2VtYmx5TmFtZRJUeXBlTG9hZE1lc3NhZ2VBcmcSVHlwZUxvYWRSZXNvdXJjZUlEAQEDAwEBAQABAAEHAQEBAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAYCAAAAG1N5c3RlbS5EbGxOb3RGb3VuZEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCgoKAAAAAAQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGV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0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var driveNotFoundException = new DriveNotFoundException("message", exception); - yield return (PopulateException(driveNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uSU8uRHJpdmVOb3RGb3VuZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0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29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var duplicateNameException = new DuplicateNameException("message", exception); - yield return (PopulateException(duplicateNameException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj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ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var duplicateWaitObjectException = new DuplicateWaitObjectException("message", exception); - yield return (PopulateException(duplicateWaitObjectException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACNTeXN0ZW0uRHVwbGljYXRlV2FpdE9iamVjdEV4Y2VwdGlvbg0AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCVBhcmFtTmFtZQEBAwMBAQEAAQABBwEpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAI1N5c3RlbS5EdXBsaWNhdGVXYWl0T2JqZWN0RXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAA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Y2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var duplicateWaitObjectException2 = new DuplicateWaitObjectException("paramName", "message"); - yield return (PopulateException(duplicateWaitObjectException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACNTeXN0ZW0uRHVwbGljYXRlV2FpdE9iamVjdEV4Y2VwdGlvbg0AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCV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SZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCVBhcmFtTmFtZQEBAwMBAQEAAQABBwEpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAI1N5c3RlbS5EdXBsaWNhdGVXYWl0T2JqZWN0RXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgYJAAAACXBhcmFtTmFtZQQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var encoderFallbackException = new EncoderFallbackException("message", exception); - yield return (PopulateException(encoderFallbackException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACRTeXN0ZW0uVGV4dC5FbmNvZGVyR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ACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var endOfStreamException = new EndOfStreamException("message", exception); - yield return (PopulateException(endOfStreamException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uSU8uRW5kT2ZTdHJlYW1FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLklPLkVuZE9mU3RyZWFtRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU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Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var entryPointNotFoundException = new EntryPointNotFoundException("message", exception); - yield return (PopulateException(entryPointNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRW50cnlQb2ludE5vdEZvdW5kRXhjZXB0aW9uEAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMRVHlwZUxvYWRDbGFzc05hbWUUVHlwZUxvYWRBc3NlbWJseU5hbWUSVHlwZUxvYWRNZXNzYWdlQXJnElR5cGVMb2FkUmVzb3VyY2VJRAEBAwMBAQEAAQABBwEBAQApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAggGAgAAACJTeXN0ZW0uRW50cnlQb2ludE5vdEZvdW5kRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi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tEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var evaluateException = new EvaluateException("message", exception); - yield return (PopulateException(evaluateException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2V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vbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var eventSourceException = new EventSourceException("message", exception); - yield return (PopulateException(eventSourceException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC9TeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZy5FdmVudFNvdXJjZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAAC9TeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZy5FdmVudFNvdXJjZUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3l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Tb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - -#pragma warning disable CS0618 // Type or member is obsolete - var executionEngineException = new ExecutionEngineException("message", exception); -#pragma warning restore CS0618 // Type or member is obsolete - yield return (PopulateException(executionEngineException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uRXhlY3V0aW9uRW5naW5lRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGV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tLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var externalException = new ExternalException("message", exception); - yield return (PopulateException(externalException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADBTeXN0ZW0uUnVudGltZS5JbnRlcm9w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FQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var externalException2 = new ExternalException("message", 0); - yield return (PopulateException(externalException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADBTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuRXh0ZXJuYWxFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAwU3lzdGVtLlJ1bnRpbWUuSW50ZXJvcFNlcnZpY2VzLkV4dGVybmFsRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ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ZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkJAAAAAgAAAAIAAAAECQAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCgAAAAZzZWNyZXQIAQEJCwAAAAELAAAACQAAAAgIAQAAAAYMAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var fieldAccessException = new FieldAccessException("message", exception); - yield return (PopulateException(fieldAccessException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uRmllbGRBY2Nlc3NFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAbU3lzdGVtLkZpZWxkQWNjZXNzRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2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ABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var fileLoadException = new FileLoadException("message", "path.md", exception); - yield return (PopulateException(fileLoadException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uSU8uRmlsZUxvYWRFeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxFGaWxlTG9hZF9GaWxlTmFtZRJGaWxlTG9hZF9GdXNpb25Mb2cBAQMDAQEBAAEAAQcBASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5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24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkOAAAACQ8AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABAAAAAkWAAAAAgAAAAIAAAABDwAAAAUAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var fileNotFoundException = new FileNotFoundException("message", exception); - yield return (PopulateException(fileNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQ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S5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var formatException = new FormatException("message", exception); - yield return (PopulateException(formatException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uRm9ybWF0RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAFlN5c3RlbS5Gb3JtYXRFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4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HRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var httpListenerException = new HttpListenerException(404, "not found"); - yield return (PopulateException(httpListenerException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAgU3lzdGVtLk5ldC5IdHRwTGlzdGVuZXJFeGNlcHRpb24NAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cw9OYXRpdmVFcnJvckNvZGUBAQMDAQEBAAEAAQcAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24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A9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cw9OYXRpdmVFcnJvckNvZGUBAQMDAQEBAAEAAQcAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIIAgAAAAYDAAAAIFN5c3RlbS5OZXQuSHR0cExpc3RlbmVyRXhjZXB0aW9uBgQAAAAJbm90IGZvdW5kCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKlAEAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var iOException = new IOException("message", exception); - yield return (PopulateException(iOException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABVTeXN0ZW0uSU8uSU9FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJF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oniker.netfx461) }); - - var iOException2 = new IOException("message", 1); - yield return (PopulateException(iOException2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABVTeXN0ZW0uSU8uSU9FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAVU3lzdGVtLklPLklPRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkJAAAAAgAAAAIAAAAECQAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCgAAAAZzZWNyZXQIAQEJCw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AAELAAAACQAAAAgIAQAAAAYMAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var inRowChangingEventException = new InRowChangingEventException("message", exception); - yield return (PopulateException(inRowChangingEventException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACdTeXN0ZW0uRGF0YS5JblJvd0NoYW5naW5nRXZlbnRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAJ1N5c3RlbS5EYXRhLkluUm93Q2hhbmdpbmdFdmVudEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ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zdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var indexOutOfRangeException = new IndexOutOfRangeException("message", exception); - yield return (PopulateException(indexOutOfRangeException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uSW5kZXhPdXRPZlJhbmdlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAH1N5c3RlbS5JbmRleE91dE9mUmFu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jZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var insufficientExecutionStackException = new InsufficientExecutionStackException("message", exception); - yield return (PopulateException(insufficientExecutionStackException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACpTeXN0ZW0uSW5zdWZmaWNpZW50RXhlY3V0aW9uU3RhY2tFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSG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UKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var insufficientMemoryException = new InsufficientMemoryException("message", exception); - yield return (PopulateException(insufficientMemoryException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uSW5zdWZmaWNpZW50TWVtb3J5RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAIlN5c3RlbS5JbnN1ZmZpY2llbnRNZW1vcnlFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0a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9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var invalidAsynchronousStateException = new InvalidAsynchronousStateException("message", exception); - yield return (PopulateException(invalidAsynchronousStateException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA3U3lzdGVtLkNvbXBvbmVudE1vZGVsLkludmFsaWRBc3luY2hyb25vdXNTdGF0ZUV4Y2VwdGlvbg0AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCVBhcmFtTmFtZQEBAwMBAQEAAQABBwEpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAADdTeXN0ZW0uQ29tcG9uZW50TW9kZWwuSW52YWxpZEFzeW5jaHJvbm91c1N0YXRlRXhjZXB0aW9uBg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uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQsAAAACAAAAAgAAAAQGAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var invalidCastException = new InvalidCastException("message", exception); - yield return (PopulateException(invalidCastException), new TypeSerializableValue[] { new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gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var invalidComObjectException = new InvalidComObjectException("message", exception); - yield return (PopulateException(invalidComObjectException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADhTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuSW52YWxpZENvbU9iamVjdEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADhTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuSW52YWxpZENvbU9iamVjdEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0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dGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var invalidConstraintException = new InvalidConstraintException("message", exception); - yield return (PopulateException(invalidConstraintException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0ZW0uRGF0YS5JbnZhbGlkQ29uc3RyYWludEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5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("message", exception); - yield return (PopulateException(invalidCredentialException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA5U3lzdGVtLlNlY3VyaXR5LkF1dGhlbnRpY2F0aW9uLkludmFsaWRDcmVkZW50aWFsRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAADlTeXN0ZW0uU2VjdXJpdHkuQXV0aGVudGljYXRpb24uSW52YWxpZENyZWRlbnRpYWxFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAEBgAAABBTeXN0ZW0uR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25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JBAAAAAkOAAAACQ8AAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var invalidDataException = new InvalidDataException("message", exception); - yield return (PopulateException(invalidDataException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAeU3lzdGVtLklPLkludmFsaWREYXRhRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxl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EnumArgumentException = new InvalidEnumArgumentException("message", exception); - yield return (PopulateException(invalidEnumArgumentException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAyU3lzdGVtLkNvbXBvbmVudE1vZGVsLkludmFsaWRFbnVtQXJndW1lbnRFeGNlcHRpb24NAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwlQYXJhbU5hbWUBAQMDAQEBAAEAAQcBKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAyU3lzdGVtLkNvbXBvbmVudE1vZGVsLkludmFsaWRFbnVtQXJndW1lbnRFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgoEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAYAA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aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var invalidExpressionException = new InvalidExpressionException("message", exception); - yield return (PopulateException(invalidExpressionException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0ZW0uRGF0YS5JbnZhbGlkRXhwcmVzc2lvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBA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AARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var invalidFilterCriteriaException = new InvalidFilterCriteriaException("message", exception); - yield return (PopulateException(invalidFilterCriteriaException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADBTeXN0ZW0uUmVmbGVjdGlvbi5JbnZhbGlkRmlsdGVyQ3JpdGVyaWFFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAwU3lzdGVtLlJlZmxlY3Rpb24uSW52YWxpZEZpbHRlckNyaXRlcmlhRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ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aWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var invalidOleVariantTypeException = new InvalidOleVariantTypeException("message", exception); - yield return (PopulateException(invalidOleVariantTypeException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAD1TeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuSW52YWxpZE9sZVZhcmlhbnRUeXBlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAPVN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcy5JbnZhbGlkT2xlVmFyaWFudFR5cGVFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1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HTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var invalidOperationException = new InvalidOperationException("message", exception); - yield return (PopulateException(invalidOperationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uSW52YWxpZE9wZXJhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2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Moniker.netfx461) }); - - var invalidProgramException = new InvalidProgramException("message", exception); - yield return (PopulateException(invalidProgramException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uSW52YWxpZFByb2dyYW1FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLkludmFsaWRQcm9ncmFtRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZG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c2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var invalidTimeZoneException = new InvalidTimeZoneException("message", exception); - yield return (PopulateException(invalidTimeZoneException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj0zLjUuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uSW52YWxpZFRpbWVab25lRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAAB9TeXN0ZW0uSW52YWxpZFRpbWVab25lRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN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UcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var jsonException = new JsonException("message", path: "path", lineNumber: 1, bytePositionInLine: 2, innerException: exception); - yield return (PopulateException(jsonException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFNTeXN0ZW0uVGV4dC5Kc29uLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Y2M3YjEzZmZjZDJkZGQ1MQUBAAAAHlN5c3RlbS5UZXh0Lkpzb24uSnNvbkV4Y2VwdGlvbhAAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwV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zdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDgAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJEAAAAAkRAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBA0AAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhYAAAAGc2VjcmV0CAEBCRcAAAABEAAAAAUAAAAJGAAAAAIAAAACAAAAAREAAAAGAAAACQ4AAAAGGgAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFwAAAA0AAAAICAEAAAAGGwAAAANvbmUKARgAAAANAAAACRYAAAAIAQEJHQAAAAEdAAAADQAAAAgIAQAAAAkbAAAACgs=", TargetFrameworkMoniker.netcoreapp30) }); - - var jsonExceptionNulls = new JsonException("message", null, null, null); - yield return (PopulateException(jsonExceptionNulls), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFNTeXN0ZW0uVGV4dC5Kc29uLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Y2M3YjEzZmZjZDJkZGQ1MQUBAAAAHlN5c3RlbS5UZXh0Lkpzb24uSnNvbkV4Y2VwdGlvbhAAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV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GlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgwAAAAGc2VjcmV0CAEBCQ0AAAABDQAAAAsAAAAICAEAAAAGDgAAAANvbmUKCw==", TargetFrameworkMoniker.netcoreapp30) }); - - // The JsonReaderException is internal. - Exception jsonReaderException = (Exception)typeof(JsonException).Assembly.GetType("System.Text.Json.JsonReaderException", throwOnError: true)! - .GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, [typeof(string), typeof(long), typeof(long)], null )! - .Invoke(["message", 1, 2]); - - yield return (PopulateException(jsonReaderException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFNTeXN0ZW0uVGV4dC5Kc29uLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Y2M3YjEzZmZjZDJkZGQ1MQUBAAAAJFN5c3RlbS5UZXh0Lkpzb24uSnNvblJlYWRlckV4Y2VwdGlvbhAAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCkxpbmVOdW1iZXISQnl0ZVBvc2l0aW9uSW5MaW5lBFBhdGgNQWN0dWFsTWVzc2FnZQEBAwMBAQEAAQABBwMDAQEpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgxTeXN0ZW0uSW50NjQMU3lzdGVtLkludDY0AgAAAAYDAAAAJFN5c3RlbS5UZXh0Lkpzb24uSnNvblJlYWRlckV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAoGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoICQEAAAAAAAAACAkCAAAAAAAAAAoJBAAAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGDAAAAAZzZWNyZXQIAQEJDQAAAAENAAAACwAAAAgIAQAAAAYOAAAAA29uZQoL", TargetFrameworkMoniker.netcoreapp30) }); - - var keyNotFoundException = new KeyNotFoundException("message", exception); - yield return (PopulateException(keyNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC9TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlOb3RGb3VuZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvd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x461) }); - - var licenseException = new LicenseException(typeof(string), aggregateException, "message", exception); - yield return (PopulateException(licenseException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLkNvbXBvbmVudE1vZGVsLkxpY2Vuc2VFeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwR0eXBlCGluc3RhbmNlAQEDAwEBAQABAAEHAgMpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAhlTeXN0ZW0uQWdncmVnYXRlRXhjZXB0aW9uAgAAAAYDAAAAJlN5c3RlbS5Db21wb25lbnRNb2RlbC5MaWNlbnNlRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoKCQsAAAAEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb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ICAEAAAAJKAAAAAoBLAAAAAwAAAAICAEAAAAJKAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var lockRecursionException = new LockRecursionException("message", exception); - yield return (PopulateException(lockRecursionException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj0zLjUuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACdTeXN0ZW0uVGhyZWFkaW5nLkxvY2tSZWN1cnNpb25FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAJ1N5c3RlbS5UaHJlYWRpbmcuTG9ja1JlY3Vyc2lvbkV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN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GVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var marshalDirectiveException = new MarshalDirectiveException("message", exception); - yield return (PopulateException(marshalDirectiveException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADhTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuTWFyc2hhbERpcmVjdGl2ZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlc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WQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var memberAccessException = new MemberAccessException("message", exception); - yield return (PopulateException(memberAccessException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQA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2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var methodAccessException = new MethodAccessException("message", exception); - yield return (PopulateException(methodAccessException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uTWV0aG9kQWNjZXNzRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAHFN5c3RlbS5NZXRob2RBY2Nlc3NFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAA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nlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var missingFieldException = new MissingFieldException("message", exception); - yield return (PopulateException(missingFieldException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uTWlzc2luZ0ZpZWxkRXhjZXB0aW9uDwAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMLTU1DbGFzc05hbWUMTU1NZW1iZXJOYW1lC01NU2lnbmF0dXJlAQEDAwEBAQABAAEHAQEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICBgIAAAAcU3lzdGVtLk1pc3NpbmdGaWVsZEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc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VN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var missingManifestResourceException = new MissingManifestResourceException("message", exception); - yield return (PopulateException(missingManifestResourceException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADFTeXN0ZW0uUmVzb3VyY2VzLk1pc3NpbmdNYW5pZmVzdFJlc291cmNlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZX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==", TargetFrameworkMoniker.netfx461) }); - - var missingMemberException = new MissingMemberException("String", "Length"); - yield return (PopulateException(missingMemberException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uTWlzc2luZ01lbWJlckV4Y2VwdGlvbg8AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzC01NQ2xhc3NOYW1lDE1NTWVtYmVyTmFtZQtNTVNpZ25hdHVyZQEBAwMBAQEAAQABBwEBBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgYCAAAAHVN5c3RlbS5NaXNzaW5nTWVtYmVyRXhjZXB0aW9uBgMAAAAVQ2Fubm90IGFjY2VzcyBtZW1iZXIuCQQAAAAKBgUAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYGAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgcAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABggAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBgkAAAAGU3RyaW5nBgoAAAAGTGVuZ3RoCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3R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nQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGDAAAAAZzZWNyZXQIAQEJDQAAAAENAAAACwAAAAgIAQAAAAYOAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var missingMethodException = new MissingMethodException("String", "Length"); - yield return (PopulateException(missingMethodException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uTWlzc2luZ01ldGhvZEV4Y2VwdGlvbg8AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzC01NQ2xhc3NOYW1lDE1NTWVtYmVyTmFtZQtNTVNpZ25hdHVyZQEBAwMBAQEAAQABBwEBBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgYCAAAAHVN5c3RlbS5NaXNzaW5nTWV0aG9kRXhjZXB0aW9uBgMAAAAlQXR0ZW1wdGVkIHRvIGFjY2VzcyBhIG1pc3NpbmcgbWVtYmVyLgkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cm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5NaXNzaW5nTWV0aG9kRXhjZXB0aW9uBgMAAAAlQXR0ZW1wdGVkIHRvIGFjY2VzcyBhIG1pc3NpbmcgbWVtYmVyLgkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgYJAAAABlN0cmluZwYKAAAABkxlbmd0aAoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgwAAAAGc2VjcmV0CAEBCQ0AAAABDQAAAAsAAAAICAEAAAAGDgAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var missingPrimaryKeyException = new MissingPrimaryKeyException("message", exception); - yield return (PopulateException(missingPrimaryKeyException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0ZW0uRGF0YS5NaXNzaW5nUHJpbWFyeUtleUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB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ZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var missingSatelliteAssemblyException = new MissingSatelliteAssemblyException("message", "en-US"); - yield return (PopulateException(missingSatelliteAssemblyException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uUmVzb3VyY2VzLk1pc3NpbmdTYXRlbGxpdGVBc3NlbWJseUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uUmVzb3VyY2VzLk1pc3NpbmdTYXRlbGxpdGVBc3NlbWJseUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAoGBQAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgYAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GBwAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCAAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb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AAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCQAAAAIAAAACAAAABAkAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgoAAAAGc2VjcmV0CAEBCQsAAAABCwAAAAkAAAAICAEAAAAGDAAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var multicastNotSupportedException = new MulticastNotSupportedException("message", exception); - yield return (PopulateException(multicastNotSupportedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACVTeXN0ZW0uTXVsdGljYXN0Tm90U3VwcG9ydGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAJVN5c3RlbS5NdWx0aWNhc3ROb3RTdXBwb3J0ZWRFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh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YXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var networkInformationException = new NetworkInformationException(); - yield return (PopulateException(networkInformationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA5U3lzdGVtLk5ldC5OZXR3b3JrSW5mb3JtYXRpb24uTmV0d29ya0luZm9ybWF0aW9uRX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U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var noNullAllowedException = new NoNullAllowedException("message", exception); - yield return (PopulateException(noNullAllowedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0ZW0uRGF0YS5Ob051bGxBbGxvd2VkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAACJTeXN0ZW0uRGF0YS5Ob051bGxBbGxvd2VkRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggA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AACAAAABAYAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var notFiniteNumberException = new NotFiniteNumberException("message", 32.485, exception); - yield return (PopulateException(notFiniteNumberException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uTm90RmluaXRlTnVtYmVyRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9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2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var notImplementedException = new NotImplementedException("message", exception); - yield return (PopulateException(notImplementedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uTm90SW1wbGVtZW50ZWRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLk5vdEltcGxlbWVudGVkRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ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vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var notSupportedException = new NotSupportedException("message", exception); - yield return (PopulateException(notSupportedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uTm90U3VwcG9ydGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAHFN5c3RlbS5Ob3RTdXBwb3J0ZWRFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZW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25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var nullReferenceException = new NullReferenceException("message", exception); - yield return (PopulateException(nullReferenceException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uTnVsbFJlZmVyZW5jZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAAB1TeXN0ZW0uTnVsbFJlZmVyZ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bS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var objectDisposedException = new ObjectDisposedException("objectname", "message"); - yield return (PopulateException(objectDisposedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uT2JqZWN0RGlzcG9zZWRFeGNlcHRpb24NAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW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NzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwpPYmplY3ROYW1lAQEDAwEBAQABAAEHASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAeU3lzdGVtLk9iamVjdERpc3Bvc2VkRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgYJAAAACm9iamVjdG5hbWUEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgsAAAAGc2VjcmV0CAEBCQwAAAABDAAAAAoAAAAICAEAAAAGDQAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var operationCanceledException = new OperationCanceledException("message", exception, new CancellationToken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CRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var outOfMemoryException = new OutOfMemoryException("message", exception); - yield return (PopulateException(outOfMemoryException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uT3V0T2ZNZW1vcnlFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAbU3lzdGVtLk91dE9mTWVtb3J5RXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3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AAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var overflowException = new OverflowException("message", exception); - yield return (PopulateException(overflowException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uT3ZlcmZsb3dFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAYU3lzdGVtLk92ZXJmbG93RXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAAB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NrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var pathTooLongException = new PathTooLongException("message", exception); - yield return (PopulateException(pathTooLongException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB5TeXN0ZW0uSU8uUGF0aFRvb0xvbmdFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIA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3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var pingException = new PingException("message", exception); - yield return (PopulateException(pingException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAArU3lzdGVtLk5ldC5OZXR3b3JrS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ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var platformNotSupportedException = new PlatformNotSupportedException("message", exception); - yield return (PopulateException(platformNotSupportedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACRTeXN0ZW0uUGxhdGZvcm1Ob3RTdXBwb3J0ZWRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAkU3lzdGVtLlBsYXRmb3JtTm90U3VwcG9ydGVkRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzd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WN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var protocolViolationException = new ProtocolViolationException("message"); - yield return (PopulateException(protocolViolationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAlU3lzdGVtLk5ldC5Qcm90b2NvbFZpb2xhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEH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IZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAlU3lzdGVtLk5ldC5Qcm90b2NvbFZpb2xhdGlvbkV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAoGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBgsAAAAGc2VjcmV0CAEBCQwAAAABDAAAAAoAAAAICAEAAAAGDQAAAANvbmUKCw==", TargetFrameworkMoniker.netfx461) }); - - var rankException = new RankException("message", exception); - yield return (PopulateException(rankException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABRTeXN0ZW0uUmF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gAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var readOnlyException = new ReadOnlyException("message", exception); - yield return (PopulateException(readOnlyException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5SZWFkT25seUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAdU3lzdGVtLkRhdGEuUmVhZE9ubHlFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZ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50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JBAAAAAkOAAAACQ8AAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var reflectionTypeLoadException = new ReflectionTypeLoadException([typeof(string), typeof(int)], [exception, aggregateException], "message"); - yield return (PopulateException(reflectionTypeLoadException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC1TeXN0ZW0uUmVmbGVjdGlvbi5SZWZsZWN0aW9uVHlwZUxvYWRFeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwVUeXBlcwpFeGNlcHRpb25zAQEDAwEBAQABAAEHAwMpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGV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VFeGNlcHRpb24JAwAAAAkZAAAACRoAAAAJBQAAAAkGAAAACQcAAAAAAAAACugDAAAJCAAAAAoJHwAAAAEOAAAACgAAAAgIAQAAAAYgAAAAA29uZQoBEQAAAAQAAAAJIQAAAAIAAAACAAAAARIAAAALAAAACQ8AAAAGIwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBGQAAAAQAAAAJJAAAAAIAAAACAAAAARoAAAALAAAACQ8AAAAGJgAAABFFeGNlcHRpb24gbWVzc2FnZQoJJwAAAAoKCgAAAAAKABUTgAoKBx8AAAAAAQAAAAEAAAADEFN5c3RlbS5FeGNlcHRpb24JGgAAAAEhAAAACgAAAAkNAAAACAEBCSoAAAABJAAAAAoAAAAJDQAAAAgBAQksAAAAAScAAAALAAAACQ8AAAAJIwAAAAoKCgoKAAAAAAoAFROACgoBKgAAAAoAAAAICAEAAAAJIAAAAAoBLAAAAAoAAAAICAEAAAAJIAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var regexMatchTimeoutException = new RegexMatchTimeoutException("message", exception); - yield return (PopulateException(regexMatchTimeoutException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA5U3lzdGVtLlRleHQuUmVndWxhckV4cHJlc3Npb25zLlJlZ2V4TWF0Y2hUaW1lb3V0RXhjZXB0aW9uDwAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMKcmVnZXhJbnB1dAxyZWdleFBhd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ZGUGFQAAAAZzZWNyZXQIAQEJFgAAAAEPAAAABQAAAAkXAAAAAgAAAAIAAAABEAAAAAYAAAAJDQAAAAYZAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEWAAAADAAAAAgIAQAAAAYaAAAAA29uZQoBFwAAAAwAAAAJFQAAAAgBAQkcAAAAARwAAAAMAAAACAgBAAAACRoAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var rowNotInTableException = new RowNotInTableException("message", exception); - yield return (PopulateException(rowNotInTableException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0ZW0uRGF0YS5Sb3dOb3RJblRhYmxlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAACJTeXN0ZW0uRGF0YS5Sb3dOb3RJblRhYmxlRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU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rVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var runtimeBinderException = new RuntimeBinderException("message", exception); - yield return (PopulateException(runtimeBinderException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFNNaWNyb3NvZnQuQ1NoYXJwLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAANU1pY3Jvc29mdC5DU2hhcnAuUnVudGltZUJpbmRlci5SdW50aW1lQmluZGVyRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZ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VjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var runtimeBinderInternalCompilerException = new RuntimeBinderInternalCompilerException("message", exception); - yield return (PopulateException(runtimeBinderInternalCompilerException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFNNaWNyb3NvZnQuQ1NoYXJwLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAARU1pY3Jvc29mdC5DU2hhcnAuUnVudGltZUJpbmRlci5SdW50aW1lQmluZGVySW50ZXJuYWxDb21waWxlckV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAABFTWljcm9zb2Z0LkNTaGFycC5SdW50aW1lQmluZGVyLlJ1bnRpbWVCaW5kZXJJbnRlcm5hbENvbXBpbGVyRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAAC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b25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAYAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - RuntimeWrappedException runtimeWrappedException = (RuntimeWrappedException)typeof(RuntimeWrappedException)! - .GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, [typeof(object)], null)! - .Invoke([exception]); - yield return (PopulateException(runtimeWrappedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADdTeXN0ZW0uUnVudGltZS5Db21waWxlclNlcnZpY2VzLlJ1bnRpbWVXcmFwcGVkRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMQV3JhcHBlZEV4Y2VwdGlvbgEBAwMBAQEAAQABBwMpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAhBTeXN0ZW0uRXhjZXB0aW9uBgIAAAA3U3lzdGVtLlJ1bnRpbWUuQ29tcGlsZXJTZXJ2aWNlcy5SdW50aW1lV3JhcHBlZEV4Y2VwdGlvbgYDAAAAY0FuIG9iamVjdCB0aGF0IGRvZXMgbm90IGRlcml2ZSBmcm9tIFN5c3RlbS5FeGNlcHRpb24gaGFzIGJlZW4gd3JhcHBlZCBpbiBhIFJ1bnRpbWVXcmFwcGVkRXhjZXB0aW9uLgkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgkJAAAABAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeX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TBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgYMAAAAB21lc3NhZ2UJDQAAAAkOAAAACQUAAAAJBgAAAAkHAAAAAAAAAAroAwAACQgAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAJAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var sEHException = new SEHException("message", exception); - yield return (PopulateException(sEHException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACtTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuU0VIRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW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niker.netfx461) }); - - var safeArrayRankMismatchException = new SafeArrayRankMismatchException("message", exception); - yield return (PopulateException(safeArrayRankMismatchException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAD1TeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuU2FmZUFycmF5UmFua01pc21hdGNoRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAPVN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcy5TYWZlQXJyYXlSYW5rTWlzbWF0Y2hFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhj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N0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var safeArrayTypeMismatchException = new SafeArrayTypeMismatchException("message", exception); - yield return (PopulateException(safeArrayTypeMismatchException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAD1TeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXMuU2FmZUFycmF5VHlwZU1pc21hdGNoRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAPVN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcy5TYWZlQXJyYXlUeXBlTWlzbWF0Y2hFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA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ABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var securityException = new SecurityException("message", exception); - - // Not testing additional serializable properties as they diverged between Core and Desktop - yield return (PopulateException(securityException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACFTeXN0ZW0uU2VjdXJpdHkuU2VjdXJpdHlFeGNlcHRpb24SAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlc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XQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var semaphoreFullException = new SemaphoreFullException("message", exception); - yield return (PopulateException(semaphoreFullException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249Mi4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAnU3lzdGVtLlRocmVhZGluZy5TZW1hcGhvcmVGdWxsRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAACdTeXN0ZW0uVGhyZWFkaW5nLlNlbWFwaG9yZUZ1bGxFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1w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hY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JBAAAAAkOAAAACQ8AAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var serializationException = new SerializationException("message", exception); - yield return (PopulateException(serializationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADNTeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLlNlcmlhbGl6YXRpb25FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlc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AAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var ambiguousImplementationException = new AmbiguousImplementationException(); - yield return (PopulateException(ambiguousImplementationException, false), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uUnVudGltZSwgVmVyc2lvbj00LjIuMS4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAC9TeXN0ZW0uUnVudGltZS5BbWJpZ3VvdXNJbXBsZW1lbnRhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAvU3lzdGVtLlJ1bnRpbWUuQW1iaWd1b3VzSW1wbGVtZW50YXRpb25FeGNlcHRpb24GBAAAAB9BbWJpZ3VvdXMgaW1wbGVtZW50YXRpb24gZm91bmQuCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAApqEBOABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netcoreapp30) }); - - var switchExpressionException = new SwitchExpressionException(34); - yield return (PopulateException(switchExpressionException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFxTeXN0ZW0uUnVudGltZS5FeHRlbnNpb25zLCBWZXJzaW9uPTQuMi4xLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAAOVN5c3RlbS5SdW50aW1lLkNvbXBpbGVyU2VydmljZXMuU3dpdGNoRXhwcmVzc2lvbkV4Y2VwdGlvbg0AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzDlVubWF0Y2hlZFZhbHVlAQEDAwEBAQABAAEHAilTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAOVN5c3RlbS5SdW50aW1lLkNvbXBpbGVyU2VydmljZXMuU3dpdGNoRXhwcmVzc2lvbkV4Y2VwdGlvbgYEAAAAO05vbi1leGhhdXN0aXZlIHN3aXRjaCBleHByZXNzaW9uIGZhaWxlZCB0byBtYXRjaCBpdHMgaW5wdXQuCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCAgiAAAABAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netcoreapp30) }); - - var socketException = new SocketException(); - yield return (PopulateException(socketException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAiU3lzdGVtLk5ldC5Tb2NrZXRzLlNvY2tldEV4Y2VwdGlvbg0AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJp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FsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netfx461) }); - - var sqlAlreadyFilledException = new SqlAlreadyFilledException("message", exception); - yield return (PopulateException(sqlAlreadyFilledException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAC5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxBbHJlYWR5RmlsbGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAAC5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxBbHJlYWR5RmlsbGVkRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN0ZW0uQ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FN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var sqlNotFilledException = new SqlNotFilledException("message", exception); - yield return (PopulateException(sqlNotFilledException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACpTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxOb3RGaWxsZWRFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5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UAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var sqlNullValueException = new SqlNullValueException("message", exception); - yield return (PopulateException(sqlNullValueException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACpTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxOdWxsVmFsdWVFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAKlN5c3RlbS5EYXRhLlNxbFR5cGVzLlNxbE51bGxWYWx1ZUV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9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JFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var sqlTruncateException = new SqlTruncateException("message", exception); - yield return (PopulateException(sqlTruncateException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAClTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxUcnVuY2F0ZUV4Y2VwdGlvbgwAAAAJQ2xhc3N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uYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var sqlTypeException = new SqlTypeException("message", exception); - yield return (PopulateException(sqlTypeException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACVTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxUeXBlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgIAAAAGAwAAACVTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxUeXBlRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAA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lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDAAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJDgAAAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var stackOverflowException = new StackOverflowException("message", exception); - yield return (PopulateException(stackOverflowException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uU3RhY2tPdmVyZmxvd0V4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4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bGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var synchronizationLockException = new SynchronizationLockException("message", exception); -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mFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var syntaxErrorException = new SyntaxErrorException("message", exception); - yield return (PopulateException(syntaxErrorException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TeW50YXhFcnJvckV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAgU3lzdGVtLkRhdGEuU3ludGF4RXJyb3JFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4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UkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYMAAAAEFN5c3RlbS5FeGNlcHRpb24JBAAAAAkOAAAACQ8AAAAJBwAAAAkIAAAACQkAAAAAAAAACugDAAAJCgAAAAoECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGFAAAAAZzZWNyZXQIAQEJFQAAAAEOAAAABQAAAAkWAAAAAgAAAAIAAAABDwAAAAYAAAAJDAAAAAYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var systemException = new SystemException("message", exception); - yield return (PopulateException(systemException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uU3lzdGVtRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cm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nQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var targetException = new TargetException("message", exception); - yield return (PopulateException(targetException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACFTeXN0ZW0uUmVmb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bWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var targetInvocationException = new TargetInvocationException("message", exception); - yield return (PopulateException(targetInvocationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACtTeXN0ZW0uUmVmbGVjdGlvbi5UYXJnZXRJbnZvY2F0aW9uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAK1N5c3RlbS5SZWZsZWN0aW9uLlRhcmdldEludm9jYXRpb25FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAA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AACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var targetParameterCountException = new TargetParameterCountException("message", exception); - yield return (PopulateException(targetParameterCountException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC9TeXN0ZW0uUmVmbGVjdGlvbi5UYXJnZXRQYXJhbWV0ZXJDb3VudEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAAC9TeXN0ZW0uUmVmbGVjdGlvbi5UYXJnZXRQYXJhbWV0ZXJDb3VudEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2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ZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var taskCanceledException = new TaskCanceledException("message", exception); - yield return (PopulateException(taskCanceledException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACxTeXN0ZW0uVGhyZWFkaW5nLlRhc2tzLlRhc2tDYW5jZWxlZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVt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AAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var taskSchedulerException = new TaskSchedulerException("message", exception); - yield return (PopulateException(taskSchedulerException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAC1TeXN0ZW0uVGhyZWFkaW5nLlRhc2tzLlRhc2tTY2hlZHVsZXJFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgIAAAAtU3lzdGVtLlRocmVhZGluZy5UYXNrcy5UYXNrU2NoZWR1bGVyRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCgAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF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aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - ThreadAbortException threadAbortException = (ThreadAbortException)typeof(ThreadAbortException)! - .GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, [], null)! - .Invoke([]); - yield return (PopulateException(threadAbortException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACVTeXN0ZW0uVGhyZWFkaW5nLlRocmVhZEFib3J0RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAJVN5c3RlbS5UaHJlYWRpbmcuVGhyZWFkQWJvcnRFeGNlcHRpb24GAwAAAA1TeXN0ZW0gZXJyb3IuCQQAAAAKBgUAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYGAAAAFFN0YWNrVHJhY2Ugc3R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ZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYGAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgcAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABggAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQkAAAACAAAAAgAAAAQJAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYKAAAABnNlY3JldAgBAQkLAAAAAQsAAAAJAAAACAgBAAAABgwAAAADb25lCgs=", TargetFrameworkMoniker.netfx461) }); - - var threadInterruptedException = new ThreadInterruptedException("message", exception); - yield return (PopulateException(threadInterruptedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACtTeXN0ZW0uVGhyZWFkaW5nLlRocmVhZEludGVycnVwdGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuY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tLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - ThreadStartException threadStartException = (ThreadStartException)typeof(ThreadStartException)! - .GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, [typeof(Exception)], null)! - .Invoke([exception]); - - yield return (Pop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dGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var threadStateException = new ThreadStateException("message", exception); - yield return (PopulateException(threadStateException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACVTeXN0ZW0uVGhyZWFkaW5nLlRocmVhZFN0YXRlRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAJVN5c3RlbS5UaHJlYWRpbmcuVGhyZWFkU3RhdGVFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5M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NvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var timeZoneNotFoundException = new TimeZoneNotFoundException("message", exception); - yield return (PopulateException(timeZoneNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj0zLjUuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uVGltZVpvbmVOb3RGb3VuZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYX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AAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var timeoutException = new TimeoutException("message", exception); - yield return (PopulateException(timeoutException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABdTeXN0ZW0uVGltZW91dEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAABdTeXN0ZW0uVGltZW91dEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUm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kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var typeAccessException = new TypeAccessException("message", exception); - yield return (PopulateException(typeAccessException, setHResult: false), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABpTeXN0ZW0uVHlwZUFjY2Vzc0V4Y2VwdGlvbhAAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzEVR5cGVMb2FkQ2xhc3NOYW1lFFR5cGVMb2FkQXNzZW1ibHlOYW1lElR5cGVMb2FkTWVzc2FnZUFyZxJUeXBlTG9hZFJlc291cmNlSUQBAQMDAQEBAAEAAQcBAQEAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIIBgIAAAAaU3lzdGVtLlR5cGVBY2Nlc3NFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAKQxUTgAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgoKCgAAAAAEBAAAA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U3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGCwAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDQAAAAkOAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAoAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhMAAAAGc2VjcmV0CAEBCRQAAAABDQAAAAQAAAAJFQAAAAIAAAACAAAAAQ4AAAAFAAAACQsAAAAGFwAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFAAAAAoAAAAICAEAAAAGGAAAAANvbmUKARUAAAAKAAAACRMAAAAIAQEJGgAAAAEaAAAACgAAAAgIAQAAAAkYAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var typeInitializationException = new TypeInitializationException("System.String", exception); - yield return (PopulateException(typeInitializationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVHlwZUluaXRpYWxpemF0aW9uRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2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AYYAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEVAAAACwAAAAgIAQAAAAYZAAAAA29uZQoBFgAAAAsAAAAJFAAAAAgBAQkbAAAAARsAAAALAAAACAgBAAAACRkAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var typeLoadException = new TypeLoadException("message", exception); - yield return (PopulateException(typeLoadException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uVHlwZUxvYWRFeGNlcHRpb24QAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxFUeXBlTG9hZENsYXNzTmFtZRRUeXBlTG9hZEFzc2VtYmx5TmFtZRJUeXBlTG9hZE1lc3NhZ2VBcmcSVHlwZUxvYWRSZXNvdXJjZUlEAQEDAwEBAQABAAEHAQEBAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAYCAAAAGFN5c3RlbS5UeXBlTG9hZEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCgoKAAAAAAQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4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AQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var typeUnloadedException = new TypeUnloadedException("message", exception); - yield return (PopulateException(typeUnloadedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uVHlwZVVubG9hZGVkRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGl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AIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var unauthorizedAccessException = new UnauthorizedAccessException("message", exception); - yield return (PopulateException(unauthorizedAccessException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVW5hdXRob3JpemVkQWNjZXNzRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhj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AAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var uriFormatException = new UriFormatException("message", exception); - yield return (PopulateException(uriFormatException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAZU3lzdGVtLlVyaUZvcm1hdEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAZU3lzdGVtLlVyaUZvcm1hdEV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQ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aW9uCAgCBgwAAAAQU3lzdGVtLkV4Y2VwdGlvbgkEAAAACQ4AAAAJDwAAAAkHAAAACQgAAAAJCQAAAAAAAAAK6AMAAAkKAAAACgQLAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var verificationException = new VerificationException("message", exception); - yield return (PopulateException(verificationException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACVTeXN0ZW0uU2VjdXJpdHkuVmVyaWZpY2F0aW9uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAJVN5c3RlbS5TZWN1cml0eS5WZXJpZmljYXRpb25FeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAA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QREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - var versionNotFoundException = new VersionNotFoundException("message", exception); - yield return (PopulateException(versionNotFoundException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACRTeXN0ZW0uRGF0YS5WZXJzaW9uTm90Rm91bmRFeGNlcHRpb24M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XJ5Tm9kZQYUAAAABnNlY3JldAgBAQkVAAAAAQ4AAAAFAAAACRYAAAACAAAAAgAAAAEPAAAABgAAAAkMAAAABhgAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARUAAAALAAAACAgBAAAABhkAAAADb25lCgEWAAAACwAAAAkUAAAACAEBCRsAAAABGwAAAAsAAAAICAEAAAAJGQAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var waitHandleCannotBeOpenedException = new WaitHandleCannotBeOpenedException("message", exception); - yield return (PopulateException(waitHandleCannotBeOpenedException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uVGhyZWFkaW5nLldhaXRIYW5kbGVDYW5ub3RCZU9wZW5lZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uVGhyZWFkaW5nLldhaXRIYW5kbGVDYW5ub3RCZU9wZW5lZEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkx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QnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var warningException = new WarningException("message", "helpUrl", "helpTopic"); - yield return (PopulateException(warningException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLkNvbXBvbmVudE1vZGVsLldhcm5pbmdFeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3V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AQEJDgAAAAEOAAAADAAAAAgIAQAAAAYPAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - var webException = new WebException("message", exception, WebExceptionStatus.Pending, null); - yield return (PopulateException(webException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAXU3lzdGVtLk5ldC5XZWJFeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAAYDAAAAF1N5c3RlbS5OZXQuV2ViRXhjZXB0aW9uBgQAAAAHbWVzc2FnZQkFAAAACQYAAAAGBwAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBggAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCQAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCgAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJCwAAAAIAAAACAAAABAYAAAAQU3lzdGVtLkV4Y2Vw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AAAkPAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBAsAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhQAAAAGc2VjcmV0CAEBCRUAAAABDgAAAAUAAAAJFgAAAAIAAAACAAAAAQ8AAAAGAAAACQwAAAAGGAAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFQAAAAsAAAAICAEAAAAGGQAAAANvbmUKARYAAAALAAAACRQAAAAIAQEJGwAAAAEbAAAACwAAAAgIAQAAAAkZAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - var webSocketException = new WebSocketException(WebSocketError.Success, 100, "message", exception); - yield return (PopulateException(webSocketException), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAoU3lzdGVtLk5ldC5XZWJTb2NrZXRzLldlYlNvY2tldEV4Y2VwdGlvbg4AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzD05hdGl2ZUVycm9yQ29kZRJXZWJTb2NrZXRFcnJvckNvZGUBAQMDAQEBAAEAAQcABClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcn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ANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYVAAAABnNlY3JldAgBAQkWAAAAAQ8AAAAFAAAACRcAAAACAAAAAgAAAAEQAAAABgAAAAkNAAAABhkAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARYAAAAMAAAACAgBAAAABhoAAAADb25lCgEXAAAADAAAAAkVAAAACAEBCRwAAAABHAAAAAwAAAAICAEAAAAJGgAAAAoL", TargetFrameworkMoniker.netfx461) }); - - var win32Exception = new Win32Exception(100, "message"); - yield return (PopulateException(win32Exception), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAkU3lzdGVtLkNvbXBvbmVudE1vZGVsLldpbjMyRXhjZXB0aW9uDQAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMPTmF0aXZlRXJyb3JDb2RlAQEDAwEBAQABAAEHAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAIAAAAGAwAAACRTeXN0ZW0uQ29tcG9uZW50TW9kZWwuV2luMzJFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVH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cnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAIAAAAGAwAAACRTeXN0ZW0uQ29tcG9uZW50TW9kZWwuV2luMzJFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKZAAAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) }); - - // Enum values - yield return (DayOfWeek.Monday, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRGF5T2ZXZWVrAQAAAAd2YWx1ZV9fAAgBAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRGF5T2ZXZWVrAQAAAAd2YWx1ZV9fAAgBAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (DateTimeKind.Local, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABNTeXN0ZW0uRGF0ZVRpbWVLaW5kAQAAAAd2YWx1ZV9fAAgCAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABNTeXN0ZW0uRGF0ZVRpbWVLaW5kAQAAAAd2YWx1ZV9fAAgCAAAACw==", TargetFrameworkMoniker.netfx461) }); - - // Nullables - yield return ((int?)1, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAEAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAEAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return ((StructWithIntField?)new StructWithIntField() { X = 42 }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADNCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoSW50RmllbGQBAAAAAVgACAIAAAAqAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADNCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoSW50RmllbGQBAAAAAVgACAIAAAAqAAAACw==", TargetFrameworkMoniker.netfx461) }); - - // EventArgs - yield return (EventArgs.Empty, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRXZlbnRBcmdzAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRXZlbnRBcmdzAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new EventArgs(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRXZlbnRBcmdzAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABBTeXN0ZW0uRXZlbnRBcmdzAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Nullable equality comparer roundtrips as opposed to other equality comparers which serialize to ObjectEqualityComparer - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDY0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDY0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uT2JqZWN0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uT2JqZWN0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTnVsbGFibGVFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTnVsbGFibGVFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTnVsbGFibGVFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5Eb3VibGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTnVsbGFibGVFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5Eb3VibGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Equality comparers which can roundtrip - yield return (EqualityComparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALUBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRW51bUVxdWFsaXR5Q29tcGFyZXJgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuSW50MzJFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAALUBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRW51bUVxdWFsaXR5Q29tcGFyZXJgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuSW50MzJFbnVtLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - - // Other core serializable types - yield return (IntPtr.Zero, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uSW50UHRyAQAAAAV2YWx1ZQAJAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uSW50UHRyAQAAAAV2YWx1ZQAJAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (UIntPtr.Zero, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uVUludFB0cgEAAAAFdmFsdWUAEAAAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uVUludFB0cgEAAAAFdmFsdWUAEAAAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new DateTime(1990, 11, 23), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA9TeXN0ZW0uRGF0ZVRpbWUCAAAABXRpY2tzCGRhdGVEYXRhAAAJEADA9z1t7LYIAMD3PW3stggL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA9TeXN0ZW0uRGF0ZVRpbWUCAAAABXRpY2tzCGRhdGVEYXRhAAAJEADA9z1t7LYIAMD3PW3stggL", TargetFrameworkMoniker.netfx461) }); - yield return (new[] { new DateTime(1990, 11, 24, 0, 0, 0, DateTimeKind.Local), new DateTime(1990, 11, 25, 0, 0, 0, DateTimeKind.Utc), new DateTime(1990, 11, 26, 0, 0, 0, DateTimeKind.Unspecified) }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAMAAAANAIBhaDbttogAQMuS/+22SAAANb3I7rYICw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAMAAAANAIBhaDbttogAQMuS/+22SAAANb3I7rYICw==", TargetFrameworkMoniker.netfx461) }); - yield return (new DateTimeOffset(1990, 11, 23, 03, 30, 00, 00, TimeSpan.FromMinutes(30)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABVTeXN0ZW0uRGF0ZVRpbWVPZmZzZXQCAAAACERhdGVUaW1lDU9mZnNldE1pbnV0ZXMAAA0HAPhEY4bstggeAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABVTeXN0ZW0uRGF0ZVRpbWVPZmZzZXQCAAAACERhdGVUaW1lDU9mZnNldE1pbnV0ZXMAAA0HAPhEY4bstggeAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (TimeZoneInfo.Utc, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj0zLjUuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABNTeXN0ZW0uVGltZVpvbmVJbmZvBwAAAAJJZAtEaXNwbGF5TmFtZQxTdGFuZGFyZE5hbWUMRGF5bGlnaHROYW1lDUJhc2VVdGNPZmZzZXQPQWRqdXN0bWVudFJ1bGVzGlN1cHBvcnRzRGF5bGlnaHRTYXZpbmdUaW1lAQEBAQACAAwBAgAAAAYDAAAAA1VUQwYEAAAAIChVVEMpIENvb3JkaW5hdGVkIFVuaXZlcnNhbCBUaW1lBgUAAAAaQ29vcmRpbmF0ZWQgVW5pdmVyc2FsIFRpbWUJBQAAAAAAAAAAAAAACgAL", TargetFrameworkMoniker.netcoreapp30), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj0zLjUuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABNTeXN0ZW0uVGltZVpvbmVJbmZvBwAAAAJJZAtEaXNwbGF5TmFtZQxTdGFuZGFyZE5hbWUMRGF5bGlnaHROYW1lDUJhc2VVdGNPZmZzZXQPQWRqdXN0bWVudFJ1bGVzGlN1cHBvcnRzRGF5bGlnaHRTYXZpbmdUaW1lAQEBAQACAAwBAgAAAAYDAAAAA1VUQwYEAAAAIChVVEMpIENvb3JkaW5hdGVkIFVuaXZlcnNhbCBUaW1lBgUAAAAaQ29vcmRpbmF0ZWQgVW5pdmVyc2FsIFRpbWUJBQAAAAAAAAAAAAAACgAL", TargetFrameworkMoniker.netfx461) }); - yield return (TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 2, 0, 0), 3, 15), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVGltZVpvbmVJbmZvK1RyYW5zaXRpb25UaW1lBgAAAAlUaW1lT2ZEYXkFTW9udGgEV2VlawNEYXkJRGF5T2ZXZWVrD0lzRml4ZWREYXRlUnVsZQAAAAADAA0CAgIQU3lzdGVtLkRheU9mV2VlawEA0IjDEAAAAAMBDwT+////EFN5c3RlbS5EYXlPZldlZWsBAAAAB3ZhbHVlX18ACAAAAAABCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVGltZVpvbmVJbmZvK1RyYW5zaXRpb25UaW1lBgAAAAlUaW1lT2ZEYXkFTW9udGgEV2VlawNEYXkJRGF5T2ZXZWVrD0lzRml4ZWREYXRlUnVsZQAAAAADAA0CAgIQU3lzdGVtLkRheU9mV2VlawEA0IjDEAAAAAMBDwT+////EFN5c3RlbS5EYXlPZldlZWsBAAAAB3ZhbHVlX18ACAAAAAABCw==", TargetFrameworkMoniker.netfx461) }); - - var adjustmentRule = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule( - new DateTime(1900, 1, 1), - new DateTime(1955, 12, 31), - TimeSpan.FromHours(2), - TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 2, 0, 0), 2, 3), - TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 2, 0, 0), 3, 4)); - yield return (adjustmentRule, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVGltZVpvbmVJbmZvK0FkanVzdG1lbnRSdWxlBwAAAAlEYXRlU3RhcnQHRGF0ZUVuZA1EYXlsaWdodERlbHRhF0RheWxpZ2h0VHJhbnNpdGlvblN0YXJ0FURheWxpZ2h0VHJhbnNpdGlvbkVuZBJCYXNlVXRjT2Zmc2V0RGVsdGEVTm9EYXlsaWdodFRyYW5zaXRpb25zAAAAAwMAAA0NDCJTeXN0ZW0uVGltZVpvbmVJbmZvK1RyYW5zaXRpb25UaW1lIlN5c3RlbS5UaW1lWm9uZUluZm8rVHJhbnNpdGlvblRpbWUMAQBAVyBTBVEIAEDGiJPMjwgA0IjDEAAAAAT+////IlN5c3RlbS5UaW1lWm9uZUluZm8rVHJhbnNpdGlvblRpbWUGAAAACVRpbWVPZkRheQVNb250aARXZWVrA0RheQlEYXlPZldlZWsPSXNGaXhlZERhdGVSdWxlAAAAAAMADQICAhBTeXN0ZW0uRGF5T2ZXZWVrAQDQiMMQAAAAAgEDBP3///8QU3lzdGVtLkRheU9mV2VlawEAAAAHdmFsdWVfXwAIAAAAAAEB/P////7///8A0IjDEAAAAAMBBAH7/////f///wAAAAABAAAAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uVGltZVpvbmVJbmZvK0FkanVzdG1lbnRSdWxlBwAAAAlEYXRlU3RhcnQHRGF0ZUVuZA1EYXlsaWdodERlbHRhF0RheWxpZ2h0VHJhbnNpdGlvblN0YXJ0FURheWxpZ2h0VHJhbnNpdGlvbkVuZBJCYXNlVXRjT2Zmc2V0RGVsdGEVTm9EYXlsaWdodFRyYW5zaXRpb25zAAAAAwMAAA0NDCJTeXN0ZW0uVGltZVpvbmVJbmZvK1RyYW5zaXRpb25UaW1lIlN5c3RlbS5UaW1lWm9uZUluZm8rVHJhbnNpdGlvblRpbWUMAQBAVyBTBVEIAEDGiJPMjwgA0IjDEAAAAAT+////IlN5c3RlbS5UaW1lWm9uZUluZm8rVHJhbnNpdGlvblRpbWUGAAAACVRpbWVPZkRheQVNb250aARXZWVrA0RheQlEYXlPZldlZWsPSXNGaXhlZERhdGVSdWxlAAAAAAMADQICAhBTeXN0ZW0uRGF5T2ZXZWVrAQDQiMMQAAAAAgEDBP3///8QU3lzdGVtLkRheU9mV2VlawEAAAAHdmFsdWVfXwAIAAAAAAEB/P////7///8A0IjDEAAAAAMBBAH7/////f///wAAAAABAAAAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (TimeSpan.FromDays(7), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA9TeXN0ZW0uVGltZVNwYW4BAAAABl90aWNrcwAJAEDkKIAFAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA9TeXN0ZW0uVGltZVNwYW4BAAAABl90aWNrcwAJAEDkKIAFAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Version(1, 2, 3, 4), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uVmVyc2lvbgQAAAAGX01ham9yBl9NaW5vcgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgBAAAAAgAAAAMAAAAEAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAA5TeXN0ZW0uVmVyc2lvbgQAAAAGX01ham9yBl9NaW5vcgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgBAAAAAgAAAAMAAAAEAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Guid("0CACAA4D-C6BD-420A-B660-2F557337CA89"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uR3VpZAsAAAACX2ECX2ICX2MCX2QCX2UCX2YCX2cCX2gCX2kCX2oCX2sAAAAAAAAAAAAAAAgHBwICAgICAgICTaqsDL3GCkK2YC9VczfKiQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAAtTeXN0ZW0uR3VpZAsAAAACX2ECX2ICX2MCX2QCX2UCX2YCX2cCX2gCX2kCX2oCX2sAAAAAAAAAAAAAAAgHBwICAgICAgICTaqsDL3GCkK2YC9VczfKiQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new List(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAAAAAAAAAAAPAgAAAAAAAAAICw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAAAAAAAAAAAPAgAAAAAAAAAICw==", TargetFrameworkMoniker.netfx461) }); - yield return (new List(27), new TypeSerializableValue[] { new("AAEAAAD/////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jAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAABQAAAAUAAAAPAgAAAAgAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAABQAAAAUAAAAPAgAAAAgAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - var dictionary = new Dictionary() { { 1, "test" }, { 2, "another test" } }; - yield return (dictionary, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAOEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRGljdGlvbmFyeWAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBAAAAAdWZXJzaW9uCENvbXBhcmVyCEhhc2hTaXplDUtleVZhbHVlUGFpcnMAAwADCJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMu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jc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUAAQgBAAAABgUAAAAEdGVzdAH6/////P///wIAAAAGBwAAAAxhbm90aGVyIHRlc3QL", TargetFrameworkMoniker.netfx461) }); - var pointDictionary = new Dictionary() - { - { 1, new Point(1, 1) }, - { 2, new Point(2, 2) } - }; - yield return (Tuple.Create(1), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAGtTeXN0ZW0uVHVwbGVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAHbV9JdGVtMQAIAQAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAGtTeXN0ZW0uVHVwbGVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAHbV9JdGVtMQAIAQAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (Tuple.Create(1, "2"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAMgBU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAB21fSXRlbTEHbV9JdGVtMgABCAEAAAAGAgAAAAEyCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAMgBU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAB21fSXRlbTEHbV9JdGVtMgABCAEAAAAGAgAAAAEyCw==", TargetFrameworkMoniker.netfx461) }); - yield return (Tuple.Create(1, "2", 3u), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAKUCU3lzdGVtLlR1cGxlYDNbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlVJbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAAB21fSXRlbTEHbV9JdGVtMgdtX0l0ZW0zAAEACA8BAAAABgIAAAABMgMAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAKUCU3lzdGVtLlR1cGxlYDNbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsL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AAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIEDU3lzdGVtLlR1cGxlYDRbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlVJbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLkludDY0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQQAAAAHbV9JdGVtMQdtX0l0ZW0yB21fSXRlbTMHbV9JdGVtNAABAAAIDwkBAAAABgIAAAABMgMAAAAEAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (Tuple.Create(1, "2", 3u, 4L, 5.6), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAN4DU3lzdGVtLlR1cGxlYDVbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlVJbn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aWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLkJ5dGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUAAAgCKgAAAFQL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAOEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLkJ5dGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUAAAgCKgAAAFQL", TargetFrameworkMoniker.netfx461) }); - yield return (new KeyValuePair>>(42, new KeyValuePair>(84, Tuple.Create(168))), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJYEU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5CeXRlLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUw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YxOTM0ZTA4OV1dLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAADa2V5BXZhbHVlAAMCa1N5c3RlbS5UdXBsZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dVAkDAAAABAMAAABrU3lzdGVtLlR1cGxlYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0BAAAAB21fSXRlbTEACKgAAAAL", TargetFrameworkMoniker.netfx461) }); - var dotnetUri = new Uri("https://dot.net"); - yield return (dotnetUri, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAKU3lzdGVtLlVyaQEAAAALQWJzb2x1dGVVcmkBAgAAAAYDAAAAEGh0dHBzOi8vZG90Lm5ldC8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAKU3lzdGVtLlVyaQEAAAALQWJzb2x1dGVVcmkBAgAAAAYDAAAAEGh0dHBzOi8vZG90Lm5ldC8L", TargetFrameworkMoniker.netfx461) }); - yield return (new Uri(dotnetUri, "articles/info.html"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAKU3lzdGVtLlVyaQEAAAALQWJzb2x1dGVVcmkBAgAAAAYDAAAAImh0dHBzOi8vZG90Lm5ldC9hcnRpY2xlcy9pbmZvLmh0bWwL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAKU3lzdGVtLlVyaQEAAAALQWJzb2x1dGVVcmkBAgAAAAYDAAAAImh0dHBzOi8vZG90Lm5ldC9hcnRpY2xlcy9pbmZvLmh0bWwL", TargetFrameworkMoniker.netfx461) }); - yield return (new WeakReference(dotnetUri, true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BAEAAAAUU3lzdGVtLldlYWtSZWZlcmVuY2UCAAAADVRyYWNrZWRPYmplY3QRVHJhY2tSZXN1cnJlY3Rpb24EAApTeXN0ZW0uVXJpAgAAAAEJAwAAAAEFAwAAAApTeXN0ZW0uVXJpAQAAAAtBYnNvbHV0ZVVyaQECAAAABgQAAAAQaHR0cHM6Ly9kb3QubmV0Lws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BAEAAAAUU3lzdGVtLldlYWtSZWZlcmVuY2UCAAAADVRyYWNrZWRPYmplY3QRVHJhY2tSZXN1cnJlY3Rpb24EAApTeXN0ZW0uVXJpAgAAAAEJAwAAAAEFAwAAAApTeXN0ZW0uVXJpAQAAAAtBYnNvbHV0ZVVyaQECAAAABgQAAAAQaHR0cHM6Ly9kb3QubmV0Lws=", TargetFrameworkMoniker.netfx461) }); - yield return (new WeakReference(new Point(2, 3), true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkEAQAAAJYBU3lzdGVtLldlYWtSZWZlcmVuY2VgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAA1UcmFja2VkT2JqZWN0EVRyYWNrUmVzdXJyZWN0aW9uBAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAQkDAAAAAQUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIAgAAAAIAAAADAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkEAQAAAJYBU3lzdGVtLldlYWtSZWZlcmVuY2VgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAA1UcmFja2VkT2JqZWN0EVRyYWNrUmVzdXJyZWN0aW9uBAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAQkDAAAAAQUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIAgAAAAIAAAADAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StringBuilder(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABlTeXN0ZW0uVGV4dC5TdHJpbmdCdWlsZGVyBAAAAA1tX01heENhcGFjaXR5CENhcGFjaXR5DW1fU3RyaW5nVmFsdWUPbV9jdXJyZW50VGhyZWFkAAABAAgICP///38QAAAABgIAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABlTeXN0ZW0uVGV4dC5TdHJpbmdCdWlsZGVyBAAAAA1tX01heENhcGFjaXR5CENhcGFjaXR5DW1fU3RyaW5nVmFsdWUPbV9jdXJyZW50VGhyZWFkAAABAAgICP///38QAAAABgIAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new StringBuilder("starting", 0, 5, 10), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABlTeXN0ZW0uVGV4dC5TdHJpbmdCdWlsZGVyBAAAAA1tX01heENhcGFjaXR5CENhcGFjaXR5DW1fU3RyaW5nVmFsdWUPbV9jdXJyZW50VGhyZWFkAAABAAgICP///38KAAAABgIAAAAFc3RhcnQAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABlTeXN0ZW0uVGV4dC5TdHJpbmdCdWlsZGVyBAAAAA1tX01heENhcGFjaXR5CENhcGFjaXR5DW1fU3RyaW5nVmFsdWUPbV9jdXJyZW50VGhyZWFkAAABAAgICP///38KAAAABgIAAAAFc3RhcnQAAAAACw==", TargetFrameworkMoniker.netfx461) }); - - // Set a fixed timestamp for a Cookie field. - var cookie = new Cookie("name1", "value", "/path", "127.0.0.1"); - typeof(Cookie)! - .GetField("m_timeStamp", BindingFlags.Instance | BindingFlags.NonPublic)! - .SetValue(cookie, s_fixedTimestamp); - yield return (cookie, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAARU3lzdGVtLk5ldC5Db29raWUVAAAACW1fY29tbWVudAxtX2NvbW1lbnRVcmkPbV9jb29raWVWYXJpYW50CW1fZGlzY2FyZAhtX2RvbWFpbhFtX2RvbWFpbl9pbXBsaWNpdAltX2V4cGlyZXMGbV9uYW1lBm1fcGF0aA9tX3BhdGhfaW1wbGljaXQGbV9wb3J0D21fcG9ydF9pbXBsaWNpdAttX3BvcnRfbGlzdAhtX3NlY3VyZQptX2h0dHBPbmx5C21fdGltZVN0YW1wB21fdmFsdWUJbV92ZXJzaW9uC21fZG9tYWluS2V5D0lzUXVvdGVkVmVyc2lvbg5Jc1F1b3RlZERvbWFpbgEEBAABAAABAQABAAcAAAABAAEAAApTeXN0ZW0uVXJpAgAAABhTeXN0ZW0uTmV0LkNvb2tpZVZhcmlhbnQCAAAAAQENAQEIAQENCAEBAgAAAAYDAAAAAAoF/P///xhTeXN0ZW0uTmV0LkNvb2tpZVZhcmlhbnQBAAAAB3ZhbHVlX18ACAIAAAABAAAAAAYFAAAACTEyNy4wLjAuMQAAAAAAAAAAAAYGAAAABW5hbWUxBgcAAAAFL3BhdGgACQMAAAABCgAAgFhsCQ2+tQgGCQAAAAV2YWx1ZQAAAAAJAwAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAARU3lzdGVtLk5ldC5Db29raWUVAAAACW1fY29tbWVudAxtX2NvbW1lbnRVcmkPbV9jb29raWVWYXJpYW50CW1fZGlzY2FyZAhtX2RvbWFpbhFtX2RvbWFpbl9pbXBsaWNpdAltX2V4cGlyZXMGbV9uYW1lBm1fcGF0aA9tX3BhdGhfaW1wbGljaXQGbV9wb3J0D21fcG9ydF9pbXBsaWNpdAttX3BvcnRfbGlzdAhtX3NlY3VyZQptX2h0dHBPbmx5C21fdGltZVN0YW1wB21fdmFsdWUJbV92ZXJzaW9uC21fZG9tYWluS2V5D0lzUXVvdGVkVmVyc2lvbg5Jc1F1b3RlZERvbWFpbgEEBAABAAABAQABAAcAAAABAAEAAApTeXN0ZW0uVXJpAgAAABhTeXN0ZW0uTmV0LkNvb2tpZVZhcmlhbnQCAAAAAQENAQEIAQENCAEBAgAAAAYDAAAAAAoF/P///xhTeXN0ZW0uTmV0LkNvb2tpZVZhcmlhbnQBAAAAB3ZhbHVlX18ACAIAAAABAAAAAAYFAAAACTEyNy4wLjAuMQAAAAAAAAAAAAYGAAAABW5hbWUxBgcAAAAFL3BhdGgACQMAAAABCgAAgFhsCQ2+tQgGCQAAAAV2YWx1ZQAAAAAJAwAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - var cookieCollection = new CookieCollection { cookie }; - yield return (cookieCollection, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAbU3lzdGVtLk5ldC5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avoid differences in generated blobs because of machine configuration (domain). - typeof(CookieContainer)! - .GetField("m_fqdnMyDomain", BindingFlags.Instance | BindingFlags.NonPublic)! - .SetValue(cookieContainer, string.Empty); - cookieContainer.Add(cookie); - yield return (cookieContainer, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAaU3lzdGVtLk5ldC5Db29raWVDb250YWluZXIGAAAADW1fZG9tYWluVGFibGUPbV9tYXhDb29raWVTaXplDG1fbWF4Q29va2llcxVtX21heENvb2tpZXNQZXJEb21haW4HbV9jb3VudA5tX2ZxZG5NeURvbWFpbgMAAAAAARxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlCAgICAIAAAAJAwAAAAAEAAAKAAAABQAAAAEAAAAGBAAAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AQAAAAoKAwAAAAkFAAAACQYAAAAQBQAAAAEAAAAGBwAAAAouMTI3LjAuMC4xEAYAAAABAAAACQgAAAAFCAAAABNTeXN0ZW0uTmV0LlBhdGhMaXN0AQAAAAZtX2xpc3QDLFN5c3RlbS5Db2xsZWN0aW9ucy5Tb3J0ZWRMaXN0K1N5bmNTb3J0ZWRMaXN0AgAAAAkJAAAABAkAAAAsU3lzdGVtLkNvbGxlY3Rpb25zLlNvcnRlZExpc3QrU3luY1NvcnRlZExpc3QJAAAABV9saXN0BV9yb290D1Nv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IAQECAAAACQQAAAAKBeb///8YU3lzdGVtLk5ldC5Db29raWVWYXJpYW50AQAAAAd2YWx1ZV9fAAgCAAAAAQAAAAAGGwAAAAkxMjcuMC4wLjEAAAAAAAAAAAAGHAAAAAVuYW1lMQkSAAAAAAkEAAAAAQoAAIBYbAkNvrUIBh8AAAAFdmFsdWUAAAAACQcAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new DataSet("Dataset") { Locale = CultureInfo.InvariantCulture }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABNTeXN0ZW0uRGF0YS5EYXRhU2V0AwAAABdEYXRhU2V0LlJlbW90aW5nVmVyc2lvbglYbWxTY2hlbWELWG1sRGlmZkdyYW0DAQEOU3lzdGVtLlZlcnNpb24CAAAACQMAAAAGBAAAAPcCPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTE2Ij8+DQo8eHM6c2NoZW1hIGlkPSJEYXRhc2V0IiB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIj4NCiAgPHhzOmVsZW1lbnQgbmFtZT0iRGF0YXNldCIgbXNkYXRhOklzRGF0YVNldD0idHJ1ZSIgbXNkYXRhOkxvY2FsZT0iIj4NCiAgICA8eHM6Y29tcGxleFR5cGU+DQogICAgICA8eHM6Y2hvaWNlIG1pbk9jY3Vycz0iMCIgbWF4T2NjdXJzPSJ1bmJvdW5kZWQiIC8+DQogICAgPC94czpjb21wbGV4VHlwZT4NCiAgPC94czplbGVtZW50Pg0KPC94czpzY2hlbWE+BgUAAACAATxkaWZmZ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E+BgUAAACAATxkaWZmZ3I6ZGlmZmdyYW0geG1sbnM6bXNkYXRhPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnhtbC1tc2RhdGEiIHhtbG5zOmRpZmZncj0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtZGlmZmdyYW0tdjEiIC8+BAMAAAAOU3lzdGVtLlZlcnNpb24EAAAABl9NYWpvcgZfTWlub3IGX0J1aWxkCV9SZXZpc2lvbgAAAAAICAgIAgAAAAAAAAD//////////ws=", TargetFrameworkMoniker.netfx461) }); - yield return (new DataSet() { Locale = CultureInfo.InvariantCulture }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABNTeXN0ZW0uRGF0YS5EYXRhU2V0AwAAABdEYXRhU2V0LlJlbW90aW5nVmVyc2lvbglYbWxTY2hlbWELWG1sRGlmZkdyYW0DAQEOU3lzdGVtLlZlcnNpb24CAAAACQMAAAAGBAAAAP0CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTE2Ij8+DQo8eHM6c2NoZW1hIGlkPSJOZXdEYXRhU2V0IiB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIj4NCiAgPHhzOmVsZW1lbnQgbmFtZT0iTmV3RGF0YVNldCIgbXNkYXRhOklzRGF0YVNldD0idHJ1ZSIgbXNkYXRhOkxvY2FsZT0iIj4NCiAgICA8eHM6Y29tcGxleFR5cGU+DQogICAgICA8eHM6Y2hvaWNlIG1pbk9jY3Vycz0iMCIgbWF4T2NjdXJzPSJ1bmJvdW5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gbWF4T2NjdXJzPSJ1bmJvdW5kZWQiIC8+DQogICAgPC94czpjb21wbGV4VHlwZT4NCiAgPC94czplbGVtZW50Pg0KPC94czpzY2hlbWE+BgUAAACAATxkaWZmZ3I6ZGlmZmdyYW0geG1sbnM6bXNkYXRhPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnhtbC1tc2RhdGEiIHhtbG5zOmRpZmZncj0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtZGlmZmdyYW0tdjEiIC8+BAMAAAAOU3lzdGVtLlZlcnNpb24EAAAABl9NYWpvcgZfTWlub3IGX0J1aWxkCV9SZXZpc2lvbgAAAAAICAgIAgAAAAAAAAD//////////ws=", TargetFrameworkMoniker.netfx461) }); - yield return (new DataTable("Datatable", "corens") { Locale = CultureInfo.InvariantCulture }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABVTeXN0ZW0uRGF0YS5EYXRhVGFibGUDAAAAGURhdGFUYWJsZS5SZW1vdGluZ1ZlcnNpb24JWG1sU2NoZW1hC1htbERpZmZHcmFtAwEBDlN5c3RlbS5WZXJzaW9uAgAAAAkDAAAABgQAAAD/BDw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi0xNiI/Pg0KPHhzOnNjaGVtYSB0YXJnZXROYW1lc3BhY2U9ImNvcmVucyIgeG1sbnM6bXN0bnM9ImNvcmVucyIgeG1sbnM9ImNvcmVucyIgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczptc2RhdGE9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206eG1sLW1zZGF0YSIgYXR0cmlidXRlRm9ybURlZmF1bHQ9InF1YWxpZmllZ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gQDAAAADlN5c3RlbS5WZXJzaW9uBAAAAAZfTWFqb3IGX01pbm9yBl9CdWlsZAlfUmV2aXNpb24AAAAACAgICAIAAAAAAAAA//////////8L", TargetFrameworkMoniker.netfx461) }); - yield return (new DataTable("Datatable") { Locale = CultureInfo.InvariantCulture }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABVTeXN0ZW0uRGF0YS5EYXRhVGFibGUDAAAAGURhdGFUYWJsZS5SZW1vdGluZ1ZlcnNpb24JWG1sU2NoZW1hC1htbERpZmZHcmFtAwEBDlN5c3RlbS5WZXJzaW9uAgAAAAkDAAAABgQAAAD+Azw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi0xNiI/Pg0KPHhzOnNjaGVtYSB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIj4NCiAgPHhzOmVsZW1lbnQgbmFtZT0iRGF0YXRhYmxlIiBtc2RhdGE6TG9jYWxlPSIiPg0KICAgIDx4czpjb21wbGV4VHlwZT4NCiAgICA8L3hzOmNvbXBsZXhUeXBlPg0KICA8L3hzOmVsZW1lbnQ+DQogIDx4czplbGVtZW50IG5hbWU9InRtcERhdGFTZXQiIG1zZGF0YTpJc0RhdGFTZXQ9InRydWUiIG1zZGF0YTpNYWluRGF0YVRhYmxlPSJEYXRhdGFibGUiIG1zZGF0YTpMb2NhbGU9IiI+DQogICAgPHhzOmNvbXBsZXhUeXBlPg0KICAgICAgPHhzOmNob2ljZSBtaW5PY2N1cnM9IjAiIG1heE9jY3Vycz0idW5ib3VuZGVkIiAvP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ZGF0YTpJc0RhdGFTZXQ9InRydWUiIG1zZGF0YTpNYWluRGF0YVRhYmxlPSJEYXRhdGFibGUiIG1zZGF0YTpMb2NhbGU9IiI+DQogICAgPHhzOmNvbXBsZXhUeXBlPg0KICAgICAgPHhzOmNob2ljZSBtaW5PY2N1cnM9IjAiIG1heE9jY3Vycz0idW5ib3VuZGVkIiAvPg0KICAgIDwveHM6Y29tcGxleFR5cGU+DQogIDwveHM6ZWxlbWVudD4NCjwveHM6c2NoZW1hPgYFAAAAgAE8ZGlmZmdyOmRpZmZncmFtIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIiB4bWxuczpkaWZmZ3I9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206eG1sLWRpZmZncmFtLXYxIiAvPgQDAAAADlN5c3RlbS5WZXJzaW9uBAAAAAZfTWFqb3IGX01pbm9yBl9CdWlsZAlfUmV2aXNpb24AAAAACAgICAIAAAAAAAAA//////////8L", TargetFrameworkMoniker.netfx461) }); - - var dt1 = new DataTable("abc", "myns1"); - dt1.Columns.Add("col1"); - dt1.Columns.Add("col2"); - dt1.Rows.Add("foo", "bar"); - dt1.Rows.Add("asdasd", "fffffffff"); - dt1.Locale = CultureInfo.InvariantCulture; - - var dt2 = new DataTable("sdfsdf"); - dt2.Columns.Add("kkk"); - dt2.Columns.Add("jfjfjf"); - dt2.Rows.Add("ff1", "ff2"); - dt2.Rows.Add("ooo", "sdflkjsdflkjsd"); - dt2.Rows.Add("nullval", DBNull.Value); - dt2.Locale = CultureInfo.InvariantCulture; - - DataSet ds = new("DataSet123") - { - Locale = CultureInfo.InvariantCulture - }; - - ds.Tables.Add(dt1); - ds.Tables.Add(dt2); - - yield return (dt1, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1Ymx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nJvd09yZGVyPSIwIiBkaWZmZ3I6aGFzQ2hhbmdlcz0iaW5zZXJ0ZWQiIHhtbG5zPSJteW5zMSI+PGNvbDE+Zm9vPC9jb2wxPjxjb2wyPmJhcjwvY29sMj48L2FiYz48YWJjIGRpZmZncjppZD0iYWJjMiIgbXNkYXRhOnJvd09yZGVyPSIxIiBkaWZmZ3I6aGFzQ2hhbmdlcz0iaW5zZXJ0ZWQiIHhtbG5zPSJteW5zMSI+PGNvbDE+YXNkYXNkPC9jb2wxPjxjb2wyPmZmZmZmZmZmZjwvY29sMj48L2FiYz48c2Rmc2RmIGRpZmZncjppZD0ic2Rmc2RmMSIgbXNkYXRhOnJvd09yZGVyPSIwIiBkaWZmZ3I6aGFzQ2hhbmdlcz0iaW5zZXJ0ZWQiPjxra2s+ZmYxPC9ra2s+PGpmamZqZj5mZjI8L2pmamZqZj48L3NkZnNkZj48c2Rmc2RmIGRpZmZncjppZD0ic2Rmc2RmMiIgbXNkYXRhOnJvd09yZGVyPSIxIiBkaWZmZ3I6aGFzQ2hhbmdlcz0iaW5zZXJ0ZWQiPjxra2s+b29vPC9ra2s+PGpmamZqZj5zZGZsa2pzZGZsa2pzZDwvamZqZmpmPjwvc2Rmc2RmPjxzZGZzZGYgZGlmZmdyOmlkPSJzZGZzZGYzIiBtc2RhdGE6cm93T3JkZXI9IjIiIGRpZmZncjpoYXNDaGFuZ2VzPSJpbnNlcnRlZCI+PGtraz5udWxsdmFsPC9ra2s+PC9zZGZzZGY+PC9EYXRhU2V0MTIzPjwvZGlmZmdyOmRpZmZncmFtPgQDAAAADlN5c3RlbS5WZXJzaW9uBAAAAAZfTWFqb3IGX01pbm9yBl9CdWlsZAlfUmV2aXNpb24AAAAACAgICAIAAAAAAAAA//////////8L", TargetFrameworkMoniker.netfx461) }); - - var propertyCollection = new PropertyCollection - { - { "p1", "v1" } - }; - - yield return (propertyCollection, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5Qcm9wZXJ0eUNvbGxlY3Rpb24HAAAACkxvYWRGYWN0b3IHVmVyc2lvbghDb21wYXJlchBIYXNoQ29kZVByb3ZpZGVyCEhhc2hTaXplBEtleXMGVmFsdWVzAAADAwAFBQsIHFN5c3RlbS5Db2xsZWN0aW9ucy5JQ29tcGFyZXIkU3lzdGVtLkNvbGxlY3Rpb25zLklIYXNoQ29kZVByb3ZpZGVyCAIAAADsUTg/AQAAAAoKAwAAAAkDAAAACQQAAAAQAwAAAAEAAAAGBQAAAAJwMRAEAAAAAQAAAAYGAAAAAnYxCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5Qcm9wZXJ0eUNvbGxlY3Rpb24HAAAACkxvYWRGYWN0b3IHVmVyc2lvbghDb21wYXJlchBIYXNoQ29kZVByb3ZpZGVyCEhhc2hTaXplBEtleXMGVmFsdWVzAAADAwAFBQsIHFN5c3RlbS5Db2xsZWN0aW9ucy5JQ29tcGFyZXIkU3lzdGVtLkNvbGxlY3Rpb25zLklIYXNoQ29kZVByb3ZpZGVyCAIAAADsUTg/AQAAAAoKAwAAAAkDAAAACQQAAAAQAwAAAAEAAAAGBQAAAAJwMRAEAAAAAQAAAAYGAAAAAnYxCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlGuid(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlGuid([74, 17, 188, 26, 104, 117, 191, 64, 132, 93, 95, 0, 182, 136, 150, 121]), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAACShG8Gmh1v0CEXV8AtoiWeQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAACShG8Gmh1v0CEXV8AtoiWeQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlGuid(new Guid("aad872f5-82bb-4989-af0f-bee5de636fd7")), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAAC9XLYqruCiUmvD77l3mNv1ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAAC9XLYqruCiUmvD77l3mNv1ws=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlGuid("aad872f5-82bb-4989-af0f-bee5de636fd7"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAAC9XLYqruCiUmvD77l3mNv1ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxHdWlkAQAAAAdtX3ZhbHVlBwICAAAACQMAAAAPAwAAABAAAAAC9XLYqruCiUmvD77l3mNv1ws=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlBoolean(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlBoolean(1), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlBoolean(true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB9TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCb29sZWFuAQAAAAdtX3ZhbHVlAAICAAAAAgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlByte(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCeXRlAgAAAAptX2ZOb3ROdWxsB21fdmFsdWUAAAECAgAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCeXRlAgAAAAptX2ZOb3ROdWxsB21fdmFsdWUAAAECAgAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlByte(255), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCeXRlAgAAAAptX2ZOb3ROdWxsB21fdmFsdWUAAAECAgAAAAH/Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABxTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxCeXRlAgAAAAptX2ZOb3ROdWxsB21fdmFsdWUAAAECAgAAAAH/Cw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(123, 546), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAXsAAAAiAgAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAXsAAAAiAgAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(2017, 11, 3), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(2017, 11, 3, 4, 50, 30), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAADIyU8ACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAADIyU8ACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(2017, 11, 3, 4, 50, 30, 99.9), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAADmyU8ACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAASCoAADmyU8ACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDateTime(new DateTime(1990, 11, 23, 03, 30, 00, 00, DateTimeKind.Utc)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAa6BAACgrTkACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACBTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEYXRlVGltZQMAAAAKbV9mTm90TnVsbAVtX2RheQZtX3RpbWUAAAABCAgCAAAAAa6BAACgrTkACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDouble(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEb3VibGUCAAAACm1fZk5vdE51bGwHbV92YWx1ZQAAAQYCAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEb3VibGUCAAAACm1fZk5vdE51bGwHbV92YWx1ZQAAAQYCAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlDouble(34.5), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEb3VibGUCAAAACm1fZk5vdE51bGwHbV92YWx1ZQAAAQYCAAAAAQAAAAAAQEFACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxEb3VibGUCAAAACm1fZk5vdE51bGwHbV92YWx1ZQAAAQYCAAAAAQAAAAAAQEFACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt16(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQxNgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABBwIAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQxNgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABBwIAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt16(256), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQxNgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABBwIAAAABAAEL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQxNgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABBwIAAAABAAEL", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt32(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQzMgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCAIAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQzMgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCAIAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt32(4096314), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQzMgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCAIAAAABOoE+AAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQzMgIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCAIAAAABOoE+AAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt64(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQ2NAIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCQIAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQ2NAIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCQIAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlInt64(3492867384596), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQ2NAIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCQIAAAABFKUePy0DAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxJbnQ2NAIAAAAKbV9mTm90TnVsbAdtX3ZhbHVlAAABCQIAAAABFKUePy0DAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAoKAAAAAAX9////JlN5c3RlbS5EYXRhLlNxbFR5cGVzLlNxbENvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgCAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAoKAAAAAAX9////JlN5c3RlbS5EYXRhLlNxbFR5cGVzLlNxbENvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgCAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString("abc", CultureInfo.InvariantCulture.LCID), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAAA2FiYwp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAZAAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAAA2FiYwp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAZAAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString("abc", CultureInfo.InvariantCulture.LCID, SqlCompareOptions.BinarySort), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAAA2FiYwp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAAA2FiYwp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString(CultureInfo.InvariantCulture.LCID, SqlCompareOptions.BinarySort, [65, 66, 67]), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString(CultureInfo.InvariantCulture.LCID, SqlCompareOptions.BinarySort, [65, 66, 67], true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString(CultureInfo.InvariantCulture.LCID, SqlCompareOptions.BinarySort, [65, 66, 67], 0, 3), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SqlString(CultureInfo.InvariantCulture.LCID, SqlCompareOptions.BinarySort, [65, 66, 67], 0, 3, true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxTdHJpbmcFAAAAB21fdmFsdWUJbV9jbXBJbmZvBm1fbGNpZAZtX2ZsYWcKbV9mTm90TnVsbAEDAAQAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCCZTeXN0ZW0uRGF0YS5TcWxUeXBlcy5TcWxDb21wYXJlT3B0aW9ucwIAAAABAgAAAAYDAAAABuSJge+/vQp/AAAABfz///8mU3lzdGVtLkRhdGEuU3FsVHlwZXMuU3FsQ29tcGFyZU9wdGlvbnMBAAAAB3ZhbHVlX18ACAIAAAAAgAAAAQs=", TargetFrameworkMoniker.netfx461) }); - yield return (DBNull.Value, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEICgIAAAAGAgAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEICgIAAAAGAgAAAAAL", TargetFrameworkMoniker.netfx461) }); - - yield return (new BigInteger(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAAAAAAAAoL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAAAAAAAAoL", TargetFrameworkMoniker.netfx461) }); - yield return (new BigInteger(10324176), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAA0IidAAoL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAA0IidAAoL", TargetFrameworkMoniker.netfx461) }); - yield return (new BigInteger(new byte[] { 1, 2, 3, 4, 5 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAAAQAAAAkDAAAADwMAAAACAAAADwECAwQFAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAEFTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUBAAAAGlN5c3RlbS5OdW1lcmljcy5CaWdJbnRlZ2VyAgAAAAVfc2lnbgVfYml0cwAHCA8CAAAAAQAAAAkDAAAADwMAAAACAAAADwECAwQFAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Complex(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFJTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAXU3lzdGVtLk51bWVyaWNzLkNvbXBsZXgCAAAABm1fcmVhbAttX2ltYWdpbmFyeQAABgYCAAAAAAAAAAAAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFJTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAXU3lzdGVtLk51bWVyaWNzLkNvbXBsZXgCAAAABm1fcmVhbAttX2ltYWdpbmFyeQAABgYCAAAAAAAAAAAAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Complex(12, 6), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFJTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAXU3lzdGVtLk51bWVyaWNzLkNvbXBsZXgCAAAABm1fcmVhbAttX2ltYWdpbmFyeQAABgYCAAAAAAAAAAAAKEAAAAAAAAAYQAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFJTeXN0ZW0uTnVtZXJpY3MsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAXU3lzdGVtLk51bWVyaWNzLkNvbXBsZXgCAAAABm1fcmVhbAttX2ltYWdpbmFyeQAABgYCAAAAAAAAAAAAKEAAAAAAAAAYQAs=", TargetFrameworkMoniker.netfx461) }); - - // Arrays of primitive types - yield return (Enumerable.Range(0, 256).Select(i => (byte)i).ToArray(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAABAAACAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAABAAACAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/ws=", TargetFrameworkMoniker.netfx461) }); - yield return (Array.Empty(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAAAAAAICw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAAAAAAICw==", TargetFrameworkMoniker.netfx461) }); - yield return (new int[] { 1 }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAIAQAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAIAQAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new int[] { 1, 2, 3, 4, 5 }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new char[] { 'a', 'b', 'c', 'd', 'e' }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAUAAAADYWJjZGUL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAUAAAADYWJjZGUL", TargetFrameworkMoniker.netfx461) }); - yield return (Array.Empty(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAARAQAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAARAQAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new string[] { "hello", "world" }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAARAQAAAAIAAAAGAgAAAAVoZWxsbwYDAAAABXdvcmxkCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAARAQAAAAIAAAAGAgAAAAVoZWxsbwYDAAAABXdvcmxkCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new short[] { short.MaxValue }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAH/38L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAH/38L", TargetFrameworkMoniker.netfx461) }); - yield return (new long[] { long.MaxValue }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAJ/////////38L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAJ/////////38L", TargetFrameworkMoniker.netfx461) }); - yield return (new ushort[] { ushort.MaxValue }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAO//8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAO//8L", TargetFrameworkMoniker.netfx461) }); - yield return (new uint[] { uint.MaxValue }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAP/////ws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAP/////ws=", TargetFrameworkMoniker.netfx461) }); - yield return (new ulong[] { ulong.MaxValue }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAQ//////////8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAQ//////////8L", TargetFrameworkMoniker.netfx461) }); - yield return (new bool[] { true, false }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAIAAAABAQAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAIAAAABAQAL", TargetFrameworkMoniker.netfx461) }); - yield return (new double[] { 1.2 }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAGMzMzMzMz8z8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAEAAAAGMzMzMzMz8z8L", TargetFrameworkMoniker.netfx461) }); - yield return (new float[] { 1.2f, 3.4f }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAPAQAAAAIAAAALmpmZP5qZWUAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAPAQAAAAIAAAALmpmZP5qZWUAL", TargetFrameworkMoniker.netfx461) }); - - // Arrays of other types - yield return (Array.Empty(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Guid[] { new("0CACAA4D-C6BD-420A-B660-2F557337CA89"), new("BE4E9FF4-82D9-4B54-85EA-0957E21DE0E2") }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAHAQAAAAABAAAAAgAAAAMLU3lzdGVtLkd1aWQE/v///wtTeXN0ZW0uR3VpZAsAAAACX2ECX2ICX2MCX2QCX2UCX2YCX2cCX2gCX2kCX2oCX2sAAAAAAAAAAAAAAAgHBwICAgICAgICTaqsDL3GCkK2YC9VczfKiQH9/////v////SfTr7ZglRLheoJV+Id4OIL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAHAQAAAAABAAAAAgAAAAMLU3lzdGVtLkd1aWQE/v///wtTeXN0ZW0uR3VpZAsAAAACX2ECX2ICX2MCX2QCX2UCX2YCX2cCX2gCX2kCX2oCX2sAAAAAAAAAAAAAAAgHBwICAgICAgICTaqsDL3GCkK2YC9VczfKiQH9/////v////SfTr7ZglRLheoJV+Id4OIL", TargetFrameworkMoniker.netfx461) }); - yield return (new DayOfWeek[] { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAHAQAAAAABAAAABQAAAAMQU3lzdGVtLkRheU9mV2VlawT+////EFN5c3RlbS5EYXlPZldlZWsBAAAAB3ZhbHVlX18ACAEAAAAB/f////7///8CAAAAAfz////+////AwAAAAH7/////v///wQAAAAB+v////7///8FAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAHAQAAAAABAAAABQAAAAMQU3lzdGVtLkRheU9mV2VlawT+////EFN5c3RlbS5EYXlPZldlZWsBAAAAB3ZhbHVlX18ACAEAAAAB/f////7///8CAAAAAfz////+////AwAAAAH7/////v///wQAAAAB+v////7///8FAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Point[] { new(1, 2), new(3, 4) }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkHAQAAAAABAAAAAgAAAAQmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAACQMAAAAJBAAAAAUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIAgAAAAEAAAACAAAAAQQAAAADAAAAAwAAAAQAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkHAQAAAAABAAAAAgAAAAQmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAACQMAAAAJBAAAAAUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIAgAAAAEAAAACAAAAAQQAAAADAAAAAwAAAAQAAAAL", TargetFrameworkMoniker.netfx461) }); - -#pragma warning disable SA1500 // Braces for multi-line statements should not share line - var objectWithArrays = new ObjectWithArrays - { - IntArray = [], - StringArray = ["hello", "world"], - ByteArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - JaggedArray = [[1, 2, 3], [4, 5, 6, 7]], - MultiDimensionalArray = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } }, - TreeArray = [new Tree(1, new Tree(2, null!, null!), new Tree(3, null!, null!))] - }; -#pragma warning restore SA1500 // Braces for multi-line statements should not share line - yield return (objectWithArrays, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADFCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5PYmplY3RXaXRoQXJyYXlzBgAAAAhJbnRBcnJheQtTdHJpbmdBcnJheQlUcmVlQXJyYXkJQnl0ZUFycmF5C0phZ2dlZEFycmF5FU11bHRpRGltZW5zaW9uYWxBcnJheQcGBAcDAwiGAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlRyZWVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXVtdAgAAAAIQU3lzdGVtLkludDMyW11bXQ9TeXN0ZW0uSW50MzJbLF0CAAAACQMAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAADwMAAAAAAAAACBEEAAAAAgAAAAYJAAAABWhlbGxvBgoAAAAFd29ybGQHBQAAAAABAAAAAQAAAASEAUJpbmFyeUZvcm1hdFRlc3RzLkZ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2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAAAAAAAAAAAPAgAAAAAAAAAICw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAAAAAAAAAAAPAgAAAAAAAAAICw==", TargetFrameworkMoniker.netfx461) }); - - // Passing an array to the IEnumerable cosntructor to hit its ICollection optimization, which causes all runtimes to - // produce the same internal state. Otherwise, they come up with different _version values - yield return (new List(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAewAAAAAAAAAPAgAAAHsAAAAIAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAApAAAAKgAAACsAAAAsAAAALQAAAC4AAAAvAAAAMAAAADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAA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AAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAFsAAABcAAAAXQAAAF4AAABfAAAAYAAAAGEAAABiAAAAYwAAAGQAAABlAAAAZgAAAGcAAABoAAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHAAAABxAAAAcgAAAHMAAAB0AAAAdQAAAHYAAAB3AAAAeAAAAHkAAAB6AAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new List(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAwAAAAAAAAAPAgAAAAMAAAAIBQAAAAcAAAAJAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkCAAAAAwAAAAAAAAAPAgAAAAMAAAAIBQAAAAcAAAAJAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new List(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY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5Qb2ludAIAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new List(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkEAQAAAKEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludCwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgQAAChCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludFtdAgAAAAgICQMAAAACAAAAAAAAAAcDAAAAAAEAAAACAAAABCZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAAJBAAAAAkFAAAABQQAAAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgCAAAAAQAAAAIAAAABBQAAAAQAAAAEAAAAAwAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkEAQAAAKEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5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LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV1bXQgICQIAAAAAAAAAAAAAAAcCAAAAAAEAAAAAAAAAA8kCU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0L", TargetFrameworkMoniker.netfx461) }); - yield return (new List>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAALsDU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZT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wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10FAAAABQAAAAAAAAAKAQcAAAAGAAAAAAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - yield return (new Dictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAOABU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRGljdGlvbmFyeWAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAAB1ZlcnNpb24IQ29tcGFyZXIISGFzaFNpemUAAwAIkQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5HZW5lcmljRXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAAJAgAAAAAAAAAEAgAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAOABU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaW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0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAbU3lzdGVtLk5ldC5Db29raWVDb2xsZWN0aW9uBAAAAAZtX2xpc3QJbV92ZXJzaW9uC21fVGltZVN0YW1wFG1faGFzX290aGVyX3ZlcnNpb25zAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0CA0BAgAAAAkDAAAAAAAAAAAAAAAAAAAAAAQDAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QDAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgUAAAgICQQAAAAAAAAAAAAAABAEAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAbU3lzdGVtLk5ldC5Db29raWVDb2xsZWN0aW9uBAAAAAZtX2xpc3QJbV92ZXJzaW9uC21fVGltZVN0YW1wFG1faGFzX290aGVyX3ZlcnNpb25zAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0CA0BAgAAAAkDAAAAAAAAAAAAAAAAAAAAAAQDAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QDAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgUAAAgICQQAAAAAAAAAAAAAABAEAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new PropertyCollection(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5Qcm9wZXJ0eUNvbGxlY3Rpb24HAAAACkxvYWRGYWN0b3IHVmVyc2lvbghDb21wYXJlchBIYXNoQ29kZVByb3ZpZGVyCEhhc2hTaXplBEtleXMGVmFsdWVzAAADAwAFBQsIHFN5c3RlbS5Db2xsZWN0aW9ucy5JQ29tcGFyZXIkU3lzdGVtLkNvbGxlY3Rpb25zLklIYXNoQ29kZVByb3ZpZGVyCAIAAADsUTg/AAAAAAoKAwAAAAkDAAAACQQAAAAQAwAAAAAAAAAQBAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB5TeXN0ZW0uRGF0YS5Qcm9wZXJ0eUNvbGxlY3Rpb24HAAAACkxvYWRGYWN0b3IHVmVyc2lvbghDb21wYXJlchBIYXNoQ29kZVByb3ZpZGVyCEhhc2hTaXplBEtleXMGVmFsdWVzAAADAwAFBQsIHFN5c3RlbS5Db2xsZWN0aW9ucy5JQ29tcGFyZXIkU3lzdGVtLkNvbGxlY3Rpb25zLklIYXNoQ29kZVByb3ZpZGVyCAIAAADsUTg/AAAAAAoKAwAAAAkDAAAACQQAAAAQAwAAAAAAAAAQBAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - - yield return (new ArrayList(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(7), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAcAAAANBws=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAcAAAANBws=", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAewAAAAEAAAAQAgAAAHsAAAAICAAAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAICCkAAAAICCoAAAAICCsAAAAICCwAAAAICC0AAAAICC4AAAAICC8AAAAICDAAAAAICDEAAAAICDIAAAAICDMAAAAICDQAAAAICDUAAAAICDYAAAAICDcAAAAICDgAAAAICDkAAAAICDoAAAAICDsAAAAICDwAAAAICD0AAAAICD4AAAAICD8AAAAICEAAAAAICEEAAAAICEIAAAAICEMAAAAICEQAAAAICEUAAAAICEYAAAAICEcAAAAICEgAAAAICEkAAAAICEoAAAAICEsAAAAICEwAAAAICE0AAAAICE4AAAAICE8AAAAICFAAAAAICFEAAAAICFIAAAAICFMAAAAICFQAAAAICFUAAAAICFYAAAAICFcAAAAICFgAAAAICFkAAAAICFoAAAAICFsAAAAICFwAAAAICF0AAAAICF4AAAAICF8AAAAICGAAAAAICGEAAAAICGIAAAAICGMAAAAICGQAAAAICGUAAAAICGYAAAAICGcAAAAICGgAAAAICGkAAAAICGoAAAAICGsAAAAICGwAAAAICG0AAAAICG4AAAAICG8AAAAICHAAAAAICHEAAAAICHIAAAAICHMAAAAICHQAAAAICHUAAAAICHYAAAAICHcAAAAICHgAAAAICHkAAAAICHoAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAewAAAAEAAAAQAgAAAHsAAAAICAAAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAICCkAAAAICCoAAAAICCsAAAAICCwAAAAICC0AAAAICC4AAAAICC8AAAAICDAAAAAICDEAAAAICDIAAAAICDMAAAAICDQAAAAICDUAAAAICDYAAAAICDcAAAAICDgAAAAICDkAAAAICDoAAAAICDsAAAAICDwAAAAICD0AAAAICD4AAAAICD8AAAAICEAAAAAICEEAAAAICEIAAAAICEMAAAAICEQAAAAICEUAAAAICEYAAAAICEcAAAAICEgAAAAICEkAAAAICEoAAAAICEsAAAAICEwAAAAICE0AAAAICE4AAAAICE8AAAAICFAAAAAICFEAAAAICFIAAAAICFMAAAAICFQAAAAICFUAAAAICFYAAAAICFcAAAAICFgAAAAICFkAAAAICFoAAAAICFsAAAAICFwAAAAICF0AAAAICF4AAAAICF8AAAAICGAAAAAICGEAAAAICGIAAAAICGMAAAAICGQAAAAICGUAAAAICGYAAAAICGcAAAAICGgAAAAICGkAAAAICGoAAAAICGsAAAAICGwAAAAICG0AAAAICG4AAAAICG8AAAAICHAAAAAICHEAAAAICHIAAAAICHMAAAAICHQAAAAICHUAAAAICHYAAAAICHcAAAAICHgAAAAICHkAAAAICHoAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAwAAAAEAAAAQAgAAAAMAAAAICAUAAAAICAcAAAAICAkAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAwAAAAEAAAAQAgAAAAMAAAAICAUAAAAICAcAAAAICAkAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAgAAAAEAAAAQAgAAAAIAAAAJAwAAAAkEAAAADAUAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQMAAAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgFAAAAAQAAAAIAAAABBAAAAAMAAAAEAAAAAwAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAgAAAAEAAAAQAgAAAAIAAAAJAwAAAAkEAAAADAUAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQMAAAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgFAAAAAQAAAAIAAAABBAAAAAMAAAAEAAAAAwAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAgAAAAEAAAAQAgAAAAIAAAAJAwAAAAkEAAAADAUAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BAMAAADJAlN5c3RlbS5UdXBsZWAyW1t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XV0ICAIAAAB7AAAACQMAAACDAAAACQQAAAAEAwAAAJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAPBAAAAHsAAAAIAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAApAAAAKgAAACsAAAAsAAAALQAAAC4AAAAvAAAAMAAAADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAARQAAAEYAAABHAAAASAAAAEkAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAFsAAABcAAAAXQAAAF4AAABfAAAAYAAAAGEAAABiAAAAYwAAAGQAAABlAAAAZgAAAGcAAABoAAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHAAAABxAAAAcgAAAHMAAAB0AAAAdQAAAHYAAAB3AAAAeAAAAHkAAAB6AAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new HashSet(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tle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LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new HashSet>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAL4DU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuSGFzaFNldGAxW1tTeXN0ZW0uVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0EAAAAB1ZlcnNpb24IQ29tcGFyZXIIQ2FwYWNpdHkIRWxlbWVudHMAAwADCM0DU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uVHV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U9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAVWYWx1ZQVMaW5rcwAECIcBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXVtdBwAAAAcAAAAAAAAACgEJAAAACAAAAAAAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new LinkedList(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACEAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAHVmVyc2lvbgVDb3VudAAACAgCAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACEAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAHVmVyc2lvbgVDb3VudAAACAgCAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList(Enumerable.Range(0, 123)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACEAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAHVmVyc2lvbgVDb3VudAREYXRhAAAHCAgIAgAAAHsAAAB7AAAACQMAAAAPAwAAAHsAAAAIAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAApAAAAKgAAACsAAAAsAAAALQAAAC4AAAAvAAAAMAAAADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAARQAAAEYAAABHAAAASAAAAEkAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAFsAAABcAAAAXQAAAF4AAABfAAAAYAAAAGEAAABiAAAAYwAAAGQAAABlAAAAZgAAAGcAAABoAAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHA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AAAB0AAAAdQAAAHYAAAB3AAAAeAAAAHkAAAB6AAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACEAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAHVmVyc2lvbgVDb3VudAREYXRhAAAHCAgIAgAAAAMAAAADAAAACQMAAAAPAwAAAAMAAAAIBQAAAAcAAAAJAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACEAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAHVmVyc2lvbgVDb3VudAREYXRhAAAHCAgIAgAAAAMAAAADAAAACQMAAAAPAwAAAAMAAAAIBQAAAAcAAAAJAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACnAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdWZXJzaW9uBUNvdW50AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACnAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdWZXJzaW9uBUNvdW50AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsL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WM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdWZXJzaW9uBUNvdW50AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAADBA1N5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdWZXJzaW9uBUNvdW50AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5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WJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAB21fSXRlbTEHbV9JdGVtMgAECIUBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQYAAAABAAAACQcAAAABBQAAAAQAAAAFAAAACQgAAAAFBwAAAIUBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFVmFsdWUFTGlua3MABAiHAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV1bXQYAAAAGAAAAAAAAAAoBCAAAAAcAAAAAAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new Queue(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADIAAAAAAAAABACAAAAIAAAAA0gCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADIAAAAAAAAABACAAAAIAAAAA0gCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(5), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADIAAAAAAAAABACAAAABQAAAA0FCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADIAAAAAAAAABACAAAABQAAAA0FCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(7, 2.2f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADcAAAAAAAAABACAAAABwAAAA0HCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAADcAAAAAAAAABACAAAABwAAAA0HCw==", Target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gAAAAgIUwAAAAgIVAAAAAgIVQAAAAgIVgAAAAgIVwAAAAgIWAAAAAgIWQAAAAgIWgAAAAgIWwAAAAgIXAAAAAgIXQAAAAgIXgAAAAgIXwAAAAgIYAAAAAgIYQAAAAgIYgAAAAgIYwAAAAgIZAAAAAgIZQAAAAgIZgAAAAgIZwAAAAgIaAAAAAgIaQAAAAgIagAAAAgIawAAAAgIbAAAAAgIbQAAAAgIbgAAAAgIbwAAAAgIcAAAAAgIcQAAAAgIcgAAAAgIcwAAAAgIdAAAAAgIdQAAAAgIdgAAAAgIdwAAAAgIeAAAAAgIeQAAAAgIegAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAMAAADIAAAAAwAAABACAAAAAwAAAAgIBQAAAAgIBwAAAAgICQAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAMAAADIAAAAAwAAABACAAAAAwAAAAgIBQAAAAgIBwAAAAgICQAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAIAAADIAAAAAgAAABACAAAAAgAAAAkDAAAACQQAAAAMBQAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAwAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAUAAAABAAAAAgAAAAEEAAAAAwAAAAQAAAADAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAIAAADIAAAAAgAAABACAAAAAgAAAAkDAAAACQQAAAAMBQAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAwAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAUAAAABAAAAAgAAAAEEAAAAAwAAAAQAAAADAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAIAAADIAAAAAgAAABACAAAAAgAAAAkDAAAACQQAAAAMBQAAAF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0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQUAAAABAAAACQYAAAABBAAAAAMAAAAFAAAACQcAAAAFBgAAAIUBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFVmFsdWUFTGlua3MABAiHAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV1bXQUAAAAFAAAAAAAAAAoBBwAAAAYAAAAAAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new SortedDictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAADmAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZERpY3Rpb25hcnlgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bm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lNvcnRWZXJzaW9uCAYFAAAABWVuLVVTCgkEAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedList(Comparer.DefaultInvariant), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdAcAAAAEa2V5cwZ2YWx1ZXMFX3NpemUHdmVyc2lvbghjb21wYXJlcgdrZXlMaXN0CXZhbHVlTGlzdAUFAAADAwMICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIlU3lzdGVtLkNvbGxlY3Rpb25zLlNvcnRlZExpc3QrS2V5TGlzdCdTeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdCtWYWx1ZUxpc3QJAgAAAAkCAAAAAAAAAAAAAAAJAwAAAAoKEAIAAAAAAAAABAMAAAAbU3lzdGVtLkNvbGxlY3Rpb25zLkNvbXBhcmVyAQAAAAtDb21wYXJlSW5mbwMgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8JBAAAAAQEAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYFAAAAAAp/AAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdAcAAAAEa2V5cwZ2YWx1ZXMFX3NpemUHdmVyc2lvbghjb21wYXJlcgdrZXlMaXN0CXZhbHVlTGlzdAUFAAADAwMICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIlU3lzdGVtLkNvbGxlY3Rpb25zLlNvcnRlZExpc3QrS2V5TGlzdCdTeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdCtWYWx1ZUxpc3QJAgAAAAkCAAAAAAAAAAAAAAAJAwAAAAoKEAIAAAAAAAAABAMAAAAbU3lzdGVtLkNvbGxlY3Rpb25zLkNvbXBhcmVyAQAAAAtDb21wYXJlSW5mbwMgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8JBAAAAAQEAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYFAAAAAAp/AAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedList(Comparer.DefaultInvariant, 4), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdAcAAAAEa2V5cwZ2YWx1ZXMFX3NpemUHdmVyc2lvbghjb21wYXJlcgdrZXlMaXN0CXZhbHVlTGlzdAUFAAADAwMICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIlU3lzdGVtLkNvbGxlY3Rpb25zLlNvcnRlZExpc3QrS2V5TGlzdCdTeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdCtWYWx1ZUxpc3QJAgAAAAkDAAAAAAAAAAAAAAAJBAAAAAoKEAIAAAAEAAAADQQQAwAAAAQAAAANBAQEAAAAG1N5c3RlbS5Db2xsZWN0aW9ucy5Db21wYXJlcgEAAAALQ29tcGFyZUluZm8DIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCQUAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBgAAAAAKfwAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdAcAAAAEa2V5cwZ2YWx1ZXMFX3NpemUHdmVyc2lvbghjb21wYXJlcgdrZXlMaXN0CXZhbHVlTGlzdAUFAAADAwMICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIlU3lzdGVtLkNvbGxlY3Rpb25zLlNvcnRlZExpc3QrS2V5TGlzdCdTeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdCtWYWx1ZUxpc3QJAgAAAAkDAAAAAAAAAAAAAAAJBAAAAAoKEAIAAAAEAAAADQQQAwAAAAQAAAANBAQEAAAAG1N5c3RlbS5Db2xsZWN0aW9ucy5Db21wYXJlcgEAAAALQ29tcGFyZUluZm8DIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvCQUAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBgAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (SortedList.Synchronized(new SortedList(Comparer.DefaultInvariant, 4)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACxTeXN0ZW0uQ29sbGVjdGlvbnMuU29ydGVkTGlzdCtTeW5jU29ydGVkTGlzdAkAAAAFX2xpc3QFX3Jvb3QPU29ydGVkTGlzdCtrZXlzEVNvcnRlZExpc3QrdmFsdWVzEFNvcnRlZExpc3QrX3NpemUSU29ydGVkTGlzdCt2ZXJzaW9uE1NvcnRlZExpc3QrY29tcGFyZXISU29ydGVkTGlzdCtrZXlMaXN0FFNvcnRlZExpc3QrdmFsdWVMaXN0AwIFBQAAAwMDHVN5c3RlbS5Db2xsZWN0aW9ucy5Tb3J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AAAgAAAAGCwAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new SortedSet(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACDAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZFNldGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAVDb3VudAhDb21wYXJlcgdWZXJzaW9uAAMACIkBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0NvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0IAgAAAAAAAAAJAwAAAAAAAAAEAwAAAIkBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0NvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACDAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZFNld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ZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedSet(Enumerable.Range(0, 123)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACDAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZFNldGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBAAAAAVDb3VudAhDb21wYXJlcgdWZXJzaW9uBUl0ZW1zAAMABwiJAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNDb21wYXJlcmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAgCAAAAewAAAAkDAAAAAAAAAAkEAAAABAMAAACJAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNDb21wYXJlcmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAA8EAAAAewAAAAgAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQA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UHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAgCAAAAewAAAAkDAAAAAAAAAAkEAAAABAMAAACJAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNDb21wYXJlcmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAA8EAAAAewAAAAgAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACAAAAAhAAAAIgAAACMAAAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAPQAAAD4AAAA/AAAAQAAAAEEAAABCAAAAQwAAAEQAAABFAAAARgAAAEcAAABIAAAASQAAAEoAAABLAAAATAAAAE0AAABOAAAATwAAAFAAAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAFkAAABaAAAAWwAAAFwAAABdAAAAXgAAAF8AAABgAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedSet(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT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NvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0Q29tcGFyZXJgMVtbU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedSet>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAADAA1N5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZFNldGAxW1tTeXN0ZW0uVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZ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dFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdtX0l0ZW0xB21fSXRlbTIABAiFAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0HAAAAAQAAAAkIAAAAAQYAAAAFAAAABQAAAAkJAAAABQgAAACFAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAABVZhbHVlBUxpbmtzAAQIhwFCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10HAAAABwAAAAAAAAAKAQkAAAAIAAAAAAAAAAoL", TargetFrameworkMoniker.netfx461) }); - - yield return (new Stack(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAAAAAAAAAAAABACAAAACgAAAA0KCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAAAAAAAAAAAABACAAAACgAAAA0KCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAB7AAAAewAAABACAAAAewAAAAgIAAAAAAgIAQAAAAgIAgAAAAgIAwAAAAgIBAAAAAgIBQAAAAgIBgAAAAgIBwAAAAgICAAAAAgICQAAAAgICgAAAAgICwAAAAgIDAAAAAgIDQAAAAgIDgAAAAgIDwAAAAgIEAAAAAgIEQAAAAgIEgAAAAgIEwAAAAgIFAAAAAgIFQAAAAgIFgAAAAgIFwAAAAgIGAAAAAgIGQAAAAgIGgAAAAgIGwAAAAgIHAAAAAgIHQAAAAgIHgAAAAgIHwAAAAgIIAAAAAgIIQAAAAgIIgAAAAgIIwAAAAgIJAAAAAgIJQAAAAgIJgAAAAgIJwAAAAgIKAAAAAgIKQAAAAgIKgAAAAgIKwAAAAgILAAAAAgILQAAAAgILgAAAAgILwAAAAgIMAAAAAgIMQAAAAgIMgAAAAgIMwAAAAgINAAAAAgINQAAAAgINgAAAAgINwAAAAgIOAAAAAgIOQAAAAgIOgAAAAgIOwAAAAgIPAAAAAgIPQAAAAgIPgAAAAgIPwAAAAgIQAAAAAgIQQAAAAgIQgAAAAgIQwAAAAgIRAAAAAgIRQAAAAgIRgAAAAgIRwAAAAgISAAAAAgISQAAAAgISgAAAAgISwAAAAgITAAAAAgITQAAAAgITgAAAAgITwAAAAgIUAAAAAgIUQAAAAgIUgAAAAgIUwAAAAgIVAAAAAgIVQAAAAgIVgAAAAgIVwAAAAgIWAAAAAgIWQAAAAgIWgAAAAgIWwAAAAgIXAAAAAgIXQAAAAgIXgAAAAgIXwAAAAgIYA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AAAAgIVgAAAAgIVwAAAAgIWAAAAAgIWQAAAAgIWgAAAAgIWwAAAAgIXAAAAAgIXQAAAAgIXgAAAAgIXwAAAAgIYAAAAAgIYQAAAAgIYgAAAAgIYwAAAAgIZAAAAAgIZQAAAAgIZgAAAAgIZwAAAAgIaAAAAAgIaQAAAAgIagAAAAgIawAAAAgIbAAAAAgIbQAAAAgIbgAAAAgIbwAAAAgIcAAAAAgIcQAAAAgIcgAAAAgIcwAAAAgIdAAAAAgIdQAAAAgIdgAAAAgIdwAAAAgIeAAAAAgIeQAAAAgIegAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAADAAAAAwAAABACAAAACgAAAAgIBQAAAAgIBwAAAAgICQAAAA0HCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAADAAAAAwAAABACAAAACgAAAAgIBQAAAAgIBwAAAAgICQAAAA0HCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAACAAAAAgAAABACAAAACgAAAAkDAAAACQQAAAANCAwFAAAAVEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIBQAAAAEAAAACAAAAAQQAAAADAAAABAAAAAMAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAACAAAAAgAAABACAAAACgAAAAkDAAAACQQAAAANCAwFAAAAVEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUDAAAAJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAFYAVkAAAgIBQAAAAEAAAACAAAAAQQAAAADAAAABAAAAAMAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAACAAAAAgAAABACAAAACgAAAAkDAAAACQQAAAANCAwFAAAAVEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQQDAAAAyQJTeXN0ZW0uVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJ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9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAVWYWx1ZQVMaW5rcwAECIcBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXVtdBQAAAAUAAAAAAAAACgEHAAAABgAAAAAAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new Hashtable(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKAwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKAwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Hashtable(EqualityComparer.Default), new TypeSerializableValue[] { new("A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Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uT2JqZWN0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAQAwAAAAAAAAAQBAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Hashtable(5), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKBwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKBwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Hashtable(new Dictionary(), 0.77f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcggp7Q0/AAAAAAoKAwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcggp7Q0/AAAAAAoKAwAAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Hashtable(StringComparer.InvariantCultureIgnoreCase), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXII7FE4PwAAAAAJAgAAAAMAAAAJAwAAAAkEAAAABAIAAAAbU3lzdGVtLkN1bHR1cmVBd2FyZUNvbXBhcmVyAwAAAAxfY29tcGFyZUluZm8IX29wdGlvbnMLX2lnbm9yZUNhc2UDAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8jU3lzdGVtLkdsb2JhbGl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oniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXII7FE4PwAAAAAJAgAAAAMAAAAJAwAAAAkEAAAABAIAAAAbU3lzdGVtLkN1bHR1cmVBd2FyZUNvbXBhcmVyAwAAAAxfY29tcGFyZUluZm8IX29wdGlvbnMLX2lnbm9yZUNhc2UDAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8jU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZU9wdGlvbnMBCQUAAAAE+v///yNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEAAAAHdmFsdWVfXwAIAQAAAAEQAwAAAAAAAAAQBAAAAAAAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBwAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx472_3260) }); - yield return (new Hashtable(StringComparer.InvariantCulture), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXII7FE4PwAAAAAJAgAAAAMAAAAJAwAAAAkEAAAABAIAAAAbU3lzdGVtLkN1bHR1cmVBd2FyZUNvbXBhcmVyAwAAAAxfY29tcGF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fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBwAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXII7FE4PwAAAAAJAgAAAAMAAAAJAwAAAAkEAAAABAIAAAAbU3lzdGVtLkN1bHR1cmVBd2FyZUNvbXBhcmVyAwAAAAxfY29tcGFyZUluZm8IX29wdGlvbnMLX2lnbm9yZUNhc2UDAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8jU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZU9wdGlvbnMBCQUAAAAE+v///yNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEAAAAHdmFsdWVfXwAIAAAAAAAQAwAAAAAAAAAQBAAAAAAAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBwAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx472_3260) }); - yield return (new Hashtable(StringComparer.CurrentCultureIgnoreCase), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3Y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21wYXJlT3B0aW9ucwEAAAAHdmFsdWVfXwAIAQAAAAEQAwAAAAAAAAAQBAAAAAAAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBwAAAAVlbi1VUwoJBAAACw==", TargetFrameworkMoniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXII7FE4PwAAAAAJAgAAAAMAAAAJAwAAAAkEAAAABAIAAAAbU3lzdGVtLkN1bHR1cmVBd2FyZUNvbXBhcmVyAwAAAAxfY29tcGFyZUluZm8IX29wdGlvbnMLX2lnbm9yZUNhc2UDAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8jU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZU9wdGlvbnMBCQUAAAAE+v///yNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEAAAAHdmFsdWVfXwAIAQAAAAEQAwAAAAAAAAAQBAAAAAAAAAAEBQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGBwAAAAVlbi1VUwoJBAAACw==", TargetFrameworkMoniker.netfx472_3260) }); - yield return (new Hashtable(StringComparer.CurrentCulture), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW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3J0VmVyc2lvbggGBwAAAAVlbi1VUwoJBAAACw==", TargetFrameworkMoniker.netfx472_3260) }); - - yield return (StringComparer.InvariantCultureIgnoreCase, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAAAAp/AAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAAAAp/AAAACw==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FyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAAAAp/AAAACw==", TargetFrameworkMoniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAAAAp/AAAACw==", TargetFrameworkMoniker.netfx472_3260) }); - // yield return (StringComparer.CurrentCultureIgnoreCase, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwt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aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAABWVuLVVTCgkEAAAL", TargetFrameworkMoniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgBAAAAAQQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAABWVuLVVTCgkEAAAL", TargetFrameworkMoniker.netfx472_3260) }); - yield return (StringComparer.InvariantCulture, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1Z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Ap/AAAACw==", TargetFrameworkMoniker.netfx472), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgAAAAAAAQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAAAAp/AAAACw==", TargetFrameworkMoniker.netfx472_3260) }); - // yield return (StringComparer.CurrentCulture, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXIDAAAADF9jb21wYXJlSW5mbwhfb3B0aW9ucwtfaWdub3JlQ2FzZQMDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgAAAAAAAQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAABWVuLVVTCgkEAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/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lSW5mbyNTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlT3B0aW9ucwEJAgAAAAT9////I1N5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVPcHRpb25zAQAAAAd2YWx1ZV9fAAgAAAAAAAQCAAAAIFN5c3RlbS5HbG9iYWxpemF0aW9uLkNvbXBhcmVJbmZvAwAAAAZtX25hbWUNbV9Tb3J0VmVyc2lvbgdjdWx0dXJlAQMAIFN5c3RlbS5HbG9iYWxpemF0aW9uLlNvcnRWZXJzaW9uCAYEAAAABWVuLVVTCgkEAAAL", TargetFrameworkMoniker.netfx472_3260) }); - yield return (StringComparer.Ordinal, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAQAAAAtfaWdub3JlQ2FzZQABAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAQAAAAtfaWdub3JlQ2FzZQABAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (StringComparer.OrdinalIgnoreCase, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAQAAAAtfaWdub3JlQ2FzZQABAQs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAQAAAAtfaWdub3JlQ2FzZQABAQs=", TargetFrameworkMoniker.netfx461) }); -#pragma warning disable 0618 // obsolete warning - yield return (new Hashtable(15, 0.8f, new HashCodeProvider(), Comparer.DefaultInvariant), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2M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QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuSGFzaENvZGVQcm92aWRlcgIAAAAIvXQTPwAAAAAJAwAAAAkEAAAAHQAAAAkFAAAACQYAAAAEAwAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIBAAAAC0NvbXBhcmVJbmZvAyBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwkHAAAABQQAAAAxQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuSGFzaENvZGVQcm92aWRlcgAAAAACAAAAEAUAAAAAAAAAEAYAAAAAAAAABAcAAAAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8DAAAABm1fbmFtZQ1tX1NvcnRWZXJzaW9uB2N1bHR1cmUBAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uU29ydFZlcnNpb24IBggAAAAACn8AAAAL", TargetFrameworkMoniker.netfx461) }); -#pragma warning restore 0618 - - yield return (new BindingList(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACAAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAlhZGROZXdQb3MWcmFpc2VMaXN0Q2hhbmdlZEV2ZW50cxZyYWlzZUl0ZW1DaGFuZ2VkRXZlbnRzCGFsbG93TmV3CWFsbG93RWRpdAthbGxvd1JlbW92ZQ91c2VyU2V0QWxsb3dOZXcSQ29sbGVjdGlvbmAxK2l0ZW1zAAAAAAAAAA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iwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAD/////AQABAQEACQMAAAAEAwAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgcAAAgICAkEAAAAAAAAAAAAAAAPBAAAAAAAAAAICw==", TargetFrameworkMoniker.netfx461) }); - yield return (new BindingList(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACAAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAlhZGROZXdQb3MWcmFpc2VMaXN0Q2hhbmdlZEV2ZW50cxZyYWlzZUl0ZW1DaGFuZ2VkRXZlbnRzCGFsbG93TmV3CWFsbG93RWRpdAthbGxvd1JlbW92ZQ91c2VyU2V0QWxsb3dOZXcSQ29sbGVjdGlvbmAxK2l0ZW1zAAAAAAAAAAMIAQEBAQEBDlN5c3RlbS5JbnQzMltdAgAAAP////8BAAEBAQAJAwAAAA8DAAAAewAAAAgAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAA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GVjdGlvbmAxK2l0ZW1zAAAAAAAAAAMIAQEBAQEBDlN5c3RlbS5JbnQzMltdAgAAAP////8BAAEBAQAJAwAAAA8DAAAAewAAAAgAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACAAAAAhAAAAIgAAACMAAAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAPQAAAD4AAAA/AAAAQAAAAEEAAABCAAAAQwAAAEQAAABFAAAARgAAAEcAAABIAAAASQAAAEoAAABLAAAATAAAAE0AAABOAAAATwAAAFAAAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAFkAAABaAAAAWwAAAFwAAABdAAAAXgAAAF8AAABgAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new BindingList(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACAAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAlhZGROZXdQb3MWcmFpc2VMaXN0Q2hhbmdlZEV2ZW50cxZyYWlzZUl0ZW1DaGFuZ2VkRXZlbnRzCGFsbG93TmV3CWFsbG93RWRpdAthbGxvd1JlbW92ZQ91c2VyU2V0QWxsb3dOZXcSQ29sbGVjdGlvbmAxK2l0ZW1zAAAAAAAAAAMIAQEBAQEBDlN5c3RlbS5JbnQzMltdAgAAAP////8BAAEBAQAJAwAAAA8DAAAAAwAAAAgFAAAABwAAAAkAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACAAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAlhZGROZXdQb3MWcmFpc2VMaXN0Q2hhbmdlZEV2ZW50cxZyYWlzZUl0ZW1DaGFuZ2VkRXZlbnRzCGFsbG93TmV3CWFsbG93RWRpdAthbGxvd1JlbW92ZQ91c2VyU2V0QWxsb3dOZXcSQ29sbGVjdGlvbmAxK2l0ZW1zAAAAAAAAAAMIAQEBAQEBDlN5c3RlbS5JbnQzMltdAgAAAP////8BAAEBAQAJAwAAAA8DAAAAAwAAAAgFAAAABwAAAAkAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new BindingList(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNL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yc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new BindingList>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAC9A1N5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXR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Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFVmFsdWUFTGlua3MABAiHAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV1bXQYAAAAGAAAAAAAAAAoBCAAAAAcAAAAAAAAACgs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new StringDictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0RpY3Rpb25hcnkBAAAACGNvbnRlbnRzAxxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlAgAAAAkDAAAABAMAAAAcU3lzdGVtLkNvbGxlY3Rpb25zLkhhc2h0YWJsZQcAAAAKTG9hZEZhY3RvcgdWZXJzaW9uCENvbXBhcmVyEEhhc2hDb2RlUHJvdmlkZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMDAAUFCwgcU3lzdGVtLkNvbGxlY3Rpb25zLklDb21wYXJlciRTeXN0ZW0uQ29sbGVjdGlvbnMuSUhhc2hDb2RlUHJvdmlkZXII7FE4PwAAAAAKCgMAAAAJBAAAAAkFAAAAEAQAAAAAAAAAEAUAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0RpY3Rpb25hcnkBAAAACGNvbnRlbnRzAxxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlAgAAAAkDAAAABAMAAAAcU3lzdGVtLkNvbGxlY3Rpb25zLkhhc2h0YWJsZQcAAAAKTG9hZEZhY3RvcgdWZXJzaW9uCENvbXBhcmVyEEhhc2hDb2RlUHJvdmlkZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMDAAUFCwgcU3lzdGVtLkNvbGxlY3Rpb25zLklDb21wYXJlciRTeXN0ZW0uQ29sbGVjdGlvbnMuSUhhc2hDb2RlUHJvdmlkZXII7FE4PwAAAAAKCgMAAAAJBAAAAAkFAAAAEAQAAAAAAAAAEAUAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StringCollection(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0NvbGxlY3Rpb24BAAAABGRhdGEDHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QCAAAACQMAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkEAAAAAAAAAAAAAAAQBAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0NvbGxlY3Rpb24BAAAABGRhdGEDHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QCAAAACQMAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkEAAAAAAAAAAAAAAAQBAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new OrderedDictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABSRTeXN0ZW0uQ29sbGVjdGlvbnMuSUVxdWFsaXR5Q29tcGFyZXIBCAIAAAAKAAAAAAAJAwAAABADAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABSRTeXN0ZW0uQ29sbGVjdGlvbnMuSUVxdWFsaXR5Q29tcGFyZXIBCAIAAAAKAAAAAAAJAwAAABADAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new OrderedDictionary(17, EqualityComparer.Default), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABZEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uT2JqZWN0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEIAgAAAAkDAAAAABEAAAAJBAAAAAQDAAAAkQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5PYmplY3RFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5PYmplY3QsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAABAEAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABZEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuT2JqZWN0RXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uT2JqZWN0LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEIAgAAAAkDAAAAABEAAAAJBAAAAAQDAAAAkQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5PYmplY3RFcXVhbGl0eUNvbXBhcmVyYDFbW1N5c3RlbS5PYmplY3QsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAAAAABAEAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - - yield return (new ListDictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyAgAAAAoAAAAAAAAAAAoL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyAgAAAAoAAAAAAAAAAAoL", TargetFrameworkMoniker.netfx461) }); - yield return (new ListDictionary(Comparer.DefaultInvariant), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXICAAAACgAAAAAAAAAACQMAAAAEAwAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIBAAAAC0NvbXBhcmVJbmZvAyBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwkEAAAABAQAAAAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8DAAAABm1fbmFtZQ1tX1NvcnRWZXJzaW9uB2N1bHR1cmUBAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uU29ydFZlcnNpb24IBgUAAAAACn8AAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXICAAAACgAAAAAAAAAACQMAAAAEAwAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIBAAAAC0NvbXBhcmVJbmZvAyBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwkEAAAABAQAAAAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8DAAAABm1fbmFtZQ1tX1NvcnRWZXJzaW9uB2N1bHR1cmUBAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uU29ydFZlcnNpb24IBgUAAAAACn8AAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new HybridDictionary(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoKAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoKAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new HybridDictionary(127, true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoJAwAAAAEEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyCOxROD8AAAAACQQAAADFAAAACQUAAAAJBgAAAAQEAAAAFlN5c3RlbS5PcmRpbmFsQ29tcGFyZXIBAAAAC19pZ25vcmVDYXNlAAEBEAUAAAAAAAAAEAYAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoJAwAAAAEEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyCOxROD8AAAAACQQAAADFAAAACQUAAAAJBgAAAAQEAAAAFlN5c3RlbS5PcmRpbmFsQ29tcGFyZXIBAAAAC19pZ25vcmVDYXNlAAEBEAUAAAAAAAAAEAYAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new ObservableCollection(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTM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Nb25pdG9yW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAApfYnVzeUNvdW50AAgCAAAAAAAAAAQEAAAAflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACAgICQUAAAAAAAAAAAAAAA8FAAAAAAAAAAgL", TargetFrameworkMoniker.netfx461) }); - - // Passing an array to the IEnumerable cosntructor to hit its ICollection optimization, which causes all runtimes to - // produce the same internal state. Otherwise, they come up with different _version values - yield return (new ObservableCollection(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzUFAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLk9ic2VydmFibGVDb2xsZWN0aW9uYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAACF9tb25pdG9yEkNvbGxlY3Rpb25gMStpdGVtcwQDoAFTeXN0ZW0uQ29sbGVjdGlvbnMuT2JqZWN0TW9kZWwuT2JzZXJ2YWJsZUNvbGxlY3Rpb25gMStTaW1wbGVNb25pdG9yW1tTeXN0ZW0uSW50MzIsIG1zY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AAFAAAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAFkAAABaAAAAWwAAAFwAAABdAAAAXgAAAF8AAABgAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ObservableCollection(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzUFAQAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLk9ic2VydmFibGVDb2xsZWN0aW9uYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAACF9tb25pdG9yEkNvbGxlY3Rpb25gMStpdGVtcwQDoAFTeXN0ZW0uQ29sbGVjdGlvbnMuT2JqZWN0TW9kZWwuT2JzZXJ2YWJsZUNvbGxlY3Rpb25gMStTaW1wbGVNb25pdG9yW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAH5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNz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BDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKEJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50W10FAAAACAgJBgAAAAAAAAAAAAAABwYAAAAAAQAAAAAAAAAEJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50BQAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new ObservableCollection(new Point[] { new(1, 2), new(4, 3) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzUFAQAAALUBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLk9ic2VydmFibGVDb2xsZWN0aW9uYDFbW0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50LCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAIX21vbml0b3ISQ29sbGVjdGlvbmAxK2l0ZW1zBAPDAVN5c3RlbS5Db2xsZWN0aW9ucy5PYmplY3RNb2RlbC5PYnNlcnZhYmxlQ29sbGVjdGlvbmAxK1NpbXBsZU1vbml0b3JbW0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50LCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAChAVN5c3RlbS5Db2xsZWN0aW9ucy5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mFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQs=", TargetFrameworkMoniker.netfx461) }); - yield return (new ObservableCollection>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzUFAQAAAM8DU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLk9ic2VydmFibGVDb2xsZWN0aW9uYDFbW1N5c3RlbS5UdXBsZWAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJ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25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24HAAAICAgJAwAAAAAAAAAAAAAADwMAAAAAAAAACAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAFaXRlbXMDflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQkCAAAABAIAAAB+U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24HAAAICAgJAwAAAAAAAAAAAAAADwMAAAAAAAAACAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Collection(Enumerable.Range(0, 123).ToArray()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3l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c3RlbS5JbnQzMltdCQIAAAAPAgAAAHsAAAAIAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAApAAAAKgAAACsAAAAsAAAALQAAAC4AAAAvAAAAMAAAADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAARQAAAEYAAABHAAAASAAAAEkAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAFsAAABcAAAAXQAAAF4AAABfAAAAYAAAAGEAAABiAAAAYwAAAGQAAABlAAAAZgAAAGcAAABoAAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHAAAABxAAAAcgAAAHMAAAB0AAAAdQAAAHYAAAB3AAAAeAAAAHkAAAB6AAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Collection(new int[] { 5, 7, 9 }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAFaXRlbXMDDlN5c3RlbS5JbnQzMltdCQIAAAAPAgAAAAMAAAAIBQAAAAcAAAAJAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAA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DdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0L", TargetFrameworkMoniker.netfx461) }); - yield return (new Collection>>(new Tuple>[] { Tuple.Create(1, new Graph()), Tuple.Create(5, new Graph()) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAMUDU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLlR1cGxlYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXSwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAVpdGVtcwPLAlN5c3RlbS5UdXBsZWAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW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cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAdtX0l0ZW0xB21fSXRlbTIABAiFAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0FAAAAAQAAAAkGAAAAAQQAAAADAAAABQAAAAkHAAAABQYAAACFAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAABVZhbHVlBUxpbmtzAAQIhwFCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10FAAAABQAAAAAAAAAKAQcAAAAGAAAAAAAAAAoL", TargetFrameworkMoniker.netfx461) }); - -#pragma warning disable SA1500 // Braces for multi-line statements should not share line - yield return (new object[] { new int[,] { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 }, { 11, 12, 13, 14, 15 } } }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgIAAAADAAAABQAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgIAAAADAAAABQAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new object[] { new int[,,] { { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 }, { 11, 12, 13, 14, 15 } } } }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgMAAAABAAAAAwAAAAUAAAAACAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgMAAAABAAAAAwAAAAUAAAAACAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAAAs=", TargetFrameworkMoniker.netfx461) }); -#pragma warning restore SA1500 // Braces for multi-line statements should not share line - yield return (new object[] { new int[,,,] { { { { 1 } } } } }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgQAAAABAAAAAQAAAAEAAAABAAAAAAgBAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAJAgAAAAcCAAAAAgQAAAABAAAAAQAAAAEAAAABAAAAAAgBAAAACw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new ArraySegment([1, 2, 3, 4, 5]), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAkCAAAAAAAAAAUAAAAPAgAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAkCAAAAAAAAAAUAAAAPAgAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArraySegment([1, 2, 3, 4, 5], 1, 2), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAkCAAAAAQAAAAIAAAAPAgAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAkCAAAAAQAAAAIAAAAPAgAAAAUAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (Enumerable.Range(0, 10000).Select(i => (object)i).ToArray(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAABAnAAAICAAAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAICCkAAAAICCoAAAAICCsAAAAICCwAAAAICC0AAAAICC4AAAAICC8AAAAICDAAAAAICDEAAAAICDIAAAAICDMAAAAICDQAAAAICDUAAAAICDYAAAAICDcAAAAICDgAAAAICDkAAAAICDoAAAAICDsAAAAICDwAAAAICD0AAAAICD4AAAAICD8AAAAICEAAAAAICEEAAAAICEIAAAAICEMAAAAICEQAAAAICEUAAAAICEYAAAAICEcAAAAICEgAAAAICEkAAAAICEoAAAAICEsAAAAICEwAAAAICE0AAAAICE4AAAAICE8AAAAICFAAAAAICFEAAAAICFIAAAAICFMAAAAICFQAAAAICFUAAAAICFYAAAAICFcAAAAICFgAAAAICFkAAAAICFoAAAAICFsAAAAICFwAAAAICF0AAAAICF4AAAAICF8AAAAICGAAAAAICGEAAAAICGIAAAAICGMAAAAICGQAAAAICGUAAAAICGYAAAAICGcAAAAICGgAAAAICGkAAAAICGoAAAAICGsAAAAICGwAAAAICG0AAAAICG4AAAAICG8AAAAICHAAAAAICHEAAAAICHIAAAAICHMAAAAICHQAAAAICHUAAAAICHYAAAAICHcAAAAICHgAAAAICHkAAAAICHoAAAAICHsAAAAICHwAAAAICH0AAAAICH4AAAAICH8AAAAICIAAAAAICIEAAAAICIIAAAAICIMAAAAICIQAAAAICIUAAAAICIYAAAAICIcAAAAICIgAAAAICIkAAAAICIoAAAAICIsAAAAICIwAAAAICI0AAAAICI4AAAAICI8AAAAICJAAAAAICJEAAAAICJIAAAAICJMAAAAICJQAAAAICJUAAAAICJYAAAAICJcAAAAICJgAAAAICJkAAAAICJoAAAAICJsAAAAICJwAAAAICJ0AAAAICJ4AAAAICJ8AAAAICKAAAAAICKEAAAAICKIAAAAICKMAAAAICKQAAAAICKUAAAAICKYAAAAICKcAAAAICKgAAAAICKkAAAAICKoAAAAICKsAAAAICKwAAAAICK0AAAAICK4AAAAICK8AAAAICLAAAAAICLEAAAAICLIAAAAICLMAAAAICLQAAAAICLUAAAAICLYAAAAICLcAAAAICLgAAAAICLkAAAAICLoAAAAICLsAAAAICLwAAAAICL0AAAAICL4AAAAICL8AAAAICMAAAAAICMEAAAAICMIAAAAICMMAAAAICMQAAAAICMUAAAAICMYAAAAICMcAAAAICMgAAAAICMkAAAAICMoAAAAICMsAAAAICMwAAAAICM0AAAAICM4AAAAICM8AAAAICNAAAAAICNEAAAAICNIAAAAICNMAAAAICNQAAAAICNUAAAAICNYAAAAICNcAAAAICNgAAAAICNkAAAAICNoAAAAICNsAAAAICNwAAAAICN0AAAAICN4AAAAICN8AAAAICOAAAAAICOEAAAAICOIAAAAICOMAAAAICOQAAAAICOUAAAAICOYAAAAICOcAAAAICOgAAAAICOkAAAAICOoAAAAICOsAAAAICOwAAAAICO0AAAAICO4AAAAICO8AAAAICPAAAAAICPEAAAAICPIAAAAICPMAAAAICPQAAAAICPUAAAAICPYAAAAICPcAAAAICPgAAAAICPkAAAAICPoAAAAICPsAAAAICPwAAAAICP0AAAAICP4AAAAICP8AAAAICAABAAAICAEBAAAICAIBAAAICAMBAAAICAQBAAAICAUBAAAICAYBAAAICAcBAAAICAgBAAAICAkBAAAICAoBAAAICAsBAAAICAwBAAAICA0BAAAICA4BAAAICA8BAAAICBABAAAICBEBAAAICBIBAAAICBMBAAAICBQBAAAICBUBAAAICBYBAAAICBcBAAAICBgBAAAICBkBAAAICBoBAAAICBsBAAAICBwBAAAICB0BAAAICB4BAAAICB8BAAAICCABAAAICCEBAAAICCIBAAAICCMBAAAICCQBAAAICCUBAAAICCYBAAAICCcBAAAICCgBAAAICCkBAAAICCoBAAAICCsBAAAICCwBAAAICC0BAAAICC4BAAAICC8BAAAICDABAAAICDEBAAAICDIBAAAICDMBAAAICDQBAAAICDUBAAAICDYBAAAICDcBAAAICDgBAAAICDkBAAAICDoBAAAICDsBAAAICDwBAAAICD0BAAAICD4BAAAICD8BAAAICEABAAAICEEBAAAICEIBAAAICEMBAAAICEQBAAAICEUBAAAICEYBAAAICEcBAAAICEgBAAAICEkBAAAICEoBAAAICEsBAAAICEwBAAAICE0BAAAICE4BAAAICE8BAAAICFABAAAICFEBAAAICFIBAAAICFMBAAAICFQBAAAICFUBAAAICFYBAAAICFcBAAAICFgBAAAICFkBAAAICFoBAAAICFsBAAAICFwBAAAICF0BAAAICF4BAAAICF8BAAAICGABAAAICGEBAAAICGIBAAAICGMBAAAICGQBAAAICGUBAAAICGYBAAAICGcBAAAICGgBAAAICGkBAAAICGoBAAAICGsBAAAICGwBAAAICG0BAAAICG4BAAAICG8BAAAICHABAAAICHEBAAAICHIBAAAICHMBAAAICHQBAAAICHUBAAAICHYBAAAICHcBAAAICHgBAAAICHkBAAAICHoBAAAICHsBAAAICHwBAAAICH0BAAAICH4BAAAICH8BAAAICIABAAAICIEBAAAICIIBAAAICIMBAAAICIQBAAAICIUBAAAICIYBAAAICIcBAAAICIgBAAAICIkBAAAICIoBAAAICIsBAAAICIwBAAAICI0BAAAICI4BAAAICI8BAAAICJABAAAICJEBAAAICJIBAAAICJMBAAAICJQBAAAICJUBAAAICJYBAAAICJcBAAAICJgBAAAICJkBAAAICJoBAAAICJsBAAAICJwBAAAICJ0BAAAICJ4BAAAICJ8BAAAICKABAAAICKEBAAAICKIBAAAICKMBAAAICKQBAAAICKUBAAAICKYBAAAICKcBAAAICKgBAAAICKkBAAAICKoBAAAICKsBAAAICKwBAAAICK0BAAAICK4BAAAICK8BAAAICLABAAAICLEBAAAICLIBAAAICLMBAAAICLQBAAAICLUBAAAICLYBAAAICLcBAAAICLgBAAAICLkBAAAICLoBAAAICLsBAAAICLwBAAAICL0BAAAICL4BAAAICL8BAAAICMABAAAICMEBAAAICMIBAAAICMMBAAAICMQBAAAICMUBAAAICMYBAAAICMcBAAAICMgBAAAICMkBAAAICMoBAAAICMsBAAAICMwBAAAICM0BAAAICM4BAAAICM8BAAAICNABAAAICNEBAAAICNIBAAAICNMBAAAICNQBAAAICNUBAAAICNYBAAAICNcBAAAICNgBAAAICNkBAAAICNoBAAAICNsBAAAICNwBAAAICN0BAAAICN4BAAAICN8BAAAICOABAAAICOEBAAAICOIBAAAICOMBAAAICOQBAAAICOUBAAAICOYBAAAICOcBAAAICOgBAAAICOkBAAAICOoBAAAICOsBAAAICOwBAAAICO0BAAAICO4BAAAICO8BAAAICPABAAAICPEBAAAICPIBAAAICPMBAAAICPQBAAAICPUBAAAICPYBAAAICPcBAAAICPgBAAAICPkBAAAICPoBAAAICPsBAAAICPwBAAAICP0BAAAICP4BAAAICP8BAAAICAACAAAICAECAAAICAICAAAICAMCAAAICAQCAAAICAUCAAAICAYCAAAICAcCAAAICAgCAAAICAkCAAAICAoCAAAICAsCAAAICAwCAAAICA0CAAAICA4CAAAICA8CAAAICBACAAAICBECAAAICBICAAAICBMCAAAICBQCAAAICBUCAAAICBYCAAAICBcCAAAICBgCAAAICBkCAAAICBoCAAAICBsCAAAICBwCAAAICB0CAAAICB4CAAAICB8CAAAICCACAAAICCECAAAICCICAAAICCMCAAAICCQCAAAICCUCAAAICCYCAAAICCcCAAAICCgCAAAICCkCAAAICCoCAAAICCsCAAAICCwCAAAICC0CAAAICC4CAAAICC8CAAAICDACAAAICDECAAAICDICAAAICDMCAAAICDQCAAAICDUCAAAICDYCAAAICDcCAAAICDgCAAAICDkCAAAICDoCAAAICDsCAAAICDwCAAAICD0CAAAICD4CAAAICD8CAAAICEACAAAICEECAAAICEICAAAICEMCAAAICEQCAAAICEUCAAAICEYCAAAICEcCAAAICEgCAAAICEkCAAAICEoCAAAICEsCAAAICEwCAAAICE0CAAAICE4CAAAICE8CAAAICFACAAAICFECAAAICFICAAAICFMCAAAICFQCAAAICFUCAAAICFYCAAAICFcCAAAICFgCAAAICFkCAAAICFoCAAAICFsCAAAICFwCAAAICF0CAAAICF4CAAAICF8CAAAICGACAAAICGECAAAICGICAAAICGMCAAAICGQCAAAICGUCAAAICGYCAAAICGcCAAAICGgCAAAICGkCAAAICGoCAAAICGsCAAAICGwCAAAICG0CAAAICG4CAAAICG8CAAAICHACAAAICHECAAAICHICAAAICHMCAAAICHQCAAAICHUCAAAICHYCAAAICHcCAAAICHgCAAAICHkCAAAICHoCAAAICHsCAAAICHwCAAAICH0CAAAICH4CAAAICH8CAAAICIACAAAICIECAAAICIICAAAICIMCAAAICIQCAAAICIUCAAAICIYCAAAICIcCAAAICIgCAAAICIkCAAAICIoCAAAICIsCAAAICIwCAAAICI0CAAAICI4CAAAICI8CAAAICJACAAAICJECAAAICJICAAAICJMCAAAICJQCAAAICJUCAAAICJYCAAAICJcCAAAICJgCAAAICJkCAAAICJoCAAAICJsCAAAICJwCAAAICJ0CAAAICJ4CAAAICJ8CAAAICKACAAAICKECAAAICKICAAAICKMCAAAICKQCAAAICKUCAAAICKYCAAAICKcCAAAICKgCAAAICKkCAAAICKoCAAAICKsCAAAICKwCAAAICK0CAAAICK4CAAAICK8CAAAICLACAAAICLECAAAICLICAAAICLMCAAAICLQCAAAICLUCAAAICLYCAAAICLcCAAAICLgCAAAICLkCAAAICLoCAAAICLsCAAAICLwCAAAICL0CAAAICL4CAAAICL8CAAAICMACAAAICMECAAAICMICAAAICMMCAAAICMQCAAAICMUCAAAICMYCAAAICMcCAAAICMgCAAAICMkCAAAICMoCAAAICMsCAAAICMwCAAAICM0CAAAICM4CAAAICM8CAAAICNACAAAICNECAAAICNICAAAICNMCAAAICNQCAAAICNUCAAAICNYCAAAICNcCAAAICNgCAAAICNkCAAAICNoCAAAICNsCAAAICNwCAAAICN0CAAAICN4CAAAICN8CAAAICOACAAAICOECAAAICOICAAAICOMCAAAICOQCAAAICOUCAAAICOYCAAAICOcCAAAICOgCAAAICOkCAAAICOoCAAAICOsCAAAICOwCAAAICO0CAAAICO4CAAAICO8CAAAICPACAAAICPECAAAICPICAAAICPMCAAAICPQCAAAICPUCAAAICPYCAAAICPcCAAAICPgCAAAICPkCAAAICPoCAAAICPsCAAAICPwCAAAICP0CAAAICP4CAAAICP8CAAAICAADAAAICAEDAAAICAIDAAAICAMDAAAICAQDAAAICAUDAAAICAYDAAAICAcDAAAICAgDAAAICAkDAAAICAoDAAAICAsDAAAICAwDAAAICA0DAAAICA4DAAAICA8DAAAICBADAAAICBEDAAAICBIDAAAICBMDAAAICBQDAAAICBUDAAAICBYDAAAICBcDAAAICBgDAAAICBkDAAAICBoDAAAICBsDAAAICBwDAAAICB0DAAAICB4DAAAICB8DAAAICCADAAAICCEDAAAICCIDAAAICCMDAAAICCQDAAAICCUDAAAICCYDAAAICCcDAAAICCgDAAAICCkDAAAICCoDAAAICCsDAAAICCwDAAAICC0DAAAICC4DAAAICC8DAAAICDADAAAICDEDAAAICDIDAAAICDMDAAAICDQDAAAICDUDAAAICDYDAAAICDcDAAAICDgDAAAICDkDAAAICDoDAAAICDsDAAAICDwDAAAICD0DAAAICD4DAAAICD8DAAAICEADAAAICEEDAAAICEIDAAAICEMDAAAICEQDAAAICEUDAAAICEYDAAAICEcDAAAICEgDAAAICEkDAAAICEoDAAAICEsDAAAICEwDAAAICE0DAAAICE4DAAAICE8DAAAICFADAAAICFEDAAAICFIDAAAICFMDAAAICFQDAAAICFUDAAAICFYDAAAICFcDAAAICFgDAAAICFkDAAAICFoDAAAICFsDAAAICFwDAAAICF0DAAAICF4DAAAICF8DAAAICGADAAAICGEDAAAICGIDAAAICGMDAAAICGQDAAAICGUDAAAICGYDAAAICGcDAAAICGgDAAAICGkDAAAICGoDAAAICGsDAAAICGwDAAAICG0DAAAICG4DAAAICG8DAAAICHADAAAICHEDAAAICHIDAAAICHMDAAAICHQDAAAICHUDAAAICHYDAAAICHcDAAAICHgDAAAICHkDAAAICHoDAAAICHsDAAAICHwDAAAICH0DAAAICH4DAAAICH8DAAAICIADAAAICIEDAAAICIIDAAAICIMDAAAICIQDAAAICIUDAAAICIYDAAAICIcDAAAICIgDAAAICIkDAAAICIoDAAAICIsDAAAICIwDAAAICI0DAAAICI4DAAAICI8DAAAICJADAAAICJEDAAAICJIDAAAICJMDAAAICJQDAAAICJUDAAAICJYDAAAICJcDAAAICJgDAAAICJkDAAAICJoDAAAICJsDAAAICJwDAAAICJ0DAAAICJ4DAAAICJ8DAAAICKADAAAICKEDAAAICKIDAAAICKMDAAAICKQDAAAICKUDAAAICKYDAAAICKcDAAAICKgDAAAICKkDAAAICKoDAAAICKsDAAAICKwDAAAICK0DAAAICK4DAAAICK8DAAAICLADAAAICLEDAAAICLIDAAAICLMDAAAICLQDAAAICLUDAAAICLYDAAAICLcDAAAICLgDAAAICLkDAAAICLoDAAAICLsDAAAICLwDAAAICL0DAAAICL4DAAAICL8DAAAICMADAAAICMEDAAAICMIDAAAICMMDAAAICMQDAAAICMUDAAAICMYDAAAICMcDAAAICMgDAAAICMkDAAAICMoDAAAICMsDAAAICMwDAAAICM0DAAAICM4DAAAICM8DAAAICNADAAAICNEDAAAICNIDAAAICNMDAAAICNQDAAAICNUDAAAICNYDAAAICNcDAAAICNgDAAAICNkDAAAICNoDAAAICNsDAAAICNwDAAAICN0DAAAICN4DAAAICN8DAAAICOADAAAICOEDAAAICOIDAAAICOMDAAAICOQDAAAICOUDAAAICOYDAAAICOcDAAAICOgDAAAICOkDAAAICOoDAAAICOsDAAAICOwDAAAICO0DAAAICO4DAAAICO8DAAAICPADAAAICPEDAAAICPIDAAAICPMDAAAICPQDAAAICPUDAAAICPYDAAAICPcDAAAICPgDAAAICPkDAAAICPoDAAAICPsDAAAICPwDAAAICP0DAAAICP4DAAAICP8DAAAICAAEAAAICAEEAAAICAIEAAAICAMEAAAICAQEAAAICAUEAAAICAYEAAAICAcEAAAICAgEAAAICAkEAAAICAoEAAAICAsEAAAICAwEAAAICA0EAAAICA4EAAAICA8EAAAICBAEAAAICBEEAAAICBIEAAAICBMEAAAICBQEAAAICBUEAAAICBYEAAAICBcEAAAICBgEAAAICBkEAAAICBoEAAAICBsEAAAICBwEAAAICB0EAAAICB4EAAAICB8EAAAICCAEAAAICCEEAAAICCIEAAAICCMEAAAICCQEAAAICCUEAAAICCYEAAAICCcEAAAICCgEAAAICCkEAAAICCoEAAAICCsEAAAICCwEAAAICC0EAAAICC4EAAAICC8EAAAICDAEAAAICDEEAAAICDIEAAAICDMEAAAICDQEAAAICDUEAAAICDYEAAAICDcEAAAICDgEAAAICDkEAAAICDoEAAAICDsEAAAICDwEAAAICD0EAAAICD4EAAAICD8EAAAICEAEAAAICEEEAAAICEIEAAAICEMEAAAICEQEAAAICEUEAAAICEYEAAAICEcEAAAICEgEAAAICEkEAAAICEoEAAAICEsEAAAICEwEAAAICE0EAAAICE4EAAAICE8EAAAICFAEAAAICFEEAAAICFIEAAAICFMEAAAICFQEAAAICFUEAAAICFYEAAAICFcEAAAICFgEAAAICFkEAAAICFoEAAAICFsEAAAICFwEAAAICF0EAAAICF4EAAAICF8EAAAICGAEAAAICGEEAAAICGIEAAAICGMEAAAICGQEAAAICGUEAAAICGYEAAAICGcEAAAICGgEAAAICGkEAAAICGoEAAAICGsEAAAICGwEAAAICG0EAAAICG4EAAAICG8EAAAICHAEAAAICHEEAAAICHIEAAAICHMEAAAICHQEAAAICHUEAAAICHYEAAAICHcEAAAICHgEAAAICHkEAAAICHoEAAAICHsEAAAICHwEAAAICH0EAAAICH4EAAAICH8EAAAICIAEAAAICIEEAAAICIIEAAAICIMEAAAICIQEAAAICIUEAAAICIYEAAAICIcEAAAICIgEAAAICIkEAAAICIoEAAAICIsEAAAICIwEAAAICI0EAAAICI4EAAAICI8EAAAICJAEAAAICJEEAAAICJIEAAAICJMEAAAICJQEAAAICJUEAAAICJYEAAAICJcEAAAICJgEAAAICJkEAAAICJoEAAAICJsEAAAICJwEAAAICJ0EAAAICJ4EAAAICJ8EAAAICKAEAAAICKEEAAAICKIEAAAICKMEAAAICKQEAAAICKUEAAAICKYEAAAICKcEAAAICKgEAAAICKkEAAAICKoEAAAICKsEAAAICKwEAAAICK0EAAAICK4EAAAICK8EAAAICLAEAAAICLEEAAAICLIEAAAICLMEAAAICLQEAAAICLUEAAAICLYEAAAICLcEAAAICLgEAAAICLkEAAAICLoEAAAICLsEAAAICLwEAAAICL0EAAAICL4EAAAICL8EAAAICMAEAAAICMEEAAAICMIEAAAICMMEAAAICMQEAAAICMUEAAAICMYEAAAICMcEAAAICMgEAAAICMkEAAAICMoEAAAICMsEAAAICMwEAAAICM0EAAAICM4EAAAICM8EAAAICNAEAAAICNEEAAAICNIEAAAICNMEAAAICNQEAAAICNUEAAAICNYEAAAICNcEAAAICNgEAAAICNkEAAAICNoEAAAICNsEAAAICNwEAAAICN0EAAAICN4EAAAICN8EAAAICOAEAAAICOEEAAAICOIEAAAICOMEAAAICOQEAAAICOUEAAAICOYEAAAICOcEAAAICOgEAAAICOkEAAAICOoEAAAICOsEAAAICOwEAAAICO0EAAAICO4EAAAICO8EAAAICPAEAAAICPEEAAAICPIEAAAICPMEAAAICPQEAAAICPUEAAAICPYEAAAICPcEAAAICPgEAAAICPkEAAAICPoEAAAICPsEAAAICPwEAAAICP0EAAAICP4EAAAICP8EAAAICAAFAAAICAEFAAAICAIFAAAICAMFAAAICAQFAAAICAUFAAAICAYFAAAICAcFAAAICAgFAAAICAkFAAAICAoFAAAICAsFAAAICAwFAAAICA0FAAAICA4FAAAICA8FAAAICBAFAAAICBEFAAAICBIFAAAICBMFAAAICBQFAAAICBUFAAAICBYFAAAICBcFAAAICBgFAAAICBkFAAAICBoFAAAICBsFAAAICBwFAAAICB0FAAAICB4FAAAICB8FAAAICCAFAAAICCEFAAAICCIFAAAICCMFAAAICCQFAAAICCUFAAAICCYFAAAICCcFAAAICCgFAAAICCkFAAAICCoFAAAICCsFAAAICCwFAAAICC0FAAAICC4FAAAICC8FAAAICDAFAAAICDEFAAAICDIFAAAICDMFAAAICDQFAAAICDUFAAAICDYFAAAICDcFAAAICDgFAAAICDkFAAAICDoFAAAICDsFAAAICDwFAAAICD0FAAAICD4FAAAICD8FAAAICEAFAAAICEEFAAAICEIFAAAICEMFAAAICEQFAAAICEUFAAAICEYFAAAICEcFAAAICEgFAAAICEkFAAAICEoFAAAICEsFAAAICEwFAAAICE0FAAAICE4FAAAICE8FAAAICFAFAAAICFEFAAAICFIFAAAICFMFAAAICFQFAAAICFUFAAAICFYFAAAICFcFAAAICFgFAAAICFkFAAAICFoFAAAICFsFAAAICFwFAAAICF0FAAAICF4FAAAICF8FAAAICGAFAAAICGEFAAAICGIFAAAICGMFAAAICGQFAAAICGUFAAAICGYFAAAICGcFAAAICGgFAAAICGkFAAAICGoFAAAICGsFAAAICGwFAAAICG0FAAAICG4FAAAICG8FAAAICHAFAAAICHEFAAAICHIFAAAICHMFAAAICHQFAAAICHUFAAAICHYFAAAICHcFAAAICHgFAAAICHkFAAAICHoFAAAICHsFAAAICHwFAAAICH0FAAAICH4FAAAICH8FAAAICIAFAAAICIEFAAAICIIFAAAICIMFAAAICIQFAAAICIUFAAAICIYFAAAICIcFAAAICIgFAAAICIkFAAAICIoFAAAICIsFAAAICIwFAAAICI0FAAAICI4FAAAICI8FAAAICJAFAAAICJEFAAAICJIFAAAICJMFAAAICJQFAAAICJUFAAAICJYFAAAICJcFAAAICJgFAAAICJkFAAAICJoFAAAICJsFAAAICJwFAAAICJ0FAAAICJ4FAAAICJ8FAAAICKAFAAAICKEFAAAICKIFAAAICKMFAAAICKQFAAAICKUFAAAICKYFAAAICKcFAAAICKgFAAAICKkFAAAICKoFAAAICKsFAAAICKwFAAAICK0FAAAICK4FAAAICK8FAAAICLAFAAAICLEFAAAICLIFAAAICLMFAAAICLQFAAAICLUFAAAICLYFAAAICLcFAAAICLgFAAAICLkFAAAICLoFAAAICLsFAAAICLwFAAAICL0FAAAICL4FAAAICL8FAAAICMAFAAAICMEFAAAICMIFAAAICMMFAAAICMQFAAAICMUFAAAICMYFAAAICMcFAAAICMgFAAAICMkFAAAICMoFAAAICMsFAAAICMwFAAAICM0FAAAICM4FAAAICM8FAAAICNAFAAAICNEFAAAICNIFAAAICNMFAAAICNQFAAAICNUFAAAICNYFAAAICNcFAAAICNgFAAAICNkFAAAICNoFAAAICNsFAAAICNwFAAAICN0FAAAICN4FAAAICN8FAAAICOAFAAAICOEFAAAICOIFAAAICOMFAAAICOQFAAAICOUFAAAICOYFAAAICOcFAAAICOgFAAAICOkFAAAICOoFAAAICOsFAAAICOwFAAAICO0FAAAICO4FAAAICO8FAAAICPAFAAAICPEFAAAICPIFAAAICPMFAAAICPQFAAAICPUFAAAICPYFAAAICPcFAAAICPgFAAAICPkFAAAICPoFAAAICPsFAAAICPwFAAAICP0FAAAICP4FAAAICP8FAAAICAAGAAAICAEGAAAICAIGAAAICAMGAAAICAQGAAAICAUGAAAICAYGAAAICAcGAAAICAgGAAAICAkGAAAICAoGAAAICAsGAAAICAwGAAAICA0GAAAICA4GAAAICA8GAAAICBAGAAAICBEGAAAICBIGAAAICBMGAAAICBQGAAAICBUGAAAICBYGAAAICBcGAAAICBgGAAAICBkGAAAICBoGAAAICBsGAAAICBwGAAAICB0GAAAICB4GAAAICB8GAAAICCAGAAAICCEGAAAICCIGAAAICCMGAAAICCQGAAAICCUGAAAICCYGAAAICCcGAAAICCgGAAAICCkGAAAICCoGAAAICCsGAAAICCwGAAAICC0GAAAICC4GAAAICC8GAAAICDAGAAAICDEGAAAICDIGAAAICDMGAAAICDQGAAAICDUGAAAICDYGAAAICDcGAAAICDgGAAAICDkGAAAICDoGAAAICDsGAAAICDwGAAAICD0GAAAICD4GAAAICD8GAAAICEAGAAAICEEGAAAICEIGAAAICEMGAAAICEQGAAAICEUGAAAICEYGAAAICEcGAAAICEgGAAAICEkGAAAICEoGAAAICEsGAAAICEwGAAAICE0GAAAICE4GAAAICE8GAAAICFAGAAAICFEGAAAICFIGAAAICFMGAAAICFQGAAAICFUGAAAICFYGAAAICFcGAAAICFgGAAAICFkGAAAICFoGAAAICFsGAAAICFwGAAAICF0GAAAICF4GAAAICF8GAAAICGAGAAAICGEGAAAICGIGAAAICGMGAAAICGQGAAAICGUGAAAICGYGAAAICGcGAAAICGgGAAAICGkGAAAICGoGAAAICGsGAAAICGwGAAAICG0GAAAICG4GAAAICG8GAAAICHAGAAAICHEGAAAICHIGAAAICHMGAAAICHQGAAAICHUGAAAICHYGAAAICHcGAAAICHgGAAAICHkGAAAICHoGAAAICHsGAAAICHwGAAAICH0GAAAICH4GAAAICH8GAAAICIAGAAAICIEGAAAICIIGAAAICIMGAAAICIQGAAAICIUGAAAICIYGAAAICIcGAAAICIgGAAAICIkGAAAICIoGAAAICIsGAAAICIwGAAAICI0GAAAICI4GAAAICI8GAAAICJAGAAAICJEGAAAICJIGAAAICJMGAAAICJQGAAAICJUGAAAICJYGAAAICJcGAAAICJgGAAAICJkGAAAICJoGAAAICJsGAAAICJwGAAAICJ0GAAAICJ4GAAAICJ8GAAAICKAGAAAICKEGAAAICKIGAAAICKMGAAAICKQGAAAICKUGAAAICKYGAAAICKcGAAAICKgGAAAICKkGAAAICKoGAAAICKsGAAAICKwGAAAICK0GAAAICK4GAAAICK8GAAAICLAGAAAICLEGAAAICLIGAAAICLMGAAAICLQGAAAICLUGAAAICLYGAAAICLcGAAAICLgGAAAICLkGAAAICLoGAAAICLsGAAAICLwGAAAICL0GAAAICL4GAAAICL8GAAAICMAGAAAICMEGAAAICMIGAAAICMMGAAAICMQGAAAICMUGAAAICMYGAAAICMcGAAAICMgGAAAICMkGAAAICMoGAAAICMsGAAAICMwGAAAICM0GAAAICM4GAAAICM8GAAAICNAGAAAICNEGAAAICNIGAAAICNMGAAAICNQGAAAICNUGAAAICNYGAAAICNcGAAAICNgGAAAICNkGAAAICNoGAAAICNsGAAAICNwGAAAICN0GAAAICN4GAAAICN8GAAAICOAGAAAICOEGAAAICOIGAAAICOMGAAAICOQGAAAICOUGAAAICOYGAAAICOcGAAAICOgGAAAICOkGAAAICOoGAAAICOsGAAAICOwGAAAICO0GAAAICO4GAAAICO8GAAAICPAGAAAICPEGAAAICPIGAAAICPMGAAAICPQGAAAICPUGAAAICPYGAAAICPcGAAAICPgGAAAICPkGAAAICPoGAAAICPsGAAAICPwGAAAICP0GAAAICP4GAAAICP8GAAAICAAHAAAICAEHAAAICAIHAAAICAMHAAAICAQHAAAICAUHAAAICAYHAAAICAcHAAAICAgHAAAICAkHAAAICAoHAAAICAsHAAAICAwHAAAICA0HAAAICA4HAAAICA8HAAAICBAHAAAICBEHAAAICBIHAAAICBMHAAAICBQHAAAICBUHAAAICBYHAAAICBcHAAAICBgHAAAICBkHAAAICBoHAAAICBsHAAAICBwHAAAICB0HAAAICB4HAAAICB8HAAAICCAHAAAICCEHAAAICCIHAAAICCMHAAAICCQHAAAICCUHAAAICCYHAAAICCcHAAAICCgHAAAICCkHAAAICCoHAAAICCsHAAAICCwHAAAICC0HAAAICC4HAAAICC8HAAAICDAHAAAICDEHAAAICDIHAAAICDMHAAAICDQHAAAICDUHAAAICDYHAAAICDcHAAAICDgHAAAICDkHAAAICDoHAAAICDsHAAAICDwHAAAICD0HAAAICD4HAAAICD8HAAAICEAHAAAICEEHAAAICEIHAAAICEMHAAAICEQHAAAICEUHAAAICEYHAAAICEcHAAAICEgHAAAICEkHAAAICEoHAAAICEsHAAAICEwHAAAICE0HAAAICE4HAAAICE8HAAAICFAHAAAICFEHAAAICFIHAAAICFMHAAAICFQHAAAICFUHAAAICFYHAAAICFcHAAAICFgHAAAICFkHAAAICFoHAAAICFsHAAAICFwHAAAICF0HAAAICF4HAAAICF8HAAAICGAHAAAICGEHAAAICGIHAAAICGMHAAAICGQHAAAICGUHAAAICGYHAAAICGcHAAAICGgHAAAICGkHAAAICGoHAAAICGsHAAAICGwHAAAICG0HAAAICG4HAAAICG8HAAAICHAHAAAICHEHAAAICHIHAAAICHMHAAAICHQHAAAICHUHAAAICHYHAAAICHcHAAAICHgHAAAICHkHAAAICHoHAAAICHsHAAAICHwHAAAICH0HAAAICH4HAAAICH8HAAAICIAHAAAICIEHAAAICIIHAAAICIMHAAAICIQHAAAICIUHAAAICIYHAAAICIcHAAAICIgHAAAICIkHAAAICIoHAAAICIsHAAAICIwHAAAICI0HAAAICI4HAAAICI8HAAAICJAHAAAICJEHAAAICJIHAAAICJMHAAAICJQHAAAICJUHAAAICJYHAAAICJcHAAAICJgHAAAICJkHAAAICJoHAAAICJsHAAAICJwHAAAICJ0HAAAICJ4HAAAICJ8HAAAICKAHAAAICKEHAAAICKIHAAAICKMHAAAICKQHAAAICKUHAAAICKYHAAAICKcHAAAICKgHAAAICKkHAAAICKoHAAAICKsHAAAICKwHAAAICK0HAAAICK4HAAAICK8HAAAICLAHAAAICLEHAAAICLIHAAAICLMHAAAICLQHAAAICLUHAAAICLYHAAAICLcHAAAICLgHAAAICLkHAAAICLoHAAAICLsHAAAICLwHAAAICL0HAAAICL4HAAAICL8HAAAICMAHAAAICMEHAAAICMIHAAAICMMHAAAICMQHAAAICMUHAAAICMYHAAAICMcHAAAICMgHAAAICMkHAAAICMoHAAAICMsHAAAICMwHAAAICM0HAAAICM4HAAAICM8HAAAICNAHAAAICNEHAAAICNIHAAAICNMHAAAICNQHAAAICNUHAAAICNYHAAAICNcHAAAICNgHAAAICNkHAAAICNoHAAAICNsHAAAICNwHAAAICN0HAAAICN4HAAAICN8HAAAICOAHAAAICOEHAAAICOIHAAAICOMHAAAICOQHAAAICOUHAAAICOYHAAAICOcHAAAICOgHAAAICOkHAAAICOoHAAAICOsHAAAICOwHAAAICO0HAAAICO4HAAAICO8HAAAICPAHAAAICPEHAAAICPIHAAAICPMHAAAICPQHAAAICPUHAAAICPYHAAAICPcHAAAICPgHAAAICPkHAAAICPoHAAAICPsHAAAICPwHAAAICP0HAAAICP4HAAAICP8HAAAICAAIAAAICAEIAAAICAIIAAAICAMIAAAICAQIAAAICAUIAAAICAYIAAAICAcIAAAICAgIAAAICAkIAAAICAoIAAAICAsIAAAICAwIAAAICA0IAAAICA4IAAAICA8IAAAICBAIAAAICBEIAAAICBIIAAAICBMIAAAICBQIAAAICBUIAAAICBYIAAAICBcIAAAICBgIAAAICBkIAAAICBoIAAAICBsIAAAICBwIAAAICB0IAAAICB4IAAAICB8IAAAICCAIAAAICCEIAAAICCIIAAAICCMIAAAICCQIAAAICCUIAAAICCYIAAAICCcIAAAICCgIAAAICCkIAAAICCoIAAAICCsIAAAICCwIAAAICC0IAAAICC4IAAAICC8IAAAICDAIAAAICDEIAAAICDIIAAAICDMIAAAICDQIAAAICDUIAAAICDYIAAAICDcIAAAICDgIAAAICDkIAAAICDoIAAAICDsIAAAICDwIAAAICD0IAAAICD4IAAAICD8IAAAICEAIAAAICEEIAAAICEIIAAAICEMIAAAICEQIAAAICEUIAAAICEYIAAAICEcIAAAICEgIAAAICEkIAAAICEoIAAAICEsIAAAICEwIAAAICE0IAAAICE4IAAAICE8IAAAICFAIAAAICFEIAAAICFIIAAAICFMIAAAICFQIAAAICFUIAAAICFYIAAAICFcIAAAICFgIAAAICFkIAAAICFoIAAAICFsIAAAICFwIAAAICF0IAAAICF4IAAAICF8IAAAICGAIAAAICGEIAAAICGIIAAAICGMIAAAICGQIAAAICGUIAAAICGYIAAAICGcIAAAICGgIAAAICGkIAAAICGoIAAAICGsIAAAICGwIAAAICG0IAAAICG4IAAAICG8IAAAICHAIAAAICHEIAAAICHIIAAAICHMIAAAICHQIAAAICHUIAAAICHYIAAAICHcIAAAICHgIAAAICHkIAAAICHoIAAAICHsIAAAICHwIAAAICH0IAAAICH4IAAAICH8IAAAICIAIAAAICIEIAAAICIIIAAAICIMIAAAICIQIAAAICIUIAAAICIYIAAAICIcIAAAICIgIAAAICIkIAAAICIoIAAAICIsIAAAICIwIAAAICI0IAAAICI4IAAAICI8IAAAICJAIAAAICJEIAAAICJIIAAAICJMIAAAICJQIAAAICJUIAAAICJYIAAAICJcIAAAICJgIAAAICJkIAAAICJoIAAAICJsIAAAICJwIAAAICJ0IAAAICJ4IAAAICJ8IAAAICKAIAAAICKEIAAAICKIIAAAICKMIAAAICKQIAAAICKUIAAAICKYIAAAICKcIAAAICKgIAAAICKkIAAAICKoIAAAICKsIAAAICKwIAAAICK0IAAAICK4IAAAICK8IAAAICLAIAAAICLEIAAAICLIIAAAICLMIAAAICLQIAAAICLUIAAAICLYIAAAICLcIAAAICLgIAAAICLkIAAAICLoIAAAICLsIAAAICLwIAAAICL0IAAAICL4IAAAICL8IAAAICMAIAAAICMEIAAAICMIIAAAICMMIAAAICMQIAAAICMUIAAAICMYIAAAICMcIAAAICMgIAAAICMkIAAAICMoIAAAICMsIAAAICMwIAAAICM0IAAAICM4IAAAICM8IAAAICNAIAAAICNEIAAAICNIIAAAICNMIAAAICNQIAAAICNUIAAAICNYIAAAICNcIAAAICNgIAAAICNkIAAAICNoIAAAICNsIAAAICNwIAAAICN0IAAAICN4IAAAICN8IAAAICOAIAAAICOEIAAAICOIIAAAICOMIAAAICOQIAAAICOUIAAAICOYIAAAICOcIAAAICOgIAAAICOkIAAAICOoIAAAICOsIAAAICOwIAAAICO0IAAAICO4IAAAICO8IAAAICPAIAAAICPEIAAAICPIIAAAICPMIAAAICPQIAAAICPUIAAAICPYIAAAICPcIAAAICPgIAAAICPkIAAAICPoIAAAICPsIAAAICPwIAAAICP0IAAAICP4IAAAICP8IAAAICAAJAAAICAEJAAAICAIJAAAICAMJAAAICAQJAAAICAUJAAAICAYJAAAICAcJAAAICAgJAAAICAkJAAAICAoJAAAICAsJAAAICAwJAAAICA0JAAAICA4JAAAICA8JAAAICBAJAAAICBEJAAAICBIJAAAICBMJAAAICBQJAAAICBUJAAAICBYJAAAICBcJAAAICBgJAAAICBkJAAAICBoJAAAICBsJAAAICBwJAAAICB0JAAAICB4JAAAICB8JAAAICCAJAAAICCEJAAAICCIJAAAICCMJAAAICCQJAAAICCUJAAAICCYJAAAICCcJAAAICCgJAAAICCkJAAAICCoJAAAICCsJAAAICCwJAAAICC0JAAAICC4JAAAICC8JAAAICDAJAAAICDEJAAAICDIJAAAICDMJAAAICDQJAAAICDUJAAAICDYJAAAICDcJAAAICDgJAAAICDkJAAAICDoJAAAICDsJAAAICDwJAAAICD0JAAAICD4JAAAICD8JAAAICEAJAAAICEEJAAAICEIJAAAICEMJAAAICEQJAAAICEUJAAAICEYJAAAICEcJAAAICEgJAAAICEkJAAAICEoJAAAICEsJAAAICEwJAAAICE0JAAAICE4JAAAICE8JAAAICFAJAAAICFEJAAAICFIJAAAICFMJAAAICFQJAAAICFUJAAAICFYJAAAICFcJAAAICFgJAAAICFkJAAAICFoJAAAICFsJAAAICFwJAAAICF0JAAAICF4JAAAICF8JAAAICGAJAAAICGEJAAAICGIJAAAICGMJAAAICGQJAAAICGUJAAAICGYJAAAICGcJAAAICGgJAAAICGkJAAAICGoJAAAICGsJAAAICGwJAAAICG0JAAAICG4JAAAICG8JAAAICHAJAAAICHEJAAAICHIJAAAICHMJAAAICHQJAAAICHUJAAAICHYJAAAICHcJAAAICHgJAAAICHkJAAAICHoJAAAICHsJAAAICHwJAAAICH0JAAAICH4JAAAICH8JAAAICIAJAAAICIEJAAAICIIJAAAICIMJAAAICIQJAAAICIUJAAAICIYJAAAICIcJAAAICIgJAAAICIkJAAAICIoJAAAICIsJAAAICIwJAAAICI0JAAAICI4JAAAICI8JAAAICJAJAAAICJEJAAAICJIJAAAICJMJAAAICJQJAAAICJUJAAAICJYJAAAICJcJAAAICJgJAAAICJkJAAAICJoJAAAICJsJAAAICJwJAAAICJ0JAAAICJ4JAAAICJ8JAAAICKAJAAAICKEJAAAICKIJAAAICKMJAAAICKQJAAAICKUJAAAICKYJAAAICKcJAAAICKgJAAAICKkJAAAICKoJAAAICKsJAAAICKwJAAAICK0JAAAICK4JAAAICK8JAAAICLAJAAAICLEJAAAICLIJAAAICLMJAAAICLQJAAAICLUJAAAICLYJAAAICLcJAAAICLgJAAAICLkJAAAICLoJAAAICLsJAAAICLwJAAAICL0JAAAICL4JAAAICL8JAAAICMAJAAAICMEJAAAICMIJAAAICMMJAAAICMQJAAAICMUJAAAICMYJAAAICMcJAAAICMgJAAAICMkJAAAICMoJAAAICMsJAAAICMwJAAAICM0JAAAICM4JAAAICM8JAAAICNAJAAAICNEJAAAICNIJAAAICNMJAAAICNQJAAAICNUJAAAICNYJAAAICNcJAAAICNgJAAAICNkJAAAICNoJAAAICNsJAAAICNwJAAAICN0JAAAICN4JAAAICN8JAAAICOAJAAAICOEJAAAICOIJAAAICOMJAAAICOQJAAAICOUJAAAICOYJAAAICOcJAAAICOgJAAAICOkJAAAICOoJAAAICOsJAAAICOwJAAAICO0JAAAICO4JAAAICO8JAAAICPAJAAAICPEJAAAICPIJAAAICPMJAAAICPQJAAAICPUJAAAICPYJAAAICPcJAAAICPgJAAAICPkJAAAICPoJAAAICPsJAAAICPwJAAAICP0JAAAICP4JAAAICP8JAAAICAAKAAAICAEKAAAICAIKAAAICAMKAAAICAQKAAAICAUKAAAICAYKAAAICAcKAAAICAgKAAAICAkKAAAICAoKAAAICAsKAAAICAwKAAAICA0KAAAICA4KAAAICA8KAAAICBAKAAAICBEKAAAICBIKAAAICBMKAAAICBQKAAAICBUKAAAICBYKAAAICBcKAAAICBgKAAAICBkKAAAICBoKAAAICBsKAAAICBwKAAAICB0KAAAICB4KAAAICB8KAAAICCAKAAAICCEKAAAICCIKAAAICCMKAAAICCQKAAAICCUKAAAICCYKAAAICCcKAAAICCgKAAAICCkKAAAICCoKAAAICCsKAAAICCwKAAAICC0KAAAICC4KAAAICC8KAAAICDAKAAAICDEKAAAICDIKAAAICDMKAAAICDQKAAAICDUKAAAICDYKAAAICDcKAAAICDgKAAAICDkKAAAICDoKAAAICDsKAAAICDwKAAAICD0KAAAICD4KAAAICD8KAAAICEAKAAAICEEKAAAICEIKAAAICEMKAAAICEQKAAAICEUKAAAICEYKAAAICEcKAAAICEgKAAAICEkKAAAICEoKAAAICEsKAAAICEwKAAAICE0KAAAICE4KAAAICE8KAAAICFAKAAAICFEKAAAICFIKAAAICFMKAAAICFQKAAAICFUKAAAICFYKAAAICFcKAAAICFgKAAAICFkKAAAICFoKAAAICFsKAAAICFwKAAAICF0KAAAICF4KAAAICF8KAAAICGAKAAAICGEKAAAICGIKAAAICGMKAAAICGQKAAAICGUKAAAICGYKAAAICGcKAAAICGgKAAAICGkKAAAICGoKAAAICGsKAAAICGwKAAAICG0KAAAICG4KAAAICG8KAAAICHAKAAAICHEKAAAICHIKAAAICHMKAAAICHQKAAAICHUKAAAICHYKAAAICHcKAAAICHgKAAAICHkKAAAICHoKAAAICHsKAAAICHwKAAAICH0KAAAICH4KAAAICH8KAAAICIAKAAAICIEKAAAICIIKAAAICIMKAAAICIQKAAAICIUKAAAICIYKAAAICIcKAAAICIgKAAAICIkKAAAICIoKAAAICIsKAAAICIwKAAAICI0KAAAICI4KAAAICI8KAAAICJAKAAAICJEKAAAICJIKAAAICJMKAAAICJQKAAAICJUKAAAICJYKAAAICJcKAAAICJgKAAAICJkKAAAICJoKAAAICJsKAAAICJwKAAAICJ0KAAAICJ4KAAAICJ8KAAAICKAKAAAICKEKAAAICKIKAAAICKMKAAAICKQKAAAICKUKAAAICKYKAAAICKcKAAAICKgKAAAICKkKAAAICKoKAAAICKsKAAAICKwKAAAICK0KAAAICK4KAAAICK8KAAAICLAKAAAICLEKAAAICLIKAAAICLMKAAAICLQKAAAICLUKAAAICLYKAAAICLcKAAAICLgKAAAICLkKAAAICLoKAAAICLsKAAAICLwKAAAICL0KAAAICL4KAAAICL8KAAAICMAKAAAICMEKAAAICMIKAAAICMMKAAAICMQKAAAICMUKAAAICMYKAAAICMcKAAAICMgKAAAICMkKAAAICMoKAAAICMsKAAAICMwKAAAICM0KAAAICM4KAAAICM8KAAAICNAKAAAICNEKAAAICNIKAAAICNMKAAAICNQKAAAICNUKAAAICNYKAAAICNcKAAAICNgKAAAICNkKAAAICNoKAAAICNsKAAAICNwKAAAICN0KAAAICN4KAAAICN8KAAAICOAKAAAICOEKAAAICOIKAAAICOMKAAAICOQKAAAICOUKAAAICOYKAAAICOcKAAAICOgKAAAICOkKAAAICOoKAAAICOsKAAAICOwKAAAICO0KAAAICO4KAAAICO8KAAAICPAKAAAICPEKAAAICPIKAAAICPMKAAAICPQKAAAICPUKAAAICPYKAAAICPcKAAAICPgKAAAICPkKAAAICPoKAAAICPsKAAAICPwKAAAICP0KAAAICP4KAAAICP8KAAAICAALAAAICAELAAAICAILAAAICAMLAAAICAQLAAAICAULAAAICAYLAAAICAcLAAAICAgLAAAICAkLAAAICAoLAAAICAsLAAAICAwLAAAICA0LAAAICA4LAAAICA8LAAAICBALAAAICBELAAAICBILAAAICBMLAAAICBQLAAAICBULAAAICBYLAAAICBcLAAAICBgLAAAICBkLAAAICBoLAAAICBsLAAAICBwLAAAICB0LAAAICB4LAAAICB8LAAAICCALAAAICCELAAAICCILAAAICCMLAAAICCQLAAAICCULAAAICCYLAAAICCcLAAAICCgLAAAICCkLAAAICCoLAAAICCsLAAAICCwLAAAICC0LAAAICC4LAAAICC8LAAAICDALAAAICDELAAAICDILAAAICDMLAAAICDQLAAAICDULAAAICDYLAAAICDcLAAAICDgLAAAICDkLAAAICDoLAAAICDsLAAAICDwLAAAICD0LAAAICD4LAAAICD8LAAAICEALAAAICEELAAAICEILAAAICEMLAAAICEQLAAAICEULAAAICEYLAAAICEcLAAAICEgLAAAICEkLAAAICEoLAAAICEsLAAAICEwLAAAICE0LAAAICE4LAAAICE8LAAAICFALAAAICFELAAAICFILAAAICFMLAAAICFQLAAAICFULAAAICFYLAAAICFcLAAAICFgLAAAICFkLAAAICFoLAAAICFsLAAAICFwLAAAICF0LAAAICF4LAAAICF8LAAAICGALAAAICGELAAAICGILAAAICGMLAAAICGQLAAAICGULAAAICGYLAAAICGcLAAAICGgLAAAICGkLAAAICGoLAAAICGsLAAAICGwLAAAICG0LAAAICG4LAAAICG8LAAAICHALAAAICHELAAAICHILAAAICHMLAAAICHQLAAAICHULAAAICHYLAAAICHcLAAAICHgLAAAICHkLAAAICHoLAAAICHsLAAAICHwLAAAICH0LAAAICH4LAAAICH8LAAAICIALAAAICIELAAAICIILAAAICIMLAAAICIQLAAAICIULAAAICIYLAAAICIcLAAAICIgLAAAICIkLAAAICIoLAAAICIsLAAAICIwLAAAICI0LAAAICI4LAAAICI8LAAAICJALAAAICJELAAAICJILAAAICJMLAAAICJQLAAAICJULAAAICJYLAAAICJcLAAAICJgLAAAICJkLAAAICJoLAAAICJsLAAAICJwLAAAICJ0LAAAICJ4LAAAICJ8LAAAICKALAAAICKELAAAICKILAAAICKMLAAAICKQLAAAICKULAAAICKYLAAAICKcLAAAICKgLAAAICKkLAAAICKoLAAAICKsLAAAICKwLAAAICK0LAAAICK4LAAAICK8LAAAICLALAAAICLELAAAICLILAAAICLMLAAAICLQLAAAICLULAAAICLYLAAAICLcLAAAICLgLAAAICLkLAAAICLoLAAAICLsLAAAICLwLAAAICL0LAAAICL4LAAAICL8LAAAICMALAAAICMELAAAICMILAAAICMMLAAAICMQLAAAICMULAAAICMYLAAAICMcLAAAICMgLAAAICMkLAAAICMoLAAAICMsLAAAICMwLAAAICM0LAAAICM4LAAAICM8LAAAICNALAAAICNELAAAICNILAAAICNMLAAAICNQLAAAICNULAAAICNYLAAAICNcLAAAICNgLAAAICNkLAAAICNoLAAAICNsLAAAICNwLAAAICN0LAAAICN4LAAAICN8LAAAICOALAAAICOELAAAICOILAAAICOMLAAAICOQLAAAICOULAAAICOYLAAAICOcLAAAICOgLAAAICOkLAAAICOoLAAAICOsLAAAICOwLAAAICO0LAAAICO4LAAAICO8LAAAICPALAAAICPELAAAICPILAAAICPMLAAAICPQLAAAICPULAAAICPYLAAAICPcLAAAICPgLAAAICPkLAAAICPoLAAAICPsLAAAICPwLAAAICP0LAAAICP4LAAAICP8LAAAICAAMAAAICAEMAAAICAIMAAAICAMMAAAICAQMAAAICAUMAAAICAYMAAAICAcMAAAICAgMAAAICAkMAAAICAoMAAAICAsMAAAICAwMAAAICA0MAAAICA4MAAAICA8MAAAICBAMAAAICBEMAAAICBIMAAAICBMMAAAICBQMAAAICBUMAAAICBYMAAAICBcMAAAICBgMAAAICBkMAAAICBoMAAAICBsMAAAICBwMAAAICB0MAAAICB4MAAAICB8MAAAICCAMAAAICCEMAAAICCIMAAAICCMMAAAICCQMAAAICCUMAAAICCYMAAAICCcMAAAICCgMAAAICCkMAAAICCoMAAAICCsMAAAICCwMAAAICC0MAAAICC4MAAAICC8MAAAICDAMAAAICDEMAAAICDIMAAAICDMMAAAICDQMAAAICDUMAAAICDYMAAAICDcMAAAICDgMAAAICDkMAAAICDoMAAAICDsMAAAICDwMAAAICD0MAAAICD4MAAAICD8MAAAICEAMAAAICEEMAAAICEIMAAAICEMMAAAICEQMAAAICEUMAAAICEYMAAAICEcMAAAICEgMAAAICEkMAAAICEoMAAAICEsMAAAICEwMAAAICE0MAAAICE4MAAAICE8MAAAICFAMAAAICFEMAAAICFIMAAAICFMMAAAICFQMAAAICFUMAAAICFYMAAAICFcMAAAICFgMAAAICFkMAAAICFoMAAAICFsMAAAICFwMAAAICF0MAAAICF4MAAAICF8MAAAICGAMAAAICGEMAAAICGIMAAAICGMMAAAICGQMAAAICGUMAAAICGYMAAAICGcMAAAICGgMAAAICGkMAAAICGoMAAAICGsMAAAICGwMAAAICG0MAAAICG4MAAAICG8MAAAICHAMAAAICHEMAAAICHIMAAAICHMMAAAICHQMAAAICHUMAAAICHYMAAAICHcMAAAICHgMAAAICHkMAAAICHoMAAAICHsMAAAICHwMAAAICH0MAAAICH4MAAAICH8MAAAICIAMAAAICIEMAAAICIIMAAAICIMMAAAICIQMAAAICIUMAAAICIYMAAAICIcMAAAICIgMAAAICIkMAAAICIoMAAAICIsMAAAICIwMAAAICI0MAAAICI4MAAAICI8MAAAICJAMAAAICJEMAAAICJIMAAAICJMMAAAICJQMAAAICJUMAAAICJYMAAAICJcMAAAICJgMAAAICJkMAAAICJoMAAAICJsMAAAICJwMAAAICJ0MAAAICJ4MAAAICJ8MAAAICKAMAAAICKEMAAAICKIMAAAICKMMAAAICKQMAAAICKUMAAAICKYMAAAICKcMAAAICKgMAAAICKkMAAAICKoMAAAICKsMAAAICKwMAAAICK0MAAAICK4MAAAICK8MAAAICLAMAAAICLEMAAAICLIMAAAICLMMAAAICLQMAAAICLUMAAAICLYMAAAICLcMAAAICLgMAAAICLkMAAAICLoMAAAICLsMAAAICLwMAAAICL0MAAAICL4MAAAICL8MAAAICMAMAAAICMEMAAAICMIMAAAICMMMAAAICMQMAAAICMUMAAAICMYMAAAICMcMAAAICMgMAAAICMkMAAAICMoMAAAICMsMAAAICMwMAAAICM0MAAAICM4MAAAICM8MAAAICNAMAAAICNEMAAAICNIMAAAICNMMAAAICNQMAAAICNUMAAAICNYMAAAICNcMAAAICNgMAAAICNkMAAAICNoMAAAICNsMAAAICNwMAAAICN0MAAAICN4MAAAICN8MAAAICOAMAAAICOEMAAAICOIMAAAICOMMAAAICOQMAAAICOUMAAAICOYMAAAICOcMAAAICOgMAAAICOkMAAAICOoMAAAICOsMAAAICOwMAAAICO0MAAAICO4MAAAICO8MAAAICPAMAAAICPEMAAAICPIMAAAICPMMAAAICPQMAAAICPUMAAAICPYMAAAICPcMAAAICPgMAAAICPkMAAAICPoMAAAICPsMAAAICPwMAAAICP0MAAAICP4MAAAICP8MAAAICAANAAAICAENAAAICAINAAAICAMNAAAICAQNAAAICAUNAAAICAYNAAAICAcNAAAICAgNAAAICAkNAAAICAoNAAAICAsNAAAICAwNAAAICA0NAAAICA4NAAAICA8NAAAICBANAAAICBENAAAICBINAAAICBMNAAAICBQNAAAICBUNAAAICBYNAAAICBcNAAAICBgNAAAICBkNAAAICBoNAAAICBsNAAAICBwNAAAICB0NAAAICB4NAAAICB8NAAAICCANAAAICCENAAAICCINAAAICCMNAAAICCQNAAAICCUNAAAICCYNAAAICCcNAAAICCgNAAAICCkNAAAICCoNAAAICCsNAAAICCwNAAAICC0NAAAICC4NAAAICC8NAAAICDANAAAICDENAAAICDINAAAICDMNAAAICDQNAAAICDUNAAAICDYNAAAICDcNAAAICDgNAAAICDkNAAAICDoNAAAICDsNAAAICDwNAAAICD0NAAAICD4NAAAICD8NAAAICEANAAAICEENAAAICEINAAAICEMNAAAICEQNAAAICEUNAAAICEYNAAAICEcNAAAICEgNAAAICEkNAAAICEoNAAAICEsNAAAICEwNAAAICE0NAAAICE4NAAAICE8NAAAICFANAAAICFENAAAICFINAAAICFMNAAAICFQNAAAICFUNAAAICFYNAAAICFcNAAAICFgNAAAICFkNAAAICFoNAAAICFsNAAAICFwNAAAICF0NAAAICF4NAAAICF8NAAAICGANAAAICGENAAAICGINAAAICGMNAAAICGQNAAAICGUNAAAICGYNAAAICGcNAAAICGgNAAAICGkNAAAICGoNAAAICGsNAAAICGwNAAAICG0NAAAICG4NAAAICG8NAAAICHANAAAICHENAAAICHINAAAICHMNAAAICHQNAAAICHUNAAAICHYNAAAICHcNAAAICHgNAAAICHkNAAAICHoNAAAICHsNAAAICHwNAAAICH0NAAAICH4NAAAICH8NAAAICIANAAAICIENAAAICIINAAAICIMNAAAICIQNAAAICIUNAAAICIYNAAAICIcNAAAICIgNAAAICIkNAAAICIoNAAAICIsNAAAICIwNAAAICI0NAAAICI4NAAAICI8NAAAICJANAAAICJENAAAICJINAAAICJMNAAAICJQNAAAICJUNAAAICJYNAAAICJcNAAAICJgNAAAICJkNAAAICJoNAAAICJsNAAAICJwNAAAICJ0NAAAICJ4NAAAICJ8NAAAICKANAAAICKENAAAICKINAAAICKMNAAAICKQNAAAICKUNAAAICKYNAAAICKcNAAAICKgNAAAICKkNAAAICKoNAAAICKsNAAAICKwNAAAICK0NAAAICK4NAAAICK8NAAAICLANAAAICLENAAAICLINAAAICLMNAAAICLQNAAAICLUNAAAICLYNAAAICLcNAAAICLgNAAAICLkNAAAICLoNAAAICLsNAAAICLwNAAAICL0NAAAICL4NAAAICL8NAAAICMANAAAICMENAAAICMINAAAICMMNAAAICMQNAAAICMUNAAAICMYNAAAICMcNAAAICMgNAAAICMkNAAAICMoNAAAICMsNAAAICMwNAAAICM0NAAAICM4NAAAICM8NAAAICNANAAAICNENAAAICNINAAAICNMNAAAICNQNAAAICNUNAAAICNYNAAAICNcNAAAICNgNAAAICNkNAAAICNoNAAAICNsNAAAICNwNAAAICN0NAAAICN4NAAAICN8NAAAICOANAAAICOENAAAICOINAAAICOMNAAAICOQNAAAICOUNAAAICOYNAAAICOcNAAAICOgNAAAICOkNAAAICOoNAAAICOsNAAAICOwNAAAICO0NAAAICO4NAAAICO8NAAAICPANAAAICPENAAAICPINAAAICPMNAAAICPQNAAAICPUNAAAICPYNAAAICPcNAAAICPgNAAAICPkNAAAICPoNAAAICPsNAAAICPwNAAAICP0NAAAICP4NAAAICP8NAAAICAAOAAAICAEOAAAICAIOAAAICAMOAAAICAQOAAAICAUOAAAICAYOAAAICAcOAAAICAgOAAAICAkOAAAICAoOAAAICAsOAAAICAwOAAAICA0OAAAICA4OAAAICA8OAAAICBAOAAAICBEOAAAICBIOAAAICBMOAAAICBQOAAAICBUOAAAICBYOAAAICBcOAAAICBgOAAAICBkOAAAICBoOAAAICBsOAAAICBwOAAAICB0OAAAICB4OAAAICB8OAAAICCAOAAAICCEOAAAICCIOAAAICCMOAAAICCQOAAAICCUOAAAICCYOAAAICCcOAAAICCgOAAAICCkOAAAICCoOAAAICCsOAAAICCwOAAAICC0OAAAICC4OAAAICC8OAAAICDAOAAAICDEOAAAICDIOAAAICDMOAAAICDQOAAAICDUOAAAICDYOAAAICDcOAAAICDgOAAAICDkOAAAICDoOAAAICDsOAAAICDwOAAAICD0OAAAICD4OAAAICD8OAAAICEAOAAAICEEOAAAICEIOAAAICEMOAAAICEQOAAAICEUOAAAICEYOAAAICEcOAAAICEgOAAAICEkOAAAICEoOAAAICEsOAAAICEwOAAAICE0OAAAICE4OAAAICE8OAAAICFAOAAAICFEOAAAICFIOAAAICFMOAAAICFQOAAAICFUOAAAICFYOAAAICFcOAAAICFgOAAAICFkOAAAICFoOAAAICFsOAAAICFwOAAAICF0OAAAICF4OAAAICF8OAAAICGAOAAAICGEOAAAICGIOAAAICGMOAAAICGQOAAAICGUOAAAICGYOAAAICGcOAAAICGgOAAAICGkOAAAICGoOAAAICGsOAAAICGwOAAAICG0OAAAICG4OAAAICG8OAAAICHAOAAAICHEOAAAICHIOAAAICHMOAAAICHQOAAAICHUOAAAICHYOAAAICHcOAAAICHgOAAAICHkOAAAICHoOAAAICHsOAAAICHwOAAAICH0OAAAICH4OAAAICH8OAAAICIAOAAAICIEOAAAICIIOAAAICIMOAAAICIQOAAAICIUOAAAICIYOAAAICIcOAAAICIgOAAAICIkOAAAICIoOAAAICIsOAAAICIwOAAAICI0OAAAICI4OAAAICI8OAAAICJAOAAAICJEOAAAICJIOAAAICJMOAAAICJQOAAAICJUOAAAICJYOAAAICJcOAAAICJgOAAAICJkOAAAICJoOAAAICJsOAAAICJwOAAAICJ0OAAAICJ4OAAAICJ8OAAAICKAOAAAICKEOAAAICKIOAAAICKMOAAAICKQOAAAICKUOAAAICKYOAAAICKcOAAAICKgOAAAICKkOAAAICKoOAAAICKsOAAAICKwOAAAICK0OAAAICK4OAAAICK8OAAAICLAOAAAICLEOAAAICLIOAAAICLMOAAAICLQOAAAICLUOAAAICLYOAAAICLcOAAAICLgOAAAICLkOAAAICLoOAAAICLsOAAAICLwOAAAICL0OAAAICL4OAAAICL8OAAAICMAOAAAICMEOAAAICMIOAAAICMMOAAAICMQOAAAICMUOAAAICMYOAAAICMcOAAAICMgOAAAICMkOAAAICMoOAAAICMsOAAAICMwOAAAICM0OAAAICM4OAAAICM8OAAAICNAOAAAICNEOAAAICNIOAAAICNMOAAAICNQOAAAICNUOAAAICNYOAAAICNcOAAAICNgOAAAICNkOAAAICNoOAAAICNsOAAAICNwOAAAICN0OAAAICN4OAAAICN8OAAAICOAOAAAICOEOAAAICOIOAAAICOMOAAAICOQOAAAICOUOAAAICOYOAAAICOcOAAAICOgOAAAICOkOAAAICOoOAAAICOsOAAAICOwOAAAICO0OAAAICO4OAAAICO8OAAAICPAOAAAICPEOAAAICPIOAAAICPMOAAAICPQOAAAICPUOAAAICPYOAAAICPcOAAAICPgOAAAICPkOAAAICPoOAAAICPsOAAAICPwOAAAICP0OAAAICP4OAAAICP8OAAAICAAPAAAICAEPAAAICAIPAAAICAMPAAAICAQPAAAICAUPAAAICAYPAAAICAcPAAAICAgPAAAICAkPAAAICAoPAAAICAsPAAAICAwPAAAICA0PAAAICA4PAAAICA8PAAAICBAPAAAICBEPAAAICBIPAAAICBMPAAAICBQPAAAICBUPAAAICBYPAAAICBcPAAAICBgPAAAICBkPAAAICBoPAAAICBsPAAAICBwPAAAICB0PAAAICB4PAAAICB8PAAAICCAPAAAICCEPAAAICCIPAAAICCMPAAAICCQPAAAICCUPAAAICCYPAAAICCcPAAAICCgPAAAICCkPAAAICCoPAAAICCsPAAAICCwPAAAICC0PAAAICC4PAAAICC8PAAAICDAPAAAICDEPAAAICDIPAAAICDMPAAAICDQPAAAICDUPAAAICDYPAAAICDcPAAAICDgPAAAICDkPAAAICDoPAAAICDsPAAAICDwPAAAICD0PAAAICD4PAAAICD8PAAAICEAPAAAICEEPAAAICEIPAAAICEMPAAAICEQPAAAICEUPAAAICEYPAAAICEcPAAAICEgPAAAICEkPAAAICEoPAAAICEsPAAAICEwPAAAICE0PAAAICE4PAAAICE8PAAAICFAPAAAICFEPAAAICFIPAAAICFMPAAAICFQPAAAICFUPAAAICFYPAAAICFcPAAAICFgPAAAICFkPAAAICFoPAAAICFsPAAAICFwPAAAICF0PAAAICF4PAAAICF8PAAAICGAPAAAICGEPAAAICGIPAAAICGMPAAAICGQPAAAICGUPAAAICGYPAAAICGcPAAAICGgPAAAICGkPAAAICGoPAAAICGsPAAAICGwPAAAICG0PAAAICG4PAAAICG8PAAAICHAPAAAICHEPAAAICHIPAAAICHMPAAAICHQPAAAICHUPAAAICHYPAAAICHcPAAAICHgPAAAICHkPAAAICHoPAAAICHsPAAAICHwPAAAICH0PAAAICH4PAAAICH8PAAAICIAPAAAICIEPAAAICIIPAAAICIMPAAAICIQPAAAICIUPAAAICIYPAAAICIcPAAAICIgPAAAICIkPAAAICIoPAAAICIsPAAAICIwPAAAICI0PAAAICI4PAAAICI8PAAAICJAPAAAICJEPAAAICJIPAAAICJMPAAAICJQPAAAICJUPAAAICJYPAAAICJcPAAAICJgPAAAICJkPAAAICJoPAAAICJsPAAAICJwPAAAICJ0PAAAICJ4PAAAICJ8PAAAICKAPAAAICKEPAAAICKIPAAAICKMPAAAICKQPAAAICKUPAAAICKYPAAAICKcPAAAICKgPAAAICKkPAAAICKoPAAAICKsPAAAICKwPAAAICK0PAAAICK4PAAAICK8PAAAICLAPAAAICLEPAAAICLIPAAAICLMPAAAICLQPAAAICLUPAAAICLYPAAAICLcPAAAICLgPAAAICLkPAAAICLoPAAAICLsPAAAICLwPAAAICL0PAAAICL4PAAAICL8PAAAICMAPAAAICMEPAAAICMIPAAAICMMPAAAICMQPAAAICMUPAAAICMYPAAAICMcPAAAICMgPAAAICMkPAAAICMoPAAAICMsPAAAICMwPAAAICM0PAAAICM4PAAAICM8PAAAICNAPAAAICNEPAAAICNIPAAAICNMPAAAICNQPAAAICNUPAAAICNYPAAAICNcPAAAICNgPAAAICNkPAAAICNoPAAAICNsPAAAICNwPAAAICN0PAAAICN4PAAAICN8PAAAICOAPAAAICOEPAAAICOIPAAAICOMPAAAICOQPAAAICOUPAAAICOYPAAAICOcPAAAICOgPAAAICOkPAAAICOoPAAAICOsPAAAICOwPAAAICO0PAAAICO4PAAAICO8PAAAICPAPAAAICPEPAAAICPIPAAAICPMPAAAICPQPAAAICPUPAAAICPYPAAAICPcPAAAICPgPAAAICPkPAAAICPoPAAAICPsPAAAICPwPAAAICP0PAAAICP4PAAAICP8PAAAICAAQAAAICAEQAAAICAIQAAAICAMQAAAICAQQAAAICAUQAAAICAYQAAAICAcQAAAICAgQAAAICAkQAAAICAoQAAAICAsQAAAICAwQAAAICA0QAAAICA4QAAAICA8QAAAICBAQAAAICBEQAAAICBIQAAAICBMQAAAICBQQAAAICBUQAAAICBYQAAAICBcQAAAICBgQAAAICBkQAAAICBoQAAAICBsQAAAICBwQAAAICB0QAAAICB4QAAAICB8QAAAICCAQAAAICCEQAAAICCIQAAAICCMQAAAICCQQAAAICCUQAAAICCYQAAAICCcQAAAICCgQAAAICCkQAAAICCoQAAAICCsQAAAICCwQAAAICC0QAAAICC4QAAAICC8QAAAICDAQAAAICDEQAAAICDIQAAAICDMQAAAICDQQAAAICDUQAAAICDYQAAAICDcQAAAICDgQAAAICDkQAAAICDoQAAAICDsQAAAICDwQAAAICD0QAAAICD4QAAAICD8QAAAICEAQAAAICEEQAAAICEIQAAAICEMQAAAICEQQAAAICEUQAAAICEYQAAAICEcQAAAICEgQAAAICEkQAAAICEoQAAAICEsQAAAICEwQAAAICE0QAAAICE4QAAAICE8QAAAICFAQAAAICFEQAAAICFIQAAAICFMQAAAICFQQAAAICFUQAAAICFYQAAAICFcQAAAICFgQAAAICFkQAAAICFoQAAAICFsQAAAICFwQAAAICF0QAAAICF4QAAAICF8QAAAICGAQAAAICGEQAAAICGIQAAAICGMQAAAICGQQAAAICGUQAAAICGYQAAAICGcQAAAICGgQAAAICGkQAAAICGoQAAAICGsQAAAICGwQAAAICG0QAAAICG4QAAAICG8QAAAICHAQAAAICHEQAAAICHIQAAAICHMQAAAICHQQAAAICHUQAAAICHYQAAAICHcQAAAICHgQAAAICHkQAAAICHoQAAAICHsQAAAICHwQAAAICH0QAAAICH4QAAAICH8QAAAICIAQAAAICIEQAAAICIIQAAAICIMQAAAICIQQAAAICIUQAAAICIYQAAAICIcQAAAICIgQAAAICIkQAAAICIoQAAAICIsQAAAICIwQAAAICI0QAAAICI4QAAAICI8QAAAICJAQAAAICJEQAAAICJIQAAAICJMQAAAICJQQAAAICJUQAAAICJYQAAAICJcQAAAICJgQAAAICJkQAAAICJoQAAAICJsQAAAICJwQAAAICJ0QAAAICJ4QAAAICJ8QAAAICKAQAAAICKEQAAAICKIQAAAICKMQAAAICKQQAAAICKUQAAAICKYQAAAICKcQAAAICKgQAAAICKkQAAAICKoQAAAICKsQAAAICKwQAAAICK0QAAAICK4QAAAICK8QAAAICLAQAAAICLEQAAAICLIQAAAICLMQAAAICLQQAAAICLUQAAAICLYQAAAICLcQAAAICLgQAAAICLkQAAAICLoQAAAICLsQAAAICLwQAAAICL0QAAAICL4QAAAICL8QAAAICMAQAAAICMEQAAAICMIQAAAICMMQAAAICMQQAAAICMUQAAAICMYQAAAICMcQAAAICMgQAAAICMkQAAAICMoQAAAICMsQAAAICMwQAAAICM0QAAAICM4QAAAICM8QAAAICNAQAAAICNEQAAAICNIQAAAICNMQAAAICNQQAAAICNUQAAAICNYQAAAICNcQAAAICNgQAAAICNkQAAAICNoQAAAICNsQAAAICNwQAAAICN0QAAAICN4QAAAICN8QAAAICOAQAAAICOEQAAAICOIQAAAICOMQAAAICOQQAAAICOUQAAAICOYQAAAICOcQAAAICOgQAAAICOkQAAAICOoQAAAICOsQAAAICOwQAAAICO0QAAAICO4QAAAICO8QAAAICPAQAAAICPEQAAAICPIQAAAICPMQAAAICPQQAAAICPUQAAAICPYQAAAICPcQAAAICPgQAAAICPkQAAAICPoQAAAICPsQAAAICPwQAAAICP0QAAAICP4QAAAICP8QAAAICAARAAAICAERAAAICAIRAAAICAMRAAAICAQRAAAICAURAAAICAYRAAAICAcRAAAICAgRAAAICAkRAAAICAoRAAAICAsRAAAICAwRAAAICA0RAAAICA4RAAAICA8RAAAICBARAAAICBERAAAICBIRAAAICBMRAAAICBQRAAAICBURAAAICBYRAAAICBcRAAAICBgRAAAICBkRAAAICBoRAAAICBsRAAAICBwRAAAICB0RAAAICB4RAAAICB8RAAAICCARAAAICCERAAAICCIRAAAICCMRAAAICCQRAAAICCURAAAICCYRAAAICCcRAAAICCgRAAAICCkRAAAICCoRAAAICCsRAAAICCwRAAAICC0RAAAICC4RAAAICC8RAAAICDARAAAICDERAAAICDIRAAAICDMRAAAICDQRAAAICDURAAAICDYRAAAICDcRAAAICDgRAAAICDkRAAAICDoRAAAICDsRAAAICDwRAAAICD0RAAAICD4RAAAICD8RAAAICEARAAAICEERAAAICEIRAAAICEMRAAAICEQRAAAICEURAAAICEYRAAAICEcRAAAICEgRAAAICEkRAAAICEoRAAAICEsRAAAICEwRAAAICE0RAAAICE4RAAAICE8RAAAICFARAAAICFERAAAICFIRAAAICFMRAAAICFQRAAAICFURAAAICFYRAAAICFcRAAAICFgRAAAICFkRAAAICFoRAAAICFsRAAAICFwRAAAICF0RAAAICF4RAAAICF8RAAAICGARAAAICGERAAAICGIRAAAICGMRAAAICGQRAAAICGURAAAICGYRAAAICGcRAAAICGgRAAAICGkRAAAICGoRAAAICGsRAAAICGwRAAAICG0RAAAICG4RAAAICG8RAAAICHARAAAICHERAAAICHIRAAAICHMRAAAICHQRAAAICHURAAAICHYRAAAICHcRAAAICHgRAAAICHkRAAAICHoRAAAICHsRAAAICHwRAAAICH0RAAAICH4RAAAICH8RAAAICIARAAAICIERAAAICIIRAAAICIMRAAAICIQRAAAICIURAAAICIYRAAAICIcRAAAICIgRAAAICIkRAAAICIoRAAAICIsRAAAICIwRAAAICI0RAAAICI4RAAAICI8RAAAICJARAAAICJERAAAICJIRAAAICJMRAAAICJQRAAAICJURAAAICJYRAAAICJcRAAAICJgRAAAICJkRAAAICJoRAAAICJsRAAAICJwRAAAICJ0RAAAICJ4RAAAICJ8RAAAICKARAAAICKERAAAICKIRAAAICKMRAAAICKQRAAAICKURAAAICKYRAAAICKcRAAAICKgRAAAICKkRAAAICKoRAAAICKsRAAAICKwRAAAICK0RAAAICK4RAAAICK8RAAAICLARAAAICLERAAAICLIRAAAICLMRAAAICLQRAAAICLURAAAICLYRAAAICLcRAAAICLgRAAAICLkRAAAICLoRAAAICLsRAAAICLwRAAAICL0RAAAICL4RAAAICL8RAAAICMARAAAICMERAAAICMIRAAAICMMRAAAICMQRAAAICMURAAAICMYRAAAICMcRAAAICMgRAAAICMkRAAAICMoRAAAICMsRAAAICMwRAAAICM0RAAAICM4RAAAICM8RAAAICNARAAAICNERAAAICNIRAAAICNMRAAAICNQRAAAICNURAAAICNYRAAAICNcRAAAICNgRAAAICNkRAAAICNoRAAAICNsRAAAICNwRAAAICN0RAAAICN4RAAAICN8RAAAICOARAAAICOERAAAICOIRAAAICOMRAAAICOQRAAAICOURAAAICOYRAAAICOcRAAAICOgRAAAICOkRAAAICOoRAAAICOsRAAAICOwRAAAICO0RAAAICO4RAAAICO8RAAAICPARAAAICPERAAAICPIRAAAICPMRAAAICPQRAAAICPURAAAICPYRAAAICPcRAAAICPgRAAAICPkRAAAICPoRAAAICPsRAAAICPwRAAAICP0RAAAICP4RAAAICP8RAAAICAASAAAICAESAAAICAISAAAICAMSAAAICAQSAAAICAUSAAAICAYSAAAICAcSAAAICAgSAAAICAkSAAAICAoSAAAICAsSAAAICAwSAAAICA0SAAAICA4SAAAICA8SAAAICBASAAAICBESAAAICBISAAAICBMSAAAICBQSAAAICBUSAAAICBYSAAAICBcSAAAICBgSAAAICBkSAAAICBoSAAAICBsSAAAICBwSAAAICB0SAAAICB4SAAAICB8SAAAICCASAAAICCESAAAICCISAAAICCMSAAAICCQSAAAICCUSAAAICCYSAAAICCcSAAAICCgSAAAICCkSAAAICCoSAAAICCsSAAAICCwSAAAICC0SAAAICC4SAAAICC8SAAAICDASAAAICDESAAAICDISAAAICDMSAAAICDQSAAAICDUSAAAICDYSAAAICDcSAAAICDgSAAAICDkSAAAICDoSAAAICDsSAAAICDwSAAAICD0SAAAICD4SAAAICD8SAAAICEASAAAICEESAAAICEISAAAICEMSAAAICEQSAAAICEUSAAAICEYSAAAICEcSAAAICEgSAAAICEkSAAAICEoSAAAICEsSAAAICEwSAAAICE0SAAAICE4SAAAICE8SAAAICFASAAAICFESAAAICFISAAAICFMSAAAICFQSAAAICFUSAAAICFYSAAAICFcSAAAICFgSAAAICFkSAAAICFoSAAAICFsSAAAICFwSAAAICF0SAAAICF4SAAAICF8SAAAICGASAAAICGESAAAICGISAAAICGMSAAAICGQSAAAICGUSAAAICGYSAAAICGcSAAAICGgSAAAICGkSAAAICGoSAAAICGsSAAAICGwSAAAICG0SAAAICG4SAAAICG8SAAAICHASAAAICHESAAAICHISAAAICHMSAAAICHQSAAAICHUSAAAICHYSAAAICHcSAAAICHgSAAAICHkSAAAICHoSAAAICHsSAAAICHwSAAAICH0SAAAICH4SAAAICH8SAAAICIASAAAICIESAAAICIISAAAICIMSAAAICIQSAAAICIUSAAAICIYSAAAICIcSAAAICIgSAAAICIkSAAAICIoSAAAICIsSAAAICIwSAAAICI0SAAAICI4SAAAICI8SAAAICJASAAAICJESAAAICJISAAAICJMSAAAICJQSAAAICJUSAAAICJYSAAAICJcSAAAICJgSAAAICJkSAAAICJoSAAAICJsSAAAICJwSAAAICJ0SAAAICJ4SAAAICJ8SAAAICKASAAAICKESAAAICKISAAAICKMSAAAICKQSAAAICKUSAAAICKYSAAAICKcSAAAICKgSAAAICKkSAAAICKoSAAAICKsSAAAICKwSAAAICK0SAAAICK4SAAAICK8SAAAICLASAAAICLESAAAICLISAAAICLMSAAAICLQSAAAICLUSAAAICLYSAAAICLcSAAAICLgSAAAICLkSAAAICLoSAAAICLsSAAAICLwSAAAICL0SAAAICL4SAAAICL8SAAAICMASAAAICMESAAAICMISAAAICMMSAAAICMQSAAAICMUSAAAICMYSAAAICMcSAAAICMgSAAAICMkSAAAICMoSAAAICMsSAAAICMwSAAAICM0SAAAICM4SAAAICM8SAAAICNASAAAICNESAAAICNISAAAICNMSAAAICNQSAAAICNUSAAAICNYSAAAICNcSAAAICNgSAAAICNkSAAAICNoSAAAICNsSAAAICNwSAAAICN0SAAAICN4SAAAICN8SAAAICOASAAAICOESAAAICOISAAAICOMSAAAICOQSAAAICOUSAAAICOYSAAAICOcSAAAICOgSAAAICOkSAAAICOoSAAAICOsSAAAICOwSAAAICO0SAAAICO4SAAAICO8SAAAICPASAAAICPESAAAICPISAAAICPMSAAAICPQSAAAICPUSAAAICPYSAAAICPcSAAAICPgSAAAICPkSAAAICPoSAAAICPsSAAAICPwSAAAICP0SAAAICP4SAAAICP8SAAAICAATAAAICAETAAAICAITAAAICAMTAAAICAQTAAAICAUTAAAICAYTAAAICAcTAAAICAgTAAAICAkTAAAICAoTAAAICAsTAAAICAwTAAAICA0TAAAICA4TAAAICA8TAAAICBATAAAICBETAAAICBITAAAICBMTAAAICBQTAAAICBUTAAAICBYTAAAICBcTAAAICBgTAAAICBkTAAAICBoTAAAICBsTAAAICBwTAAAICB0TAAAICB4TAAAICB8TAAAICCATAAAICCETAAAICCITAAAICCMTAAAICCQTAAAICCUTAAAICCYTAAAICCcTAAAICCgTAAAICCkTAAAICCoTAAAICCsTAAAICCwTAAAICC0TAAAICC4TAAAICC8TAAAICDATAAAICDETAAAICDITAAAICDMTAAAICDQTAAAICDUTAAAICDYTAAAICDcTAAAICDgTAAAICDkTAAAICDoTAAAICDsTAAAICDwTAAAICD0TAAAICD4TAAAICD8TAAAICEATAAAICEETAAAICEITAAAICEMTAAAICEQTAAAICEUTAAAICEYTAAAICEcTAAAICEgTAAAICEkTAAAICEoTAAAICEsTAAAICEwTAAAICE0TAAAICE4TAAAICE8TAAAICFATAAAICFETAAAICFITAAAICFMTAAAICFQTAAAICFUTAAAICFYTAAAICFcTAAAICFgTAAAICFkTAAAICFoTAAAICFsTAAAICFwTAAAICF0TAAAICF4TAAAICF8TAAAICGATAAAICGETAAAICGITAAAICGMTAAAICGQTAAAICGUTAAAICGYTAAAICGcTAAAICGgTAAAICGkTAAAICGoTAAAICGsTAAAICGwTAAAICG0TAAAICG4TAAAICG8TAAAICHATAAAICHETAAAICHITAAAICHMTAAAICHQTAAAICHUTAAAICHYTAAAICHcTAAAICHgTAAAICHkTAAAICHoTAAAICHsTAAAICHwTAAAICH0TAAAICH4TAAAICH8TAAAICIATAAAICIETAAAICIITAAAICIMTAAAICIQTAAAICIUTAAAICIYTAAAICIcTAAAICIgTAAAICIkTAAAICIoTAAAICIsTAAAICIwTAAAICI0TAAAICI4TAAAICI8TAAAICJATAAAICJETAAAICJITAAAICJMTAAAICJQTAAAICJUTAAAICJYTAAAICJcTAAAICJgTAAAICJkTAAAICJoTAAAICJsTAAAICJwTAAAICJ0TAAAICJ4TAAAICJ8TAAAICKATAAAICKETAAAICKITAAAICKMTAAAICKQTAAAICKUTAAAICKYTAAAICKcTAAAICKgTAAAICKkTAAAICKoTAAAICKsTAAAICKwTAAAICK0TAAAICK4TAAAICK8TAAAICLATAAAICLETAAAICLITAAAICLMTAAAICLQTAAAICLUTAAAICLYTAAAICLcTAAAICLgTAAAICLkTAAAICLoTAAAICLsTAAAICLwTAAAICL0TAAAICL4TAAAICL8TAAAICMATAAAICMETAAAICMITAAAICMMTAAAICMQTAAAICMUTAAAICMYTAAAICMcTAAAICMgTAAAICMkTAAAICMoTAAAICMsTAAAICMwTAAAICM0TAAAICM4TAAAICM8TAAAICNATAAAICNETAAAICNITAAAICNMTAAAICNQTAAAICNUTAAAICNYTAAAICNcTAAAICNgTAAAICNkTAAAICNoTAAAICNsTAAAICNwTAAAICN0TAAAICN4TAAAICN8TAAAICOATAAAICOETAAAICOITAAAICOMTAAAICOQTAAAICOUTAAAICOYTAAAICOcTAAAICOgTAAAICOkTAAAICOoTAAAICOsTAAAICOwTAAAICO0TAAAICO4TAAAICO8TAAAICPATAAAICPETAAAICPITAAAICPMTAAAICPQTAAAICPUTAAAICPYTAAAICPcTAAAICPgTAAAICPkTAAAICPoTAAAICPsTAAAICPwTAAAICP0TAAAICP4TAAAICP8TAAAICAAUAAAICAEUAAAICAIUAAAICAMUAAAICAQUAAAICAUUAAAICAYUAAAICAcUAAAICAgUAAAICAkUAAAICAoUAAAICAsUAAAICAwUAAAICA0UAAAICA4UAAAICA8UAAAICBAUAAAICBEUAAAICBIUAAAICBMUAAAICBQUAAAICBUUAAAICBYUAAAICBcUAAAICBgUAAAICBkUAAAICBoUAAAICBsUAAAICBwUAAAICB0UAAAICB4UAAAICB8UAAAICCAUAAAICCEUAAAICCIUAAAICCMUAAAICCQUAAAICCUUAAAICCYUAAAICCcUAAAICCgUAAAICCkUAAAICCoUAAAICCsUAAAICCwUAAAICC0UAAAICC4UAAAICC8UAAAICDAUAAAICDEUAAAICDIUAAAICDMUAAAICDQUAAAICDUUAAAICDYUAAAICDcUAAAICDgUAAAICDkUAAAICDoUAAAICDsUAAAICDwUAAAICD0UAAAICD4UAAAICD8UAAAICEAUAAAICEEUAAAICEIUAAAICEMUAAAICEQUAAAICEUUAAAICEYUAAAICEcUAAAICEgUAAAICEkUAAAICEoUAAAICEsUAAAICEwUAAAICE0UAAAICE4UAAAICE8UAAAICFAUAAAICFEUAAAICFIUAAAICFMUAAAICFQUAAAICFUUAAAICFYUAAAICFcUAAAICFgUAAAICFkUAAAICFoUAAAICFsUAAAICFwUAAAICF0UAAAICF4UAAAICF8UAAAICGAUAAAICGEUAAAICGIUAAAICGMUAAAICGQUAAAICGUUAAAICGYUAAAICGcUAAAICGgUAAAICGkUAAAICGoUAAAICGsUAAAICGwUAAAICG0UAAAICG4UAAAICG8UAAAICHAUAAAICHEUAAAICHIUAAAICHMUAAAICHQUAAAICHUUAAAICHYUAAAICHcUAAAICHgUAAAICHkUAAAICHoUAAAICHsUAAAICHwUAAAICH0UAAAICH4UAAAICH8UAAAICIAUAAAICIEUAAAICIIUAAAICIMUAAAICIQUAAAICIUUAAAICIYUAAAICIcUAAAICIgUAAAICIkUAAAICIoUAAAICIsUAAAICIwUAAAICI0UAAAICI4UAAAICI8UAAAICJAUAAAICJEUAAAICJIUAAAICJMUAAAICJQUAAAICJUUAAAICJYUAAAICJcUAAAICJgUAAAICJkUAAAICJoUAAAICJsUAAAICJwUAAAICJ0UAAAICJ4UAAAICJ8UAAAICKAUAAAICKEUAAAICKIUAAAICKMUAAAICKQUAAAICKUUAAAICKYUAAAICKcUAAAICKgUAAAICKkUAAAICKoUAAAICKsUAAAICKwUAAAICK0UAAAICK4UAAAICK8UAAAICLAUAAAICLEUAAAICLIUAAAICLMUAAAICLQUAAAICLUUAAAICLYUAAAICLcUAAAICLgUAAAICLkUAAAICLoUAAAICLsUAAAICLwUAAAICL0UAAAICL4UAAAICL8UAAAICMAUAAAICMEUAAAICMIUAAAICMMUAAAICMQUAAAICMUUAAAICMYUAAAICMcUAAAICMgUAAAICMkUAAAICMoUAAAICMsUAAAICMwUAAAICM0UAAAICM4UAAAICM8UAAAICNAUAAAICNEUAAAICNIUAAAICNMUAAAICNQUAAAICNUUAAAICNYUAAAICNcUAAAICNgUAAAICNkUAAAICNoUAAAICNsUAAAICNwUAAAICN0UAAAICN4UAAAICN8UAAAICOAUAAAICOEUAAAICOIUAAAICOMUAAAICOQUAAAICOUUAAAICOYUAAAICOcUAAAICOgUAAAICOkUAAAICOoUAAAICOsUAAAICOwUAAAICO0UAAAICO4UAAAICO8UAAAICPAUAAAICPEUAAAICPIUAAAICPMUAAAICPQUAAAICPUUAAAICPYUAAAICPcUAAAICPgUAAAICPkUAAAICPoUAAAICPsUAAAICPwUAAAICP0UAAAICP4UAAAICP8UAAAICAAVAAAICAEVAAAICAIVAAAICAMVAAAICAQVAAAICAUVAAAICAYVAAAICAcVAAAICAgVAAAICAkVAAAICAoVAAAICAsVAAAICAwVAAAICA0VAAAICA4VAAAICA8VAAAICBAVAAAICBEVAAAICBIVAAAICBMVAAAICBQVAAAICBUVAAAICBYVAAAICBcVAAAICBgVAAAICBkVAAAICBoVAAAICBsVAAAICBwVAAAICB0VAAAICB4VAAAICB8VAAAICCAVAAAICCEVAAAICCIVAAAICCMVAAAICCQVAAAICCUVAAAICCYVAAAICCcVAAAICCgVAAAICCkVAAAICCoVAAAICCsVAAAICCwVAAAICC0VAAAICC4VAAAICC8VAAAICDAVAAAICDEVAAAICDIVAAAICDMVAAAICDQVAAAICDUVAAAICDYVAAAICDcVAAAICDgVAAAICDkVAAAICDoVAAAICDsVAAAICDwVAAAICD0VAAAICD4VAAAICD8VAAAICEAVAAAICEEVAAAICEIVAAAICEMVAAAICEQVAAAICEUVAAAICEYVAAAICEcVAAAICEgVAAAICEkVAAAICEoVAAAICEsVAAAICEwVAAAICE0VAAAICE4VAAAICE8VAAAICFAVAAAICFEVAAAICFIVAAAICFMVAAAICFQVAAAICFUVAAAICFYVAAAICFcVAAAICFgVAAAICFkVAAAICFoVAAAICFsVAAAICFwVAAAICF0VAAAICF4VAAAICF8VAAAICGAVAAAICGEVAAAICGIVAAAICGMVAAAICGQVAAAICGUVAAAICGYVAAAICGcVAAAICGgVAAAICGkVAAAICGoVAAAICGsVAAAICGwVAAAICG0VAAAICG4VAAAICG8VAAAICHAVAAAICHEVAAAICHIVAAAICHMVAAAICHQVAAAICHUVAAAICHYVAAAICHcVAAAICHgVAAAICHkVAAAICHoVAAAICHsVAAAICHwVAAAICH0VAAAICH4VAAAICH8VAAAICIAVAAAICIEVAAAICIIVAAAICIMVAAAICIQVAAAICIUVAAAICIYVAAAICIcVAAAICIgVAAAICIkVAAAICIoVAAAICIsVAAAICIwVAAAICI0VAAAICI4VAAAICI8VAAAICJAVAAAICJEVAAAICJIVAAAICJMVAAAICJQVAAAICJUVAAAICJYVAAAICJcVAAAICJgVAAAICJkVAAAICJoVAAAICJsVAAAICJwVAAAICJ0VAAAICJ4VAAAICJ8VAAAICKAVAAAICKEVAAAICKIVAAAICKMVAAAICKQVAAAICKUVAAAICKYVAAAICKcVAAAICKgVAAAICKkVAAAICKoVAAAICKsVAAAICKwVAAAICK0VAAAICK4VAAAICK8VAAAICLAVAAAICLEVAAAICLIVAAAICLMVAAAICLQVAAAICLUVAAAICLYVAAAICLcVAAAICLgVAAAICLkVAAAICLoVAAAICLsVAAAICLwVAAAICL0VAAAICL4VAAAICL8VAAAICMAVAAAICMEVAAAICMIVAAAICMMVAAAICMQVAAAICMUVAAAICMYVAAAICMcVAAAICMgVAAAICMkVAAAICMoVAAAICMsVAAAICMwVAAAICM0VAAAICM4VAAAICM8VAAAICNAVAAAICNEVAAAICNIVAAAICNMVAAAICNQVAAAICNUVAAAICNYVAAAICNcVAAAICNgVAAAICNkVAAAICNoVAAAICNsVAAAICNwVAAAICN0VAAAICN4VAAAICN8VAAAICOAVAAAICOEVAAAICOIVAAAICOMVAAAICOQVAAAICOUVAAAICOYVAAAICOcVAAAICOgVAAAICOkVAAAICOoVAAAICOsVAAAICOwVAAAICO0VAAAICO4VAAAICO8VAAAICPAVAAAICPEVAAAICPIVAAAICPMVAAAICPQVAAAICPUVAAAICPYVAAAICPcVAAAICPgVAAAICPkVAAAICPoVAAAICPsVAAAICPwVAAAICP0VAAAICP4VAAAICP8VAAAICAAWAAAICAEWAAAICAIWAAAICAMWAAAICAQWAAAICAUWAAAICAYWAAAICAcWAAAICAgWAAAICAkWAAAICAoWAAAICAsWAAAICAwWAAAICA0WAAAICA4WAAAICA8WAAAICBAWAAAICBEWAAAICBIWAAAICBMWAAAICBQWAAAICBUWAAAICBYWAAAICBcWAAAICBgWAAAICBkWAAAICBoWAAAICBsWAAAICBwWAAAICB0WAAAICB4WAAAICB8WAAAICCAWAAAICCEWAAAICCIWAAAICCMWAAAICCQWAAAICCUWAAAICCYWAAAICCcWAAAICCgWAAAICCkWAAAICCoWAAAICCsWAAAICCwWAAAICC0WAAAICC4WAAAICC8WAAAICDAWAAAICDEWAAAICDIWAAAICDMWAAAICDQWAAAICDUWAAAICDYWAAAICDcWAAAICDgWAAAICDkWAAAICDoWAAAICDsWAAAICDwWAAAICD0WAAAICD4WAAAICD8WAAAICEAWAAAICEEWAAAICEIWAAAICEMWAAAICEQWAAAICEUWAAAICEYWAAAICEcWAAAICEgWAAAICEkWAAAICEoWAAAICEsWAAAICEwWAAAICE0WAAAICE4WAAAICE8WAAAICFAWAAAICFEWAAAICFIWAAAICFMWAAAICFQWAAAICFUWAAAICFYWAAAICFcWAAAICFgWAAAICFkWAAAICFoWAAAICFsWAAAICFwWAAAICF0WAAAICF4WAAAICF8WAAAICGAWAAAICGEWAAAICGIWAAAICGMWAAAICGQWAAAICGUWAAAICGYWAAAICGcWAAAICGgWAAAICGkWAAAICGoWAAAICGsWAAAICGwWAAAICG0WAAAICG4WAAAICG8WAAAICHAWAAAICHEWAAAICHIWAAAICHMWAAAICHQWAAAICHUWAAAICHYWAAAICHcWAAAICHgWAAAICHkWAAAICHoWAAAICHsWAAAICHwWAAAICH0WAAAICH4WAAAICH8WAAAICIAWAAAICIEWAAAICIIWAAAICIMWAAAICIQWAAAICIUWAAAICIYWAAAICIcWAAAICIgWAAAICIkWAAAICIoWAAAICIsWAAAICIwWAAAICI0WAAAICI4WAAAICI8WAAAICJAWAAAICJEWAAAICJIWAAAICJMWAAAICJQWAAAICJUWAAAICJYWAAAICJcWAAAICJgWAAAICJkWAAAICJoWAAAICJsWAAAICJwWAAAICJ0WAAAICJ4WAAAICJ8WAAAICKAWAAAICKEWAAAICKIWAAAICKMWAAAICKQWAAAICKUWAAAICKYWAAAICKcWAAAICKgWAAAICKkWAAAICKoWAAAICKsWAAAICKwWAAAICK0WAAAICK4WAAAICK8WAAAICLAWAAAICLEWAAAICLIWAAAICLMWAAAICLQWAAAICLUWAAAICLYWAAAICLcWAAAICLgWAAAICLkWAAAICLoWAAAICLsWAAAICLwWAAAICL0WAAAICL4WAAAICL8WAAAICMAWAAAICMEWAAAICMIWAAAICMMWAAAICMQWAAAICMUWAAAICMYWAAAICMcWAAAICMgWAAAICMkWAAAICMoWAAAICMsWAAAICMwWAAAICM0WAAAICM4WAAAICM8WAAAICNAWAAAICNEWAAAICNIWAAAICNMWAAAICNQWAAAICNUWAAAICNYWAAAICNcWAAAICNgWAAAICNkWAAAICNoWAAAICNsWAAAICNwWAAAICN0WAAAICN4WAAAICN8WAAAICOAWAAAICOEWAAAICOIWAAAICOMWAAAICOQWAAAICOUWAAAICOYWAAAICOcWAAAICOgWAAAICOkWAAAICOoWAAAICOsWAAAICOwWAAAICO0WAAAICO4WAAAICO8WAAAICPAWAAAICPEWAAAICPIWAAAICPMWAAAICPQWAAAICPUWAAAICPYWAAAICPcWAAAICPgWAAAICPkWAAAICPoWAAAICPsWAAAICPwWAAAICP0WAAAICP4WAAAICP8WAAAICAAXAAAICAEXAAAICAIXAAAICAMXAAAICAQXAAAICAUXAAAICAYXAAAICAcXAAAICAgXAAAICAkXAAAICAoXAAAICAsXAAAICAwXAAAICA0XAAAICA4XAAAICA8XAAAICBAXAAAICBEXAAAICBIXAAAICBMXAAAICBQXAAAICBUXAAAICBYXAAAICBcXAAAICBgXAAAICBkXAAAICBoXAAAICBsXAAAICBwXAAAICB0XAAAICB4XAAAICB8XAAAICCAXAAAICCEXAAAICCIXAAAICCMXAAAICCQXAAAICCUXAAAICCYXAAAICCcXAAAICCgXAAAICCkXAAAICCoXAAAICCsXAAAICCwXAAAICC0XAAAICC4XAAAICC8XAAAICDAXAAAICDEXAAAICDIXAAAICDMXAAAICDQXAAAICDUXAAAICDYXAAAICDcXAAAICDgXAAAICDkXAAAICDoXAAAICDsXAAAICDwXAAAICD0XAAAICD4XAAAICD8XAAAICEAXAAAICEEXAAAICEIXAAAICEMXAAAICEQXAAAICEUXAAAICEYXAAAICEcXAAAICEgXAAAICEkXAAAICEoXAAAICEsXAAAICEwXAAAICE0XAAAICE4XAAAICE8XAAAICFAXAAAICFEXAAAICFIXAAAICFMXAAAICFQXAAAICFUXAAAICFYXAAAICFcXAAAICFgXAAAICFkXAAAICFoXAAAICFsXAAAICFwXAAAICF0XAAAICF4XAAAICF8XAAAICGAXAAAICGEXAAAICGIXAAAICGMXAAAICGQXAAAICGUXAAAICGYXAAAICGcXAAAICGgXAAAICGkXAAAICGoXAAAICGsXAAAICGwXAAAICG0XAAAICG4XAAAICG8XAAAICHAXAAAICHEXAAAICHIXAAAICHMXAAAICHQXAAAICHUXAAAICHYXAAAICHcXAAAICHgXAAAICHkXAAAICHoXAAAICHsXAAAICHwXAAAICH0XAAAICH4XAAAICH8XAAAICIAXAAAICIEXAAAICIIXAAAICIMXAAAICIQXAAAICIUXAAAICIYXAAAICIcXAAAICIgXAAAICIkXAAAICIoXAAAICIsXAAAICIwXAAAICI0XAAAICI4XAAAICI8XAAAICJAXAAAICJEXAAAICJIXAAAICJMXAAAICJQXAAAICJUXAAAICJYXAAAICJcXAAAICJgXAAAICJkXAAAICJoXAAAICJsXAAAICJwXAAAICJ0XAAAICJ4XAAAICJ8XAAAICKAXAAAICKEXAAAICKIXAAAICKMXAAAICKQXAAAICKUXAAAICKYXAAAICKcXAAAICKgXAAAICKkXAAAICKoXAAAICKsXAAAICKwXAAAICK0XAAAICK4XAAAICK8XAAAICLAXAAAICLEXAAAICLIXAAAICLMXAAAICLQXAAAICLUXAAAICLYXAAAICLcXAAAICLgXAAAICLkXAAAICLoXAAAICLsXAAAICLwXAAAICL0XAAAICL4XAAAICL8XAAAICMAXAAAICMEXAAAICMIXAAAICMMXAAAICMQXAAAICMUXAAAICMYXAAAICMcXAAAICMgXAAAICMkXAAAICMoXAAAICMsXAAAICMwXAAAICM0XAAAICM4XAAAICM8XAAAICNAXAAAICNEXAAAICNIXAAAICNMXAAAICNQXAAAICNUXAAAICNYXAAAICNcXAAAICNgXAAAICNkXAAAICNoXAAAICNsXAAAICNwXAAAICN0XAAAICN4XAAAICN8XAAAICOAXAAAICOEXAAAICOIXAAAICOMXAAAICOQXAAAICOUXAAAICOYXAAAICOcXAAAICOgXAAAICOkXAAAICOoXAAAICOsXAAAICOwXAAAICO0XAAAICO4XAAAICO8XAAAICPAXAAAICPEXAAAICPIXAAAICPMXAAAICPQXAAAICPUXAAAICPYXAAAICPcXAAAICPgXAAAICPkXAAAICPoXAAAICPsXAAAICPwXAAAICP0XAAAICP4XAAAICP8XAAAICAAYAAAICAEYAAAICAIYAAAICAMYAAAICAQYAAAICAUYAAAICAYYAAAICAcYAAAICAgYAAAICAkYAAAICAoYAAAICAsYAAAICAwYAAAICA0YAAAICA4YAAAICA8YAAAICBAYAAAICBEYAAAICBIYAAAICBMYAAAICBQYAAAICBUYAAAICBYYAAAICBcYAAAICBgYAAAICBkYAAAICBoYAAAICBsYAAAICBwYAAAICB0YAAAICB4YAAAICB8YAAAICCAYAAAICCEYAAAICCIYAAAICCMYAAAICCQYAAAICCUYAAAICCYYAAAICCcYAAAICCgYAAAICCkYAAAICCoYAAAICCsYAAAICCwYAAAICC0YAAAICC4YAAAICC8YAAAICDAYAAAICDEYAAAICDIYAAAICDMYAAAICDQYAAAICDUYAAAICDYYAAAICDcYAAAICDgYAAAICDkYAAAICDoYAAAICDsYAAAICDwYAAAICD0YAAAICD4YAAAICD8YAAAICEAYAAAICEEYAAAICEIYAAAICEMYAAAICEQYAAAICEUYAAAICEYYAAAICEcYAAAICEgYAAAICEkYAAAICEoYAAAICEsYAAAICEwYAAAICE0YAAAICE4YAAAICE8YAAAICFAYAAAICFEYAAAICFIYAAAICFMYAAAICFQYAAAICFUYAAAICFYYAAAICFcYAAAICFgYAAAICFkYAAAICFoYAAAICFsYAAAICFwYAAAICF0YAAAICF4YAAAICF8YAAAICGAYAAAICGEYAAAICGIYAAAICGMYAAAICGQYAAAICGUYAAAICGYYAAAICGcYAAAICGgYAAAICGkYAAAICGoYAAAICGsYAAAICGwYAAAICG0YAAAICG4YAAAICG8YAAAICHAYAAAICHEYAAAICHIYAAAICHMYAAAICHQYAAAICHUYAAAICHYYAAAICHcYAAAICHgYAAAICHkYAAAICHoYAAAICHsYAAAICHwYAAAICH0YAAAICH4YAAAICH8YAAAICIAYAAAICIEYAAAICIIYAAAICIMYAAAICIQYAAAICIUYAAAICIYYAAAICIcYAAAICIgYAAAICIkYAAAICIoYAAAICIsYAAAICIwYAAAICI0YAAAICI4YAAAICI8YAAAICJAYAAAICJEYAAAICJIYAAAICJMYAAAICJQYAAAICJUYAAAICJYYAAAICJcYAAAICJgYAAAICJkYAAAICJoYAAAICJsYAAAICJwYAAAICJ0YAAAICJ4YAAAICJ8YAAAICKAYAAAICKEYAAAICKIYAAAICKMYAAAICKQYAAAICKUYAAAICKYYAAAICKcYAAAICKgYAAAICKkYAAAICKoYAAAICKsYAAAICKwYAAAICK0YAAAICK4YAAAICK8YAAAICLAYAAAICLEYAAAICLIYAAAICLMYAAAICLQYAAAICLUYAAAICLYYAAAICLcYAAAICLgYAAAICLkYAAAICLoYAAAICLsYAAAICLwYAAAICL0YAAAICL4YAAAICL8YAAAICMAYAAAICMEYAAAICMIYAAAICMMYAAAICMQYAAAICMUYAAAICMYYAAAICMcYAAAICMgYAAAICMkYAAAICMoYAAAICMsYAAAICMwYAAAICM0YAAAICM4YAAAICM8YAAAICNAYAAAICNEYAAAICNIYAAAICNMYAAAICNQYAAAICNUYAAAICNYYAAAICNcYAAAICNgYAAAICNkYAAAICNoYAAAICNsYAAAICNwYAAAICN0YAAAICN4YAAAICN8YAAAICOAYAAAICOEYAAAICOIYAAAICOMYAAAICOQYAAAICOUYAAAICOYYAAAICOcYAAAICOgYAAAICOkYAAAICOoYAAAICOsYAAAICOwYAAAICO0YAAAICO4YAAAICO8YAAAICPAYAAAICPEYAAAICPIYAAAICPMYAAAICPQYAAAICPUYAAAICPYYAAAICPcYAAAICPgYAAAICPkYAAAICPoYAAAICPsYAAAICPwYAAAICP0YAAAICP4YAAAICP8YAAAICAAZAAAICAEZAAAICAIZAAAICAMZAAAICAQZAAAICAUZAAAICAYZAAAICAcZAAAICAgZAAAICAkZAAAICAoZAAAICAsZAAAICAwZAAAICA0ZAAAICA4ZAAAICA8ZAAAICBAZAAAICBEZAAAICBIZAAAICBMZAAAICBQZAAAICBUZAAAICBYZAAAICBcZAAAICBgZAAAICBkZAAAICBoZAAAICBsZAAAICBwZAAAICB0ZAAAICB4ZAAAICB8ZAAAICCAZAAAICCEZAAAICCIZAAAICCMZAAAICCQZAAAICCUZAAAICCYZAAAICCcZAAAICCgZAAAICCkZAAAICCoZAAAICCsZAAAICCwZAAAICC0ZAAAICC4ZAAAICC8ZAAAICDAZAAAICDEZAAAICDIZAAAICDMZAAAICDQZAAAICDUZAAAICDYZAAAICDcZAAAICDgZAAAICDkZAAAICDoZAAAICDsZAAAICDwZAAAICD0ZAAAICD4ZAAAICD8ZAAAICEAZAAAICEEZAAAICEIZAAAICEMZAAAICEQZAAAICEUZAAAICEYZAAAICEcZAAAICEgZAAAICEkZAAAICEoZAAAICEsZAAAICEwZAAAICE0ZAAAICE4ZAAAICE8ZAAAICFAZAAAICFEZAAAICFIZAAAICFMZAAAICFQZAAAICFUZAAAICFYZAAAICFcZAAAICFgZAAAICFkZAAAICFoZAAAICFsZAAAICFwZAAAICF0ZAAAICF4ZAAAICF8ZAAAICGAZAAAICGEZAAAICGIZAAAICGMZAAAICGQZAAAICGUZAAAICGYZAAAICGcZAAAICGgZAAAICGkZAAAICGoZAAAICGsZAAAICGwZAAAICG0ZAAAICG4ZAAAICG8ZAAAICHAZAAAICHEZAAAICHIZAAAICHMZAAAICHQZAAAICHUZAAAICHYZAAAICHcZAAAICHgZAAAICHkZAAAICHoZAAAICHsZAAAICHwZAAAICH0ZAAAICH4ZAAAICH8ZAAAICIAZAAAICIEZAAAICIIZAAAICIMZAAAICIQZAAAICIUZAAAICIYZAAAICIcZAAAICIgZAAAICIkZAAAICIoZAAAICIsZAAAICIwZAAAICI0ZAAAICI4ZAAAICI8ZAAAICJAZAAAICJEZAAAICJIZAAAICJMZAAAICJQZAAAICJUZAAAICJYZAAAICJcZAAAICJgZAAAICJkZAAAICJoZAAAICJsZAAAICJwZAAAICJ0ZAAAICJ4ZAAAICJ8ZAAAICKAZAAAICKEZAAAICKIZAAAICKMZAAAICKQZAAAICKUZAAAICKYZAAAICKcZAAAICKgZAAAICKkZAAAICKoZAAAICKsZAAAICKwZAAAICK0ZAAAICK4ZAAAICK8ZAAAICLAZAAAICLEZAAAICLIZAAAICLMZAAAICLQZAAAICLUZAAAICLYZAAAICLcZAAAICLgZAAAICLkZAAAICLoZAAAICLsZAAAICLwZAAAICL0ZAAAICL4ZAAAICL8ZAAAICMAZAAAICMEZAAAICMIZAAAICMMZAAAICMQZAAAICMUZAAAICMYZAAAICMcZAAAICMgZAAAICMkZAAAICMoZAAAICMsZAAAICMwZAAAICM0ZAAAICM4ZAAAICM8ZAAAICNAZAAAICNEZAAAICNIZAAAICNMZAAAICNQZAAAICNUZAAAICNYZAAAICNcZAAAICNgZAAAICNkZAAAICNoZAAAICNsZAAAICNwZAAAICN0ZAAAICN4ZAAAICN8ZAAAICOAZAAAICOEZAAAICOIZAAAICOMZAAAICOQZAAAICOUZAAAICOYZAAAICOcZAAAICOgZAAAICOkZAAAICOoZAAAICOsZAAAICOwZAAAICO0ZAAAICO4ZAAAICO8ZAAAICPAZAAAICPEZAAAICPIZAAAICPMZAAAICPQZAAAICPUZAAAICPYZAAAICPcZAAAICPgZAAAICPkZAAAICPoZAAAICPsZAAAICPwZAAAICP0ZAAAICP4ZAAAICP8ZAAAICAAaAAAICAEaAAAICAIaAAAICAMaAAAICAQaAAAICAUaAAAICAYaAAAICAcaAAAICAgaAAAICAkaAAAICAoaAAAICAsaAAAICAwaAAAICA0aAAAICA4aAAAICA8aAAAICBAaAAAICBEaAAAICBIaAAAICBMaAAAICBQaAAAICBUaAAAICBYaAAAICBcaAAAICBgaAAAICBkaAAAICBoaAAAICBsaAAAICBwaAAAICB0aAAAICB4aAAAICB8aAAAICCAaAAAICCEaAAAICCIaAAAICCMaAAAICCQaAAAICCUaAAAICCYaAAAICCcaAAAICCgaAAAICCkaAAAICCoaAAAICCsaAAAICCwaAAAICC0aAAAICC4aAAAICC8aAAAICDAaAAAICDEaAAAICDIaAAAICDMaAAAICDQaAAAICDUaAAAICDYaAAAICDcaAAAICDgaAAAICDkaAAAICDoaAAAICDsaAAAICDwaAAAICD0aAAAICD4aAAAICD8aAAAICEAaAAAICEEaAAAICEIaAAAICEMaAAAICEQaAAAICEUaAAAICEYaAAAICEcaAAAICEgaAAAICEkaAAAICEoaAAAICEsaAAAICEwaAAAICE0aAAAICE4aAAAICE8aAAAICFAaAAAICFEaAAAICFIaAAAICFMaAAAICFQaAAAICFUaAAAICFYaAAAICFcaAAAICFgaAAAICFkaAAAICFoaAAAICFsaAAAICFwaAAAICF0aAAAICF4aAAAICF8aAAAICGAaAAAICGEaAAAICGIaAAAICGMaAAAICGQaAAAICGUaAAAICGYaAAAICGcaAAAICGgaAAAICGkaAAAICGoaAAAICGsaAAAICGwaAAAICG0aAAAICG4aAAAICG8aAAAICHAaAAAICHEaAAAICHIaAAAICHMaAAAICHQaAAAICHUaAAAICHYaAAAICHcaAAAICHgaAAAICHkaAAAICHoaAAAICHsaAAAICHwaAAAICH0aAAAICH4aAAAICH8aAAAICIAaAAAICIEaAAAICIIaAAAICIMaAAAICIQaAAAICIUaAAAICIYaAAAICIcaAAAICIgaAAAICIkaAAAICIoaAAAICIsaAAAICIwaAAAICI0aAAAICI4aAAAICI8aAAAICJAaAAAICJEaAAAICJIaAAAICJMaAAAICJQaAAAICJUaAAAICJYaAAAICJcaAAAICJgaAAAICJkaAAAICJoaAAAICJsaAAAICJwaAAAICJ0aAAAICJ4aAAAICJ8aAAAICKAaAAAICKEaAAAICKIaAAAICKMaAAAICKQaAAAICKUaAAAICKYaAAAICKcaAAAICKgaAAAICKkaAAAICKoaAAAICKsaAAAICKwaAAAICK0aAAAICK4aAAAICK8aAAAICLAaAAAICLEaAAAICLIaAAAICLMaAAAICLQaAAAICLUaAAAICLYaAAAICLcaAAAICLgaAAAICLkaAAAICLoaAAAICLsaAAAICLwaAAAICL0aAAAICL4aAAAICL8aAAAICMAaAAAICMEaAAAICMIaAAAICMMaAAAICMQaAAAICMUaAAAICMYaAAAICMcaAAAICMgaAAAICMkaAAAICMoaAAAICMsaAAAICMwaAAAICM0aAAAICM4aAAAICM8aAAAICNAaAAAICNEaAAAICNIaAAAICNMaAAAICNQaAAAICNUaAAAICNYaAAAICNcaAAAICNgaAAAICNkaAAAICNoaAAAICNsaAAAICNwaAAAICN0aAAAICN4aAAAICN8aAAAICOAaAAAICOEaAAAICOIaAAAICOMaAAAICOQaAAAICOUaAAAICOYaAAAICOcaAAAICOgaAAAICOkaAAAICOoaAAAICOsaAAAICOwaAAAICO0aAAAICO4aAAAICO8aAAAICPAaAAAICPEaAAAICPIaAAAICPMaAAAICPQaAAAICPUaAAAICPYaAAAICPcaAAAICPgaAAAICPkaAAAICPoaAAAICPsaAAAICPwaAAAICP0aAAAICP4aAAAICP8aAAAICAAbAAAICAEbAAAICAIbAAAICAMbAAAICAQbAAAICAUbAAAICAYbAAAICAcbAAAICAgbAAAICAkbAAAICAobAAAICAsbAAAICAwbAAAICA0bAAAICA4bAAAICA8bAAAICBAbAAAICBEbAAAICBIbAAAICBMbAAAICBQbAAAICBUbAAAICBYbAAAICBcbAAAICBgbAAAICBkbAAAICBobAAAICBsbAAAICBwbAAAICB0bAAAICB4bAAAICB8bAAAICCAbAAAICCEbAAAICCIbAAAICCMbAAAICCQbAAAICCUbAAAICCYbAAAICCcbAAAICCgbAAAICCkbAAAICCobAAAICCsbAAAICCwbAAAICC0bAAAICC4bAAAICC8bAAAICDAbAAAICDEbAAAICDIbAAAICDMbAAAICDQbAAAICDUbAAAICDYbAAAICDcbAAAICDgbAAAICDkbAAAICDobAAAICDsbAAAICDwbAAAICD0bAAAICD4bAAAICD8bAAAICEAbAAAICEEbAAAICEIbAAAICEMbAAAICEQbAAAICEUbAAAICEYbAAAICEcbAAAICEgbAAAICEkbAAAICEobAAAICEsbAAAICEwbAAAICE0bAAAICE4bAAAICE8bAAAICFAbAAAICFEbAAAICFIbAAAICFMbAAAICFQbAAAICFUbAAAICFYbAAAICFcbAAAICFgbAAAICFkbAAAICFobAAAICFsbAAAICFwbAAAICF0bAAAICF4bAAAICF8bAAAICGAbAAAICGEbAAAICGIbAAAICGMbAAAICGQbAAAICGUbAAAICGYbAAAICGcbAAAICGgbAAAICGkbAAAICGobAAAICGsbAAAICGwbAAAICG0bAAAICG4bAAAICG8bAAAICHAbAAAICHEbAAAICHIbAAAICHMbAAAICHQbAAAICHUbAAAICHYbAAAICHcbAAAICHgbAAAICHkbAAAICHobAAAICHsbAAAICHwbAAAICH0bAAAICH4bAAAICH8bAAAICIAbAAAICIEbAAAICIIbAAAICIMbAAAICIQbAAAICIUbAAAICIYbAAAICIcbAAAICIgbAAAICIkbAAAICIobAAAICIsbAAAICIwbAAAICI0bAAAICI4bAAAICI8bAAAICJAbAAAICJEbAAAICJIbAAAICJMbAAAICJQbAAAICJUbAAAICJYbAAAICJcbAAAICJgbAAAICJkbAAAICJobAAAICJsbAAAICJwbAAAICJ0bAAAICJ4bAAAICJ8bAAAICKAbAAAICKEbAAAICKIbAAAICKMbAAAICKQbAAAICKUbAAAICKYbAAAICKcbAAAICKgbAAAICKkbAAAICKobAAAICKsbAAAICKwbAAAICK0bAAAICK4bAAAICK8bAAAICLAbAAAICLEbAAAICLIbAAAICLMbAAAICLQbAAAICLUbAAAICLYbAAAICLcbAAAICLgbAAAICLkbAAAICLobAAAICLsbAAAICLwbAAAICL0bAAAICL4bAAAICL8bAAAICMAbAAAICMEbAAAICMIbAAAICMMbAAAICMQbAAAICMUbAAAICMYbAAAICMcbAAAICMgbAAAICMkbAAAICMobAAAICMsbAAAICMwbAAAICM0bAAAICM4bAAAICM8bAAAICNAbAAAICNEbAAAICNIbAAAICNMbAAAICNQbAAAICNUbAAAICNYbAAAICNcbAAAICNgbAAAICNkbAAAICNobAAAICNsbAAAICNwbAAAICN0bAAAICN4bAAAICN8bAAAICOAbAAAICOEbAAAICOIbAAAICOMbAAAICOQbAAAICOUbAAAICOYbAAAICOcbAAAICOgbAAAICOkbAAAICOobAAAICOsbAAAICOwbAAAICO0bAAAICO4bAAAICO8bAAAICPAbAAAICPEbAAAICPIbAAAICPMbAAAICPQbAAAICPUbAAAICPYbAAAICPcbAAAICPgbAAAICPkbAAAICPobAAAICPsbAAAICPwbAAAICP0bAAAICP4bAAAICP8bAAAICAAcAAAICAEcAAAICAIcAAAICAMcAAAICAQcAAAICAUcAAAICAYcAAAICAccAAAICAgcAAAICAkcAAAICAocAAAICAscAAAICAwcAAAICA0cAAAICA4cAAAICA8cAAAICBAcAAAICBEcAAAICBIcAAAICBMcAAAICBQcAAAICBUcAAAICBYcAAAICBccAAAICBgcAAAICBkcAAAICBocAAAICBscAAAICBwcAAAICB0cAAAICB4cAAAICB8cAAAICCAcAAAICCEcAAAICCIcAAAICCMcAAAICCQcAAAICCUcAAAICCYcAAAICCccAAAICCgcAAAICCkcAAAICCocAAAICCscAAAICCwcAAAICC0cAAAICC4cAAAICC8cAAAICDAcAAAICDEcAAAICDIcAAAICDMcAAAICDQcAAAICDUcAAAICDYcAAAICDccAAAICDgcAAAICDkcAAAICDocAAAICDscAAAICDwcAAAICD0cAAAICD4cAAAICD8cAAAICEAcAAAICEEcAAAICEIcAAAICEMcAAAICEQcAAAICEUcAAAICEYcAAAICEccAAAICEgcAAAICEkcAAAICEocAAAICEscAAAICEwcAAAICE0cAAAICE4cAAAICE8cAAAICFAcAAAICFEcAAAICFIcAAAICFMcAAAICFQcAAAICFUcAAAICFYcAAAICFccAAAICFgcAAAICFkcAAAICFocAAAICFscAAAICFwcAAAICF0cAAAICF4cAAAICF8cAAAICGAcAAAICGEcAAAICGIcAAAICGMcAAAICGQcAAAICGUcAAAICGYcAAAICGccAAAICGgcAAAICGkcAAAICGocAAAICGscAAAICGwcAAAICG0cAAAICG4cAAAICG8cAAAICHAcAAAICHEcAAAICHIcAAAICHMcAAAICHQcAAAICHUcAAAICHYcAAAICHccAAAICHgcAAAICHkcAAAICHocAAAICHscAAAICHwcAAAICH0cAAAICH4cAAAICH8cAAAICIAcAAAICIEcAAAICIIcAAAICIMcAAAICIQcAAAICIUcAAAICIYcAAAICIccAAAICIgcAAAICIkcAAAICIocAAAICIscAAAICIwcAAAICI0cAAAICI4cAAAICI8cAAAICJAcAAAICJEcAAAICJIcAAAICJMcAAAICJQcAAAICJUcAAAICJYcAAAICJccAAAICJgcAAAICJkcAAAICJocAAAICJscAAAICJwcAAAICJ0cAAAICJ4cAAAICJ8cAAAICKAcAAAICKEcAAAICKIcAAAICKMcAAAICKQcAAAICKUcAAAICKYcAAAICKccAAAICKgcAAAICKkcAAAICKocAAAICKscAAAICKwcAAAICK0cAAAICK4cAAAICK8cAAAICLAcAAAICLEcAAAICLIcAAAICLMcAAAICLQcAAAICLUcAAAICLYcAAAICLccAAAICLgcAAAICLkcAAAICLocAAAICLscAAAICLwcAAAICL0cAAAICL4cAAAICL8cAAAICMAcAAAICMEcAAAICMIcAAAICMMcAAAICMQcAAAICMUcAAAICMYcAAAICMccAAAICMgcAAAICMkcAAAICMocAAAICMscAAAICMwcAAAICM0cAAAICM4cAAAICM8cAAAICNAcAAAICNEcAAAICNIcAAAICNMcAAAICNQcAAAICNUcAAAICNYcAAAICNccAAAICNgcAAAICNkcAAAICNocAAAICNscAAAICNwcAAAICN0cAAAICN4cAAAICN8cAAAICOAcAAAICOEcAAAICOIcAAAICOMcAAAICOQcAAAICOUcAAAICOYcAAAICOccAAAICOgcAAAICOkcAAAICOocAAAICOscAAAICOwcAAAICO0cAAAICO4cAAAICO8cAAAICPAcAAAICPEcAAAICPIcAAAICPMcAAAICPQcAAAICPUcAAAICPYcAAAICPccAAAICPgcAAAICPkcAAAICPocAAAICPscAAAICPwcAAAICP0cAAAICP4cAAAICP8cAAAICAAdAAAICAEdAAAICAIdAAAICAMdAAAICAQdAAAICAUdAAAICAYdAAAICAcdAAAICAgdAAAICAkdAAAICAodAAAICAsdAAAICAwdAAAICA0dAAAICA4dAAAICA8dAAAICBAdAAAICBEdAAAICBIdAAAICBMdAAAICBQdAAAICBUdAAAICBYdAAAICBcdAAAICBgdAAAICBkdAAAICBodAAAICBsdAAAICBwdAAAICB0dAAAICB4dAAAICB8dAAAICCAdAAAICCEdAAAICCIdAAAICCMdAAAICCQdAAAICCUdAAAICCYdAAAICCcdAAAICCgdAAAICCkdAAAICCodAAAICCsdAAAICCwdAAAICC0dAAAICC4dAAAICC8dAAAICDAdAAAICDEdAAAICDIdAAAICDMdAAAICDQdAAAICDUdAAAICDYdAAAICDcdAAAICDgdAAAICDkdAAAICDodAAAICDsdAAAICDwdAAAICD0dAAAICD4dAAAICD8dAAAICEAdAAAICEEdAAAICEIdAAAICEMdAAAICEQdAAAICEUdAAAICEYdAAAICEcdAAAICEgdAAAICEkdAAAICEodAAAICEsdAAAICEwdAAAICE0dAAAICE4dAAAICE8dAAAICFAdAAAICFEdAAAICFIdAAAICFMdAAAICFQdAAAICFUdAAAICFYdAAAICFcdAAAICFgdAAAICFkdAAAICFodAAAICFsdAAAICFwdAAAICF0dAAAICF4dAAAICF8dAAAICGAdAAAICGEdAAAICGIdAAAICGMdAAAICGQdAAAICGUdAAAICGYdAAAICGcdAAAICGgdAAAICGkdAAAICGodAAAICGsdAAAICGwdAAAICG0dAAAICG4dAAAICG8dAAAICHAdAAAICHEdAAAICHIdAAAICHMdAAAICHQdAAAICHUdAAAICHYdAAAICHcdAAAICHgdAAAICHkdAAAICHodAAAICHsdAAAICHwdAAAICH0dAAAICH4dAAAICH8dAAAICIAdAAAICIEdAAAICIIdAAAICIMdAAAICIQdAAAICIUdAAAICIYdAAAICIcdAAAICIgdAAAICIkdAAAICIodAAAICIsdAAAICIwdAAAICI0dAAAICI4dAAAICI8dAAAICJAdAAAICJEdAAAICJIdAAAICJMdAAAICJQdAAAICJUdAAAICJYdAAAICJcdAAAICJgdAAAICJkdAAAICJodAAAICJsdAAAICJwdAAAICJ0dAAAICJ4dAAAICJ8dAAAICKAdAAAICKEdAAAICKIdAAAICKMdAAAICKQdAAAICKUdAAAICKYdAAAICKcdAAAICKgdAAAICKkdAAAICKodAAAICKsdAAAICKwdAAAICK0dAAAICK4dAAAICK8dAAAICLAdAAAICLEdAAAICLIdAAAICLMdAAAICLQdAAAICLUdAAAICLYdAAAICLcdAAAICLgdAAAICLkdAAAICLodAAAICLsdAAAICLwdAAAICL0dAAAICL4dAAAICL8dAAAICMAdAAAICMEdAAAICMIdAAAICMMdAAAICMQdAAAICMUdAAAICMYdAAAICMcdAAAICMgdAAAICMkdAAAICModAAAICMsdAAAICMwdAAAICM0dAAAICM4dAAAICM8dAAAICNAdAAAICNEdAAAICNIdAAAICNMdAAAICNQdAAAICNUdAAAICNYdAAAICNcdAAAICNgdAAAICNkdAAAICNodAAAICNsdAAAICNwdAAAICN0dAAAICN4dAAAICN8dAAAICOAdAAAICOEdAAAICOIdAAAICOMdAAAICOQdAAAICOUdAAAICOYdAAAICOcdAAAICOgdAAAICOkdAAAICOodAAAICOsdAAAICOwdAAAICO0dAAAICO4dAAAICO8dAAAICPAdAAAICPEdAAAICPIdAAAICPMdAAAICPQdAAAICPUdAAAICPYdAAAICPcdAAAICPgdAAAICPkdAAAICPodAAAICPsdAAAICPwdAAAICP0dAAAICP4dAAAICP8dAAAICAAeAAAICAEeAAAICAIeAAAICAMeAAAICAQeAAAICAUeAAAICAYeAAAICAceAAAICAgeAAAICAkeAAAICAoeAAAICAseAAAICAweAAAICA0eAAAICA4eAAAICA8eAAAICBAeAAAICBEeAAAICBIeAAAICBMeAAAICBQeAAAICBUeAAAICBYeAAAICBceAAAICBgeAAAICBkeAAAICBoeAAAICBseAAAICBweAAAICB0eAAAICB4eAAAICB8eAAAICCAeAAAICCEeAAAICCIeAAAICCMeAAAICCQeAAAICCUeAAAICCYeAAAICCceAAAICCgeAAAICCkeAAAICCoeAAAICCseAAAICCweAAAICC0eAAAICC4eAAAICC8eAAAICDAeAAAICDEeAAAICDIeAAAICDMeAAAICDQeAAAICDUeAAAICDYeAAAICDceAAAICDgeAAAICDkeAAAICDoeAAAICDseAAAICDweAAAICD0eAAAICD4eAAAICD8eAAAICEAeAAAICEEeAAAICEIeAAAICEMeAAAICEQeAAAICEUeAAAICEYeAAAICEceAAAICEgeAAAICEkeAAAICEoeAAAICEseAAAICEweAAAICE0eAAAICE4eAAAICE8eAAAICFAeAAAICFEeAAAICFIeAAAICFMeAAAICFQeAAAICFUeAAAICFYeAAAICFceAAAICFgeAAAICFkeAAAICFoeAAAICFseAAAICFweAAAICF0eAAAICF4eAAAICF8eAAAICGAeAAAICGEeAAAICGIeAAAICGMeAAAICGQeAAAICGUeAAAICGYeAAAICGceAAAICGgeAAAICGkeAAAICGoeAAAICGseAAAICGweAAAICG0eAAAICG4eAAAICG8eAAAICHAeAAAICHEeAAAICHIeAAAICHMeAAAICHQeAAAICHUeAAAICHYeAAAICHceAAAICHgeAAAICHkeAAAICHoeAAAICHseAAAICHweAAAICH0eAAAICH4eAAAICH8eAAAICIAeAAAICIEeAAAICIIeAAAICIMeAAAICIQeAAAICIUeAAAICIYeAAAICIceAAAICIgeAAAICIkeAAAICIoeAAAICIseAAAICIweAAAICI0eAAAICI4eAAAICI8eAAAICJAeAAAICJEeAAAICJIeAAAICJMeAAAICJQeAAAICJUeAAAICJYeAAAICJceAAAICJgeAAAICJkeAAAICJoeAAAICJseAAAICJweAAAICJ0eAAAICJ4eAAAICJ8eAAAICKAeAAAICKEeAAAICKIeAAAICKMeAAAICKQeAAAICKUeAAAICKYeAAAICKceAAAICKgeAAAICKkeAAAICKoeAAAICKseAAAICKweAAAICK0eAAAICK4eAAAICK8eAAAICLAeAAAICLEeAAAICLIeAAAICLMeAAAICLQeAAAICLUeAAAICLYeAAAICLceAAAICLgeAAAICLkeAAAICLoeAAAICLseAAAICLweAAAICL0eAAAICL4eAAAICL8eAAAICMAeAAAICMEeAAAICMIeAAAICMMeAAAICMQeAAAICMUeAAAICMYeAAAICMceAAAICMgeAAAICMkeAAAICMoeAAAICMseAAAICMweAAAICM0eAAAICM4eAAAICM8eAAAICNAeAAAICNEeAAAICNIeAAAICNMeAAAICNQeAAAICNUeAAAICNYeAAAICNceAAAICNgeAAAICNkeAAAICNoeAAAICNseAAAICNweAAAICN0eAAAICN4eAAAICN8eAAAICOAeAAAICOEeAAAICOIeAAAICOMeAAAICOQeAAAICOUeAAAICOYeAAAICOceAAAICOgeAAAICOkeAAAICOoeAAAICOseAAAICOweAAAICO0eAAAICO4eAAAICO8eAAAICPAeAAAICPEeAAAICPIeAAAICPMeAAAICPQeAAAICPUeAAAICPYeAAAICPceAAAICPgeAAAICPkeAAAICPoeAAAICPseAAAICPweAAAICP0eAAAICP4eAAAICP8eAAAICAAfAAAICAEfAAAICAIfAAAICAMfAAAICAQfAAAICAUfAAAICAYfAAAICAcfAAAICAgfAAAICAkfAAAICAofAAAICAsfAAAICAwfAAAICA0fAAAICA4fAAAICA8fAAAICBAfAAAICBEfAAAICBIfAAAICBMfAAAICBQfAAAICBUfAAAICBYfAAAICBcfAAAICBgfAAAICBkfAAAICBofAAAICBsfAAAICBwfAAAICB0fAAAICB4fAAAICB8fAAAICCAfAAAICCEfAAAICCIfAAAICCMfAAAICCQfAAAICCUfAAAICCYfAAAICCcfAAAICCgfAAAICCkfAAAICCofAAAICCsfAAAICCwfAAAICC0fAAAICC4fAAAICC8fAAAICDAfAAAICDEfAAAICDIfAAAICDMfAAAICDQfAAAICDUfAAAICDYfAAAICDcfAAAICDgfAAAICDkfAAAICDofAAAICDsfAAAICDwfAAAICD0fAAAICD4fAAAICD8fAAAICEAfAAAICEEfAAAICEIfAAAICEMfAAAICEQfAAAICEUfAAAICEYfAAAICEcfAAAICEgfAAAICEkfAAAICEofAAAICEsfAAAICEwfAAAICE0fAAAICE4fAAAICE8fAAAICFAfAAAICFEfAAAICFIfAAAICFMfAAAICFQfAAAICFUfAAAICFYfAAAICFcfAAAICFgfAAAICFkfAAAICFofAAAICFsfAAAICFwfAAAICF0fAAAICF4fAAAICF8fAAAICGAfAAAICGEfAAAICGIfAAAICGMfAAAICGQfAAAICGUfAAAICGYfAAAICGcfAAAICGgfAAAICGkfAAAICGofAAAICGsfAAAICGwfAAAICG0fAAAICG4fAAAICG8fAAAICHAfAAAICHEfAAAICHIfAAAICHMfAAAICHQfAAAICHUfAAAICHYfAAAICHcfAAAICHgfAAAICHkfAAAICHofAAAICHsfAAAICHwfAAAICH0fAAAICH4fAAAICH8fAAAICIAfAAAICIEfAAAICIIfAAAICIMfAAAICIQfAAAICIUfAAAICIYfAAAICIcfAAAICIgfAAAICIkfAAAICIofAAAICIsfAAAICIwfAAAICI0fAAAICI4fAAAICI8fAAAICJAfAAAICJEfAAAICJIfAAAICJMfAAAICJQfAAAICJUfAAAICJYfAAAICJcfAAAICJgfAAAICJkfAAAICJofAAAICJsfAAAICJwfAAAICJ0fAAAICJ4fAAAICJ8fAAAICKAfAAAICKEfAAAICKIfAAAICKMfAAAICKQfAAAICKUfAAAICKYfAAAICKcfAAAICKgfAAAICKkfAAAICKofAAAICKsfAAAICKwfAAAICK0fAAAICK4fAAAICK8fAAAICLAfAAAICLEfAAAICLIfAAAICLMfAAAICLQfAAAICLUfAAAICLYfAAAICLcfAAAICLgfAAAICLkfAAAICLofAAAICLsfAAAICLwfAAAICL0fAAAICL4fAAAICL8fAAAICMAfAAAICMEfAAAICMIfAAAICMMfAAAICMQfAAAICMUfAAAICMYfAAAICMcfAAAICMgfAAAICMkfAAAICMofAAAICMsfAAAICMwfAAAICM0fAAAICM4fAAAICM8fAAAICNAfAAAICNEfAAAICNIfAAAICNMfAAAICNQfAAAICNUfAAAICNYfAAAICNcfAAAICNgfAAAICNkfAAAICNofAAAICNsfAAAICNwfAAAICN0fAAAICN4fAAAICN8fAAAICOAfAAAICOEfAAAICOIfAAAICOMfAAAICOQfAAAICOUfAAAICOYfAAAICOcfAAAICOgfAAAICOkfAAAICOofAAAICOsfAAAICOwfAAAICO0fAAAICO4fAAAICO8fAAAICPAfAAAICPEfAAAICPIfAAAICPMfAAAICPQfAAAICPUfAAAICPYfAAAICPcfAAAICPgfAAAICPkfAAAICPofAAAICPsfAAAICPwfAAAICP0fAAAICP4fAAAICP8fAAAICAAgAAAICAEgAAAICAIgAAAICAMgAAAICAQgAAAICAUgAAAICAYgAAAICAcgAAAICAggAAAICAkgAAAICAogAAAICAsgAAAICAwgAAAICA0gAAAICA4gAAAICA8gAAAICBAgAAAICBEgAAAICBIgAAAICBMgAAAICBQgAAAICBUgAAAICBYgAAAICBcgAAAICBggAAAICBkgAAAICBogAAAICBsgAAAICBwgAAAICB0gAAAICB4gAAAICB8gAAAICCAgAAAICCEgAAAICCIgAAAICCMgAAAICCQgAAAICCUgAAAICCYgAAAICCcgAAAICCggAAAICCkgAAAICCogAAAICCsgAAAICCwgAAAICC0gAAAICC4gAAAICC8gAAAICDAgAAAICDEgAAAICDIgAAAICDMgAAAICDQgAAAICDUgAAAICDYgAAAICDcgAAAICDggAAAICDkgAAAICDogAAAICDsgAAAICDwgAAAICD0gAAAICD4gAAAICD8gAAAICEAgAAAICEEgAAAICEIgAAAICEMgAAAICEQgAAAICEUgAAAICEYgAAAICEcgAAAICEggAAAICEkgAAAICEogAAAICEsgAAAICEwgAAAICE0gAAAICE4gAAAICE8gAAAICFAgAAAICFEgAAAICFIgAAAICFMgAAAICFQgAAAICFUgAAAICFYgAAAICFcgAAAICFggAAAICFkgAAAICFogAAAICFsgAAAICFwgAAAICF0gAAAICF4gAAAICF8gAAAICGAgAAAICGEgAAAICGIgAAAICGMgAAAICGQgAAAICGUgAAAICGYgAAAICGcgAAAICGggAAAICGkgAAAICGogAAAICGsgAAAICGwgAAAICG0gAAAICG4gAAAICG8gAAAICHAgAAAICHEgAAAICHIgAAAICHMgAAAICHQgAAAICHUgAAAICHYgAAAICHcgAAAICHggAAAICHkgAAAICHogAAAICHsgAAAICHwgAAAICH0gAAAICH4gAAAICH8gAAAICIAgAAAICIEgAAAICIIgAAAICIMgAAAICIQgAAAICIUgAAAICIYgAAAICIcgAAAICIggAAAICIkgAAAICIogAAAICIsgAAAICIwgAAAICI0gAAAICI4gAAAICI8gAAAICJAgAAAICJEgAAAICJIgAAAICJMgAAAICJQgAAAICJUgAAAICJYgAAAICJcgAAAICJggAAAICJkgAAAICJogAAAICJsgAAAICJwgAAAICJ0gAAAICJ4gAAAICJ8gAAAICKAgAAAICKEgAAAICKIgAAAICKMgAAAICKQgAAAICKUgAAAICKYgAAAICKcgAAAICKggAAAICKkgAAAICKogAAAICKsgAAAICKwgAAAICK0gAAAICK4gAAAICK8gAAAICLAgAAAICLEgAAAICLIgAAAICLMgAAAICLQgAAAICLUgAAAICLYgAAAICLcgAAAICLggAAAICLkgAAAICLogAAAICLsgAAAICLwgAAAICL0gAAAICL4gAAAICL8gAAAICMAgAAAICMEgAAAICMIgAAAICMMgAAAICMQgAAAICMUgAAAICMYgAAAICMcgAAAICMggAAAICMkgAAAICMogAAAICMsgAAAICMwgAAAICM0gAAAICM4gAAAICM8gAAAICNAgAAAICNEgAAAICNIgAAAICNMgAAAICNQgAAAICNUgAAAICNYgAAAICNcgAAAICNggAAAICNkgAAAICNogAAAICNsgAAAICNwgAAAICN0gAAAICN4gAAAICN8gAAAICOAgAAAICOEgAAAICOIgAAAICOMgAAAICOQgAAAICOUgAAAICOYgAAAICOcgAAAICOggAAAICOkgAAAICOogAAAICOsgAAAICOwgAAAICO0gAAAICO4gAAAICO8gAAAICPAgAAAICPEgAAAICPIgAAAICPMgAAAICPQgAAAICPUgAAAICPYgAAAICPcgAAAICPggAAAICPkgAAAICPogAAAICPsgAAAICPwgAAAICP0gAAAICP4gAAAICP8gAAAICAAhAAAICAEhAAAICAIhAAAICAMhAAAICAQhAAAICAUhAAAICAYhAAAICAchAAAICAghAAAICAkhAAAICAohAAAICAshAAAICAwhAAAICA0hAAAICA4hAAAICA8hAAAICBAhAAAICBEhAAAICBIhAAAICBMhAAAICBQhAAAICBUhAAAICBYhAAAICBchAAAICBghAAAICBkhAAAICBohAAAICBshAAAICBwhAAAICB0hAAAICB4hAAAICB8hAAAICCAhAAAICCEhAAAICCIhAAAICCMhAAAICCQhAAAICCUhAAAICCYhAAAICCchAAAICCghAAAICCkhAAAICCohAAAICCshAAAICCwhAAAICC0hAAAICC4hAAAICC8hAAAICDAhAAAICDEhAAAICDIhAAAICDMhAAAICDQhAAAICDUhAAAICDYhAAAICDchAAAICDghAAAICDkhAAAICDohAAAICDshAAAICDwhAAAICD0hAAAICD4hAAAICD8hAAAICEAhAAAICEEhAAAICEIhAAAICEMhAAAICEQhAAAICEUhAAAICEYhAAAICEchAAAICEghAAAICEkhAAAICEohAAAICEshAAAICEwhAAAICE0hAAAICE4hAAAICE8hAAAICFAhAAAICFEhAAAICFIhAAAICFMhAAAICFQhAAAICFUhAAAICFYhAAAICFchAAAICFghAAAICFkhAAAICFohAAAICFshAAAICFwhAAAICF0hAAAICF4hAAAICF8hAAAICGAhAAAICGEhAAAICGIhAAAICGMhAAAICGQhAAAICGUhAAAICGYhAAAICGchAAAICGghAAAICGkhAAAICGohAAAICGshAAAICGwhAAAICG0hAAAICG4hAAAICG8hAAAICHAhAAAICHEhAAAICHIhAAAICHMhAAAICHQhAAAICHUhAAAICHYhAAAICHchAAAICHghAAAICHkhAAAICHohAAAICHshAAAICHwhAAAICH0hAAAICH4hAAAICH8hAAAICIAhAAAICIEhAAAICIIhAAAICIMhAAAICIQhAAAICIUhAAAICIYhAAAICIchAAAICIghAAAICIkhAAAICIohAAAICIshAAAICIwhAAAICI0hAAAICI4hAAAICI8hAAAICJAhAAAICJEhAAAICJIhAAAICJMhAAAICJQhAAAICJUhAAAICJYhAAAICJchAAAICJghAAAICJkhAAAICJohAAAICJshAAAICJwhAAAICJ0hAAAICJ4hAAAICJ8hAAAICKAhAAAICKEhAAAICKIhAAAICKMhAAAICKQhAAAICKUhAAAICKYhAAAICKchAAAICKghAAAICKkhAAAICKohAAAICKshAAAICKwhAAAICK0hAAAICK4hAAAICK8hAAAICLAhAAAICLEhAAAICLIhAAAICLMhAAAICLQhAAAICLUhAAAICLYhAAAICLchAAAICLghAAAICLkhAAAICLohAAAICLshAAAICLwhAAAICL0hAAAICL4hAAAICL8hAAAICMAhAAAICMEhAAAICMIhAAAICMMhAAAICMQhAAAICMUhAAAICMYhAAAICMchAAAICMghAAAICMkhAAAICMohAAAICMshAAAICMwhAAAICM0hAAAICM4hAAAICM8hAAAICNAhAAAICNEhAAAICNIhAAAICNMhAAAICNQhAAAICNUhAAAICNYhAAAICNchAAAICNghAAAICNkhAAAICNohAAAICNshAAAICNwhAAAICN0hAAAICN4hAAAICN8hAAAICOAhAAAICOEhAAAICOIhAAAICOMhAAAICOQhAAAICOUhAAAICOYhAAAICOchAAAICOghAAAICOkhAAAICOohAAAICOshAAAICOwhAAAICO0hAAAICO4hAAAICO8hAAAICPAhAAAICPEhAAAICPIhAAAICPMhAAAICPQhAAAICPUhAAAICPYhAAAICPchAAAICPghAAAICPkhAAAICPohAAAICPshAAAICPwhAAAICP0hAAAICP4hAAAICP8hAAAICAAiAAAICAEiAAAICAIiAAAICAMiAAAICAQiAAAICAUiAAAICAYiAAAICAciAAAICAgiAAAICAkiAAAICAoiAAAICAsiAAAICAwiAAAICA0iAAAICA4iAAAICA8iAAAICBAiAAAICBEiAAAICBIiAAAICBMiAAAICBQiAAAICBUiAAAICBYiAAAICBciAAAICBgiAAAICBkiAAAICBoiAAAICBsiAAAICBwiAAAICB0iAAAICB4iAAAICB8iAAAICCAiAAAICCEiAAAICCIiAAAICCMiAAAICCQiAAAICCUiAAAICCYiAAAICCciAAAICCgiAAAICCkiAAAICCoiAAAICCsiAAAICCwiAAAICC0iAAAICC4iAAAICC8iAAAICDAiAAAICDEiAAAICDIiAAAICDMiAAAICDQiAAAICDUiAAAICDYiAAAICDciAAAICDgiAAAICDkiAAAICDoiAAAICDsiAAAICDwiAAAICD0iAAAICD4iAAAICD8iAAAICEAiAAAICEEiAAAICEIiAAAICEMiAAAICEQiAAAICEUiAAAICEYiAAAICEciAAAICEgiAAAICEkiAAAICEoiAAAICEsiAAAICEwiAAAICE0iAAAICE4iAAAICE8iAAAICFAiAAAICFEiAAAICFIiAAAICFMiAAAICFQiAAAICFUiAAAICFYiAAAICFciAAAICFgiAAAICFkiAAAICFoiAAAICFsiAAAICFwiAAAICF0iAAAICF4iAAAICF8iAAAICGAiAAAICGEiAAAICGIiAAAICGMiAAAICGQiAAAICGUiAAAICGYiAAAICGciAAAICGgiAAAICGkiAAAICGoiAAAICGsiAAAICGwiAAAICG0iAAAICG4iAAAICG8iAAAICHAiAAAICHEiAAAICHIiAAAICHMiAAAICHQiAAAICHUiAAAICHYiAAAICHciAAAICHgiAAAICHkiAAAICHoiAAAICHsiAAAICHwiAAAICH0iAAAICH4iAAAICH8iAAAICIAiAAAICIEiAAAICIIiAAAICIMiAAAICIQiAAAICIUiAAAICIYiAAAICIciAAAICIgiAAAICIkiAAAICIoiAAAICIsiAAAICIwiAAAICI0iAAAICI4iAAAICI8iAAAICJAiAAAICJEiAAAICJIiAAAICJMiAAAICJQiAAAICJUiAAAICJYiAAAICJciAAAICJgiAAAICJkiAAAICJoiAAAICJsiAAAICJwiAAAICJ0iAAAICJ4iAAAICJ8iAAAICKAiAAAICKEiAAAICKIiAAAICKMiAAAICKQiAAAICKUiAAAICKYiAAAICKciAAAICKgiAAAICKkiAAAICKoiAAAICKsiAAAICKwiAAAICK0iAAAICK4iAAAICK8iAAAICLAiAAAICLEiAAAICLIiAAAICLMiAAAICLQiAAAICLUiAAAICLYiAAAICLciAAAICLgiAAAICLkiAAAICLoiAAAICLsiAAAICLwiAAAICL0iAAAICL4iAAAICL8iAAAICMAiAAAICMEiAAAICMIiAAAICMMiAAAICMQiAAAICMUiAAAICMYiAAAICMciAAAICMgiAAAICMkiAAAICMoiAAAICMsiAAAICMwiAAAICM0iAAAICM4iAAAICM8iAAAICNAiAAAICNEiAAAICNIiAAAICNMiAAAICNQiAAAICNUiAAAICNYiAAAICNciAAAICNgiAAAICNkiAAAICNoiAAAICNsiAAAICNwiAAAICN0iAAAICN4iAAAICN8iAAAICOAiAAAICOEiAAAICOIiAAAICOMiAAAICOQiAAAICOUiAAAICOYiAAAICOciAAAICOgiAAAICOkiAAAICOoiAAAICOsiAAAICOwiAAAICO0iAAAICO4iAAAICO8iAAAICPAiAAAICPEiAAAICPIiAAAICPMiAAAICPQiAAAICPUiAAAICPYiAAAICPciAAAICPgiAAAICPkiAAAICPoiAAAICPsiAAAICPwiAAAICP0iAAAICP4iAAAICP8iAAAICAAjAAAICAEjAAAICAIjAAAICAMjAAAICAQjAAAICAUjAAAICAYjAAAICAcjAAAICAgjAAAICAkjAAAICAojAAAICAsjAAAICAwjAAAICA0jAAAICA4jAAAICA8jAAAICBAjAAAICBEjAAAICBIjAAAICBMjAAAICBQjAAAICBUjAAAICBYjAAAICBcjAAAICBgjAAAICBkjAAAICBojAAAICBsjAAAICBwjAAAICB0jAAAICB4jAAAICB8jAAAICCAjAAAICCEjAAAICCIjAAAICCMjAAAICCQjAAAICCUjAAAICCYjAAAICCcjAAAICCgjAAAICCkjAAAICCojAAAICCsjAAAICCwjAAAICC0jAAAICC4jAAAICC8jAAAICDAjAAAICDEjAAAICDIjAAAICDMjAAAICDQjAAAICDUjAAAICDYjAAAICDcjAAAICDgjAAAICDkjAAAICDojAAAICDsjAAAICDwjAAAICD0jAAAICD4jAAAICD8jAAAICEAjAAAICEEjAAAICEIjAAAICEMjAAAICEQjAAAICEUjAAAICEYjAAAICEcjAAAICEgjAAAICEkjAAAICEojAAAICEsjAAAICEwjAAAICE0jAAAICE4jAAAICE8jAAAICFAjAAAICFEjAAAICFIjAAAICFMjAAAICFQjAAAICFUjAAAICFYjAAAICFcjAAAICFgjAAAICFkjAAAICFojAAAICFsjAAAICFwjAAAICF0jAAAICF4jAAAICF8jAAAICGAjAAAICGEjAAAICGIjAAAICGMjAAAICGQjAAAICGUjAAAICGYjAAAICGcjAAAICGgjAAAICGkjAAAICGojAAAICGsjAAAICGwjAAAICG0jAAAICG4jAAAICG8jAAAICHAjAAAICHEjAAAICHIjAAAICHMjAAAICHQjAAAICHUjAAAICHYjAAAICHcjAAAICHgjAAAICHkjAAAICHojAAAICHsjAAAICHwjAAAICH0jAAAICH4jAAAICH8jAAAICIAjAAAICIEjAAAICIIjAAAICIMjAAAICIQjAAAICIUjAAAICIYjAAAICIcjAAAICIgjAAAICIkjAAAICIojAAAICIsjAAAICIwjAAAICI0jAAAICI4jAAAICI8jAAAICJAjAAAICJEjAAAICJIjAAAICJMjAAAICJQjAAAICJUjAAAICJYjAAAICJcjAAAICJgjAAAICJkjAAAICJojAAAICJsjAAAICJwjAAAICJ0jAAAICJ4jAAAICJ8jAAAICKAjAAAICKEjAAAICKIjAAAICKMjAAAICKQjAAAICKUjAAAICKYjAAAICKcjAAAICKgjAAAICKkjAAAICKojAAAICKsjAAAICKwjAAAICK0jAAAICK4jAAAICK8jAAAICLAjAAAICLEjAAAICLIjAAAICLMjAAAICLQjAAAICLUjAAAICLYjAAAICLcjAAAICLgjAAAICLkjAAAICLojAAAICLsjAAAICLwjAAAICL0jAAAICL4jAAAICL8jAAAICMAjAAAICMEjAAAICMIjAAAICMMjAAAICMQjAAAICMUjAAAICMYjAAAICMcjAAAICMgjAAAICMkjAAAICMojAAAICMsjAAAICMwjAAAICM0jAAAICM4jAAAICM8jAAAICNAjAAAICNEjAAAICNIjAAAICNMjAAAICNQjAAAICNUjAAAICNYjAAAICNcjAAAICNgjAAAICNkjAAAICNojAAAICNsjAAAICNwjAAAICN0jAAAICN4jAAAICN8jAAAICOAjAAAICOEjAAAICOIjAAAICOMjAAAICOQjAAAICOUjAAAICOYjAAAICOcjAAAICOgjAAAICOkjAAAICOojAAAICOsjAAAICOwjAAAICO0jAAAICO4jAAAICO8jAAAICPAjAAAICPEjAAAICPIjAAAICPMjAAAICPQjAAAICPUjAAAICPYjAAAICPcjAAAICPgjAAAICPkjAAAICPojAAAICPsjAAAICPwjAAAICP0jAAAICP4jAAAICP8jAAAICAAkAAAICAEkAAAICAIkAAAICAMkAAAICAQkAAAICAUkAAAICAYkAAAICAckAAAICAgkAAAICAkkAAAICAokAAAICAskAAAICAwkAAAICA0kAAAICA4kAAAICA8kAAAICBAkAAAICBEkAAAICBIkAAAICBMkAAAICBQkAAAICBUkAAAICBYkAAAICBckAAAICBgkAAAICBkkAAAICBokAAAICBskAAAICBwkAAAICB0kAAAICB4kAAAICB8kAAAICCAkAAAICCEkAAAICCIkAAAICCMkAAAICCQkAAAICCUkAAAICCYkAAAICCckAAAICCgkAAAICCkkAAAICCokAAAICCskAAAICCwkAAAICC0kAAAICC4kAAAICC8kAAAICDAkAAAICDEkAAAICDIkAAAICDMkAAAICDQkAAAICDUkAAAICDYkAAAICDckAAAICDgkAAAICDkkAAAICDokAAAICDskAAAICDwkAAAICD0kAAAICD4kAAAICD8kAAAICEAkAAAICEEkAAAICEIkAAAICEMkAAAICEQkAAAICEUkAAAICEYkAAAICEckAAAICEgkAAAICEkkAAAICEokAAAICEskAAAICEwkAAAICE0kAAAICE4kAAAICE8kAAAICFAkAAAICFEkAAAICFIkAAAICFMkAAAICFQkAAAICFUkAAAICFYkAAAICFckAAAICFgkAAAICFkkAAAICFokAAAICFskAAAICFwkAAAICF0kAAAICF4kAAAICF8kAAAICGAkAAAICGEkAAAICGIkAAAICGMkAAAICGQkAAAICGUkAAAICGYkAAAICGckAAAICGgkAAAICGkkAAAICGokAAAICGskAAAICGwkAAAICG0kAAAICG4kAAAICG8kAAAICHAkAAAICHEkAAAICHIkAAAICHMkAAAICHQkAAAICHUkAAAICHYkAAAICHckAAAICHgkAAAICHkkAAAICHokAAAICHskAAAICHwkAAAICH0kAAAICH4kAAAICH8kAAAICIAkAAAICIEkAAAICIIkAAAICIMkAAAICIQkAAAICIUkAAAICIYkAAAICIckAAAICIgkAAAICIkkAAAICIokAAAICIskAAAICIwkAAAICI0kAAAICI4kAAAICI8kAAAICJAkAAAICJEkAAAICJIkAAAICJMkAAAICJQkAAAICJUkAAAICJYkAAAICJckAAAICJgkAAAICJkkAAAICJokAAAICJskAAAICJwkAAAICJ0kAAAICJ4kAAAICJ8kAAAICKAkAAAICKEkAAAICKIkAAAICKMkAAAICKQkAAAICKUkAAAICKYkAAAICKckAAAICKgkAAAICKkkAAAICKokAAAICKskAAAICKwkAAAICK0kAAAICK4kAAAICK8kAAAICLAkAAAICLEkAAAICLIkAAAICLMkAAAICLQkAAAICLUkAAAICLYkAAAICLckAAAICLgkAAAICLkkAAAICLokAAAICLskAAAICLwkAAAICL0kAAAICL4kAAAICL8kAAAICMAkAAAICMEkAAAICMIkAAAICMMkAAAICMQkAAAICMUkAAAICMYkAAAICMckAAAICMgkAAAICMkkAAAICMokAAAICMskAAAICMwkAAAICM0kAAAICM4kAAAICM8kAAAICNAkAAAICNEkAAAICNIkAAAICNMkAAAICNQkAAAICNUkAAAICNYkAAAICNckAAAICNgkAAAICNkkAAAICNokAAAICNskAAAICNwkAAAICN0kAAAICN4kAAAICN8kAAAICOAkAAAICOEkAAAICOIkAAAICOMkAAAICOQkAAAICOUkAAAICOYkAAAICOckAAAICOgkAAAICOkkAAAICOokAAAICOskAAAICOwkAAAICO0kAAAICO4kAAAICO8kAAAICPAkAAAICPEkAAAICPIkAAAICPMkAAAICPQkAAAICPUkAAAICPYkAAAICPckAAAICPgkAAAICPkkAAAICPokAAAICPskAAAICPwkAAAICP0kAAAICP4kAAAICP8kAAAICAAlAAAICAElAAAICAIlAAAICAMlAAAICAQlAAAICAUlAAAICAYlAAAICAclAAAICAglAAAICAklAAAICAolAAAICAslAAAICAwlAAAICA0lAAAICA4lAAAICA8lAAAICBAlAAAICBElAAAICBIlAAAICBMlAAAICBQlAAAICBUlAAAICBYlAAAICBclAAAICBglAAAICBklAAAICBolAAAICBslAAAICBwlAAAICB0lAAAICB4lAAAICB8lAAAICCAlAAAICCElAAAICCIlAAAICCMlAAAICCQlAAAICCUlAAAICCYlAAAICCclAAAICCglAAAICCklAAAICColAAAICCslAAAICCwlAAAICC0lAAAICC4lAAAICC8lAAAICDAlAAAICDElAAAICDIlAAAICDMlAAAICDQlAAAICDUlAAAICDYlAAAICDclAAAICDglAAAICDklAAAICDolAAAICDslAAAICDwlAAAICD0lAAAICD4lAAAICD8lAAAICEAlAAAICEElAAAICEIlAAAICEMlAAAICEQlAAAICEUlAAAICEYlAAAICEclAAAICEglAAAICEklAAAICEolAAAICEslAAAICEwlAAAICE0lAAAICE4lAAAICE8lAAAICFAlAAAICFElAAAICFIlAAAICFMlAAAICFQlAAAICFUlAAAICFYlAAAICFclAAAICFglAAAICFklAAAICFolAAAICFslAAAICFwlAAAICF0lAAAICF4lAAAICF8lAAAICGAlAAAICGElAAAICGIlAAAICGMlAAAICGQlAAAICGUlAAAICGYlAAAICGclAAAICGglAAAICGklAAAICGolAAAICGslAAAICGwlAAAICG0lAAAICG4lAAAICG8lAAAICHAlAAAICHElAAAICHIlAAAICHMlAAAICHQlAAAICHUlAAAICHYlAAAICHclAAAICHglAAAICHklAAAICHolAAAICHslAAAICHwlAAAICH0lAAAICH4lAAAICH8lAAAICIAlAAAICIElAAAICIIlAAAICIMlAAAICIQlAAAICIUlAAAICIYlAAAICIclAAAICIglAAAICIklAAAICIolAAAICIslAAAICIwlAAAICI0lAAAICI4lAAAICI8lAAAICJAlAAAICJElAAAICJIlAAAICJMlAAAICJQlAAAICJUlAAAICJYlAAAICJclAAAICJglAAAICJklAAAICJolAAAICJslAAAICJwlAAAICJ0lAAAICJ4lAAAICJ8lAAAICKAlAAAICKElAAAICKIlAAAICKMlAAAICKQlAAAICKUlAAAICKYlAAAICKclAAAICKglAAAICKklAAAICKolAAAICKslAAAICKwlAAAICK0lAAAICK4lAAAICK8lAAAICLAlAAAICLElAAAICLIlAAAICLMlAAAICLQlAAAICLUlAAAICLYlAAAICLclAAAICLglAAAICLklAAAICLolAAAICLslAAAICLwlAAAICL0lAAAICL4lAAAICL8lAAAICMAlAAAICMElAAAICMIlAAAICMMlAAAICMQlAAAICMUlAAAICMYlAAAICMclAAAICMglAAAICMklAAAICMolAAAICMslAAAICMwlAAAICM0lAAAICM4lAAAICM8lAAAICNAlAAAICNElAAAICNIlAAAICNMlAAAICNQlAAAICNUlAAAICNYlAAAICNclAAAICNglAAAICNklAAAICNolAAAICNslAAAICNwlAAAICN0lAAAICN4lAAAICN8lAAAICOAlAAAICOElAAAICOIlAAAICOMlAAAICOQlAAAICOUlAAAICOYlAAAICOclAAAICOglAAAICOklAAAICOolAAAICOslAAAICOwlAAAICO0lAAAICO4lAAAICO8lAAAICPAlAAAICPElAAAICPIlAAAICPMlAAAICPQlAAAICPUlAAAICPYlAAAICPclAAAICPglAAAICPklAAAICPolAAAICPslAAAICPwlAAAICP0lAAAICP4lAAAICP8lAAAICAAmAAAICAEmAAAICAImAAAICAMmAAAICAQmAAAICAUmAAAICAYmAAAICAcmAAAICAgmAAAICAkmAAAICAomAAAICAsmAAAICAwmAAAICA0mAAAICA4mAAAICA8mAAAICBAmAAAICBEmAAAICBImAAAICBMmAAAICBQmAAAICBUmAAAICBYmAAAICBcmAAAICBgmAAAICBkmAAAICBomAAAICBsmAAAICBwmAAAICB0mAAAICB4mAAAICB8mAAAICCAmAAAICCEmAAAICCImAAAICCMmAAAICCQmAAAICCUmAAAICCYmAAAICCcmAAAICCgmAAAICCkmAAAICComAAAICCsmAAAICCwmAAAICC0mAAAICC4mAAAICC8mAAAICDAmAAAICDEmAAAICDImAAAICDMmAAAICDQmAAAICDUmAAAICDYmAAAICDcmAAAICDgmAAAICDkmAAAICDomAAAICDsmAAAICDwmAAAICD0mAAAICD4mAAAICD8mAAAICEAmAAAICEEmAAAICEImAAAICEMmAAAICEQmAAAICEUmAAAICEYmAAAICEcmAAAICEgmAAAICEkmAAAICEomAAAICEsmAAAICEwmAAAICE0mAAAICE4mAAAICE8mAAAICFAmAAAICFEmAAAICFImAAAICFMmAAAICFQmAAAICFUmAAAICFYmAAAICFcmAAAICFgmAAAICFkmAAAICFomAAAICFsmAAAICFwmAAAICF0mAAAICF4mAAAICF8mAAAICGAmAAAICGEmAAAICGImAAAICGMmAAAICGQmAAAICGUmAAAICGYmAAAICGcmAAAICGgmAAAICGkmAAAICGomAAAICGsmAAAICGwmAAAICG0mAAAICG4mAAAICG8mAAAICHAmAAAICHEmAAAICHImAAAICHMmAAAICHQmAAAICHUmAAAICHYmAAAICHcmAAAICHgmAAAICHkmAAAICHomAAAICHsmAAAICHwmAAAICH0mAAAICH4mAAAICH8mAAAICIAmAAAICIEmAAAICIImAAAICIMmAAAICIQmAAAICIUmAAAICIYmAAAICIcmAAAICIgmAAAICIkmAAAICIomAAAICIsmAAAICIwmAAAICI0mAAAICI4mAAAICI8mAAAICJAmAAAICJEmAAAICJImAAAICJMmAAAICJQmAAAICJUmAAAICJYmAAAICJcmAAAICJgmAAAICJkmAAAICJomAAAICJsmAAAICJwmAAAICJ0mAAAICJ4mAAAICJ8mAAAICKAmAAAICKEmAAAICKImAAAICKMmAAAICKQmAAAICKUmAAAICKYmAAAICKcmAAAICKgmAAAICKkmAAAICKomAAAICKsmAAAICKwmAAAICK0mAAAICK4mAAAICK8mAAAICLAmAAAICLEmAAAICLImAAAICLMmAAAICLQmAAAICLUmAAAICLYmAAAICLcmAAAICLgmAAAICLkmAAAICLomAAAICLsmAAAICLwmAAAICL0mAAAICL4mAAAICL8mAAAICMAmAAAICMEmAAAICMImAAAICMMmAAAICMQmAAAICMUmAAAICMYmAAAICMcmAAAICMgmAAAICMkmAAAICMomAAAICMsmAAAICMwmAAAICM0mAAAICM4mAAAICM8mAAAICNAmAAAICNEmAAAICNImAAAICNMmAAAICNQmAAAICNUmAAAICNYmAAAICNcmAAAICNgmAAAICNkmAAAICNomAAAICNsmAAAICNwmAAAICN0mAAAICN4mAAAICN8mAAAICOAmAAAICOEmAAAICOImAAAICOMmAAAICOQmAAAICOUmAAAICOYmAAAICOcmAAAICOgmAAAICOkmAAAICOomAAAICOsmAAAICOwmAAAICO0mAAAICO4mAAAICO8mAAAICPAmAAAICPEmAAAICPImAAAICPMmAAAICPQmAAAICPUmAAAICPYmAAAICPcmAAAICPgmAAAICPkmAAAICPomAAAICPsmAAAICPwmAAAICP0mAAAICP4mAAAICP8mAAAICAAnAAAICAEnAAAICAInAAAICAMnAAAICAQnAAAICAUnAAAICAYnAAAICAcnAAAICAgnAAAICAknAAAICAonAAAICAsnAAAICAwnAAAICA0nAAAICA4nAAAICA8nAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAABAnAAAICAAAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAICCkAAAAICCoAAAAICCsAAAAICCwAAAAICC0AAAAICC4AAAAICC8AAAAICDAAAAAICDEAAAAICDIAAAAICDMAAAAICDQAAAAICDUAAAAICDYAAAAICDcAAAAICDgAAAAICDkAAAAICDoAAAAICDsAAAAICDwAAAAICD0AAAAICD4AAAAICD8AAAAICEAAAAAICEEAAAAICEIAAAAICEMAAAAICEQAAAAICEUAAAAICEYAAAAICEcAAAAICEgAAAAICEkAAAAICEoAAAAICEsAAAAICEwAAAAICE0AAAAICE4AAAAICE8AAAAICFAAAAAICFEAAAAICFIAAAAICFMAAAAICFQAAAAICFUAAAAICFYAAAAICFcAAAAICFgAAAAICFkAAAAICFoAAAAICFsAAAAICFwAAAAICF0AAAAICF4AAAAICF8AAAAICGAAAAAICGEAAAAICGIAAAAICGMAAAAICGQAAAAICGUAAAAICGYAAAAICGcAAAAICGgAAAAICGkAAAAICGoAAAAICGsAAAAICGwAAAAICG0AAAAICG4AAAAICG8AAAAICHAAAAAICHEAAAAICHIAAAAICHMAAAAICHQAAAAICHUAAAAICHYAAAAICHcAAAAICHgAAAAICHkAAAAICHoAAAAICHsAAAAICHwAAAAICH0AAAAICH4AAAAICH8AAAAICIAAAAAICIEAAAAICIIAAAAICIMAAAAICIQAAAAICIUAAAAICIYAAAAICIcAAAAICIgAAAAICIkAAAAICIoAAAAICIsAAAAICIwAAAAICI0AAAAICI4AAAAICI8AAAAICJAAAAAICJEAAAAICJIAAAAICJMAAAAICJQAAAAICJUAAAAICJYAAAAICJcAAAAICJgAAAAICJkAAAAICJoAAAAICJsAAAAICJwAAAAICJ0AAAAICJ4AAAAICJ8AAAAICKAAAAAICKEAAAAICKIAAAAICKMAAAAICKQAAAAICKUAAAAICKYAAAAICKcAAAAICKgAAAAICKkAAAAICKoAAAAICKsAAAAICKwAAAAICK0AAAAICK4AAAAICK8AAAAICLAAAAAICLEAAAAICLIAAAAICLMAAAAICLQAAAAICLUAAAAICLYAAAAICLcAAAAICLgAAAAICLkAAAAICLoAAAAICLsAAAAICLwAAAAICL0AAAAICL4AAAAICL8AAAAICMAAAAAICMEAAAAICMIAAAAICMMAAAAICMQAAAAICMUAAAAICMYAAAAICMcAAAAICMgAAAAICMkAAAAICMoAAAAICMsAAAAICMwAAAAICM0AAAAICM4AAAAICM8AAAAICNAAAAAICNEAAAAICNIAAAAICNMAAAAICNQAAAAICNUAAAAICNYAAAAICNcAAAAICNgAAAAICNkAAAAICNoAAAAICNsAAAAICNwAAAAICN0AAAAICN4AAAAICN8AAAAICOAAAAAICOEAAAAICOIAAAAICOMAAAAICOQAAAAICOUAAAAICOYAAAAICOcAAAAICOgAAAAICOkAAAAICOoAAAAICOsAAAAICOwAAAAICO0AAAAICO4AAAAICO8AAAAICPAAAAAICPEAAAAICPIAAAAICPMAAAAICPQAAAAICPUAAAAICPYAAAAICPcAAAAICPgAAAAICPkAAAAICPoAAAAICPsAAAAICPwAAAAICP0AAAAICP4AAAAICP8AAAAICAABAAAICAEBAAAICAIBAAAICAMBAAAICAQBAAAICAUBAAAICAYBAAAICAcBAAAICAgBAAAICAkBAAAICAoBAAAICAsBAAAICAwBAAAICA0BAAAICA4BAAAICA8BAAAICBABAAAICBEBAAAICBIBAAAICBMBAAAICBQBAAAICBUBAAAICBYBAAAICBcBAAAICBgBAAAICBkBAAAICBoBAAAICBsBAAAICBwBAAAICB0BAAAICB4BAAAICB8BAAAICCABAAAICCEBAAAICCIBAAAICCMBAAAICCQBAAAICCUBAAAICCYBAAAICCcBAAAICCgBAAAICCkBAAAICCoBAAAICCsBAAAICCwBAAAICC0BAAAICC4BAAAICC8BAAAICDABAAAICDEBAAAICDIBAAAICDMBAAAICDQBAAAICDUBAAAICDYBAAAICDcBAAAICDgBAAAICDkBAAAICDoBAAAICDsBAAAICDwBAAAICD0BAAAICD4BAAAICD8BAAAICEABAAAICEEBAAAICEIBAAAICEMBAAAICEQBAAAICEUBAAAICEYBAAAICEcBAAAICEgBAAAICEkBAAAICEoBAAAICEsBAAAICEwBAAAICE0BAAAICE4BAAAICE8BAAAICFABAAAICFEBAAAICFIBAAAICFMBAAAICFQBAAAICFUBAAAICFYBAAAICFcBAAAICFgBAAAICFkBAAAICFoBAAAICFsBAAAICFwBAAAICF0BAAAICF4BAAAICF8BAAAICGABAAAICGEBAAAICGIBAAAICGMBAAAICGQBAAAICGUBAAAICGYBAAAICGcBAAAICGgBAAAICGkBAAAICGoBAAAICGsBAAAICGwBAAAICG0BAAAICG4BAAAICG8BAAAICHABAAAICHEBAAAICHIBAAAICHMBAAAICHQBAAAICHUBAAAICHYBAAAICHcBAAAICHgBAAAICHkBAAAICHoBAAAICHsBAAAICHwBAAAICH0BAAAICH4BAAAICH8BAAAICIABAAAICIEBAAAICIIBAAAICIMBAAAICIQBAAAICIUBAAAICIYBAAAICIcBAAAICIgBAAAICIkBAAAICIoBAAAICIsBAAAICIwBAAAICI0BAAAICI4BAAAICI8BAAAICJABAAAICJEBAAAICJIBAAAICJMBAAAICJQBAAAICJUBAAAICJYBAAAICJcBAAAICJgBAAAICJkBAAAICJoBAAAICJsBAAAICJwBAAAICJ0BAAAICJ4BAAAICJ8BAAAICKABAAAICKEBAAAICKIBAAAICKMBAAAICKQBAAAICKUBAAAICKYBAAAICKcBAAAICKgBAAAICKkBAAAICKoBAAAICKsBAAAICKwBAAAICK0BAAAICK4BAAAICK8BAAAICLABAAAICLEBAAAICLIBAAAICLMBAAAICLQBAAAICLUBAAAICLYBAAAICLcBAAAICLgBAAAICLkBAAAICLoBAAAICLsBAAAICLwBAAAICL0BAAAICL4BAAAICL8BAAAICMABAAAICMEBAAAICMIBAAAICMMBAAAICMQBAAAICMUBAAAICMYBAAAICMcBAAAICMgBAAAICMkBAAAICMoBAAAICMsBAAAICMwBAAAICM0BAAAICM4BAAAICM8BAAAICNABAAAICNEBAAAICNIBAAAICNMBAAAICNQBAAAICNUBAAAICNYBAAAICNcBAAAICNgBAAAICNkBAAAICNoBAAAICNsBAAAICNwBAAAICN0BAAAICN4BAAAICN8BAAAICOABAAAICOEBAAAICOIBAAAICOMBAAAICOQBAAAICOUBAAAICOYBAAAICOcBAAAICOgBAAAICOkBAAAICOoBAAAICOsBAAAICOwBAAAICO0BAAAICO4BAAAICO8BAAAICPABAAAICPEBAAAICPIBAAAICPMBAAAICPQBAAAICPUBAAAICPYBAAAICPcBAAAICPgBAAAICPkBAAAICPoBAAAICPsBAAAICPwBAAAICP0BAAAICP4BAAAICP8BAAAICAACAAAICAECAAAICAICAAAICAMCAAAICAQCAAAICAUCAAAICAYCAAAICAcCAAAICAgCAAAICAkCAAAICAoCAAAICAsCAAAICAwCAAAICA0CAAAICA4CAAAICA8CAAAICBACAAAICBECAAAICBICAAAICBMCAAAICBQCAAAICBUCAAAICBYCAAAICBcCAAAICBgCAAAICBkCAAAICBoCAAAICBsCAAAICBwCAAAICB0CAAAICB4CAAAICB8CAAAICCACAAAICCECAAAICCICAAAICCMCAAAICCQCAAAICCUCAAAICCYCAAAICCcCAAAICCgCAAAICCkCAAAICCoCAAAICCsCAAAICCwCAAAICC0CAAAICC4CAAAICC8CAAAICDACAAAICDECAAAICDICAAAICDMCAAAICDQCAAAICDUCAAAICDYCAAAICDcCAAAICDgCAAAICDkCAAAICDoCAAAICDsCAAAICDwCAAAICD0CAAAICD4CAAAICD8CAAAICEACAAAICEECAAAICEICAAAICEMCAAAICEQCAAAICEUCAAAICEYCAAAICEcCAAAICEgCAAAICEkCAAAICEoCAAAICEsCAAAICEwCAAAICE0CAAAICE4CAAAICE8CAAAICFACAAAICFECAAAICFICAAAICFMCAAAICFQCAAAICFUCAAAICFYCAAAICFcCAAAICFgCAAAICFkCAAAICFoCAAAICFsCAAAICFwCAAAICF0CAAAICF4CAAAICF8CAAAICGACAAAICGECAAAICGICAAAICGMCAAAICGQCAAAICGUCAAAICGYCAAAICGcCAAAICGgCAAAICGkCAAAICGoCAAAICGsCAAAICGwCAAAICG0CAAAICG4CAAAICG8CAAAICHACAAAICHECAAAICHICAAAICHMCAAAICHQCAAAICHUCAAAICHYCAAAICHcCAAAICHgCAAAICHkCAAAICHoCAAAICHsCAAAICHwCAAAICH0CAAAICH4CAAAICH8CAAAICIACAAAICIECAAAICIICAAAICIMCAAAICIQCAAAICIUCAAAICIYCAAAICIcCAAAICIgCAAAICIkCAAAICIoCAAAICIsCAAAICIwCAAAICI0CAAAICI4CAAAICI8CAAAICJACAAAICJECAAAICJICAAAICJMCAAAICJQCAAAICJUCAAAICJYCAAAICJcCAAAICJgCAAAICJkCAAAICJoCAAAICJsCAAAICJwCAAAICJ0CAAAICJ4CAAAICJ8CAAAICKACAAAICKECAAAICKICAAAICKMCAAAICKQCAAAICKUCAAAICKYCAAAICKcCAAAICKgCAAAICKkCAAAICKoCAAAICKsCAAAICKwCAAAICK0CAAAICK4CAAAICK8CAAAICLACAAAICLECAAAICLICAAAICLMCAAAICLQCAAAICLUCAAAICLYCAAAICLcCAAAICLgCAAAICLkCAAAICLoCAAAICLsCAAAICLwCAAAICL0CAAAICL4CAAAICL8CAAAICMACAAAICMECAAAICMICAAAICMMCAAAICMQCAAAICMUCAAAICMYCAAAICMcCAAAICMgCAAAICMkCAAAICMoCAAAICMsCAAAICMwCAAAICM0CAAAICM4CAAAICM8CAAAICNACAAAICNECAAAICNICAAAICNMCAAAICNQCAAAICNUCAAAICNYCAAAICNcCAAAICNgCAAAICNkCAAAICNoCAAAICNsCAAAICNwCAAAICN0CAAAICN4CAAAICN8CAAAICOACAAAICOECAAAICOICAAAICOMCAAAICOQCAAAICOUCAAAICOYCAAAICOcCAAAICOgCAAAICOkCAAAICOoCAAAICOsCAAAICOwCAAAICO0CAAAICO4CAAAICO8CAAAICPACAAAICPECAAAICPICAAAICPMCAAAICPQCAAAICPUCAAAICPYCAAAICPcCAAAICPgCAAAICPkCAAAICPoCAAAICPsCAAAICPwCAAAICP0CAAAICP4CAAAICP8CAAAICAADAAAICAEDAAAICAIDAAAICAMDAAAICAQDAAAICAUDAAAICAYDAAAICAcDAAAICAgDAAAICAkDAAAICAoDAAAICAsDAAAICAwDAAAICA0DAAAICA4DAAAICA8DAAAICBADAAAICBEDAAAICBIDAAAICBMDAAAICBQDAAAICBUDAAAICBYDAAAICBcDAAAICBgDAAAICBkDAAAICBoDAAAICBsDAAAICBwDAAAICB0DAAAICB4DAAAICB8DAAAICCADAAAICCEDAAAICCIDAAAICCMDAAAICCQDAAAICCUDAAAICCYDAAAICCcDAAAICCgDAAAICCkDAAAICCoDAAAICCsDAAAICCwDAAAICC0DAAAICC4DAAAICC8DAAAICDADAAAICDEDAAAICDIDAAAICDMDAAAICDQDAAAICDUDAAAICDYDAAAICDcDAAAICDgDAAAICDkDAAAICDoDAAAICDsDAAAICDwDAAAICD0DAAAICD4DAAAICD8DAAAICEADAAAICEEDAAAICEIDAAAICEMDAAAICEQDAAAICEUDAAAICEYDAAAICEcDAAAICEgDAAAICEkDAAAICEoDAAAICEsDAAAICEwDAAAICE0DAAAICE4DAAAICE8DAAAICFADAAAICFEDAAAICFIDAAAICFMDAAAICFQDAAAICFUDAAAICFYDAAAICFcDAAAICFgDAAAICFkDAAAICFoDAAAICFsDAAAICFwDAAAICF0DAAAICF4DAAAICF8DAAAICGADAAAICGEDAAAICGIDAAAICGMDAAAICGQDAAAICGUDAAAICGYDAAAICGcDAAAICGgDAAAICGkDAAAICGoDAAAICGsDAAAICGwDAAAICG0DAAAICG4DAAAICG8DAAAICHADAAAICHEDAAAICHIDAAAICHMDAAAICHQDAAAICHUDAAAICHYDAAAICHcDAAAICHgDAAAICHkDAAAICHoDAAAICHsDAAAICHwDAAAICH0DAAAICH4DAAAICH8DAAAICIADAAAICIEDAAAICIIDAAAICIMDAAAICIQDAAAICIUDAAAICIYDAAAICIcDAAAICIgDAAAICIkDAAAICIoDAAAICIsDAAAICIwDAAAICI0DAAAICI4DAAAICI8DAAAICJADAAAICJEDAAAICJIDAAAICJMDAAAICJQDAAAICJUDAAAICJYDAAAICJcDAAAICJgDAAAICJkDAAAICJoDAAAICJsDAAAICJwDAAAICJ0DAAAICJ4DAAAICJ8DAAAICKADAAAICKEDAAAICKIDAAAICKMDAAAICKQDAAAICKUDAAAICKYDAAAICKcDAAAICKgDAAAICKkDAAAICKoDAAAICKsDAAAICKwDAAAICK0DAAAICK4DAAAICK8DAAAICLADAAAICLEDAAAICLIDAAAICLMDAAAICLQDAAAICLUDAAAICLYDAAAICLcDAAAICLgDAAAICLkDAAAICLoDAAAICLsDAAAICLwDAAAICL0DAAAICL4DAAAICL8DAAAICMADAAAICMEDAAAICMIDAAAICMMDAAAICMQDAAAICMUDAAAICMYDAAAICMcDAAAICMgDAAAICMkDAAAICMoDAAAICMsDAAAICMwDAAAICM0DAAAICM4DAAAICM8DAAAICNADAAAICNEDAAAICNIDAAAICNMDAAAICNQDAAAICNUDAAAICNYDAAAICNcDAAAICNgDAAAICNkDAAAICNoDAAAICNsDAAAICNwDAAAICN0DAAAICN4DAAAICN8DAAAICOADAAAICOEDAAAICOIDAAAICOMDAAAICOQDAAAICOUDAAAICOYDAAAICOcDAAAICOgDAAAICOkDAAAICOoDAAAICOsDAAAICOwDAAAICO0DAAAICO4DAAAICO8DAAAICPADAAAICPEDAAAICPIDAAAICPMDAAAICPQDAAAICPUDAAAICPYDAAAICPcDAAAICPgDAAAICPkDAAAICPoDAAAICPsDAAAICPwDAAAICP0DAAAICP4DAAAICP8DAAAICAAEAAAICAEEAAAICAIEAAAICAMEAAAICAQEAAAICAUEAAAICAYEAAAICAcEAAAICAgEAAAICAkEAAAICAoEAAAICAsEAAAICAwEAAAICA0EAAAICA4EAAAICA8EAAAICBAEAAAICBEEAAAICBIEAAAICBMEAAAICBQEAAAICBUEAAAICBYEAAAICBcEAAAICBgEAAAICBkEAAAICBoEAAAICBsEAAAICBwEAAAICB0EAAAICB4EAAAICB8EAAAICCAEAAAICCEEAAAICCIEAAAICCMEAAAICCQEAAAICCUEAAAICCYEAAAICCcEAAAICCgEAAAICCkEAAAICCoEAAAICCsEAAAICCwEAAAICC0EAAAICC4EAAAICC8EAAAICDAEAAAICDEEAAAICDIEAAAICDMEAAAICDQEAAAICDUEAAAICDYEAAAICDcEAAAICDgEAAAICDkEAAAICDoEAAAICDsEAAAICDwEAAAICD0EAAAICD4EAAAICD8EAAAICEAEAAAICEEEAAAICEIEAAAICEMEAAAICEQEAAAICEUEAAAICEYEAAAICEcEAAAICEgEAAAICEkEAAAICEoEAAAICEsEAAAICEwEAAAICE0EAAAICE4EAAAICE8EAAAICFAEAAAICFEEAAAICFIEAAAICFMEAAAICFQEAAAICFUEAAAICFYEAAAICFcEAAAICFgEAAAICFkEAAAICFoEAAAICFsEAAAICFwEAAAICF0EAAAICF4EAAAICF8EAAAICGAEAAAICGEEAAAICGIEAAAICGMEAAAICGQEAAAICGUEAAAICGYEAAAICGcEAAAICGgEAAAICGkEAAAICGoEAAAICGsEAAAICGwEAAAICG0EAAAICG4EAAAICG8EAAAICHAEAAAICHEEAAAICHIEAAAICHMEAAAICHQEAAAICHUEAAAICHYEAAAICHcEAAAICHgEAAAICHkEAAAICHoEAAAICHsEAAAICHwEAAAICH0EAAAICH4EAAAICH8EAAAICIAEAAAICIEEAAAICIIEAAAICIMEAAAICIQEAAAICIUEAAAICIYEAAAICIcEAAAICIgEAAAICIkEAAAICIoEAAAICIsEAAAICIwEAAAICI0EAAAICI4EAAAICI8EAAAICJAEAAAICJEEAAAICJIEAAAICJMEAAAICJQEAAAICJUEAAAICJYEAAAICJcEAAAICJgEAAAICJkEAAAICJoEAAAICJsEAAAICJwEAAAICJ0EAAAICJ4EAAAICJ8EAAAICKAEAAAICKEEAAAICKIEAAAICKMEAAAICKQEAAAICKUEAAAICKYEAAAICKcEAAAICKgEAAAICKkEAAAICKoEAAAICKsEAAAICKwEAAAICK0EAAAICK4EAAAICK8EAAAICLAEAAAICLEEAAAICLIEAAAICLMEAAAICLQEAAAICLUEAAAICLYEAAAICLcEAAAICLgEAAAICLkEAAAICLoEAAAICLsEAAAICLwEAAAICL0EAAAICL4EAAAICL8EAAAICMAEAAAICMEEAAAICMIEAAAICMMEAAAICMQEAAAICMUEAAAICMYEAAAICMcEAAAICMgEAAAICMkEAAAICMoEAAAICMsEAAAICMwEAAAICM0EAAAICM4EAAAICM8EAAAICNAEAAAICNEEAAAICNIEAAAICNMEAAAICNQEAAAICNUEAAAICNYEAAAICNcEAAAICNgEAAAICNkEAAAICNoEAAAICNsEAAAICNwEAAAICN0EAAAICN4EAAAICN8EAAAICOAEAAAICOEEAAAICOIEAAAICOMEAAAICOQEAAAICOUEAAAICOYEAAAICOcEAAAICOgEAAAICOkEAAAICOoEAAAICOsEAAAICOwEAAAICO0EAAAICO4EAAAICO8EAAAICPAEAAAICPEEAAAICPIEAAAICPMEAAAICPQEAAAICPUEAAAICPYEAAAICPcEAAAICPgEAAAICPkEAAAICPoEAAAICPsEAAAICPwEAAAICP0EAAAICP4EAAAICP8EAAAICAAFAAAICAEFAAAICAIFAAAICAMFAAAICAQFAAAICAUFAAAICAYFAAAICAcFAAAICAgFAAAICAkFAAAICAoFAAAICAsFAAAICAwFAAAICA0FAAAICA4FAAAICA8FAAAICBAFAAAICBEFAAAICBIFAAAICBMFAAAICBQFAAAICBUFAAAICBYFAAAICBcFAAAICBgFAAAICBkFAAAICBoFAAAICBsFAAAICBwFAAAICB0FAAAICB4FAAAICB8FAAAICCAFAAAICCEFAAAICCIFAAAICCMFAAAICCQFAAAICCUFAAAICCYFAAAICCcFAAAICCgFAAAICCkFAAAICCoFAAAICCsFAAAICCwFAAAICC0FAAAICC4FAAAICC8FAAAICDAFAAAICDEFAAAICDIFAAAICDMFAAAICDQFAAAICDUFAAAICDYFAAAICDcFAAAICDgFAAAICDkFAAAICDoFAAAICDsFAAAICDwFAAAICD0FAAAICD4FAAAICD8FAAAICEAFAAAICEEFAAAICEIFAAAICEMFAAAICEQFAAAICEUFAAAICEYFAAAICEcFAAAICEgFAAAICEkFAAAICEoFAAAICEsFAAAICEwFAAAICE0FAAAICE4FAAAICE8FAAAICFAFAAAICFEFAAAICFIFAAAICFMFAAAICFQFAAAICFUFAAAICFYFAAAICFcFAAAICFgFAAAICFkFAAAICFoFAAAICFsFAAAICFwFAAAICF0FAAAICF4FAAAICF8FAAAICGAFAAAICGEFAAAICGIFAAAICGMFAAAICGQFAAAICGUFAAAICGYFAAAICGcFAAAICGgFAAAICGkFAAAICGoFAAAICGsFAAAICGwFAAAICG0FAAAICG4FAAAICG8FAAAICHAFAAAICHEFAAAICHIFAAAICHMFAAAICHQFAAAICHUFAAAICHYFAAAICHcFAAAICHgFAAAICHkFAAAICHoFAAAICHsFAAAICHwFAAAICH0FAAAICH4FAAAICH8FAAAICIAFAAAICIEFAAAICIIFAAAICIMFAAAICIQFAAAICIUFAAAICIYFAAAICIcFAAAICIgFAAAICIkFAAAICIoFAAAICIsFAAAICIwFAAAICI0FAAAICI4FAAAICI8FAAAICJAFAAAICJEFAAAICJIFAAAICJMFAAAICJQFAAAICJUFAAAICJYFAAAICJcFAAAICJgFAAAICJkFAAAICJoFAAAICJsFAAAICJwFAAAICJ0FAAAICJ4FAAAICJ8FAAAICKAFAAAICKEFAAAICKIFAAAICKMFAAAICKQFAAAICKUFAAAICKYFAAAICKcFAAAICKgFAAAICKkFAAAICKoFAAAICKsFAAAICKwFAAAICK0FAAAICK4FAAAICK8FAAAICLAFAAAICLEFAAAICLIFAAAICLMFAAAICLQFAAAICLUFAAAICLYFAAAICLcFAAAICLgFAAAICLkFAAAICLoFAAAICLsFAAAICLwFAAAICL0FAAAICL4FAAAICL8FAAAICMAFAAAICMEFAAAICMIFAAAICMMFAAAICMQFAAAICMUFAAAICMYFAAAICMcFAAAICMgFAAAICMkFAAAICMoFAAAICMsFAAAICMwFAAAICM0FAAAICM4FAAAICM8FAAAICNAFAAAICNEFAAAICNIFAAAICNMFAAAICNQFAAAICNUFAAAICNYFAAAICNcFAAAICNgFAAAICNkFAAAICNoFAAAICNsFAAAICNwFAAAICN0FAAAICN4FAAAICN8FAAAICOAFAAAICOEFAAAICOIFAAAICOMFAAAICOQFAAAICOUFAAAICOYFAAAICOcFAAAICOgFAAAICOkFAAAICOoFAAAICOsFAAAICOwFAAAICO0FAAAICO4FAAAICO8FAAAICPAFAAAICPEFAAAICPIFAAAICPMFAAAICPQFAAAICPUFAAAICPYFAAAICPcFAAAICPgFAAAICPkFAAAICPoFAAAICPsFAAAICPwFAAAICP0FAAAICP4FAAAICP8FAAAICAAGAAAICAEGAAAICAIGAAAICAMGAAAICAQGAAAICAUGAAAICAYGAAAICAcGAAAICAgGAAAICAkGAAAICAoGAAAICAsGAAAICAwGAAAICA0GAAAICA4GAAAICA8GAAAICBAGAAAICBEGAAAICBIGAAAICBMGAAAICBQGAAAICBUGAAAICBYGAAAICBcGAAAICBgGAAAICBkGAAAICBoGAAAICBsGAAAICBwGAAAICB0GAAAICB4GAAAICB8GAAAICCAGAAAICCEGAAAICCIGAAAICCMGAAAICCQGAAAICCUGAAAICCYGAAAICCcGAAAICCgGAAAICCkGAAAICCoGAAAICCsGAAAICCwGAAAICC0GAAAICC4GAAAICC8GAAAICDAGAAAICDEGAAAICDIGAAAICDMGAAAICDQGAAAICDUGAAAICDYGAAAICDcGAAAICDgGAAAICDkGAAAICDoGAAAICDsGAAAICDwGAAAICD0GAAAICD4GAAAICD8GAAAICEAGAAAICEEGAAAICEIGAAAICEMGAAAICEQGAAAICEUGAAAICEYGAAAICEcGAAAICEgGAAAICEkGAAAICEoGAAAICEsGAAAICEwGAAAICE0GAAAICE4GAAAICE8GAAAICFAGAAAICFEGAAAICFIGAAAICFMGAAAICFQGAAAICFUGAAAICFYGAAAICFcGAAAICFgGAAAICFkGAAAICFoGAAAICFsGAAAICFwGAAAICF0GAAAICF4GAAAICF8GAAAICGAGAAAICGEGAAAICGIGAAAICGMGAAAICGQGAAAICGUGAAAICGYGAAAICGcGAAAICGgGAAAICGkGAAAICGoGAAAICGsGAAAICGwGAAAICG0GAAAICG4GAAAICG8GAAAICHAGAAAICHEGAAAICHIGAAAICHMGAAAICHQGAAAICHUGAAAICHYGAAAICHcGAAAICHgGAAAICHkGAAAICHoGAAAICHsGAAAICHwGAAAICH0GAAAICH4GAAAICH8GAAAICIAGAAAICIEGAAAICIIGAAAICIMGAAAICIQGAAAICIUGAAAICIYGAAAICIcGAAAICIgGAAAICIkGAAAICIoGAAAICIsGAAAICIwGAAAICI0GAAAICI4GAAAICI8GAAAICJAGAAAICJEGAAAICJIGAAAICJMGAAAICJQGAAAICJUGAAAICJYGAAAICJcGAAAICJgGAAAICJkGAAAICJoGAAAICJsGAAAICJwGAAAICJ0GAAAICJ4GAAAICJ8GAAAICKAGAAAICKEGAAAICKIGAAAICKMGAAAICKQGAAAICKUGAAAICKYGAAAICKcGAAAICKgGAAAICKkGAAAICKoGAAAICKsGAAAICKwGAAAICK0GAAAICK4GAAAICK8GAAAICLAGAAAICLEGAAAICLIGAAAICLMGAAAICLQGAAAICLUGAAAICLYGAAAICLcGAAAICLgGAAAICLkGAAAICLoGAAAICLsGAAAICLwGAAAICL0GAAAICL4GAAAICL8GAAAICMAGAAAICMEGAAAICMIGAAAICMMGAAAICMQGAAAICMUGAAAICMYGAAAICMcGAAAICMgGAAAICMkGAAAICMoGAAAICMsGAAAICMwGAAAICM0GAAAICM4GAAAICM8GAAAICNAGAAAICNEGAAAICNIGAAAICNMGAAAICNQGAAAICNUGAAAICNYGAAAICNcGAAAICNgGAAAICNkGAAAICNoGAAAICNsGAAAICNwGAAAICN0GAAAICN4GAAAICN8GAAAICOAGAAAICOEGAAAICOIGAAAICOMGAAAICOQGAAAICOUGAAAICOYGAAAICOcGAAAICOgGAAAICOkGAAAICOoGAAAICOsGAAAICOwGAAAICO0GAAAICO4GAAAICO8GAAAICPAGAAAICPEGAAAICPIGAAAICPMGAAAICPQGAAAICPUGAAAICPYGAAAICPcGAAAICPgGAAAICPkGAAAICPoGAAAICPsGAAAICPwGAAAICP0GAAAICP4GAAAICP8GAAAICAAHAAAICAEHAAAICAIHAAAICAMHAAAICAQHAAAICAUHAAAICAYHAAAICAcHAAAICAgHAAAICAkHAAAICAoHAAAICAsHAAAICAwHAAAICA0HAAAICA4HAAAICA8HAAAICBAHAAAICBEHAAAICBIHAAAICBMHAAAICBQHAAAICBUHAAAICBYHAAAICBcHAAAICBgHAAAICBkHAAAICBoHAAAICBsHAAAICBwHAAAICB0HAAAICB4HAAAICB8HAAAICCAHAAAICCEHAAAICCIHAAAICCMHAAAICCQHAAAICCUHAAAICCYHAAAICCcHAAAICCgHAAAICCkHAAAICCoHAAAICCsHAAAICCwHAAAICC0HAAAICC4HAAAICC8HAAAICDAHAAAICDEHAAAICDIHAAAICDMHAAAICDQHAAAICDUHAAAICDYHAAAICDcHAAAICDgHAAAICDkHAAAICDoHAAAICDsHAAAICDwHAAAICD0HAAAICD4HAAAICD8HAAAICEAHAAAICEEHAAAICEIHAAAICEMHAAAICEQHAAAICEUHAAAICEYHAAAICEcHAAAICEgHAAAICEkHAAAICEoHAAAICEsHAAAICEwHAAAICE0HAAAICE4HAAAICE8HAAAICFAHAAAICFEHAAAICFIHAAAICFMHAAAICFQHAAAICFUHAAAICFYHAAAICFcHAAAICFgHAAAICFkHAAAICFoHAAAICFsHAAAICFwHAAAICF0HAAAICF4HAAAICF8HAAAICGAHAAAICGEHAAAICGIHAAAICGMHAAAICGQHAAAICGUHAAAICGYHAAAICGcHAAAICGgHAAAICGkHAAAICGoHAAAICGsHAAAICGwHAAAICG0HAAAICG4HAAAICG8HAAAICHAHAAAICHEHAAAICHIHAAAICHMHAAAICHQHAAAICHUHAAAICHYHAAAICHcHAAAICHgHAAAICHkHAAAICHoHAAAICHsHAAAICHwHAAAICH0HAAAICH4HAAAICH8HAAAICIAHAAAICIEHAAAICIIHAAAICIMHAAAICIQHAAAICIUHAAAICIYHAAAICIcHAAAICIgHAAAICIkHAAAICIoHAAAICIsHAAAICIwHAAAICI0HAAAICI4HAAAICI8HAAAICJAHAAAICJEHAAAICJIHAAAICJMHAAAICJQHAAAICJUHAAAICJYHAAAICJcHAAAICJgHAAAICJkHAAAICJoHAAAICJsHAAAICJwHAAAICJ0HAAAICJ4HAAAICJ8HAAAICKAHAAAICKEHAAAICKIHAAAICKMHAAAICKQHAAAICKUHAAAICKYHAAAICKcHAAAICKgHAAAICKkHAAAICKoHAAAICKsHAAAICKwHAAAICK0HAAAICK4HAAAICK8HAAAICLAHAAAICLEHAAAICLIHAAAICLMHAAAICLQHAAAICLUHAAAICLYHAAAICLcHAAAICLgHAAAICLkHAAAICLoHAAAICLsHAAAICLwHAAAICL0HAAAICL4HAAAICL8HAAAICMAHAAAICMEHAAAICMIHAAAICMMHAAAICMQHAAAICMUHAAAICMYHAAAICMcHAAAICMgHAAAICMkHAAAICMoHAAAICMsHAAAICMwHAAAICM0HAAAICM4HAAAICM8HAAAICNAHAAAICNEHAAAICNIHAAAICNMHAAAICNQHAAAICNUHAAAICNYHAAAICNcHAAAICNgHAAAICNkHAAAICNoHAAAICNsHAAAICNwHAAAICN0HAAAICN4HAAAICN8HAAAICOAHAAAICOEHAAAICOIHAAAICOMHAAAICOQHAAAICOUHAAAICOYHAAAICOcHAAAICOgHAAAICOkHAAAICOoHAAAICOsHAAAICOwHAAAICO0HAAAICO4HAAAICO8HAAAICPAHAAAICPEHAAAICPIHAAAICPMHAAAICPQHAAAICPUHAAAICPYHAAAICPcHAAAICPgHAAAICPkHAAAICPoHAAAICPsHAAAICPwHAAAICP0HAAAICP4HAAAICP8HAAAICAAIAAAICAEIAAAICAIIAAAICAMIAAAICAQIAAAICAUIAAAICAYIAAAICAcIAAAICAgIAAAICAkIAAAICAoIAAAICAsIAAAICAwIAAAICA0IAAAICA4IAAAICA8IAAAICBAIAAAICBEIAAAICBIIAAAICBMIAAAICBQIAAAICBUIAAAICBYIAAAICBcIAAAICBgIAAAICBkIAAAICBoIAAAICBsIAAAICBwIAAAICB0IAAAICB4IAAAICB8IAAAICCAIAAAICCEIAAAICCIIAAAICCMIAAAICCQIAAAICCUIAAAICCYIAAAICCcIAAAICCgIAAAICCkIAAAICCoIAAAICCsIAAAICCwIAAAICC0IAAAICC4IAAAICC8IAAAICDAIAAAICDEIAAAICDIIAAAICDMIAAAICDQIAAAICDUIAAAICDYIAAAICDcIAAAICDgIAAAICDkIAAAICDoIAAAICDsIAAAICDwIAAAICD0IAAAICD4IAAAICD8IAAAICEAIAAAICEEIAAAICEIIAAAICEMIAAAICEQIAAAICEUIAAAICEYIAAAICEcIAAAICEgIAAAICEkIAAAICEoIAAAICEsIAAAICEwIAAAICE0IAAAICE4IAAAICE8IAAAICFAIAAAICFEIAAAICFIIAAAICFMIAAAICFQIAAAICFUIAAAICFYIAAAICFcIAAAICFgIAAAICFkIAAAICFoIAAAICFsIAAAICFwIAAAICF0IAAAICF4IAAAICF8IAAAICGAIAAAICGEIAAAICGIIAAAICGMIAAAICGQIAAAICGUIAAAICGYIAAAICGcIAAAICGgIAAAICGkIAAAICGoIAAAICGsIAAAICGwIAAAICG0IAAAICG4IAAAICG8IAAAICHAIAAAICHEIAAAICHIIAAAICHMIAAAICHQIAAAICHUIAAAICHYIAAAICHcIAAAICHgIAAAICHkIAAAICHoIAAAICHsIAAAICHwIAAAICH0IAAAICH4IAAAICH8IAAAICIAIAAAICIEIAAAICIIIAAAICIMIAAAICIQIAAAICIUIAAAICIYIAAAICIcIAAAICIgIAAAICIkIAAAICIoIAAAICIsIAAAICIwIAAAICI0IAAAICI4IAAAICI8IAAAICJAIAAAICJEIAAAICJIIAAAICJMIAAAICJQIAAAICJUIAAAICJYIAAAICJcIAAAICJgIAAAICJkIAAAICJoIAAAICJsIAAAICJwIAAAICJ0IAAAICJ4IAAAICJ8IAAAICKAIAAAICKEIAAAICKIIAAAICKMIAAAICKQIAAAICKUIAAAICKYIAAAICKcIAAAICKgIAAAICKkIAAAICKoIAAAICKsIAAAICKwIAAAICK0IAAAICK4IAAAICK8IAAAICLAIAAAICLEIAAAICLIIAAAICLMIAAAICLQIAAAICLUIAAAICLYIAAAICLcIAAAICLgIAAAICLkIAAAICLoIAAAICLsIAAAICLwIAAAICL0IAAAICL4IAAAICL8IAAAICMAIAAAICMEIAAAICMIIAAAICMMIAAAICMQIAAAICMUIAAAICMYIAAAICMcIAAAICMgIAAAICMkIAAAICMoIAAAICMsIAAAICMwIAAAICM0IAAAICM4IAAAICM8IAAAICNAIAAAICNEIAAAICNIIAAAICNMIAAAICNQIAAAICNUIAAAICNYIAAAICNcIAAAICNgIAAAICNkIAAAICNoIAAAICNsIAAAICNwIAAAICN0IAAAICN4IAAAICN8IAAAICOAIAAAICOEIAAAICOIIAAAICOMIAAAICOQIAAAICOUIAAAICOYIAAAICOcIAAAICOgIAAAICOkIAAAICOoIAAAICOsIAAAICOwIAAAICO0IAAAICO4IAAAICO8IAAAICPAIAAAICPEIAAAICPIIAAAICPMIAAAICPQIAAAICPUIAAAICPYIAAAICPcIAAAICPgIAAAICPkIAAAICPoIAAAICPsIAAAICPwIAAAICP0IAAAICP4IAAAICP8IAAAICAAJAAAICAEJAAAICAIJAAAICAMJAAAICAQJAAAICAUJAAAICAYJAAAICAcJAAAICAgJAAAICAkJAAAICAoJAAAICAsJAAAICAwJAAAICA0JAAAICA4JAAAICA8JAAAICBAJAAAICBEJAAAICBIJAAAICBMJAAAICBQJAAAICBUJAAAICBYJAAAICBcJAAAICBgJAAAICBkJAAAICBoJAAAICBsJAAAICBwJAAAICB0JAAAICB4JAAAICB8JAAAICCAJAAAICCEJAAAICCIJAAAICCMJAAAICCQJAAAICCUJAAAICCYJAAAICCcJAAAICCgJAAAICCkJAAAICCoJAAAICCsJAAAICCwJAAAICC0JAAAICC4JAAAICC8JAAAICDAJAAAICDEJAAAICDIJAAAICDMJAAAICDQJAAAICDUJAAAICDYJAAAICDcJAAAICDgJAAAICDkJAAAICDoJAAAICDsJAAAICDwJAAAICD0JAAAICD4JAAAICD8JAAAICEAJAAAICEEJAAAICEIJAAAICEMJAAAICEQJAAAICEUJAAAICEYJAAAICEcJAAAICEgJAAAICEkJAAAICEoJAAAICEsJAAAICEwJAAAICE0JAAAICE4JAAAICE8JAAAICFAJAAAICFEJAAAICFIJAAAICFMJAAAICFQJAAAICFUJAAAICFYJAAAICFcJAAAICFgJAAAICFkJAAAICFoJAAAICFsJAAAICFwJAAAICF0JAAAICF4JAAAICF8JAAAICGAJAAAICGEJAAAICGIJAAAICGMJAAAICGQJAAAICGUJAAAICGYJAAAICGcJAAAICGgJAAAICGkJAAAICGoJAAAICGsJAAAICGwJAAAICG0JAAAICG4JAAAICG8JAAAICHAJAAAICHEJAAAICHIJAAAICHMJAAAICHQJAAAICHUJAAAICHYJAAAICHcJAAAICHgJAAAICHkJAAAICHoJAAAICHsJAAAICHwJAAAICH0JAAAICH4JAAAICH8JAAAICIAJAAAICIEJAAAICIIJAAAICIMJAAAICIQJAAAICIUJAAAICIYJAAAICIcJAAAICIgJAAAICIkJAAAICIoJAAAICIsJAAAICIwJAAAICI0JAAAICI4JAAAICI8JAAAICJAJAAAICJEJAAAICJIJAAAICJMJAAAICJQJAAAICJUJAAAICJYJAAAICJcJAAAICJgJAAAICJkJAAAICJoJAAAICJsJAAAICJwJAAAICJ0JAAAICJ4JAAAICJ8JAAAICKAJAAAICKEJAAAICKIJAAAICKMJAAAICKQJAAAICKUJAAAICKYJAAAICKcJAAAICKgJAAAICKkJAAAICKoJAAAICKsJAAAICKwJAAAICK0JAAAICK4JAAAICK8JAAAICLAJAAAICLEJAAAICLIJAAAICLMJAAAICLQJAAAICLUJAAAICLYJAAAICLcJAAAICLgJAAAICLkJAAAICLoJAAAICLsJAAAICLwJAAAICL0JAAAICL4JAAAICL8JAAAICMAJAAAICMEJAAAICMIJAAAICMMJAAAICMQJAAAICMUJAAAICMYJAAAICMcJAAAICMgJAAAICMkJAAAICMoJAAAICMsJAAAICMwJAAAICM0JAAAICM4JAAAICM8JAAAICNAJAAAICNEJAAAICNIJAAAICNMJAAAICNQJAAAICNUJAAAICNYJAAAICNcJAAAICNgJAAAICNkJAAAICNoJAAAICNsJAAAICNwJAAAICN0JAAAICN4JAAAICN8JAAAICOAJAAAICOEJAAAICOIJAAAICOMJAAAICOQJAAAICOUJAAAICOYJAAAICOcJAAAICOgJAAAICOkJAAAICOoJAAAICOsJAAAICOwJAAAICO0JAAAICO4JAAAICO8JAAAICPAJAAAICPEJAAAICPIJAAAICPMJAAAICPQJAAAICPUJAAAICPYJAAAICPcJAAAICPgJAAAICPkJAAAICPoJAAAICPsJAAAICPwJAAAICP0JAAAICP4JAAAICP8JAAAICAAKAAAICAEKAAAICAIKAAAICAMKAAAICAQKAAAICAUKAAAICAYKAAAICAcKAAAICAgKAAAICAkKAAAICAoKAAAICAsKAAAICAwKAAAICA0KAAAICA4KAAAICA8KAAAICBAKAAAICBEKAAAICBIKAAAICBMKAAAICBQKAAAICBUKAAAICBYKAAAICBcKAAAICBgKAAAICBkKAAAICBoKAAAICBsKAAAICBwKAAAICB0KAAAICB4KAAAICB8KAAAICCAKAAAICCEKAAAICCIKAAAICCMKAAAICCQKAAAICCUKAAAICCYKAAAICCcKAAAICCgKAAAICCkKAAAICCoKAAAICCsKAAAICCwKAAAICC0KAAAICC4KAAAICC8KAAAICDAKAAAICDEKAAAICDIKAAAICDMKAAAICDQKAAAICDUKAAAICDYKAAAICDcKAAAICDgKAAAICDkKAAAICDoKAAAICDsKAAAICDwKAAAICD0KAAAICD4KAAAICD8KAAAICEAKAAAICEEKAAAICEIKAAAICEMKAAAICEQKAAAICEUKAAAICEYKAAAICEcKAAAICEgKAAAICEkKAAAICEoKAAAICEsKAAAICEwKAAAICE0KAAAICE4KAAAICE8KAAAICFAKAAAICFEKAAAICFIKAAAICFMKAAAICFQKAAAICFUKAAAICFYKAAAICFcKAAAICFgKAAAICFkKAAAICFoKAAAICFsKAAAICFwKAAAICF0KAAAICF4KAAAICF8KAAAICGAKAAAICGEKAAAICGIKAAAICGMKAAAICGQKAAAICGUKAAAICGYKAAAICGcKAAAICGgKAAAICGkKAAAICGoKAAAICGsKAAAICGwKAAAICG0KAAAICG4KAAAICG8KAAAICHAKAAAICHEKAAAICHIKAAAICHMKAAAICHQKAAAICHUKAAAICHYKAAAICHcKAAAICHgKAAAICHkKAAAICHoKAAAICHsKAAAICHwKAAAICH0KAAAICH4KAAAICH8KAAAICIAKAAAICIEKAAAICIIKAAAICIMKAAAICIQKAAAICIUKAAAICIYKAAAICIcKAAAICIgKAAAICIkKAAAICIoKAAAICIsKAAAICIwKAAAICI0KAAAICI4KAAAICI8KAAAICJAKAAAICJEKAAAICJIKAAAICJMKAAAICJQKAAAICJUKAAAICJYKAAAICJcKAAAICJgKAAAICJkKAAAICJoKAAAICJsKAAAICJwKAAAICJ0KAAAICJ4KAAAICJ8KAAAICKAKAAAICKEKAAAICKIKAAAICKMKAAAICKQKAAAICKUKAAAICKYKAAAICKcKAAAICKgKAAAICKkKAAAICKoKAAAICKsKAAAICKwKAAAICK0KAAAICK4KAAAICK8KAAAICLAKAAAICLEKAAAICLIKAAAICLMKAAAICLQKAAAICLUKAAAICLYKAAAICLcKAAAICLgKAAAICLkKAAAICLoKAAAICLsKAAAICLwKAAAICL0KAAAICL4KAAAICL8KAAAICMAKAAAICMEKAAAICMIKAAAICMMKAAAICMQKAAAICMUKAAAICMYKAAAICMcKAAAICMgKAAAICMkKAAAICMoKAAAICMsKAAAICMwKAAAICM0KAAAICM4KAAAICM8KAAAICNAKAAAICNEKAAAICNIKAAAICNMKAAAICNQKAAAICNUKAAAICNYKAAAICNcKAAAICNgKAAAICNkKAAAICNoKAAAICNsKAAAICNwKAAAICN0KAAAICN4KAAAICN8KAAAICOAKAAAICOEKAAAICOIKAAAICOMKAAAICOQKAAAICOUKAAAICOYKAAAICOcKAAAICOgKAAAICOkKAAAICOoKAAAICOsKAAAICOwKAAAICO0KAAAICO4KAAAICO8KAAAICPAKAAAICPEKAAAICPIKAAAICPMKAAAICPQKAAAICPUKAAAICPYKAAAICPcKAAAICPgKAAAICPkKAAAICPoKAAAICPsKAAAICPwKAAAICP0KAAAICP4KAAAICP8KAAAICAALAAAICAELAAAICAILAAAICAMLAAAICAQLAAAICAULAAAICAYLAAAICAcLAAAICAgLAAAICAkLAAAICAoLAAAICAsLAAAICAwLAAAICA0LAAAICA4LAAAICA8LAAAICBALAAAICBELAAAICBILAAAICBMLAAAICBQLAAAICBULAAAICBYLAAAICBcLAAAICBgLAAAICBkLAAAICBoLAAAICBsLAAAICBwLAAAICB0LAAAICB4LAAAICB8LAAAICCALAAAICCELAAAICCILAAAICCMLAAAICCQLAAAICCULAAAICCYLAAAICCcLAAAICCgLAAAICCkLAAAICCoLAAAICCsLAAAICCwLAAAICC0LAAAICC4LAAAICC8LAAAICDALAAAICDELAAAICDILAAAICDMLAAAICDQLAAAICDULAAAICDYLAAAICDcLAAAICDgLAAAICDkLAAAICDoLAAAICDsLAAAICDwLAAAICD0LAAAICD4LAAAICD8LAAAICEALAAAICEELAAAICEILAAAICEMLAAAICEQLAAAICEULAAAICEYLAAAICEcLAAAICEgLAAAICEkLAAAICEoLAAAICEsLAAAICEwLAAAICE0LAAAICE4LAAAICE8LAAAICFALAAAICFELAAAICFILAAAICFMLAAAICFQLAAAICFULAAAICFYLAAAICFcLAAAICFgLAAAICFkLAAAICFoLAAAICFsLAAAICFwLAAAICF0LAAAICF4LAAAICF8LAAAICGALAAAICGELAAAICGILAAAICGMLAAAICGQLAAAICGULAAAICGYLAAAICGcLAAAICGgLAAAICGkLAAAICGoLAAAICGsLAAAICGwLAAAICG0LAAAICG4LAAAICG8LAAAICHALAAAICHELAAAICHILAAAICHMLAAAICHQLAAAICHULAAAICHYLAAAICHcLAAAICHgLAAAICHkLAAAICHoLAAAICHsLAAAICHwLAAAICH0LAAAICH4LAAAICH8LAAAICIALAAAICIELAAAICIILAAAICIMLAAAICIQLAAAICIULAAAICIYLAAAICIcLAAAICIgLAAAICIkLAAAICIoLAAAICIsLAAAICIwLAAAICI0LAAAICI4LAAAICI8LAAAICJALAAAICJELAAAICJILAAAICJMLAAAICJQLAAAICJULAAAICJYLAAAICJcLAAAICJgLAAAICJkLAAAICJoLAAAICJsLAAAICJwLAAAICJ0LAAAICJ4LAAAICJ8LAAAICKALAAAICKELAAAICKILAAAICKMLAAAICKQLAAAICKULAAAICKYLAAAICKcLAAAICKgLAAAICKkLAAAICKoLAAAICKsLAAAICKwLAAAICK0LAAAICK4LAAAICK8LAAAICLALAAAICLELAAAICLILAAAICLMLAAAICLQLAAAICLULAAAICLYLAAAICLcLAAAICLgLAAAICLkLAAAICLoLAAAICLsLAAAICLwLAAAICL0LAAAICL4LAAAICL8LAAAICMALAAAICMELAAAICMILAAAICMMLAAAICMQLAAAICMULAAAICMYLAAAICMcLAAAICMgLAAAICMkLAAAICMoLAAAICMsLAAAICMwLAAAICM0LAAAICM4LAAAICM8LAAAICNALAAAICNELAAAICNILAAAICNMLAAAICNQLAAAICNULAAAICNYLAAAICNcLAAAICNgLAAAICNkLAAAICNoLAAAICNsLAAAICNwLAAAICN0LAAAICN4LAAAICN8LAAAICOALAAAICOELAAAICOILAAAICOMLAAAICOQLAAAICOULAAAICOYLAAAICOcLAAAICOgLAAAICOkLAAAICOoLAAAICOsLAAAICOwLAAAICO0LAAAICO4LAAAICO8LAAAICPALAAAICPELAAAICPILAAAICPMLAAAICPQLAAAICPULAAAICPYLAAAICPcLAAAICPgLAAAICPkLAAAICPoLAAAICPsLAAAICPwLAAAICP0LAAAICP4LAAAICP8LAAAICAAMAAAICAEMAAAICAIMAAAICAMMAAAICAQMAAAICAUMAAAICAYMAAAICAcMAAAICAgMAAAICAkMAAAICAoMAAAICAsMAAAICAwMAAAICA0MAAAICA4MAAAICA8MAAAICBAMAAAICBEMAAAICBIMAAAICBMMAAAICBQMAAAICBUMAAAICBYMAAAICBcMAAAICBgMAAAICBkMAAAICBoMAAAICBsMAAAICBwMAAAICB0MAAAICB4MAAAICB8MAAAICCAMAAAICCEMAAAICCIMAAAICCMMAAAICCQMAAAICCUMAAAICCYMAAAICCcMAAAICCgMAAAICCkMAAAICCoMAAAICCsMAAAICCwMAAAICC0MAAAICC4MAAAICC8MAAAICDAMAAAICDEMAAAICDIMAAAICDMMAAAICDQMAAAICDUMAAAICDYMAAAICDcMAAAICDgMAAAICDkMAAAICDoMAAAICDsMAAAICDwMAAAICD0MAAAICD4MAAAICD8MAAAICEAMAAAICEEMAAAICEIMAAAICEMMAAAICEQMAAAICEUMAAAICEYMAAAICEcMAAAICEgMAAAICEkMAAAICEoMAAAICEsMAAAICEwMAAAICE0MAAAICE4MAAAICE8MAAAICFAMAAAICFEMAAAICFIMAAAICFMMAAAICFQMAAAICFUMAAAICFYMAAAICFcMAAAICFgMAAAICFkMAAAICFoMAAAICFsMAAAICFwMAAAICF0MAAAICF4MAAAICF8MAAAICGAMAAAICGEMAAAICGIMAAAICGMMAAAICGQMAAAICGUMAAAICGYMAAAICGcMAAAICGgMAAAICGkMAAAICGoMAAAICGsMAAAICGwMAAAICG0MAAAICG4MAAAICG8MAAAICHAMAAAICHEMAAAICHIMAAAICHMMAAAICHQMAAAICHUMAAAICHYMAAAICHcMAAAICHgMAAAICHkMAAAICHoMAAAICHsMAAAICHwMAAAICH0MAAAICH4MAAAICH8MAAAICIAMAAAICIEMAAAICIIMAAAICIMMAAAICIQMAAAICIUMAAAICIYMAAAICIcMAAAICIgMAAAICIkMAAAICIoMAAAICIsMAAAICIwMAAAICI0MAAAICI4MAAAICI8MAAAICJAMAAAICJEMAAAICJIMAAAICJMMAAAICJQMAAAICJUMAAAICJYMAAAICJcMAAAICJgMAAAICJkMAAAICJoMAAAICJsMAAAICJwMAAAICJ0MAAAICJ4MAAAICJ8MAAAICKAMAAAICKEMAAAICKIMAAAICKMMAAAICKQMAAAICKUMAAAICKYMAAAICKcMAAAICKgMAAAICKkMAAAICKoMAAAICKsMAAAICKwMAAAICK0MAAAICK4MAAAICK8MAAAICLAMAAAICLEMAAAICLIMAAAICLMMAAAICLQMAAAICLUMAAAICLYMAAAICLcMAAAICLgMAAAICLkMAAAICLoMAAAICLsMAAAICLwMAAAICL0MAAAICL4MAAAICL8MAAAICMAMAAAICMEMAAAICMIMAAAICMMMAAAICMQMAAAICMUMAAAICMYMAAAICMcMAAAICMgMAAAICMkMAAAICMoMAAAICMsMAAAICMwMAAAICM0MAAAICM4MAAAICM8MAAAICNAMAAAICNEMAAAICNIMAAAICNMMAAAICNQMAAAICNUMAAAICNYMAAAICNcMAAAICNgMAAAICNkMAAAICNoMAAAICNsMAAAICNwMAAAICN0MAAAICN4MAAAICN8MAAAICOAMAAAICOEMAAAICOIMAAAICOMMAAAICOQMAAAICOUMAAAICOYMAAAICOcMAAAICOgMAAAICOkMAAAICOoMAAAICOsMAAAICOwMAAAICO0MAAAICO4MAAAICO8MAAAICPAMAAAICPEMAAAICPIMAAAICPMMAAAICPQMAAAICPUMAAAICPYMAAAICPcMAAAICPgMAAAICPkMAAAICPoMAAAICPsMAAAICPwMAAAICP0MAAAICP4MAAAICP8MAAAICAANAAAICAENAAAICAINAAAICAMNAAAICAQNAAAICAUNAAAICAYNAAAICAcNAAAICAgNAAAICAkNAAAICAoNAAAICAsNAAAICAwNAAAICA0NAAAICA4NAAAICA8NAAAICBANAAAICBENAAAICBINAAAICBMNAAAICBQNAAAICBUNAAAICBYNAAAICBcNAAAICBgNAAAICBkNAAAICBoNAAAICBsNAAAICBwNAAAICB0NAAAICB4NAAAICB8NAAAICCANAAAICCENAAAICCINAAAICCMNAAAICCQNAAAICCUNAAAICCYNAAAICCcNAAAICCgNAAAICCkNAAAICCoNAAAICCsNAAAICCwNAAAICC0NAAAICC4NAAAICC8NAAAICDANAAAICDENAAAICDINAAAICDMNAAAICDQNAAAICDUNAAAICDYNAAAICDcNAAAICDgNAAAICDkNAAAICDoNAAAICDsNAAAICDwNAAAICD0NAAAICD4NAAAICD8NAAAICEANAAAICEENAAAICEINAAAICEMNAAAICEQNAAAICEUNAAAICEYNAAAICEcNAAAICEgNAAAICEkNAAAICEoNAAAICEsNAAAICEwNAAAICE0NAAAICE4NAAAICE8NAAAICFANAAAICFENAAAICFINAAAICFMNAAAICFQNAAAICFUNAAAICFYNAAAICFcNAAAICFgNAAAICFkNAAAICFoNAAAICFsNAAAICFwNAAAICF0NAAAICF4NAAAICF8NAAAICGANAAAICGENAAAICGINAAAICGMNAAAICGQNAAAICGUNAAAICGYNAAAICGcNAAAICGgNAAAICGkNAAAICGoNAAAICGsNAAAICGwNAAAICG0NAAAICG4NAAAICG8NAAAICHANAAAICHENAAAICHINAAAICHMNAAAICHQNAAAICHUNAAAICHYNAAAICHcNAAAICHgNAAAICHkNAAAICHoNAAAICHsNAAAICHwNAAAICH0NAAAICH4NAAAICH8NAAAICIANAAAICIENAAAICIINAAAICIMNAAAICIQNAAAICIUNAAAICIYNAAAICIcNAAAICIgNAAAICIkNAAAICIoNAAAICIsNAAAICIwNAAAICI0NAAAICI4NAAAICI8NAAAICJANAAAICJENAAAICJINAAAICJMNAAAICJQNAAAICJUNAAAICJYNAAAICJcNAAAICJgNAAAICJkNAAAICJoNAAAICJsNAAAICJwNAAAICJ0NAAAICJ4NAAAICJ8NAAAICKANAAAICKENAAAICKINAAAICKMNAAAICKQNAAAICKUNAAAICKYNAAAICKcNAAAICKgNAAAICKkNAAAICKoNAAAICKsNAAAICKwNAAAICK0NAAAICK4NAAAICK8NAAAICLANAAAICLENAAAICLINAAAICLMNAAAICLQNAAAICLUNAAAICLYNAAAICLcNAAAICLgNAAAICLkNAAAICLoNAAAICLsNAAAICLwNAAAICL0NAAAICL4NAAAICL8NAAAICMANAAAICMENAAAICMINAAAICMMNAAAICMQNAAAICMUNAAAICMYNAAAICMcNAAAICMgNAAAICMkNAAAICMoNAAAICMsNAAAICMwNAAAICM0NAAAICM4NAAAICM8NAAAICNANAAAICNENAAAICNINAAAICNMNAAAICNQNAAAICNUNAAAICNYNAAAICNcNAAAICNgNAAAICNkNAAAICNoNAAAICNsNAAAICNwNAAAICN0NAAAICN4NAAAICN8NAAAICOANAAAICOENAAAICOINAAAICOMNAAAICOQNAAAICOUNAAAICOYNAAAICOcNAAAICOgNAAAICOkNAAAICOoNAAAICOsNAAAICOwNAAAICO0NAAAICO4NAAAICO8NAAAICPANAAAICPENAAAICPINAAAICPMNAAAICPQNAAAICPUNAAAICPYNAAAICPcNAAAICPgNAAAICPkNAAAICPoNAAAICPsNAAAICPwNAAAICP0NAAAICP4NAAAICP8NAAAICAAOAAAICAEOAAAICAIOAAAICAMOAAAICAQOAAAICAUOAAAICAYOAAAICAcOAAAICAgOAAAICAkOAAAICAoOAAAICAsOAAAICAwOAAAICA0OAAAICA4OAAAICA8OAAAICBAOAAAICBEOAAAICBIOAAAICBMOAAAICBQOAAAICBUOAAAICBYOAAAICBcOAAAICBgOAAAICBkOAAAICBoOAAAICBsOAAAICBwOAAAICB0OAAAICB4OAAAICB8OAAAICCAOAAAICCEOAAAICCIOAAAICCMOAAAICCQOAAAICCUOAAAICCYOAAAICCcOAAAICCgOAAAICCkOAAAICCoOAAAICCsOAAAICCwOAAAICC0OAAAICC4OAAAICC8OAAAICDAOAAAICDEOAAAICDIOAAAICDMOAAAICDQOAAAICDUOAAAICDYOAAAICDcOAAAICDgOAAAICDkOAAAICDoOAAAICDsOAAAICDwOAAAICD0OAAAICD4OAAAICD8OAAAICEAOAAAICEEOAAAICEIOAAAICEMOAAAICEQOAAAICEUOAAAICEYOAAAICEcOAAAICEgOAAAICEkOAAAICEoOAAAICEsOAAAICEwOAAAICE0OAAAICE4OAAAICE8OAAAICFAOAAAICFEOAAAICFIOAAAICFMOAAAICFQOAAAICFUOAAAICFYOAAAICFcOAAAICFgOAAAICFkOAAAICFoOAAAICFsOAAAICFwOAAAICF0OAAAICF4OAAAICF8OAAAICGAOAAAICGEOAAAICGIOAAAICGMOAAAICGQOAAAICGUOAAAICGYOAAAICGcOAAAICGgOAAAICGkOAAAICGoOAAAICGsOAAAICGwOAAAICG0OAAAICG4OAAAICG8OAAAICHAOAAAICHEOAAAICHIOAAAICHMOAAAICHQOAAAICHUOAAAICHYOAAAICHcOAAAICHgOAAAICHkOAAAICHoOAAAICHsOAAAICHwOAAAICH0OAAAICH4OAAAICH8OAAAICIAOAAAICIEOAAAICIIOAAAICIMOAAAICIQOAAAICIUOAAAICIYOAAAICIcOAAAICIgOAAAICIkOAAAICIoOAAAICIsOAAAICIwOAAAICI0OAAAICI4OAAAICI8OAAAICJAOAAAICJEOAAAICJIOAAAICJMOAAAICJQOAAAICJUOAAAICJYOAAAICJcOAAAICJgOAAAICJkOAAAICJoOAAAICJsOAAAICJwOAAAICJ0OAAAICJ4OAAAICJ8OAAAICKAOAAAICKEOAAAICKIOAAAICKMOAAAICKQOAAAICKUOAAAICKYOAAAICKcOAAAICKgOAAAICKkOAAAICKoOAAAICKsOAAAICKwOAAAICK0OAAAICK4OAAAICK8OAAAICLAOAAAICLEOAAAICLIOAAAICLMOAAAICLQOAAAICLUOAAAICLYOAAAICLcOAAAICLgOAAAICLkOAAAICLoOAAAICLsOAAAICLwOAAAICL0OAAAICL4OAAAICL8OAAAICMAOAAAICMEOAAAICMIOAAAICMMOAAAICMQOAAAICMUOAAAICMYOAAAICMcOAAAICMgOAAAICMkOAAAICMoOAAAICMsOAAAICMwOAAAICM0OAAAICM4OAAAICM8OAAAICNAOAAAICNEOAAAICNIOAAAICNMOAAAICNQOAAAICNUOAAAICNYOAAAICNcOAAAICNgOAAAICNkOAAAICNoOAAAICNsOAAAICNwOAAAICN0OAAAICN4OAAAICN8OAAAICOAOAAAICOEOAAAICOIOAAAICOMOAAAICOQOAAAICOUOAAAICOYOAAAICOcOAAAICOgOAAAICOkOAAAICOoOAAAICOsOAAAICOwOAAAICO0OAAAICO4OAAAICO8OAAAICPAOAAAICPEOAAAICPIOAAAICPMOAAAICPQOAAAICPUOAAAICPYOAAAICPcOAAAICPgOAAAICPkOAAAICPoOAAAICPsOAAAICPwOAAAICP0OAAAICP4OAAAICP8OAAAICAAPAAAICAEPAAAICAIPAAAICAMPAAAICAQPAAAICAUPAAAICAYPAAAICAcPAAAICAgPAAAICAkPAAAICAoPAAAICAsPAAAICAwPAAAICA0PAAAICA4PAAAICA8PAAAICBAPAAAICBEPAAAICBIPAAAICBMPAAAICBQPAAAICBUPAAAICBYPAAAICBcPAAAICBgPAAAICBkPAAAICBoPAAAICBsPAAAICBwPAAAICB0PAAAICB4PAAAICB8PAAAICCAPAAAICCEPAAAICCIPAAAICCMPAAAICCQPAAAICCUPAAAICCYPAAAICCcPAAAICCgPAAAICCkPAAAICCoPAAAICCsPAAAICCwPAAAICC0PAAAICC4PAAAICC8PAAAICDAPAAAICDEPAAAICDIPAAAICDMPAAAICDQPAAAICDUPAAAICDYPAAAICDcPAAAICDgPAAAICDkPAAAICDoPAAAICDsPAAAICDwPAAAICD0PAAAICD4PAAAICD8PAAAICEAPAAAICEEPAAAICEIPAAAICEMPAAAICEQPAAAICEUPAAAICEYPAAAICEcPAAAICEgPAAAICEkPAAAICEoPAAAICEsPAAAICEwPAAAICE0PAAAICE4PAAAICE8PAAAICFAPAAAICFEPAAAICFIPAAAICFMPAAAICFQPAAAICFUPAAAICFYPAAAICFcPAAAICFgPAAAICFkPAAAICFoPAAAICFsPAAAICFwPAAAICF0PAAAICF4PAAAICF8PAAAICGAPAAAICGEPAAAICGIPAAAICGMPAAAICGQPAAAICGUPAAAICGYPAAAICGcPAAAICGgPAAAICGkPAAAICGoPAAAICGsPAAAICGwPAAAICG0PAAAICG4PAAAICG8PAAAICHAPAAAICHEPAAAICHIPAAAICHMPAAAICHQPAAAICHUPAAAICHYPAAAICHcPAAAICHgPAAAICHkPAAAICHoPAAAICHsPAAAICHwPAAAICH0PAAAICH4PAAAICH8PAAAICIAPAAAICIEPAAAICIIPAAAICIMPAAAICIQPAAAICIUPAAAICIYPAAAICIcPAAAICIgPAAAICIkPAAAICIoPAAAICIsPAAAICIwPAAAICI0PAAAICI4PAAAICI8PAAAICJAPAAAICJEPAAAICJIPAAAICJMPAAAICJQPAAAICJUPAAAICJYPAAAICJcPAAAICJgPAAAICJkPAAAICJoPAAAICJsPAAAICJwPAAAICJ0PAAAICJ4PAAAICJ8PAAAICKAPAAAICKEPAAAICKIPAAAICKMPAAAICKQPAAAICKUPAAAICKYPAAAICKcPAAAICKgPAAAICKkPAAAICKoPAAAICKsPAAAICKwPAAAICK0PAAAICK4PAAAICK8PAAAICLAPAAAICLEPAAAICLIPAAAICLMPAAAICLQPAAAICLUPAAAICLYPAAAICLcPAAAICLgPAAAICLkPAAAICLoPAAAICLsPAAAICLwPAAAICL0PAAAICL4PAAAICL8PAAAICMAPAAAICMEPAAAICMIPAAAICMMPAAAICMQPAAAICMUPAAAICMYPAAAICMcPAAAICMgPAAAICMkPAAAICMoPAAAICMsPAAAICMwPAAAICM0PAAAICM4PAAAICM8PAAAICNAPAAAICNEPAAAICNIPAAAICNMPAAAICNQPAAAICNUPAAAICNYPAAAICNcPAAAICNgPAAAICNkPAAAICNoPAAAICNsPAAAICNwPAAAICN0PAAAICN4PAAAICN8PAAAICOAPAAAICOEPAAAICOIPAAAICOMPAAAICOQPAAAICOUPAAAICOYPAAAICOcPAAAICOgPAAAICOkPAAAICOoPAAAICOsPAAAICOwPAAAICO0PAAAICO4PAAAICO8PAAAICPAPAAAICPEPAAAICPIPAAAICPMPAAAICPQPAAAICPUPAAAICPYPAAAICPcPAAAICPgPAAAICPkPAAAICPoPAAAICPsPAAAICPwPAAAICP0PAAAICP4PAAAICP8PAAAICAAQAAAICAEQAAAICAIQAAAICAMQAAAICAQQAAAICAUQAAAICAYQAAAICAcQAAAICAgQAAAICAkQAAAICAoQAAAICAsQAAAICAwQAAAICA0QAAAICA4QAAAICA8QAAAICBAQAAAICBEQAAAICBIQAAAICBMQAAAICBQQAAAICBUQAAAICBYQAAAICBcQAAAICBgQAAAICBkQAAAICBoQAAAICBsQAAAICBwQAAAICB0QAAAICB4QAAAICB8QAAAICCAQAAAICCEQAAAICCIQAAAICCMQAAAICCQQAAAICCUQAAAICCYQAAAICCcQAAAICCgQAAAICCkQAAAICCoQAAAICCsQAAAICCwQAAAICC0QAAAICC4QAAAICC8QAAAICDAQAAAICDEQAAAICDIQAAAICDMQAAAICDQQAAAICDUQAAAICDYQAAAICDcQAAAICDgQAAAICDkQAAAICDoQAAAICDsQAAAICDwQAAAICD0QAAAICD4QAAAICD8QAAAICEAQAAAICEEQAAAICEIQAAAICEMQAAAICEQQAAAICEUQAAAICEYQAAAICEcQAAAICEgQAAAICEkQAAAICEoQAAAICEsQAAAICEwQAAAICE0QAAAICE4QAAAICE8QAAAICFAQAAAICFEQAAAICFIQAAAICFMQAAAICFQQAAAICFUQAAAICFYQAAAICFcQAAAICFgQAAAICFkQAAAICFoQAAAICFsQAAAICFwQAAAICF0QAAAICF4QAAAICF8QAAAICGAQAAAICGEQAAAICGIQAAAICGMQAAAICGQQAAAICGUQAAAICGYQAAAICGcQAAAICGgQAAAICGkQAAAICGoQAAAICGsQAAAICGwQAAAICG0QAAAICG4QAAAICG8QAAAICHAQAAAICHEQAAAICHIQAAAICHMQAAAICHQQAAAICHUQAAAICHYQAAAICHcQAAAICHgQAAAICHkQAAAICHoQAAAICHsQAAAICHwQAAAICH0QAAAICH4QAAAICH8QAAAICIAQAAAICIEQAAAICIIQAAAICIMQAAAICIQQAAAICIUQAAAICIYQAAAICIcQAAAICIgQAAAICIkQAAAICIoQAAAICIsQAAAICIwQAAAICI0QAAAICI4QAAAICI8QAAAICJAQAAAICJEQAAAICJIQAAAICJMQAAAICJQQAAAICJUQAAAICJYQAAAICJcQAAAICJgQAAAICJkQAAAICJoQAAAICJsQAAAICJwQAAAICJ0QAAAICJ4QAAAICJ8QAAAICKAQAAAICKEQAAAICKIQAAAICKMQAAAICKQQAAAICKUQAAAICKYQAAAICKcQAAAICKgQAAAICKkQAAAICKoQAAAICKsQAAAICKwQAAAICK0QAAAICK4QAAAICK8QAAAICLAQAAAICLEQAAAICLIQAAAICLMQAAAICLQQAAAICLUQAAAICLYQAAAICLcQAAAICLgQAAAICLkQAAAICLoQAAAICLsQAAAICLwQAAAICL0QAAAICL4QAAAICL8QAAAICMAQAAAICMEQAAAICMIQAAAICMMQAAAICMQQAAAICMUQAAAICMYQAAAICMcQAAAICMgQAAAICMkQAAAICMoQAAAICMsQAAAICMwQAAAICM0QAAAICM4QAAAICM8QAAAICNAQAAAICNEQAAAICNIQAAAICNMQAAAICNQQAAAICNUQAAAICNYQAAAICNcQAAAICNgQAAAICNkQAAAICNoQAAAICNsQAAAICNwQAAAICN0QAAAICN4QAAAICN8QAAAICOAQAAAICOEQAAAICOIQAAAICOMQAAAICOQQAAAICOUQAAAICOYQAAAICOcQAAAICOgQAAAICOkQAAAICOoQAAAICOsQAAAICOwQAAAICO0QAAAICO4QAAAICO8QAAAICPAQAAAICPEQAAAICPIQAAAICPMQAAAICPQQAAAICPUQAAAICPYQAAAICPcQAAAICPgQAAAICPkQAAAICPoQAAAICPsQAAAICPwQAAAICP0QAAAICP4QAAAICP8QAAAICAARAAAICAERAAAICAIRAAAICAMRAAAICAQRAAAICAURAAAICAYRAAAICAcRAAAICAgRAAAICAkRAAAICAoRAAAICAsRAAAICAwRAAAICA0RAAAICA4RAAAICA8RAAAICBARAAAICBERAAAICBIRAAAICBMRAAAICBQRAAAICBURAAAICBYRAAAICBcRAAAICBgRAAAICBkRAAAICBoRAAAICBsRAAAICBwRAAAICB0RAAAICB4RAAAICB8RAAAICCARAAAICCERAAAICCIRAAAICCMRAAAICCQRAAAICCURAAAICCYRAAAICCcRAAAICCgRAAAICCkRAAAICCoRAAAICCsRAAAICCwRAAAICC0RAAAICC4RAAAICC8RAAAICDARAAAICDERAAAICDIRAAAICDMRAAAICDQRAAAICDURAAAICDYRAAAICDcRAAAICDgRAAAICDkRAAAICDoRAAAICDsRAAAICDwRAAAICD0RAAAICD4RAAAICD8RAAAICEARAAAICEERAAAICEIRAAAICEMRAAAICEQRAAAICEURAAAICEYRAAAICEcRAAAICEgRAAAICEkRAAAICEoRAAAICEsRAAAICEwRAAAICE0RAAAICE4RAAAICE8RAAAICFARAAAICFERAAAICFIRAAAICFMRAAAICFQRAAAICFURAAAICFYRAAAICFcRAAAICFgRAAAICFkRAAAICFoRAAAICFsRAAAICFwRAAAICF0RAAAICF4RAAAICF8RAAAICGARAAAICGERAAAICGIRAAAICGMRAAAICGQRAAAICGURAAAICGYRAAAICGcRAAAICGgRAAAICGkRAAAICGoRAAAICGsRAAAICGwRAAAICG0RAAAICG4RAAAICG8RAAAICHARAAAICHERAAAICHIRAAAICHMRAAAICHQRAAAICHURAAAICHYRAAAICHcRAAAICHgRAAAICHkRAAAICHoRAAAICHsRAAAICHwRAAAICH0RAAAICH4RAAAICH8RAAAICIARAAAICIERAAAICIIRAAAICIMRAAAICIQRAAAICIURAAAICIYRAAAICIcRAAAICIgRAAAICIkRAAAICIoRAAAICIsRAAAICIwRAAAICI0RAAAICI4RAAAICI8RAAAICJARAAAICJERAAAICJIRAAAICJMRAAAICJQRAAAICJURAAAICJYRAAAICJcRAAAICJgRAAAICJkRAAAICJoRAAAICJsRAAAICJwRAAAICJ0RAAAICJ4RAAAICJ8RAAAICKARAAAICKERAAAICKIRAAAICKMRAAAICKQRAAAICKURAAAICKYRAAAICKcRAAAICKgRAAAICKkRAAAICKoRAAAICKsRAAAICKwRAAAICK0RAAAICK4RAAAICK8RAAAICLARAAAICLERAAAICLIRAAAICLMRAAAICLQRAAAICLURAAAICLYRAAAICLcRAAAICLgRAAAICLkRAAAICLoRAAAICLsRAAAICLwRAAAICL0RAAAICL4RAAAICL8RAAAICMARAAAICMERAAAICMIRAAAICMMRAAAICMQRAAAICMURAAAICMYRAAAICMcRAAAICMgRAAAICMkRAAAICMoRAAAICMsRAAAICMwRAAAICM0RAAAICM4RAAAICM8RAAAICNARAAAICNERAAAICNIRAAAICNMRAAAICNQRAAAICNURAAAICNYRAAAICNcRAAAICNgRAAAICNkRAAAICNoRAAAICNsRAAAICNwRAAAICN0RAAAICN4RAAAICN8RAAAICOARAAAICOERAAAICOIRAAAICOMRAAAICOQRAAAICOURAAAICOYRAAAICOcRAAAICOgRAAAICOkRAAAICOoRAAAICOsRAAAICOwRAAAICO0RAAAICO4RAAAICO8RAAAICPARAAAICPERAAAICPIRAAAICPMRAAAICPQRAAAICPURAAAICPYRAAAICPcRAAAICPgRAAAICPkRAAAICPoRAAAICPsRAAAICPwRAAAICP0RAAAICP4RAAAICP8RAAAICAASAAAICAESAAAICAISAAAICAMSAAAICAQSAAAICAUSAAAICAYSAAAICAcSAAAICAgSAAAICAkSAAAICAoSAAAICAsSAAAICAwSAAAICA0SAAAICA4SAAAICA8SAAAICBASAAAICBESAAAICBISAAAICBMSAAAICBQSAAAICBUSAAAICBYSAAAICBcSAAAICBgSAAAICBkSAAAICBoSAAAICBsSAAAICBwSAAAICB0SAAAICB4SAAAICB8SAAAICCASAAAICCESAAAICCISAAAICCMSAAAICCQSAAAICCUSAAAICCYSAAAICCcSAAAICCgSAAAICCkSAAAICCoSAAAICCsSAAAICCwSAAAICC0SAAAICC4SAAAICC8SAAAICDASAAAICDESAAAICDISAAAICDMSAAAICDQSAAAICDUSAAAICDYSAAAICDcSAAAICDgSAAAICDkSAAAICDoSAAAICDsSAAAICDwSAAAICD0SAAAICD4SAAAICD8SAAAICEASAAAICEESAAAICEISAAAICEMSAAAICEQSAAAICEUSAAAICEYSAAAICEcSAAAICEgSAAAICEkSAAAICEoSAAAICEsSAAAICEwSAAAICE0SAAAICE4SAAAICE8SAAAICFASAAAICFESAAAICFISAAAICFMSAAAICFQSAAAICFUSAAAICFYSAAAICFcSAAAICFgSAAAICFkSAAAICFoSAAAICFsSAAAICFwSAAAICF0SAAAICF4SAAAICF8SAAAICGASAAAICGESAAAICGISAAAICGMSAAAICGQSAAAICGUSAAAICGYSAAAICGcSAAAICGgSAAAICGkSAAAICGoSAAAICGsSAAAICGwSAAAICG0SAAAICG4SAAAICG8SAAAICHASAAAICHESAAAICHISAAAICHMSAAAICHQSAAAICHUSAAAICHYSAAAICHcSAAAICHgSAAAICHkSAAAICHoSAAAICHsSAAAICHwSAAAICH0SAAAICH4SAAAICH8SAAAICIASAAAICIESAAAICIISAAAICIMSAAAICIQSAAAICIUSAAAICIYSAAAICIcSAAAICIgSAAAICIkSAAAICIoSAAAICIsSAAAICIwSAAAICI0SAAAICI4SAAAICI8SAAAICJASAAAICJESAAAICJISAAAICJMSAAAICJQSAAAICJUSAAAICJYSAAAICJcSAAAICJgSAAAICJkSAAAICJoSAAAICJsSAAAICJwSAAAICJ0SAAAICJ4SAAAICJ8SAAAICKASAAAICKESAAAICKISAAAICKMSAAAICKQSAAAICKUSAAAICKYSAAAICKcSAAAICKgSAAAICKkSAAAICKoSAAAICKsSAAAICKwSAAAICK0SAAAICK4SAAAICK8SAAAICLASAAAICLESAAAICLISAAAICLMSAAAICLQSAAAICLUSAAAICLYSAAAICLcSAAAICLgSAAAICLkSAAAICLoSAAAICLsSAAAICLwSAAAICL0SAAAICL4SAAAICL8SAAAICMASAAAICMESAAAICMISAAAICMMSAAAICMQSAAAICMUSAAAICMYSAAAICMcSAAAICMgSAAAICMkSAAAICMoSAAAICMsSAAAICMwSAAAICM0SAAAICM4SAAAICM8SAAAICNASAAAICNESAAAICNISAAAICNMSAAAICNQSAAAICNUSAAAICNYSAAAICNcSAAAICNgSAAAICNkSAAAICNoSAAAICNsSAAAICNwSAAAICN0SAAAICN4SAAAICN8SAAAICOASAAAICOESAAAICOISAAAICOMSAAAICOQSAAAICOUSAAAICOYSAAAICOcSAAAICOgSAAAICOkSAAAICOoSAAAICOsSAAAICOwSAAAICO0SAAAICO4SAAAICO8SAAAICPASAAAICPESAAAICPISAAAICPMSAAAICPQSAAAICPUSAAAICPYSAAAICPcSAAAICPgSAAAICPkSAAAICPoSAAAICPsSAAAICPwSAAAICP0SAAAICP4SAAAICP8SAAAICAATAAAICAETAAAICAITAAAICAMTAAAICAQTAAAICAUTAAAICAYTAAAICAcTAAAICAgTAAAICAkTAAAICAoTAAAICAsTAAAICAwTAAAICA0TAAAICA4TAAAICA8TAAAICBATAAAICBETAAAICBITAAAICBMTAAAICBQTAAAICBUTAAAICBYTAAAICBcTAAAICBgTAAAICBkTAAAICBoTAAAICBsTAAAICBwTAAAICB0TAAAICB4TAAAICB8TAAAICCATAAAICCETAAAICCITAAAICCMTAAAICCQTAAAICCUTAAAICCYTAAAICCcTAAAICCgTAAAICCkTAAAICCoTAAAICCsTAAAICCwTAAAICC0TAAAICC4TAAAICC8TAAAICDATAAAICDETAAAICDITAAAICDMTAAAICDQTAAAICDUTAAAICDYTAAAICDcTAAAICDgTAAAICDkTAAAICDoTAAAICDsTAAAICDwTAAAICD0TAAAICD4TAAAICD8TAAAICEATAAAICEETAAAICEITAAAICEMTAAAICEQTAAAICEUTAAAICEYTAAAICEcTAAAICEgTAAAICEkTAAAICEoTAAAICEsTAAAICEwTAAAICE0TAAAICE4TAAAICE8TAAAICFATAAAICFETAAAICFITAAAICFMTAAAICFQTAAAICFUTAAAICFYTAAAICFcTAAAICFgTAAAICFkTAAAICFoTAAAICFsTAAAICFwTAAAICF0TAAAICF4TAAAICF8TAAAICGATAAAICGETAAAICGITAAAICGMTAAAICGQTAAAICGUTAAAICGYTAAAICGcTAAAICGgTAAAICGkTAAAICGoTAAAICGsTAAAICGwTAAAICG0TAAAICG4TAAAICG8TAAAICHATAAAICHETAAAICHITAAAICHMTAAAICHQTAAAICHUTAAAICHYTAAAICHcTAAAICHgTAAAICHkTAAAICHoTAAAICHsTAAAICHwTAAAICH0TAAAICH4TAAAICH8TAAAICIATAAAICIETAAAICIITAAAICIMTAAAICIQTAAAICIUTAAAICIYTAAAICIcTAAAICIgTAAAICIkTAAAICIoTAAAICIsTAAAICIwTAAAICI0TAAAICI4TAAAICI8TAAAICJATAAAICJETAAAICJITAAAICJMTAAAICJQTAAAICJUTAAAICJYTAAAICJcTAAAICJgTAAAICJkTAAAICJoTAAAICJsTAAAICJwTAAAICJ0TAAAICJ4TAAAICJ8TAAAICKATAAAICKETAAAICKITAAAICKMTAAAICKQTAAAICKUTAAAICKYTAAAICKcTAAAICKgTAAAICKkTAAAICKoTAAAICKsTAAAICKwTAAAICK0TAAAICK4TAAAICK8TAAAICLATAAAICLETAAAICLITAAAICLMTAAAICLQTAAAICLUTAAAICLYTAAAICLcTAAAICLgTAAAICLkTAAAICLoTAAAICLsTAAAICLwTAAAICL0TAAAICL4TAAAICL8TAAAICMATAAAICMETAAAICMITAAAICMMTAAAICMQTAAAICMUTAAAICMYTAAAICMcTAAAICMgTAAAICMkTAAAICMoTAAAICMsTAAAICMwTAAAICM0TAAAICM4TAAAICM8TAAAICNATAAAICNETAAAICNITAAAICNMTAAAICNQTAAAICNUTAAAICNYTAAAICNcTAAAICNgTAAAICNkTAAAICNoTAAAICNsTAAAICNwTAAAICN0TAAAICN4TAAAICN8TAAAICOATAAAICOETAAAICOITAAAICOMTAAAICOQTAAAICOUTAAAICOYTAAAICOcTAAAICOgTAAAICOkTAAAICOoTAAAICOsTAAAICOwTAAAICO0TAAAICO4TAAAICO8TAAAICPATAAAICPETAAAICPITAAAICPMTAAAICPQTAAAICPUTAAAICPYTAAAICPcTAAAICPgTAAAICPkTAAAICPoTAAAICPsTAAAICPwTAAAICP0TAAAICP4TAAAICP8TAAAICAAUAAAICAEUAAAICAIUAAAICAMUAAAICAQUAAAICAUUAAAICAYUAAAICAcUAAAICAgUAAAICAkUAAAICAoUAAAICAsUAAAICAwUAAAICA0UAAAICA4UAAAICA8UAAAICBAUAAAICBEUAAAICBIUAAAICBMUAAAICBQUAAAICBUUAAAICBYUAAAICBcUAAAICBgUAAAICBkUAAAICBoUAAAICBsUAAAICBwUAAAICB0UAAAICB4UAAAICB8UAAAICCAUAAAICCEUAAAICCIUAAAICCMUAAAICCQUAAAICCUUAAAICCYUAAAICCcUAAAICCgUAAAICCkUAAAICCoUAAAICCsUAAAICCwUAAAICC0UAAAICC4UAAAICC8UAAAICDAUAAAICDEUAAAICDIUAAAICDMUAAAICDQUAAAICDUUAAAICDYUAAAICDcUAAAICDgUAAAICDkUAAAICDoUAAAICDsUAAAICDwUAAAICD0UAAAICD4UAAAICD8UAAAICEAUAAAICEEUAAAICEIUAAAICEMUAAAICEQUAAAICEUUAAAICEYUAAAICEcUAAAICEgUAAAICEkUAAAICEoUAAAICEsUAAAICEwUAAAICE0UAAAICE4UAAAICE8UAAAICFAUAAAICFEUAAAICFIUAAAICFMUAAAICFQUAAAICFUUAAAICFYUAAAICFcUAAAICFgUAAAICFkUAAAICFoUAAAICFsUAAAICFwUAAAICF0UAAAICF4UAAAICF8UAAAICGAUAAAICGEUAAAICGIUAAAICGMUAAAICGQUAAAICGUUAAAICGYUAAAICGcUAAAICGgUAAAICGkUAAAICGoUAAAICGsUAAAICGwUAAAICG0UAAAICG4UAAAICG8UAAAICHAUAAAICHEUAAAICHIUAAAICHMUAAAICHQUAAAICHUUAAAICHYUAAAICHcUAAAICHgUAAAICHkUAAAICHoUAAAICHsUAAAICHwUAAAICH0UAAAICH4UAAAICH8UAAAICIAUAAAICIEUAAAICIIUAAAICIMUAAAICIQUAAAICIUUAAAICIYUAAAICIcUAAAICIgUAAAICIkUAAAICIoUAAAICIsUAAAICIwUAAAICI0UAAAICI4UAAAICI8UAAAICJAUAAAICJEUAAAICJIUAAAICJMUAAAICJQUAAAICJUUAAAICJYUAAAICJcUAAAICJgUAAAICJkUAAAICJoUAAAICJsUAAAICJwUAAAICJ0UAAAICJ4UAAAICJ8UAAAICKAUAAAICKEUAAAICKIUAAAICKMUAAAICKQUAAAICKUUAAAICKYUAAAICKcUAAAICKgUAAAICKkUAAAICKoUAAAICKsUAAAICKwUAAAICK0UAAAICK4UAAAICK8UAAAICLAUAAAICLEUAAAICLIUAAAICLMUAAAICLQUAAAICLUUAAAICLYUAAAICLcUAAAICLgUAAAICLkUAAAICLoUAAAICLsUAAAICLwUAAAICL0UAAAICL4UAAAICL8UAAAICMAUAAAICMEUAAAICMIUAAAICMMUAAAICMQUAAAICMUUAAAICMYUAAAICMcUAAAICMgUAAAICMkUAAAICMoUAAAICMsUAAAICMwUAAAICM0UAAAICM4UAAAICM8UAAAICNAUAAAICNEUAAAICNIUAAAICNMUAAAICNQUAAAICNUUAAAICNYUAAAICNcUAAAICNgUAAAICNkUAAAICNoUAAAICNsUAAAICNwUAAAICN0UAAAICN4UAAAICN8UAAAICOAUAAAICOEUAAAICOIUAAAICOMUAAAICOQUAAAICOUUAAAICOYUAAAICOcUAAAICOgUAAAICOkUAAAICOoUAAAICOsUAAAICOwUAAAICO0UAAAICO4UAAAICO8UAAAICPAUAAAICPEUAAAICPIUAAAICPMUAAAICPQUAAAICPUUAAAICPYUAAAICPcUAAAICPgUAAAICPkUAAAICPoUAAAICPsUAAAICPwUAAAICP0UAAAICP4UAAAICP8UAAAICAAVAAAICAEVAAAICAIVAAAICAMVAAAICAQVAAAICAUVAAAICAYVAAAICAcVAAAICAgVAAAICAkVAAAICAoVAAAICAsVAAAICAwVAAAICA0VAAAICA4VAAAICA8VAAAICBAVAAAICBEVAAAICBIVAAAICBMVAAAICBQVAAAICBUVAAAICBYVAAAICBcVAAAICBgVAAAICBkVAAAICBoVAAAICBsVAAAICBwVAAAICB0VAAAICB4VAAAICB8VAAAICCAVAAAICCEVAAAICCIVAAAICCMVAAAICCQVAAAICCUVAAAICCYVAAAICCcVAAAICCgVAAAICCkVAAAICCoVAAAICCsVAAAICCwVAAAICC0VAAAICC4VAAAICC8VAAAICDAVAAAICDEVAAAICDIVAAAICDMVAAAICDQVAAAICDUVAAAICDYVAAAICDcVAAAICDgVAAAICDkVAAAICDoVAAAICDsVAAAICDwVAAAICD0VAAAICD4VAAAICD8VAAAICEAVAAAICEEVAAAICEIVAAAICEMVAAAICEQVAAAICEUVAAAICEYVAAAICEcVAAAICEgVAAAICEkVAAAICEoVAAAICEsVAAAICEwVAAAICE0VAAAICE4VAAAICE8VAAAICFAVAAAICFEVAAAICFIVAAAICFMVAAAICFQVAAAICFUVAAAICFYVAAAICFcVAAAICFgVAAAICFkVAAAICFoVAAAICFsVAAAICFwVAAAICF0VAAAICF4VAAAICF8VAAAICGAVAAAICGEVAAAICGIVAAAICGMVAAAICGQVAAAICGUVAAAICGYVAAAICGcVAAAICGgVAAAICGkVAAAICGoVAAAICGsVAAAICGwVAAAICG0VAAAICG4VAAAICG8VAAAICHAVAAAICHEVAAAICHIVAAAICHMVAAAICHQVAAAICHUVAAAICHYVAAAICHcVAAAICHgVAAAICHkVAAAICHoVAAAICHsVAAAICHwVAAAICH0VAAAICH4VAAAICH8VAAAICIAVAAAICIEVAAAICIIVAAAICIMVAAAICIQVAAAICIUVAAAICIYVAAAICIcVAAAICIgVAAAICIkVAAAICIoVAAAICIsVAAAICIwVAAAICI0VAAAICI4VAAAICI8VAAAICJAVAAAICJEVAAAICJIVAAAICJMVAAAICJQVAAAICJUVAAAICJYVAAAICJcVAAAICJgVAAAICJkVAAAICJoVAAAICJsVAAAICJwVAAAICJ0VAAAICJ4VAAAICJ8VAAAICKAVAAAICKEVAAAICKIVAAAICKMVAAAICKQVAAAICKUVAAAICKYVAAAICKcVAAAICKgVAAAICKkVAAAICKoVAAAICKsVAAAICKwVAAAICK0VAAAICK4VAAAICK8VAAAICLAVAAAICLEVAAAICLIVAAAICLMVAAAICLQVAAAICLUVAAAICLYVAAAICLcVAAAICLgVAAAICLkVAAAICLoVAAAICLsVAAAICLwVAAAICL0VAAAICL4VAAAICL8VAAAICMAVAAAICMEVAAAICMIVAAAICMMVAAAICMQVAAAICMUVAAAICMYVAAAICMcVAAAICMgVAAAICMkVAAAICMoVAAAICMsVAAAICMwVAAAICM0VAAAICM4VAAAICM8VAAAICNAVAAAICNEVAAAICNIVAAAICNMVAAAICNQVAAAICNUVAAAICNYVAAAICNcVAAAICNgVAAAICNkVAAAICNoVAAAICNsVAAAICNwVAAAICN0VAAAICN4VAAAICN8VAAAICOAVAAAICOEVAAAICOIVAAAICOMVAAAICOQVAAAICOUVAAAICOYVAAAICOcVAAAICOgVAAAICOkVAAAICOoVAAAICOsVAAAICOwVAAAICO0VAAAICO4VAAAICO8VAAAICPAVAAAICPEVAAAICPIVAAAICPMVAAAICPQVAAAICPUVAAAICPYVAAAICPcVAAAICPgVAAAICPkVAAAICPoVAAAICPsVAAAICPwVAAAICP0VAAAICP4VAAAICP8VAAAICAAWAAAICAEWAAAICAIWAAAICAMWAAAICAQWAAAICAUWAAAICAYWAAAICAcWAAAICAgWAAAICAkWAAAICAoWAAAICAsWAAAICAwWAAAICA0WAAAICA4WAAAICA8WAAAICBAWAAAICBEWAAAICBIWAAAICBMWAAAICBQWAAAICBUWAAAICBYWAAAICBcWAAAICBgWAAAICBkWAAAICBoWAAAICBsWAAAICBwWAAAICB0WAAAICB4WAAAICB8WAAAICCAWAAAICCEWAAAICCIWAAAICCMWAAAICCQWAAAICCUWAAAICCYWAAAICCcWAAAICCgWAAAICCkWAAAICCoWAAAICCsWAAAICCwWAAAICC0WAAAICC4WAAAICC8WAAAICDAWAAAICDEWAAAICDIWAAAICDMWAAAICDQWAAAICDUWAAAICDYWAAAICDcWAAAICDgWAAAICDkWAAAICDoWAAAICDsWAAAICDwWAAAICD0WAAAICD4WAAAICD8WAAAICEAWAAAICEEWAAAICEIWAAAICEMWAAAICEQWAAAICEUWAAAICEYWAAAICEcWAAAICEgWAAAICEkWAAAICEoWAAAICEsWAAAICEwWAAAICE0WAAAICE4WAAAICE8WAAAICFAWAAAICFEWAAAICFIWAAAICFMWAAAICFQWAAAICFUWAAAICFYWAAAICFcWAAAICFgWAAAICFkWAAAICFoWAAAICFsWAAAICFwWAAAICF0WAAAICF4WAAAICF8WAAAICGAWAAAICGEWAAAICGIWAAAICGMWAAAICGQWAAAICGUWAAAICGYWAAAICGcWAAAICGgWAAAICGkWAAAICGoWAAAICGsWAAAICGwWAAAICG0WAAAICG4WAAAICG8WAAAICHAWAAAICHEWAAAICHIWAAAICHMWAAAICHQWAAAICHUWAAAICHYWAAAICHcWAAAICHgWAAAICHkWAAAICHoWAAAICHsWAAAICHwWAAAICH0WAAAICH4WAAAICH8WAAAICIAWAAAICIEWAAAICIIWAAAICIMWAAAICIQWAAAICIUWAAAICIYWAAAICIcWAAAICIgWAAAICIkWAAAICIoWAAAICIsWAAAICIwWAAAICI0WAAAICI4WAAAICI8WAAAICJAWAAAICJEWAAAICJIWAAAICJMWAAAICJQWAAAICJUWAAAICJYWAAAICJcWAAAICJgWAAAICJkWAAAICJoWAAAICJsWAAAICJwWAAAICJ0WAAAICJ4WAAAICJ8WAAAICKAWAAAICKEWAAAICKIWAAAICKMWAAAICKQWAAAICKUWAAAICKYWAAAICKcWAAAICKgWAAAICKkWAAAICKoWAAAICKsWAAAICKwWAAAICK0WAAAICK4WAAAICK8WAAAICLAWAAAICLEWAAAICLIWAAAICLMWAAAICLQWAAAICLUWAAAICLYWAAAICLcWAAAICLgWAAAICLkWAAAICLoWAAAICLsWAAAICLwWAAAICL0WAAAICL4WAAAICL8WAAAICMAWAAAICMEWAAAICMIWAAAICMMWAAAICMQWAAAICMUWAAAICMYWAAAICMcWAAAICMgWAAAICMkWAAAICMoWAAAICMsWAAAICMwWAAAICM0WAAAICM4WAAAICM8WAAAICNAWAAAICNEWAAAICNIWAAAICNMWAAAICNQWAAAICNUWAAAICNYWAAAICNcWAAAICNgWAAAICNkWAAAICNoWAAAICNsWAAAICNwWAAAICN0WAAAICN4WAAAICN8WAAAICOAWAAAICOEWAAAICOIWAAAICOMWAAAICOQWAAAICOUWAAAICOYWAAAICOcWAAAICOgWAAAICOkWAAAICOoWAAAICOsWAAAICOwWAAAICO0WAAAICO4WAAAICO8WAAAICPAWAAAICPEWAAAICPIWAAAICPMWAAAICPQWAAAICPUWAAAICPYWAAAICPcWAAAICPgWAAAICPkWAAAICPoWAAAICPsWAAAICPwWAAAICP0WAAAICP4WAAAICP8WAAAICAAXAAAICAEXAAAICAIXAAAICAMXAAAICAQXAAAICAUXAAAICAYXAAAICAcXAAAICAgXAAAICAkXAAAICAoXAAAICAsXAAAICAwXAAAICA0XAAAICA4XAAAICA8XAAAICBAXAAAICBEXAAAICBIXAAAICBMXAAAICBQXAAAICBUXAAAICBYXAAAICBcXAAAICBgXAAAICBkXAAAICBoXAAAICBsXAAAICBwXAAAICB0XAAAICB4XAAAICB8XAAAICCAXAAAICCEXAAAICCIXAAAICCMXAAAICCQXAAAICCUXAAAICCYXAAAICCcXAAAICCgXAAAICCkXAAAICCoXAAAICCsXAAAICCwXAAAICC0XAAAICC4XAAAICC8XAAAICDAXAAAICDEXAAAICDIXAAAICDMXAAAICDQXAAAICDUXAAAICDYXAAAICDcXAAAICDgXAAAICDkXAAAICDoXAAAICDsXAAAICDwXAAAICD0XAAAICD4XAAAICD8XAAAICEAXAAAICEEXAAAICEIXAAAICEMXAAAICEQXAAAICEUXAAAICEYXAAAICEcXAAAICEgXAAAICEkXAAAICEoXAAAICEsXAAAICEwXAAAICE0XAAAICE4XAAAICE8XAAAICFAXAAAICFEXAAAICFIXAAAICFMXAAAICFQXAAAICFUXAAAICFYXAAAICFcXAAAICFgXAAAICFkXAAAICFoXAAAICFsXAAAICFwXAAAICF0XAAAICF4XAAAICF8XAAAICGAXAAAICGEXAAAICGIXAAAICGMXAAAICGQXAAAICGUXAAAICGYXAAAICGcXAAAICGgXAAAICGkXAAAICGoXAAAICGsXAAAICGwXAAAICG0XAAAICG4XAAAICG8XAAAICHAXAAAICHEXAAAICHIXAAAICHMXAAAICHQXAAAICHUXAAAICHYXAAAICHcXAAAICHgXAAAICHkXAAAICHoXAAAICHsXAAAICHwXAAAICH0XAAAICH4XAAAICH8XAAAICIAXAAAICIEXAAAICIIXAAAICIMXAAAICIQXAAAICIUXAAAICIYXAAAICIcXAAAICIgXAAAICIkXAAAICIoXAAAICIsXAAAICIwXAAAICI0XAAAICI4XAAAICI8XAAAICJAXAAAICJEXAAAICJIXAAAICJMXAAAICJQXAAAICJUXAAAICJYXAAAICJcXAAAICJgXAAAICJkXAAAICJoXAAAICJsXAAAICJwXAAAICJ0XAAAICJ4XAAAICJ8XAAAICKAXAAAICKEXAAAICKIXAAAICKMXAAAICKQXAAAICKUXAAAICKYXAAAICKcXAAAICKgXAAAICKkXAAAICKoXAAAICKsXAAAICKwXAAAICK0XAAAICK4XAAAICK8XAAAICLAXAAAICLEXAAAICLIXAAAICLMXAAAICLQXAAAICLUXAAAICLYXAAAICLcXAAAICLgXAAAICLkXAAAICLoXAAAICLsXAAAICLwXAAAICL0XAAAICL4XAAAICL8XAAAICMAXAAAICMEXAAAICMIXAAAICMMXAAAICMQXAAAICMUXAAAICMYXAAAICMcXAAAICMgXAAAICMkXAAAICMoXAAAICMsXAAAICMwXAAAICM0XAAAICM4XAAAICM8XAAAICNAXAAAICNEXAAAICNIXAAAICNMXAAAICNQXAAAICNUXAAAICNYXAAAICNcXAAAICNgXAAAICNkXAAAICNoXAAAICNsXAAAICNwXAAAICN0XAAAICN4XAAAICN8XAAAICOAXAAAICOEXAAAICOIXAAAICOMXAAAICOQXAAAICOUXAAAICOYXAAAICOcXAAAICOgXAAAICOkXAAAICOoXAAAICOsXAAAICOwXAAAICO0XAAAICO4XAAAICO8XAAAICPAXAAAICPEXAAAICPIXAAAICPMXAAAICPQXAAAICPUXAAAICPYXAAAICPcXAAAICPgXAAAICPkXAAAICPoXAAAICPsXAAAICPwXAAAICP0XAAAICP4XAAAICP8XAAAICAAYAAAICAEYAAAICAIYAAAICAMYAAAICAQYAAAICAUYAAAICAYYAAAICAcYAAAICAgYAAAICAkYAAAICAoYAAAICAsYAAAICAwYAAAICA0YAAAICA4YAAAICA8YAAAICBAYAAAICBEYAAAICBIYAAAICBMYAAAICBQYAAAICBUYAAAICBYYAAAICBcYAAAICBgYAAAICBkYAAAICBoYAAAICBsYAAAICBwYAAAICB0YAAAICB4YAAAICB8YAAAICCAYAAAICCEYAAAICCIYAAAICCMYAAAICCQYAAAICCUYAAAICCYYAAAICCcYAAAICCgYAAAICCkYAAAICCoYAAAICCsYAAAICCwYAAAICC0YAAAICC4YAAAICC8YAAAICDAYAAAICDEYAAAICDIYAAAICDMYAAAICDQYAAAICDUYAAAICDYYAAAICDcYAAAICDgYAAAICDkYAAAICDoYAAAICDsYAAAICDwYAAAICD0YAAAICD4YAAAICD8YAAAICEAYAAAICEEYAAAICEIYAAAICEMYAAAICEQYAAAICEUYAAAICEYYAAAICEcYAAAICEgYAAAICEkYAAAICEoYAAAICEsYAAAICEwYAAAICE0YAAAICE4YAAAICE8YAAAICFAYAAAICFEYAAAICFIYAAAICFMYAAAICFQYAAAICFUYAAAICFYYAAAICFcYAAAICFgYAAAICFkYAAAICFoYAAAICFsYAAAICFwYAAAICF0YAAAICF4YAAAICF8YAAAICGAYAAAICGEYAAAICGIYAAAICGMYAAAICGQYAAAICGUYAAAICGYYAAAICGcYAAAICGgYAAAICGkYAAAICGoYAAAICGsYAAAICGwYAAAICG0YAAAICG4YAAAICG8YAAAICHAYAAAICHEYAAAICHIYAAAICHMYAAAICHQYAAAICHUYAAAICHYYAAAICHcYAAAICHgYAAAICHkYAAAICHoYAAAICHsYAAAICHwYAAAICH0YAAAICH4YAAAICH8YAAAICIAYAAAICIEYAAAICIIYAAAICIMYAAAICIQYAAAICIUYAAAICIYYAAAICIcYAAAICIgYAAAICIkYAAAICIoYAAAICIsYAAAICIwYAAAICI0YAAAICI4YAAAICI8YAAAICJAYAAAICJEYAAAICJIYAAAICJMYAAAICJQYAAAICJUYAAAICJYYAAAICJcYAAAICJgYAAAICJkYAAAICJoYAAAICJsYAAAICJwYAAAICJ0YAAAICJ4YAAAICJ8YAAAICKAYAAAICKEYAAAICKIYAAAICKMYAAAICKQYAAAICKUYAAAICKYYAAAICKcYAAAICKgYAAAICKkYAAAICKoYAAAICKsYAAAICKwYAAAICK0YAAAICK4YAAAICK8YAAAICLAYAAAICLEYAAAICLIYAAAICLMYAAAICLQYAAAICLUYAAAICLYYAAAICLcYAAAICLgYAAAICLkYAAAICLoYAAAICLsYAAAICLwYAAAICL0YAAAICL4YAAAICL8YAAAICMAYAAAICMEYAAAICMIYAAAICMMYAAAICMQYAAAICMUYAAAICMYYAAAICMcYAAAICMgYAAAICMkYAAAICMoYAAAICMsYAAAICMwYAAAICM0YAAAICM4YAAAICM8YAAAICNAYAAAICNEYAAAICNIYAAAICNMYAAAICNQYAAAICNUYAAAICNYYAAAICNcYAAAICNgYAAAICNkYAAAICNoYAAAICNsYAAAICNwYAAAICN0YAAAICN4YAAAICN8YAAAICOAYAAAICOEYAAAICOIYAAAICOMYAAAICOQYAAAICOUYAAAICOYYAAAICOcYAAAICOgYAAAICOkYAAAICOoYAAAICOsYAAAICOwYAAAICO0YAAAICO4YAAAICO8YAAAICPAYAAAICPEYAAAICPIYAAAICPMYAAAICPQYAAAICPUYAAAICPYYAAAICPcYAAAICPgYAAAICPkYAAAICPoYAAAICPsYAAAICPwYAAAICP0YAAAICP4YAAAICP8YAAAICAAZAAAICAEZAAAICAIZAAAICAMZAAAICAQZAAAICAUZAAAICAYZAAAICAcZAAAICAgZAAAICAkZAAAICAoZAAAICAsZAAAICAwZAAAICA0ZAAAICA4ZAAAICA8ZAAAICBAZAAAICBEZAAAICBIZAAAICBMZAAAICBQZAAAICBUZAAAICBYZAAAICBcZAAAICBgZAAAICBkZAAAICBoZAAAICBsZAAAICBwZAAAICB0ZAAAICB4ZAAAICB8ZAAAICCAZAAAICCEZAAAICCIZAAAICCMZAAAICCQZAAAICCUZAAAICCYZAAAICCcZAAAICCgZAAAICCkZAAAICCoZAAAICCsZAAAICCwZAAAICC0ZAAAICC4ZAAAICC8ZAAAICDAZAAAICDEZAAAICDIZAAAICDMZAAAICDQZAAAICDUZAAAICDYZAAAICDcZAAAICDgZAAAICDkZAAAICDoZAAAICDsZAAAICDwZAAAICD0ZAAAICD4ZAAAICD8ZAAAICEAZAAAICEEZAAAICEIZAAAICEMZAAAICEQZAAAICEUZAAAICEYZAAAICEcZAAAICEgZAAAICEkZAAAICEoZAAAICEsZAAAICEwZAAAICE0ZAAAICE4ZAAAICE8ZAAAICFAZAAAICFEZAAAICFIZAAAICFMZAAAICFQZAAAICFUZAAAICFYZAAAICFcZAAAICFgZAAAICFkZAAAICFoZAAAICFsZAAAICFwZAAAICF0ZAAAICF4ZAAAICF8ZAAAICGAZAAAICGEZAAAICGIZAAAICGMZAAAICGQZAAAICGUZAAAICGYZAAAICGcZAAAICGgZAAAICGkZAAAICGoZAAAICGsZAAAICGwZAAAICG0ZAAAICG4ZAAAICG8ZAAAICHAZAAAICHEZAAAICHIZAAAICHMZAAAICHQZAAAICHUZAAAICHYZAAAICHcZAAAICHgZAAAICHkZAAAICHoZAAAICHsZAAAICHwZAAAICH0ZAAAICH4ZAAAICH8ZAAAICIAZAAAICIEZAAAICIIZAAAICIMZAAAICIQZAAAICIUZAAAICIYZAAAICIcZAAAICIgZAAAICIkZAAAICIoZAAAICIsZAAAICIwZAAAICI0ZAAAICI4ZAAAICI8ZAAAICJAZAAAICJEZAAAICJIZAAAICJMZAAAICJQZAAAICJUZAAAICJYZAAAICJcZAAAICJgZAAAICJkZAAAICJoZAAAICJsZAAAICJwZAAAICJ0ZAAAICJ4ZAAAICJ8ZAAAICKAZAAAICKEZAAAICKIZAAAICKMZAAAICKQZAAAICKUZAAAICKYZAAAICKcZAAAICKgZAAAICKkZAAAICKoZAAAICKsZAAAICKwZAAAICK0ZAAAICK4ZAAAICK8ZAAAICLAZAAAICLEZAAAICLIZAAAICLMZAAAICLQZAAAICLUZAAAICLYZAAAICLcZAAAICLgZAAAICLkZAAAICLoZAAAICLsZAAAICLwZAAAICL0ZAAAICL4ZAAAICL8ZAAAICMAZAAAICMEZAAAICMIZAAAICMMZAAAICMQZAAAICMUZAAAICMYZAAAICMcZAAAICMgZAAAICMkZAAAICMoZAAAICMsZAAAICMwZAAAICM0ZAAAICM4ZAAAICM8ZAAAICNAZAAAICNEZAAAICNIZAAAICNMZAAAICNQZAAAICNUZAAAICNYZAAAICNcZAAAICNgZAAAICNkZAAAICNoZAAAICNsZAAAICNwZAAAICN0ZAAAICN4ZAAAICN8ZAAAICOAZAAAICOEZAAAICOIZAAAICOMZAAAICOQZAAAICOUZAAAICOYZAAAICOcZAAAICOgZAAAICOkZAAAICOoZAAAICOsZAAAICOwZAAAICO0ZAAAICO4ZAAAICO8ZAAAICPAZAAAICPEZAAAICPIZAAAICPMZAAAICPQZAAAICPUZAAAICPYZAAAICPcZAAAICPgZAAAICPkZAAAICPoZAAAICPsZAAAICPwZAAAICP0ZAAAICP4ZAAAICP8ZAAAICAAaAAAICAEaAAAICAIaAAAICAMaAAAICAQaAAAICAUaAAAICAYaAAAICAcaAAAICAgaAAAICAkaAAAICAoaAAAICAsaAAAICAwaAAAICA0aAAAICA4aAAAICA8aAAAICBAaAAAICBEaAAAICBIaAAAICBMaAAAICBQaAAAICBUaAAAICBYaAAAICBcaAAAICBgaAAAICBkaAAAICBoaAAAICBsaAAAICBwaAAAICB0aAAAICB4aAAAICB8aAAAICCAaAAAICCEaAAAICCIaAAAICCMaAAAICCQaAAAICCUaAAAICCYaAAAICCcaAAAICCgaAAAICCkaAAAICCoaAAAICCsaAAAICCwaAAAICC0aAAAICC4aAAAICC8aAAAICDAaAAAICDEaAAAICDIaAAAICDMaAAAICDQaAAAICDUaAAAICDYaAAAICDcaAAAICDgaAAAICDkaAAAICDoaAAAICDsaAAAICDwaAAAICD0aAAAICD4aAAAICD8aAAAICEAaAAAICEEaAAAICEIaAAAICEMaAAAICEQaAAAICEUaAAAICEYaAAAICEcaAAAICEgaAAAICEkaAAAICEoaAAAICEsaAAAICEwaAAAICE0aAAAICE4aAAAICE8aAAAICFAaAAAICFEaAAAICFIaAAAICFMaAAAICFQaAAAICFUaAAAICFYaAAAICFcaAAAICFgaAAAICFkaAAAICFoaAAAICFsaAAAICFwaAAAICF0aAAAICF4aAAAICF8aAAAICGAaAAAICGEaAAAICGIaAAAICGMaAAAICGQaAAAICGUaAAAICGYaAAAICGcaAAAICGgaAAAICGkaAAAICGoaAAAICGsaAAAICGwaAAAICG0aAAAICG4aAAAICG8aAAAICHAaAAAICHEaAAAICHIaAAAICHMaAAAICHQaAAAICHUaAAAICHYaAAAICHcaAAAICHgaAAAICHkaAAAICHoaAAAICHsaAAAICHwaAAAICH0aAAAICH4aAAAICH8aAAAICIAaAAAICIEaAAAICIIaAAAICIMaAAAICIQaAAAICIUaAAAICIYaAAAICIcaAAAICIgaAAAICIkaAAAICIoaAAAICIsaAAAICIwaAAAICI0aAAAICI4aAAAICI8aAAAICJAaAAAICJEaAAAICJIaAAAICJMaAAAICJQaAAAICJUaAAAICJYaAAAICJcaAAAICJgaAAAICJkaAAAICJoaAAAICJsaAAAICJwaAAAICJ0aAAAICJ4aAAAICJ8aAAAICKAaAAAICKEaAAAICKIaAAAICKMaAAAICKQaAAAICKUaAAAICKYaAAAICKcaAAAICKgaAAAICKkaAAAICKoaAAAICKsaAAAICKwaAAAICK0aAAAICK4aAAAICK8aAAAICLAaAAAICLEaAAAICLIaAAAICLMaAAAICLQaAAAICLUaAAAICLYaAAAICLcaAAAICLgaAAAICLkaAAAICLoaAAAICLsaAAAICLwaAAAICL0aAAAICL4aAAAICL8aAAAICMAaAAAICMEaAAAICMIaAAAICMMaAAAICMQaAAAICMUaAAAICMYaAAAICMcaAAAICMgaAAAICMkaAAAICMoaAAAICMsaAAAICMwaAAAICM0aAAAICM4aAAAICM8aAAAICNAaAAAICNEaAAAICNIaAAAICNMaAAAICNQaAAAICNUaAAAICNYaAAAICNcaAAAICNgaAAAICNkaAAAICNoaAAAICNsaAAAICNwaAAAICN0aAAAICN4aAAAICN8aAAAICOAaAAAICOEaAAAICOIaAAAICOMaAAAICOQaAAAICOUaAAAICOYaAAAICOcaAAAICOgaAAAICOkaAAAICOoaAAAICOsaAAAICOwaAAAICO0aAAAICO4aAAAICO8aAAAICPAaAAAICPEaAAAICPIaAAAICPMaAAAICPQaAAAICPUaAAAICPYaAAAICPcaAAAICPgaAAAICPkaAAAICPoaAAAICPsaAAAICPwaAAAICP0aAAAICP4aAAAICP8aAAAICAAbAAAICAEbAAAICAIbAAAICAMbAAAICAQbAAAICAUbAAAICAYbAAAICAcbAAAICAgbAAAICAkbAAAICAobAAAICAsbAAAICAwbAAAICA0bAAAICA4bAAAICA8bAAAICBAbAAAICBEbAAAICBIbAAAICBMbAAAICBQbAAAICBUbAAAICBYbAAAICBcbAAAICBgbAAAICBkbAAAICBobAAAICBsbAAAICBwbAAAICB0bAAAICB4bAAAICB8bAAAICCAbAAAICCEbAAAICCIbAAAICCMbAAAICCQbAAAICCUbAAAICCYbAAAICCcbAAAICCgbAAAICCkbAAAICCobAAAICCsbAAAICCwbAAAICC0bAAAICC4bAAAICC8bAAAICDAbAAAICDEbAAAICDIbAAAICDMbAAAICDQbAAAICDUbAAAICDYbAAAICDcbAAAICDgbAAAICDkbAAAICDobAAAICDsbAAAICDwbAAAICD0bAAAICD4bAAAICD8bAAAICEAbAAAICEEbAAAICEIbAAAICEMbAAAICEQbAAAICEUbAAAICEYbAAAICEcbAAAICEgbAAAICEkbAAAICEobAAAICEsbAAAICEwbAAAICE0bAAAICE4bAAAICE8bAAAICFAbAAAICFEbAAAICFIbAAAICFMbAAAICFQbAAAICFUbAAAICFYbAAAICFcbAAAICFgbAAAICFkbAAAICFobAAAICFsbAAAICFwbAAAICF0bAAAICF4bAAAICF8bAAAICGAbAAAICGEbAAAICGIbAAAICGMbAAAICGQbAAAICGUbAAAICGYbAAAICGcbAAAICGgbAAAICGkbAAAICGobAAAICGsbAAAICGwbAAAICG0bAAAICG4bAAAICG8bAAAICHAbAAAICHEbAAAICHIbAAAICHMbAAAICHQbAAAICHUbAAAICHYbAAAICHcbAAAICHgbAAAICHkbAAAICHobAAAICHsbAAAICHwbAAAICH0bAAAICH4bAAAICH8bAAAICIAbAAAICIEbAAAICIIbAAAICIMbAAAICIQbAAAICIUbAAAICIYbAAAICIcbAAAICIgbAAAICIkbAAAICIobAAAICIsbAAAICIwbAAAICI0bAAAICI4bAAAICI8bAAAICJAbAAAICJEbAAAICJIbAAAICJMbAAAICJQbAAAICJUbAAAICJYbAAAICJcbAAAICJgbAAAICJkbAAAICJobAAAICJsbAAAICJwbAAAICJ0bAAAICJ4bAAAICJ8bAAAICKAbAAAICKEbAAAICKIbAAAICKMbAAAICKQbAAAICKUbAAAICKYbAAAICKcbAAAICKgbAAAICKkbAAAICKobAAAICKsbAAAICKwbAAAICK0bAAAICK4bAAAICK8bAAAICLAbAAAICLEbAAAICLIbAAAICLMbAAAICLQbAAAICLUbAAAICLYbAAAICLcbAAAICLgbAAAICLkbAAAICLobAAAICLsbAAAICLwbAAAICL0bAAAICL4bAAAICL8bAAAICMAbAAAICMEbAAAICMIbAAAICMMbAAAICMQbAAAICMUbAAAICMYbAAAICMcbAAAICMgbAAAICMkbAAAICMobAAAICMsbAAAICMwbAAAICM0bAAAICM4bAAAICM8bAAAICNAbAAAICNEbAAAICNIbAAAICNMbAAAICNQbAAAICNUbAAAICNYbAAAICNcbAAAICNgbAAAICNkbAAAICNobAAAICNsbAAAICNwbAAAICN0bAAAICN4bAAAICN8bAAAICOAbAAAICOEbAAAICOIbAAAICOMbAAAICOQbAAAICOUbAAAICOYbAAAICOcbAAAICOgbAAAICOkbAAAICOobAAAICOsbAAAICOwbAAAICO0bAAAICO4bAAAICO8bAAAICPAbAAAICPEbAAAICPIbAAAICPMbAAAICPQbAAAICPUbAAAICPYbAAAICPcbAAAICPgbAAAICPkbAAAICPobAAAICPsbAAAICPwbAAAICP0bAAAICP4bAAAICP8bAAAICAAcAAAICAEcAAAICAIcAAAICAMcAAAICAQcAAAICAUcAAAICAYcAAAICAccAAAICAgcAAAICAkcAAAICAocAAAICAscAAAICAwcAAAICA0cAAAICA4cAAAICA8cAAAICBAcAAAICBEcAAAICBIcAAAICBMcAAAICBQcAAAICBUcAAAICBYcAAAICBccAAAICBgcAAAICBkcAAAICBocAAAICBscAAAICBwcAAAICB0cAAAICB4cAAAICB8cAAAICCAcAAAICCEcAAAICCIcAAAICCMcAAAICCQcAAAICCUcAAAICCYcAAAICCccAAAICCgcAAAICCkcAAAICCocAAAICCscAAAICCwcAAAICC0cAAAICC4cAAAICC8cAAAICDAcAAAICDEcAAAICDIcAAAICDMcAAAICDQcAAAICDUcAAAICDYcAAAICDccAAAICDgcAAAICDkcAAAICDocAAAICDscAAAICDwcAAAICD0cAAAICD4cAAAICD8cAAAICEAcAAAICEEcAAAICEIcAAAICEMcAAAICEQcAAAICEUcAAAICEYcAAAICEccAAAICEgcAAAICEkcAAAICEocAAAICEscAAAICEwcAAAICE0cAAAICE4cAAAICE8cAAAICFAcAAAICFEcAAAICFIcAAAICFMcAAAICFQcAAAICFUcAAAICFYcAAAICFccAAAICFgcAAAICFkcAAAICFocAAAICFscAAAICFwcAAAICF0cAAAICF4cAAAICF8cAAAICGAcAAAICGEcAAAICGIcAAAICGMcAAAICGQcAAAICGUcAAAICGYcAAAICGccAAAICGgcAAAICGkcAAAICGocAAAICGscAAAICGwcAAAICG0cAAAICG4cAAAICG8cAAAICHAcAAAICHEcAAAICHIcAAAICHMcAAAICHQcAAAICHUcAAAICHYcAAAICHccAAAICHgcAAAICHkcAAAICHocAAAICHscAAAICHwcAAAICH0cAAAICH4cAAAICH8cAAAICIAcAAAICIEcAAAICIIcAAAICIMcAAAICIQcAAAICIUcAAAICIYcAAAICIccAAAICIgcAAAICIkcAAAICIocAAAICIscAAAICIwcAAAICI0cAAAICI4cAAAICI8cAAAICJAcAAAICJEcAAAICJIcAAAICJMcAAAICJQcAAAICJUcAAAICJYcAAAICJccAAAICJgcAAAICJkcAAAICJocAAAICJscAAAICJwcAAAICJ0cAAAICJ4cAAAICJ8cAAAICKAcAAAICKEcAAAICKIcAAAICKMcAAAICKQcAAAICKUcAAAICKYcAAAICKccAAAICKgcAAAICKkcAAAICKocAAAICKscAAAICKwcAAAICK0cAAAICK4cAAAICK8cAAAICLAcAAAICLEcAAAICLIcAAAICLMcAAAICLQcAAAICLUcAAAICLYcAAAICLccAAAICLgcAAAICLkcAAAICLocAAAICLscAAAICLwcAAAICL0cAAAICL4cAAAICL8cAAAICMAcAAAICMEcAAAICMIcAAAICMMcAAAICMQcAAAICMUcAAAICMYcAAAICMccAAAICMgcAAAICMkcAAAICMocAAAICMscAAAICMwcAAAICM0cAAAICM4cAAAICM8cAAAICNAcAAAICNEcAAAICNIcAAAICNMcAAAICNQcAAAICNUcAAAICNYcAAAICNccAAAICNgcAAAICNkcAAAICNocAAAICNscAAAICNwcAAAICN0cAAAICN4cAAAICN8cAAAICOAcAAAICOEcAAAICOIcAAAICOMcAAAICOQcAAAICOUcAAAICOYcAAAICOccAAAICOgcAAAICOkcAAAICOocAAAICOscAAAICOwcAAAICO0cAAAICO4cAAAICO8cAAAICPAcAAAICPEcAAAICPIcAAAICPMcAAAICPQcAAAICPUcAAAICPYcAAAICPccAAAICPgcAAAICPkcAAAICPocAAAICPscAAAICPwcAAAICP0cAAAICP4cAAAICP8cAAAICAAdAAAICAEdAAAICAIdAAAICAMdAAAICAQdAAAICAUdAAAICAYdAAAICAcdAAAICAgdAAAICAkdAAAICAodAAAICAsdAAAICAwdAAAICA0dAAAICA4dAAAICA8dAAAICBAdAAAICBEdAAAICBIdAAAICBMdAAAICBQdAAAICBUdAAAICBYdAAAICBcdAAAICBgdAAAICBkdAAAICBodAAAICBsdAAAICBwdAAAICB0dAAAICB4dAAAICB8dAAAICCAdAAAICCEdAAAICCIdAAAICCMdAAAICCQdAAAICCUdAAAICCYdAAAICCcdAAAICCgdAAAICCkdAAAICCodAAAICCsdAAAICCwdAAAICC0dAAAICC4dAAAICC8dAAAICDAdAAAICDEdAAAICDIdAAAICDMdAAAICDQdAAAICDUdAAAICDYdAAAICDcdAAAICDgdAAAICDkdAAAICDodAAAICDsdAAAICDwdAAAICD0dAAAICD4dAAAICD8dAAAICEAdAAAICEEdAAAICEIdAAAICEMdAAAICEQdAAAICEUdAAAICEYdAAAICEcdAAAICEgdAAAICEkdAAAICEodAAAICEsdAAAICEwdAAAICE0dAAAICE4dAAAICE8dAAAICFAdAAAICFEdAAAICFIdAAAICFMdAAAICFQdAAAICFUdAAAICFYdAAAICFcdAAAICFgdAAAICFkdAAAICFodAAAICFsdAAAICFwdAAAICF0dAAAICF4dAAAICF8dAAAICGAdAAAICGEdAAAICGIdAAAICGMdAAAICGQdAAAICGUdAAAICGYdAAAICGcdAAAICGgdAAAICGkdAAAICGodAAAICGsdAAAICGwdAAAICG0dAAAICG4dAAAICG8dAAAICHAdAAAICHEdAAAICHIdAAAICHMdAAAICHQdAAAICHUdAAAICHYdAAAICHcdAAAICHgdAAAICHkdAAAICHodAAAICHsdAAAICHwdAAAICH0dAAAICH4dAAAICH8dAAAICIAdAAAICIEdAAAICIIdAAAICIMdAAAICIQdAAAICIUdAAAICIYdAAAICIcdAAAICIgdAAAICIkdAAAICIodAAAICIsdAAAICIwdAAAICI0dAAAICI4dAAAICI8dAAAICJAdAAAICJEdAAAICJIdAAAICJMdAAAICJQdAAAICJUdAAAICJYdAAAICJcdAAAICJgdAAAICJkdAAAICJodAAAICJsdAAAICJwdAAAICJ0dAAAICJ4dAAAICJ8dAAAICKAdAAAICKEdAAAICKIdAAAICKMdAAAICKQdAAAICKUdAAAICKYdAAAICKcdAAAICKgdAAAICKkdAAAICKodAAAICKsdAAAICKwdAAAICK0dAAAICK4dAAAICK8dAAAICLAdAAAICLEdAAAICLIdAAAICLMdAAAICLQdAAAICLUdAAAICLYdAAAICLcdAAAICLgdAAAICLkdAAAICLodAAAICLsdAAAICLwdAAAICL0dAAAICL4dAAAICL8dAAAICMAdAAAICMEdAAAICMIdAAAICMMdAAAICMQdAAAICMUdAAAICMYdAAAICMcdAAAICMgdAAAICMkdAAAICModAAAICMsdAAAICMwdAAAICM0dAAAICM4dAAAICM8dAAAICNAdAAAICNEdAAAICNIdAAAICNMdAAAICNQdAAAICNUdAAAICNYdAAAICNcdAAAICNgdAAAICNkdAAAICNodAAAICNsdAAAICNwdAAAICN0dAAAICN4dAAAICN8dAAAICOAdAAAICOEdAAAICOIdAAAICOMdAAAICOQdAAAICOUdAAAICOYdAAAICOcdAAAICOgdAAAICOkdAAAICOodAAAICOsdAAAICOwdAAAICO0dAAAICO4dAAAICO8dAAAICPAdAAAICPEdAAAICPIdAAAICPMdAAAICPQdAAAICPUdAAAICPYdAAAICPcdAAAICPgdAAAICPkdAAAICPodAAAICPsdAAAICPwdAAAICP0dAAAICP4dAAAICP8dAAAICAAeAAAICAEeAAAICAIeAAAICAMeAAAICAQeAAAICAUeAAAICAYeAAAICAceAAAICAgeAAAICAkeAAAICAoeAAAICAseAAAICAweAAAICA0eAAAICA4eAAAICA8eAAAICBAeAAAICBEeAAAICBIeAAAICBMeAAAICBQeAAAICBUeAAAICBYeAAAICBceAAAICBgeAAAICBkeAAAICBoeAAAICBseAAAICBweAAAICB0eAAAICB4eAAAICB8eAAAICCAeAAAICCEeAAAICCIeAAAICCMeAAAICCQeAAAICCUeAAAICCYeAAAICCceAAAICCgeAAAICCkeAAAICCoeAAAICCseAAAICCweAAAICC0eAAAICC4eAAAICC8eAAAICDAeAAAICDEeAAAICDIeAAAICDMeAAAICDQeAAAICDUeAAAICDYeAAAICDceAAAICDgeAAAICDkeAAAICDoeAAAICDseAAAICDweAAAICD0eAAAICD4eAAAICD8eAAAICEAeAAAICEEeAAAICEIeAAAICEMeAAAICEQeAAAICEUeAAAICEYeAAAICEceAAAICEgeAAAICEkeAAAICEoeAAAICEseAAAICEweAAAICE0eAAAICE4eAAAICE8eAAAICFAeAAAICFEeAAAICFIeAAAICFMeAAAICFQeAAAICFUeAAAICFYeAAAICFceAAAICFgeAAAICFkeAAAICFoeAAAICFseAAAICFweAAAICF0eAAAICF4eAAAICF8eAAAICGAeAAAICGEeAAAICGIeAAAICGMeAAAICGQeAAAICGUeAAAICGYeAAAICGceAAAICGgeAAAICGkeAAAICGoeAAAICGseAAAICGweAAAICG0eAAAICG4eAAAICG8eAAAICHAeAAAICHEeAAAICHIeAAAICHMeAAAICHQeAAAICHUeAAAICHYeAAAICHceAAAICHgeAAAICHkeAAAICHoeAAAICHseAAAICHweAAAICH0eAAAICH4eAAAICH8eAAAICIAeAAAICIEeAAAICIIeAAAICIMeAAAICIQeAAAICIUeAAAICIYeAAAICIceAAAICIgeAAAICIkeAAAICIoeAAAICIseAAAICIweAAAICI0eAAAICI4eAAAICI8eAAAICJAeAAAICJEeAAAICJIeAAAICJMeAAAICJQeAAAICJUeAAAICJYeAAAICJceAAAICJgeAAAICJkeAAAICJoeAAAICJseAAAICJweAAAICJ0eAAAICJ4eAAAICJ8eAAAICKAeAAAICKEeAAAICKIeAAAICKMeAAAICKQeAAAICKUeAAAICKYeAAAICKceAAAICKgeAAAICKkeAAAICKoeAAAICKseAAAICKweAAAICK0eAAAICK4eAAAICK8eAAAICLAeAAAICLEeAAAICLIeAAAICLMeAAAICLQeAAAICLUeAAAICLYeAAAICLceAAAICLgeAAAICLkeAAAICLoeAAAICLseAAAICLweAAAICL0eAAAICL4eAAAICL8eAAAICMAeAAAICMEeAAAICMIeAAAICMMeAAAICMQeAAAICMUeAAAICMYeAAAICMceAAAICMgeAAAICMkeAAAICMoeAAAICMseAAAICMweAAAICM0eAAAICM4eAAAICM8eAAAICNAeAAAICNEeAAAICNIeAAAICNMeAAAICNQeAAAICNUeAAAICNYeAAAICNceAAAICNgeAAAICNkeAAAICNoeAAAICNseAAAICNweAAAICN0eAAAICN4eAAAICN8eAAAICOAeAAAICOEeAAAICOIeAAAICOMeAAAICOQeAAAICOUeAAAICOYeAAAICOceAAAICOgeAAAICOkeAAAICOoeAAAICOseAAAICOweAAAICO0eAAAICO4eAAAICO8eAAAICPAeAAAICPEeAAAICPIeAAAICPMeAAAICPQeAAAICPUeAAAICPYeAAAICPceAAAICPgeAAAICPkeAAAICPoeAAAICPseAAAICPweAAAICP0eAAAICP4eAAAICP8eAAAICAAfAAAICAEfAAAICAIfAAAICAMfAAAICAQfAAAICAUfAAAICAYfAAAICAcfAAAICAgfAAAICAkfAAAICAofAAAICAsfAAAICAwfAAAICA0fAAAICA4fAAAICA8fAAAICBAfAAAICBEfAAAICBIfAAAICBMfAAAICBQfAAAICBUfAAAICBYfAAAICBcfAAAICBgfAAAICBkfAAAICBofAAAICBsfAAAICBwfAAAICB0fAAAICB4fAAAICB8fAAAICCAfAAAICCEfAAAICCIfAAAICCMfAAAICCQfAAAICCUfAAAICCYfAAAICCcfAAAICCgfAAAICCkfAAAICCofAAAICCsfAAAICCwfAAAICC0fAAAICC4fAAAICC8fAAAICDAfAAAICDEfAAAICDIfAAAICDMfAAAICDQfAAAICDUfAAAICDYfAAAICDcfAAAICDgfAAAICDkfAAAICDofAAAICDsfAAAICDwfAAAICD0fAAAICD4fAAAICD8fAAAICEAfAAAICEEfAAAICEIfAAAICEMfAAAICEQfAAAICEUfAAAICEYfAAAICEcfAAAICEgfAAAICEkfAAAICEofAAAICEsfAAAICEwfAAAICE0fAAAICE4fAAAICE8fAAAICFAfAAAICFEfAAAICFIfAAAICFMfAAAICFQfAAAICFUfAAAICFYfAAAICFcfAAAICFgfAAAICFkfAAAICFofAAAICFsfAAAICFwfAAAICF0fAAAICF4fAAAICF8fAAAICGAfAAAICGEfAAAICGIfAAAICGMfAAAICGQfAAAICGUfAAAICGYfAAAICGcfAAAICGgfAAAICGkfAAAICGofAAAICGsfAAAICGwfAAAICG0fAAAICG4fAAAICG8fAAAICHAfAAAICHEfAAAICHIfAAAICHMfAAAICHQfAAAICHUfAAAICHYfAAAICHcfAAAICHgfAAAICHkfAAAICHofAAAICHsfAAAICHwfAAAICH0fAAAICH4fAAAICH8fAAAICIAfAAAICIEfAAAICIIfAAAICIMfAAAICIQfAAAICIUfAAAICIYfAAAICIcfAAAICIgfAAAICIkfAAAICIofAAAICIsfAAAICIwfAAAICI0fAAAICI4fAAAICI8fAAAICJAfAAAICJEfAAAICJIfAAAICJMfAAAICJQfAAAICJUfAAAICJYfAAAICJcfAAAICJgfAAAICJkfAAAICJofAAAICJsfAAAICJwfAAAICJ0fAAAICJ4fAAAICJ8fAAAICKAfAAAICKEfAAAICKIfAAAICKMfAAAICKQfAAAICKUfAAAICKYfAAAICKcfAAAICKgfAAAICKkfAAAICKofAAAICKsfAAAICKwfAAAICK0fAAAICK4fAAAICK8fAAAICLAfAAAICLEfAAAICLIfAAAICLMfAAAICLQfAAAICLUfAAAICLYfAAAICLcfAAAICLgfAAAICLkfAAAICLofAAAICLsfAAAICLwfAAAICL0fAAAICL4fAAAICL8fAAAICMAfAAAICMEfAAAICMIfAAAICMMfAAAICMQfAAAICMUfAAAICMYfAAAICMcfAAAICMgfAAAICMkfAAAICMofAAAICMsfAAAICMwfAAAICM0fAAAICM4fAAAICM8fAAAICNAfAAAICNEfAAAICNIfAAAICNMfAAAICNQfAAAICNUfAAAICNYfAAAICNcfAAAICNgfAAAICNkfAAAICNofAAAICNsfAAAICNwfAAAICN0fAAAICN4fAAAICN8fAAAICOAfAAAICOEfAAAICOIfAAAICOMfAAAICOQfAAAICOUfAAAICOYfAAAICOcfAAAICOgfAAAICOkfAAAICOofAAAICOsfAAAICOwfAAAICO0fAAAICO4fAAAICO8fAAAICPAfAAAICPEfAAAICPIfAAAICPMfAAAICPQfAAAICPUfAAAICPYfAAAICPcfAAAICPgfAAAICPkfAAAICPofAAAICPsfAAAICPwfAAAICP0fAAAICP4fAAAICP8fAAAICAAgAAAICAEgAAAICAIgAAAICAMgAAAICAQgAAAICAUgAAAICAYgAAAICAcgAAAICAggAAAICAkgAAAICAogAAAICAsgAAAICAwgAAAICA0gAAAICA4gAAAICA8gAAAICBAgAAAICBEgAAAICBIgAAAICBMgAAAICBQgAAAICBUgAAAICBYgAAAICBcgAAAICBggAAAICBkgAAAICBogAAAICBsgAAAICBwgAAAICB0gAAAICB4gAAAICB8gAAAICCAgAAAICCEgAAAICCIgAAAICCMgAAAICCQgAAAICCUgAAAICCYgAAAICCcgAAAICCggAAAICCkgAAAICCogAAAICCsgAAAICCwgAAAICC0gAAAICC4gAAAICC8gAAAICDAgAAAICDEgAAAICDIgAAAICDMgAAAICDQgAAAICDUgAAAICDYgAAAICDcgAAAICDggAAAICDkgAAAICDogAAAICDsgAAAICDwgAAAICD0gAAAICD4gAAAICD8gAAAICEAgAAAICEEgAAAICEIgAAAICEMgAAAICEQgAAAICEUgAAAICEYgAAAICEcgAAAICEggAAAICEkgAAAICEogAAAICEsgAAAICEwgAAAICE0gAAAICE4gAAAICE8gAAAICFAgAAAICFEgAAAICFIgAAAICFMgAAAICFQgAAAICFUgAAAICFYgAAAICFcgAAAICFggAAAICFkgAAAICFogAAAICFsgAAAICFwgAAAICF0gAAAICF4gAAAICF8gAAAICGAgAAAICGEgAAAICGIgAAAICGMgAAAICGQgAAAICGUgAAAICGYgAAAICGcgAAAICGggAAAICGkgAAAICGogAAAICGsgAAAICGwgAAAICG0gAAAICG4gAAAICG8gAAAICHAgAAAICHEgAAAICHIgAAAICHMgAAAICHQgAAAICHUgAAAICHYgAAAICHcgAAAICHggAAAICHkgAAAICHogAAAICHsgAAAICHwgAAAICH0gAAAICH4gAAAICH8gAAAICIAgAAAICIEgAAAICIIgAAAICIMgAAAICIQgAAAICIUgAAAICIYgAAAICIcgAAAICIggAAAICIkgAAAICIogAAAICIsgAAAICIwgAAAICI0gAAAICI4gAAAICI8gAAAICJAgAAAICJEgAAAICJIgAAAICJMgAAAICJQgAAAICJUgAAAICJYgAAAICJcgAAAICJggAAAICJkgAAAICJogAAAICJsgAAAICJwgAAAICJ0gAAAICJ4gAAAICJ8gAAAICKAgAAAICKEgAAAICKIgAAAICKMgAAAICKQgAAAICKUgAAAICKYgAAAICKcgAAAICKggAAAICKkgAAAICKogAAAICKsgAAAICKwgAAAICK0gAAAICK4gAAAICK8gAAAICLAgAAAICLEgAAAICLIgAAAICLMgAAAICLQgAAAICLUgAAAICLYgAAAICLcgAAAICLggAAAICLkgAAAICLogAAAICLsgAAAICLwgAAAICL0gAAAICL4gAAAICL8gAAAICMAgAAAICMEgAAAICMIgAAAICMMgAAAICMQgAAAICMUgAAAICMYgAAAICMcgAAAICMggAAAICMkgAAAICMogAAAICMsgAAAICMwgAAAICM0gAAAICM4gAAAICM8gAAAICNAgAAAICNEgAAAICNIgAAAICNMgAAAICNQgAAAICNUgAAAICNYgAAAICNcgAAAICNggAAAICNkgAAAICNogAAAICNsgAAAICNwgAAAICN0gAAAICN4gAAAICN8gAAAICOAgAAAICOEgAAAICOIgAAAICOMgAAAICOQgAAAICOUgAAAICOYgAAAICOcgAAAICOggAAAICOkgAAAICOogAAAICOsgAAAICOwgAAAICO0gAAAICO4gAAAICO8gAAAICPAgAAAICPEgAAAICPIgAAAICPMgAAAICPQgAAAICPUgAAAICPYgAAAICPcgAAAICPggAAAICPkgAAAICPogAAAICPsgAAAICPwgAAAICP0gAAAICP4gAAAICP8gAAAICAAhAAAICAEhAAAICAIhAAAICAMhAAAICAQhAAAICAUhAAAICAYhAAAICAchAAAICAghAAAICAkhAAAICAohAAAICAshAAAICAwhAAAICA0hAAAICA4hAAAICA8hAAAICBAhAAAICBEhAAAICBIhAAAICBMhAAAICBQhAAAICBUhAAAICBYhAAAICBchAAAICBghAAAICBkhAAAICBohAAAICBshAAAICBwhAAAICB0hAAAICB4hAAAICB8hAAAICCAhAAAICCEhAAAICCIhAAAICCMhAAAICCQhAAAICCUhAAAICCYhAAAICCchAAAICCghAAAICCkhAAAICCohAAAICCshAAAICCwhAAAICC0hAAAICC4hAAAICC8hAAAICDAhAAAICDEhAAAICDIhAAAICDMhAAAICDQhAAAICDUhAAAICDYhAAAICDchAAAICDghAAAICDkhAAAICDohAAAICDshAAAICDwhAAAICD0hAAAICD4hAAAICD8hAAAICEAhAAAICEEhAAAICEIhAAAICEMhAAAICEQhAAAICEUhAAAICEYhAAAICEchAAAICEghAAAICEkhAAAICEohAAAICEshAAAICEwhAAAICE0hAAAICE4hAAAICE8hAAAICFAhAAAICFEhAAAICFIhAAAICFMhAAAICFQhAAAICFUhAAAICFYhAAAICFchAAAICFghAAAICFkhAAAICFohAAAICFshAAAICFwhAAAICF0hAAAICF4hAAAICF8hAAAICGAhAAAICGEhAAAICGIhAAAICGMhAAAICGQhAAAICGUhAAAICGYhAAAICGchAAAICGghAAAICGkhAAAICGohAAAICGshAAAICGwhAAAICG0hAAAICG4hAAAICG8hAAAICHAhAAAICHEhAAAICHIhAAAICHMhAAAICHQhAAAICHUhAAAICHYhAAAICHchAAAICHghAAAICHkhAAAICHohAAAICHshAAAICHwhAAAICH0hAAAICH4hAAAICH8hAAAICIAhAAAICIEhAAAICIIhAAAICIMhAAAICIQhAAAICIUhAAAICIYhAAAICIchAAAICIghAAAICIkhAAAICIohAAAICIshAAAICIwhAAAICI0hAAAICI4hAAAICI8hAAAICJAhAAAICJEhAAAICJIhAAAICJMhAAAICJQhAAAICJUhAAAICJYhAAAICJchAAAICJghAAAICJkhAAAICJohAAAICJshAAAICJwhAAAICJ0hAAAICJ4hAAAICJ8hAAAICKAhAAAICKEhAAAICKIhAAAICKMhAAAICKQhAAAICKUhAAAICKYhAAAICKchAAAICKghAAAICKkhAAAICKohAAAICKshAAAICKwhAAAICK0hAAAICK4hAAAICK8hAAAICLAhAAAICLEhAAAICLIhAAAICLMhAAAICLQhAAAICLUhAAAICLYhAAAICLchAAAICLghAAAICLkhAAAICLohAAAICLshAAAICLwhAAAICL0hAAAICL4hAAAICL8hAAAICMAhAAAICMEhAAAICMIhAAAICMMhAAAICMQhAAAICMUhAAAICMYhAAAICMchAAAICMghAAAICMkhAAAICMohAAAICMshAAAICMwhAAAICM0hAAAICM4hAAAICM8hAAAICNAhAAAICNEhAAAICNIhAAAICNMhAAAICNQhAAAICNUhAAAICNYhAAAICNchAAAICNghAAAICNkhAAAICNohAAAICNshAAAICNwhAAAICN0hAAAICN4hAAAICN8hAAAICOAhAAAICOEhAAAICOIhAAAICOMhAAAICOQhAAAICOUhAAAICOYhAAAICOchAAAICOghAAAICOkhAAAICOohAAAICOshAAAICOwhAAAICO0hAAAICO4hAAAICO8hAAAICPAhAAAICPEhAAAICPIhAAAICPMhAAAICPQhAAAICPUhAAAICPYhAAAICPchAAAICPghAAAICPkhAAAICPohAAAICPshAAAICPwhAAAICP0hAAAICP4hAAAICP8hAAAICAAiAAAICAEiAAAICAIiAAAICAMiAAAICAQiAAAICAUiAAAICAYiAAAICAciAAAICAgiAAAICAkiAAAICAoiAAAICAsiAAAICAwiAAAICA0iAAAICA4iAAAICA8iAAAICBAiAAAICBEiAAAICBIiAAAICBMiAAAICBQiAAAICBUiAAAICBYiAAAICBciAAAICBgiAAAICBkiAAAICBoiAAAICBsiAAAICBwiAAAICB0iAAAICB4iAAAICB8iAAAICCAiAAAICCEiAAAICCIiAAAICCMiAAAICCQiAAAICCUiAAAICCYiAAAICCciAAAICCgiAAAICCkiAAAICCoiAAAICCsiAAAICCwiAAAICC0iAAAICC4iAAAICC8iAAAICDAiAAAICDEiAAAICDIiAAAICDMiAAAICDQiAAAICDUiAAAICDYiAAAICDciAAAICDgiAAAICDkiAAAICDoiAAAICDsiAAAICDwiAAAICD0iAAAICD4iAAAICD8iAAAICEAiAAAICEEiAAAICEIiAAAICEMiAAAICEQiAAAICEUiAAAICEYiAAAICEciAAAICEgiAAAICEkiAAAICEoiAAAICEsiAAAICEwiAAAICE0iAAAICE4iAAAICE8iAAAICFAiAAAICFEiAAAICFIiAAAICFMiAAAICFQiAAAICFUiAAAICFYiAAAICFciAAAICFgiAAAICFkiAAAICFoiAAAICFsiAAAICFwiAAAICF0iAAAICF4iAAAICF8iAAAICGAiAAAICGEiAAAICGIiAAAICGMiAAAICGQiAAAICGUiAAAICGYiAAAICGciAAAICGgiAAAICGkiAAAICGoiAAAICGsiAAAICGwiAAAICG0iAAAICG4iAAAICG8iAAAICHAiAAAICHEiAAAICHIiAAAICHMiAAAICHQiAAAICHUiAAAICHYiAAAICHciAAAICHgiAAAICHkiAAAICHoiAAAICHsiAAAICHwiAAAICH0iAAAICH4iAAAICH8iAAAICIAiAAAICIEiAAAICIIiAAAICIMiAAAICIQiAAAICIUiAAAICIYiAAAICIciAAAICIgiAAAICIkiAAAICIoiAAAICIsiAAAICIwiAAAICI0iAAAICI4iAAAICI8iAAAICJAiAAAICJEiAAAICJIiAAAICJMiAAAICJQiAAAICJUiAAAICJYiAAAICJciAAAICJgiAAAICJkiAAAICJoiAAAICJsiAAAICJwiAAAICJ0iAAAICJ4iAAAICJ8iAAAICKAiAAAICKEiAAAICKIiAAAICKMiAAAICKQiAAAICKUiAAAICKYiAAAICKciAAAICKgiAAAICKkiAAAICKoiAAAICKsiAAAICKwiAAAICK0iAAAICK4iAAAICK8iAAAICLAiAAAICLEiAAAICLIiAAAICLMiAAAICLQiAAAICLUiAAAICLYiAAAICLciAAAICLgiAAAICLkiAAAICLoiAAAICLsiAAAICLwiAAAICL0iAAAICL4iAAAICL8iAAAICMAiAAAICMEiAAAICMIiAAAICMMiAAAICMQiAAAICMUiAAAICMYiAAAICMciAAAICMgiAAAICMkiAAAICMoiAAAICMsiAAAICMwiAAAICM0iAAAICM4iAAAICM8iAAAICNAiAAAICNEiAAAICNIiAAAICNMiAAAICNQiAAAICNUiAAAICNYiAAAICNciAAAICNgiAAAICNkiAAAICNoiAAAICNsiAAAICNwiAAAICN0iAAAICN4iAAAICN8iAAAICOAiAAAICOEiAAAICOIiAAAICOMiAAAICOQiAAAICOUiAAAICOYiAAAICOciAAAICOgiAAAICOkiAAAICOoiAAAICOsiAAAICOwiAAAICO0iAAAICO4iAAAICO8iAAAICPAiAAAICPEiAAAICPIiAAAICPMiAAAICPQiAAAICPUiAAAICPYiAAAICPciAAAICPgiAAAICPkiAAAICPoiAAAICPsiAAAICPwiAAAICP0iAAAICP4iAAAICP8iAAAICAAjAAAICAEjAAAICAIjAAAICAMjAAAICAQjAAAICAUjAAAICAYjAAAICAcjAAAICAgjAAAICAkjAAAICAojAAAICAsjAAAICAwjAAAICA0jAAAICA4jAAAICA8jAAAICBAjAAAICBEjAAAICBIjAAAICBMjAAAICBQjAAAICBUjAAAICBYjAAAICBcjAAAICBgjAAAICBkjAAAICBojAAAICBsjAAAICBwjAAAICB0jAAAICB4jAAAICB8jAAAICCAjAAAICCEjAAAICCIjAAAICCMjAAAICCQjAAAICCUjAAAICCYjAAAICCcjAAAICCgjAAAICCkjAAAICCojAAAICCsjAAAICCwjAAAICC0jAAAICC4jAAAICC8jAAAICDAjAAAICDEjAAAICDIjAAAICDMjAAAICDQjAAAICDUjAAAICDYjAAAICDcjAAAICDgjAAAICDkjAAAICDojAAAICDsjAAAICDwjAAAICD0jAAAICD4jAAAICD8jAAAICEAjAAAICEEjAAAICEIjAAAICEMjAAAICEQjAAAICEUjAAAICEYjAAAICEcjAAAICEgjAAAICEkjAAAICEojAAAICEsjAAAICEwjAAAICE0jAAAICE4jAAAICE8jAAAICFAjAAAICFEjAAAICFIjAAAICFMjAAAICFQjAAAICFUjAAAICFYjAAAICFcjAAAICFgjAAAICFkjAAAICFojAAAICFsjAAAICFwjAAAICF0jAAAICF4jAAAICF8jAAAICGAjAAAICGEjAAAICGIjAAAICGMjAAAICGQjAAAICGUjAAAICGYjAAAICGcjAAAICGgjAAAICGkjAAAICGojAAAICGsjAAAICGwjAAAICG0jAAAICG4jAAAICG8jAAAICHAjAAAICHEjAAAICHIjAAAICHMjAAAICHQjAAAICHUjAAAICHYjAAAICHcjAAAICHgjAAAICHkjAAAICHojAAAICHsjAAAICHwjAAAICH0jAAAICH4jAAAICH8jAAAICIAjAAAICIEjAAAICIIjAAAICIMjAAAICIQjAAAICIUjAAAICIYjAAAICIcjAAAICIgjAAAICIkjAAAICIojAAAICIsjAAAICIwjAAAICI0jAAAICI4jAAAICI8jAAAICJAjAAAICJEjAAAICJIjAAAICJMjAAAICJQjAAAICJUjAAAICJYjAAAICJcjAAAICJgjAAAICJkjAAAICJojAAAICJsjAAAICJwjAAAICJ0jAAAICJ4jAAAICJ8jAAAICKAjAAAICKEjAAAICKIjAAAICKMjAAAICKQjAAAICKUjAAAICKYjAAAICKcjAAAICKgjAAAICKkjAAAICKojAAAICKsjAAAICKwjAAAICK0jAAAICK4jAAAICK8jAAAICLAjAAAICLEjAAAICLIjAAAICLMjAAAICLQjAAAICLUjAAAICLYjAAAICLcjAAAICLgjAAAICLkjAAAICLojAAAICLsjAAAICLwjAAAICL0jAAAICL4jAAAICL8jAAAICMAjAAAICMEjAAAICMIjAAAICMMjAAAICMQjAAAICMUjAAAICMYjAAAICMcjAAAICMgjAAAICMkjAAAICMojAAAICMsjAAAICMwjAAAICM0jAAAICM4jAAAICM8jAAAICNAjAAAICNEjAAAICNIjAAAICNMjAAAICNQjAAAICNUjAAAICNYjAAAICNcjAAAICNgjAAAICNkjAAAICNojAAAICNsjAAAICNwjAAAICN0jAAAICN4jAAAICN8jAAAICOAjAAAICOEjAAAICOIjAAAICOMjAAAICOQjAAAICOUjAAAICOYjAAAICOcjAAAICOgjAAAICOkjAAAICOojAAAICOsjAAAICOwjAAAICO0jAAAICO4jAAAICO8jAAAICPAjAAAICPEjAAAICPIjAAAICPMjAAAICPQjAAAICPUjAAAICPYjAAAICPcjAAAICPgjAAAICPkjAAAICPojAAAICPsjAAAICPwjAAAICP0jAAAICP4jAAAICP8jAAAICAAkAAAICAEkAAAICAIkAAAICAMkAAAICAQkAAAICAUkAAAICAYkAAAICAckAAAICAgkAAAICAkkAAAICAokAAAICAskAAAICAwkAAAICA0kAAAICA4kAAAICA8kAAAICBAkAAAICBEkAAAICBIkAAAICBMkAAAICBQkAAAICBUkAAAICBYkAAAICBckAAAICBgkAAAICBkkAAAICBokAAAICBskAAAICBwkAAAICB0kAAAICB4kAAAICB8kAAAICCAkAAAICCEkAAAICCIkAAAICCMkAAAICCQkAAAICCUkAAAICCYkAAAICCckAAAICCgkAAAICCkkAAAICCokAAAICCskAAAICCwkAAAICC0kAAAICC4kAAAICC8kAAAICDAkAAAICDEkAAAICDIkAAAICDMkAAAICDQkAAAICDUkAAAICDYkAAAICDckAAAICDgkAAAICDkkAAAICDokAAAICDskAAAICDwkAAAICD0kAAAICD4kAAAICD8kAAAICEAkAAAICEEkAAAICEIkAAAICEMkAAAICEQkAAAICEUkAAAICEYkAAAICEckAAAICEgkAAAICEkkAAAICEokAAAICEskAAAICEwkAAAICE0kAAAICE4kAAAICE8kAAAICFAkAAAICFEkAAAICFIkAAAICFMkAAAICFQkAAAICFUkAAAICFYkAAAICFckAAAICFgkAAAICFkkAAAICFokAAAICFskAAAICFwkAAAICF0kAAAICF4kAAAICF8kAAAICGAkAAAICGEkAAAICGIkAAAICGMkAAAICGQkAAAICGUkAAAICGYkAAAICGckAAAICGgkAAAICGkkAAAICGokAAAICGskAAAICGwkAAAICG0kAAAICG4kAAAICG8kAAAICHAkAAAICHEkAAAICHIkAAAICHMkAAAICHQkAAAICHUkAAAICHYkAAAICHckAAAICHgkAAAICHkkAAAICHokAAAICHskAAAICHwkAAAICH0kAAAICH4kAAAICH8kAAAICIAkAAAICIEkAAAICIIkAAAICIMkAAAICIQkAAAICIUkAAAICIYkAAAICIckAAAICIgkAAAICIkkAAAICIokAAAICIskAAAICIwkAAAICI0kAAAICI4kAAAICI8kAAAICJAkAAAICJEkAAAICJIkAAAICJMkAAAICJQkAAAICJUkAAAICJYkAAAICJckAAAICJgkAAAICJkkAAAICJokAAAICJskAAAICJwkAAAICJ0kAAAICJ4kAAAICJ8kAAAICKAkAAAICKEkAAAICKIkAAAICKMkAAAICKQkAAAICKUkAAAICKYkAAAICKckAAAICKgkAAAICKkkAAAICKokAAAICKskAAAICKwkAAAICK0kAAAICK4kAAAICK8kAAAICLAkAAAICLEkAAAICLIkAAAICLMkAAAICLQkAAAICLUkAAAICLYkAAAICLckAAAICLgkAAAICLkkAAAICLokAAAICLskAAAICLwkAAAICL0kAAAICL4kAAAICL8kAAAICMAkAAAICMEkAAAICMIkAAAICMMkAAAICMQkAAAICMUkAAAICMYkAAAICMckAAAICMgkAAAICMkkAAAICMokAAAICMskAAAICMwkAAAICM0kAAAICM4kAAAICM8kAAAICNAkAAAICNEkAAAICNIkAAAICNMkAAAICNQkAAAICNUkAAAICNYkAAAICNckAAAICNgkAAAICNkkAAAICNokAAAICNskAAAICNwkAAAICN0kAAAICN4kAAAICN8kAAAICOAkAAAICOEkAAAICOIkAAAICOMkAAAICOQkAAAICOUkAAAICOYkAAAICOckAAAICOgkAAAICOkkAAAICOokAAAICOskAAAICOwkAAAICO0kAAAICO4kAAAICO8kAAAICPAkAAAICPEkAAAICPIkAAAICPMkAAAICPQkAAAICPUkAAAICPYkAAAICPckAAAICPgkAAAICPkkAAAICPokAAAICPskAAAICPwkAAAICP0kAAAICP4kAAAICP8kAAAICAAlAAAICAElAAAICAIlAAAICAMlAAAICAQlAAAICAUlAAAICAYlAAAICAclAAAICAglAAAICAklAAAICAolAAAICAslAAAICAwlAAAICA0lAAAICA4lAAAICA8lAAAICBAlAAAICBElAAAICBIlAAAICBMlAAAICBQlAAAICBUlAAAICBYlAAAICBclAAAICBglAAAICBklAAAICBolAAAICBslAAAICBwlAAAICB0lAAAICB4lAAAICB8lAAAICCAlAAAICCElAAAICCIlAAAICCMlAAAICCQlAAAICCUlAAAICCYlAAAICCclAAAICCglAAAICCklAAAICColAAAICCslAAAICCwlAAAICC0lAAAICC4lAAAICC8lAAAICDAlAAAICDElAAAICDIlAAAICDMlAAAICDQlAAAICDUlAAAICDYlAAAICDclAAAICDglAAAICDklAAAICDolAAAICDslAAAICDwlAAAICD0lAAAICD4lAAAICD8lAAAICEAlAAAICEElAAAICEIlAAAICEMlAAAICEQlAAAICEUlAAAICEYlAAAICEclAAAICEglAAAICEklAAAICEolAAAICEslAAAICEwlAAAICE0lAAAICE4lAAAICE8lAAAICFAlAAAICFElAAAICFIlAAAICFMlAAAICFQlAAAICFUlAAAICFYlAAAICFclAAAICFglAAAICFklAAAICFolAAAICFslAAAICFwlAAAICF0lAAAICF4lAAAICF8lAAAICGAlAAAICGElAAAICGIlAAAICGMlAAAICGQlAAAICGUlAAAICGYlAAAICGclAAAICGglAAAICGklAAAICGolAAAICGslAAAICGwlAAAICG0lAAAICG4lAAAICG8lAAAICHAlAAAICHElAAAICHIlAAAICHMlAAAICHQlAAAICHUlAAAICHYlAAAICHclAAAICHglAAAICHklAAAICHolAAAICHslAAAICHwlAAAICH0lAAAICH4lAAAICH8lAAAICIAlAAAICIElAAAICIIlAAAICIMlAAAICIQlAAAICIUlAAAICIYlAAAICIclAAAICIglAAAICIklAAAICIolAAAICIslAAAICIwlAAAICI0lAAAICI4lAAAICI8lAAAICJAlAAAICJElAAAICJIlAAAICJMlAAAICJQlAAAICJUlAAAICJYlAAAICJclAAAICJglAAAICJklAAAICJolAAAICJslAAAICJwlAAAICJ0lAAAICJ4lAAAICJ8lAAAICKAlAAAICKElAAAICKIlAAAICKMlAAAICKQlAAAICKUlAAAICKYlAAAICKclAAAICKglAAAICKklAAAICKolAAAICKslAAAICKwlAAAICK0lAAAICK4lAAAICK8lAAAICLAlAAAICLElAAAICLIlAAAICLMlAAAICLQlAAAICLUlAAAICLYlAAAICLclAAAICLglAAAICLklAAAICLolAAAICLslAAAICLwlAAAICL0lAAAICL4lAAAICL8lAAAICMAlAAAICMElAAAICMIlAAAICMMlAAAICMQlAAAICMUlAAAICMYlAAAICMclAAAICMglAAAICMklAAAICMolAAAICMslAAAICMwlAAAICM0lAAAICM4lAAAICM8lAAAICNAlAAAICNElAAAICNIlAAAICNMlAAAICNQlAAAICNUlAAAICNYlAAAICNclAAAICNglAAAICNklAAAICNolAAAICNslAAAICNwlAAAICN0lAAAICN4lAAAICN8lAAAICOAlAAAICOElAAAICOIlAAAICOMlAAAICOQlAAAICOUlAAAICOYlAAAICOclAAAICOglAAAICOklAAAICOolAAAICOslAAAICOwlAAAICO0lAAAICO4lAAAICO8lAAAICPAlAAAICPElAAAICPIlAAAICPMlAAAICPQlAAAICPUlAAAICPYlAAAICPclAAAICPglAAAICPklAAAICPolAAAICPslAAAICPwlAAAICP0lAAAICP4lAAAICP8lAAAICAAmAAAICAEmAAAICAImAAAICAMmAAAICAQmAAAICAUmAAAICAYmAAAICAcmAAAICAgmAAAICAkmAAAICAomAAAICAsmAAAICAwmAAAICA0mAAAICA4mAAAICA8mAAAICBAmAAAICBEmAAAICBImAAAICBMmAAAICBQmAAAICBUmAAAICBYmAAAICBcmAAAICBgmAAAICBkmAAAICBomAAAICBsmAAAICBwmAAAICB0mAAAICB4mAAAICB8mAAAICCAmAAAICCEmAAAICCImAAAICCMmAAAICCQmAAAICCUmAAAICCYmAAAICCcmAAAICCgmAAAICCkmAAAICComAAAICCsmAAAICCwmAAAICC0mAAAICC4mAAAICC8mAAAICDAmAAAICDEmAAAICDImAAAICDMmAAAICDQmAAAICDUmAAAICDYmAAAICDcmAAAICDgmAAAICDkmAAAICDomAAAICDsmAAAICDwmAAAICD0mAAAICD4mAAAICD8mAAAICEAmAAAICEEmAAAICEImAAAICEMmAAAICEQmAAAICEUmAAAICEYmAAAICEcmAAAICEgmAAAICEkmAAAICEomAAAICEsmAAAICEwmAAAICE0mAAAICE4mAAAICE8mAAAICFAmAAAICFEmAAAICFImAAAICFMmAAAICFQmAAAICFUmAAAICFYmAAAICFcmAAAICFgmAAAICFkmAAAICFomAAAICFsmAAAICFwmAAAICF0mAAAICF4mAAAICF8mAAAICGAmAAAICGEmAAAICGImAAAICGMmAAAICGQmAAAICGUmAAAICGYmAAAICGcmAAAICGgmAAAICGkmAAAICGomAAAICGsmAAAICGwmAAAICG0mAAAICG4mAAAICG8mAAAICHAmAAAICHEmAAAICHImAAAICHMmAAAICHQmAAAICHUmAAAICHYmAAAICHcmAAAICHgmAAAICHkmAAAICHomAAAICHsmAAAICHwmAAAICH0mAAAICH4mAAAICH8mAAAICIAmAAAICIEmAAAICIImAAAICIMmAAAICIQmAAAICIUmAAAICIYmAAAICIcmAAAICIgmAAAICIkmAAAICIomAAAICIsmAAAICIwmAAAICI0mAAAICI4mAAAICI8mAAAICJAmAAAICJEmAAAICJImAAAICJMmAAAICJQmAAAICJUmAAAICJYmAAAICJcmAAAICJgmAAAICJkmAAAICJomAAAICJsmAAAICJwmAAAICJ0mAAAICJ4mAAAICJ8mAAAICKAmAAAICKEmAAAICKImAAAICKMmAAAICKQmAAAICKUmAAAICKYmAAAICKcmAAAICKgmAAAICKkmAAAICKomAAAICKsmAAAICKwmAAAICK0mAAAICK4mAAAICK8mAAAICLAmAAAICLEmAAAICLImAAAICLMmAAAICLQmAAAICLUmAAAICLYmAAAICLcmAAAICLgmAAAICLkmAAAICLomAAAICLsmAAAICLwmAAAICL0mAAAICL4mAAAICL8mAAAICMAmAAAICMEmAAAICMImAAAICMMmAAAICMQmAAAICMUmAAAICMYmAAAICMcmAAAICMgmAAAICMkmAAAICMomAAAICMsmAAAICMwmAAAICM0mAAAICM4mAAAICM8mAAAICNAmAAAICNEmAAAICNImAAAICNMmAAAICNQmAAAICNUmAAAICNYmAAAICNcmAAAICNgmAAAICNkmAAAICNomAAAICNsmAAAICNwmAAAICN0mAAAICN4mAAAICN8mAAAICOAmAAAICOEmAAAICOImAAAICOMmAAAICOQmAAAICOUmAAAICOYmAAAICOcmAAAICOgmAAAICOkmAAAICOomAAAICOsmAAAICOwmAAAICO0mAAAICO4mAAAICO8mAAAICPAmAAAICPEmAAAICPImAAAICPMmAAAICPQmAAAICPUmAAAICPYmAAAICPcmAAAICPgmAAAICPkmAAAICPomAAAICPsmAAAICPwmAAAICP0mAAAICP4mAAAICP8mAAAICAAnAAAICAEnAAAICAInAAAICAMnAAAICAQnAAAICAUnAAAICAYnAAAICAcnAAAICAgnAAAICAknAAAICAonAAAICAsnAAAICAwnAAAICA0nAAAICA4nAAAICA8nAAAL", TargetFrameworkMoniker.netfx461) }); - // fewer than 256 nulls - yield return (new object[200], new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAMgAAAANyAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAAMgAAAANyAs=", TargetFrameworkMoniker.netfx461) }); - // more than 256 nulls - yield return (new object[300], new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAACwBAAAOLAEAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAQAQAAACwBAAAOLAEAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Non-vector arrays - if (PlatformDetection.IsNonZeroLowerBoundArraySupported) - { - yield return (Array.CreateInstance(typeof(uint), [5], [1]), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAHAQAAAAMBAAAABQAAAAEAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAHAQAAAAMBAAAABQAAAAEAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAACw==", TargetFrameworkMoniker.netfx461) }); - } - - yield return (Array.CreateInstance(typeof(int), [0, 0, 0], [0, 0, 0]), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAHAQAAAAIDAAAAAAAAAAAAAAAAAAAAAAgL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAHAQAAAAIDAAAAAAAAAAAAAAAAAAAAAAgL", TargetFrameworkMoniker.netfx461) }); - if (PlatformDetection.IsNonZeroLowerBoundArraySupported) - { - var arr = Array.CreateInstance(typeof(string), [1, 2], [3, 4]); - arr.SetValue("hello", new[] { 3, 5 }); - yield return (arr, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAHAQAAAAUCAAAAAQAAAAIAAAADAAAABAAAAAEKBgIAAAAFaGVsbG8L", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAHAQAAAAUCAAAAAQAAAAIAAAADAAAABAAAAAEKBgIAAAAFaGVsbG8L", TargetFrameworkMoniker.netfx461) }); - } - - // Globalization types - - // CultureInfo.InvariantCulture.CompareInfo has fields which get lazy initialized - var sortVersion = new SortVersion(12345, Guid.Parse("9fac6fbb-f683-42f5-a593-0d4a5e34b257")); - CompareInfo compareInfo = new CultureInfo("").CompareInfo; - - // We set the sort version (if the field exists as it is optional) explicitly so that we aren't - // dependent on the machine configuration NLS Sorting Change tables. - typeof(CompareInfo)! - .GetField("m_SortVersion", BindingFlags.NonPublic | BindingFlags.Instance)! - .SetValue(compareInfo, sortVersion); - - yield return (compareInfo, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGAgAAAAAJAwAAAH8AAAAEAwAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbgIAAAAMbV9ObHNWZXJzaW9uCG1fU29ydElkAAMIC1N5c3RlbS5HdWlkOTAAAAT8////C1N5c3RlbS5HdWlkCwAAAAJfYQJfYgJfYwJfZAJfZQJfZgJfZwJfaAJfaQJfagJfawAAAAAAAAAAAAAACAcHAgICAgICAgK7b6yfg/b1QqWTDUpeNLJXCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGAgAAAAAJAwAAAH8AAAAEAwAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbgIAAAAMbV9ObHNWZXJzaW9uCG1fU29ydElkAAMIC1N5c3RlbS5HdWlkOTAAAAT8////C1N5c3RlbS5HdWlkCwAAAAJfYQJfYgJfYwJfZAJfZQJfZgJfZwJfaAJfaQJfagJfawAAAAAAAAAAAAAACAcHAgICAgICAgK7b6yfg/b1QqWTDUpeNLJXCw==", TargetFrameworkMoniker.netfx461) }); - yield return (sortVersion, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbgIAAAAMbV9ObHNWZXJzaW9uCG1fU29ydElkAAMIC1N5c3RlbS5HdWlkOTAAAAT+////C1N5c3RlbS5HdWlkCwAAAAJfYQJfYgJfYwJfZAJfZQJfZgJfZwJfaAJfaQJfagJfawAAAAAAAAAAAAAACAcHAgICAgICAgK7b6yfg/b1QqWTDUpeNLJXCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbgIAAAAMbV9ObHNWZXJzaW9uCG1fU29ydElkAAMIC1N5c3RlbS5HdWlkOTAAAAT+////C1N5c3RlbS5HdWlkCwAAAAJfYQJfYgJfYwJfZAJfZQJfZgJfZwJfaAJfaQJfagJfawAAAAAAAAAAAAAACAcHAgICAgICAgK7b6yfg/b1QqWTDUpeNLJXCw==", TargetFrameworkMoniker.netfx461) }); - - // Drawing types - yield return (new System.Drawing.Point(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Qb2ludAIAAAABeAF5AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Qb2ludAIAAAABeAF5AAAICAIAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new System.Drawing.Point(10, 10), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Qb2ludAIAAAABeAF5AAAICAIAAAAKAAAACgAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Qb2ludAIAAAABeAF5AAAICAIAAAAKAAAACgAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (Color.FromArgb(255, 100, 55, 255), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgQAAAAEbmFtZQV2YWx1ZQprbm93bkNvbG9yBXN0YXRlAQAAAAkHBwIAAAAK/zdk/wAAAAAAAAIACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgQAAAAEbmFtZQV2YWx1ZQprbm93bkNvbG9yBXN0YXRlAQAAAAkHBwIAAAAK/zdk/wAAAAAAAAIACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new PointF(10.5f, 10.25f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJhd2luZy5Qb2ludEYCAAAAAXgBeQAACwsCAAAAAAAoQQAAJEEL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJhd2luZy5Qb2ludEYCAAAAAXgBeQAACwsCAAAAAAAoQQAAJEEL", TargetFrameworkMoniker.netfx461) }); - yield return (new Rectangle(10, 10, 100, 50), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABhTeXN0ZW0uRHJhd2luZy5SZWN0YW5nbGUEAAAAAXgBeQV3aWR0aAZoZWlnaHQAAAAACAgICAIAAAAKAAAACgAAAGQAAAAyAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABhTeXN0ZW0uRHJhd2luZy5SZWN0YW5nbGUEAAAAAXgBeQV3aWR0aAZoZWlnaHQAAAAACAgICAIAAAAKAAAACgAAAGQAAAAyAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new RectangleF(10.5f, 10.5f, 52.3f, 69.4f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABlTeXN0ZW0uRHJhd2luZy5SZWN0YW5nbGVGBAAAAAF4AXkFd2lkdGgGaGVpZ2h0AAAAAAsLCwsCAAAAAAAoQQAAKEEzM1FCzcyKQgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABlTeXN0ZW0uRHJhd2luZy5SZWN0YW5nbGVGBAAAAAF4AXkFd2lkdGgGaGVpZ2h0AAAAAAsLCwsCAAAAAAAoQQAAKEEzM1FCzcyKQgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Size(10, 45), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0ZW0uRHJhd2luZy5TaXplAgAAAAV3aWR0aAZoZWlnaHQAAAgIAgAAAAoAAAAtAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0ZW0uRHJhd2luZy5TaXplAgAAAAV3aWR0aAZoZWlnaHQAAAgIAgAAAAoAAAAtAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SizeF(10.2f, 45.8f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5TaXplRgIAAAAFd2lkdGgGaGVpZ2h0AAALCwIAAAAzMyNBMzM3Qgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABRTeXN0ZW0uRHJhd2luZy5TaXplRgIAAAAFd2lkdGgGaGVpZ2h0AAALCwIAAAAzMyNBMzM3Qgs=", TargetFrameworkMoniker.netfx461) }); - - // Drawing is not supported on all platforms - yield return (GraphicsUnit.Pixel, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAIAAAACAAAACw==", TargetFrameworkMoniker.netcoreapp21), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAIAAAACAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (ContentAlignment.BottomCenter, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAB9TeXN0ZW0uRHJhd2luZy5Db250ZW50QWxpZ25tZW50AQAAAAd2YWx1ZV9fAAgCAAAAAAIAAAs=", TargetFrameworkMoniker.netcoreapp21), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAB9TeXN0ZW0uRHJhd2luZy5Db250ZW50QWxpZ25tZW50AQAAAAd2YWx1ZV9fAAgCAAAAAAIAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (LinearGradientMode.BackwardDiagonal, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACtTeXN0ZW0uRHJhd2luZy5EcmF3aW5nMkQuTGluZWFyR3JhZGllbnRNb2RlAQAAAAd2YWx1ZV9fAAgCAAAAAwAAAAs=", TargetFrameworkMoniker.netcoreapp21), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACtTeXN0ZW0uRHJhd2luZy5EcmF3aW5nMkQuTGluZWFyR3JhZGllbnRNb2RlAQAAAAd2YWx1ZV9fAAgCAAAAAwAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (FontStyle.Bold, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18ACAIAAAABAAAACw==", TargetFrameworkMoniker.netcoreapp21), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18ACAIAAAABAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new Font("coreFxAwesomeFont", 8.5f, FontStyle.Strikeout, GraphicsUnit.Pixel), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0ZW0uRHJhd2luZy5Gb250BAAAAAROYW1lBFNpemUFU3R5bGUEVW5pdAEABAQLGFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQIAAAAbU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AgAAAAIAAAAGAwAAABFjb3JlRnhBd2Vzb21lRm9udAAACEEF/P///xhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18ACAIAAAAIAAAABfv///8bU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AQAAAAd2YWx1ZV9fAAgCAAAAAgAAAAs=", TargetFrameworkMoniker.netcoreapp30), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0ZW0uRHJhd2luZy5Gb250BAAAAAROYW1lBFNpemUFU3R5bGUEVW5pdAEABAQLGFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQIAAAAbU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AgAAAAIAAAAGAwAAABFjb3JlRnhBd2Vzb21lRm9udAAACEEF/P///xhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18ACAIAAAAIAAAABfv///8bU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AQAAAAd2YWx1ZV9fAAgCAAAAAgAAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Custom object - var sealedObjectWithIntStringFields = new SealedObjectWithIntStringFields(); - yield return (sealedObjectWithIntStringFields, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEBCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TZWFsZWRPYmplY3RXaXRoSW50U3RyaW5nRmllbGRzAwAAAAdNZW1iZXIxB01lbWJlcjIHTWVtYmVyMwABAQgCAAAAAAAAAAoKCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEBCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TZWFsZWRPYmplY3RXaXRoSW50U3RyaW5nRmllbGRzAwAAAAdNZW1iZXIxB01lbWJlcjIHTWVtYmVyMwABAQgCAAAAAAAAAAoKCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SealedObjectWithIntStringFields() { Member1 = 42, Member2 = null!, Member3 = "84" }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEBCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TZWFsZWRPYmplY3RXaXRoSW50U3RyaW5nRmllbGRzAwAAAAdNZW1iZXIxB01lbWJlcjIHTWVtYmVyMwABAQgCAAAAKgAAAAoGAwAAAAI4NAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEBCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TZWFsZWRPYmplY3RXaXRoSW50U3RyaW5nRmllbGRzAwAAAAdNZW1iZXIxB01lbWJlcjIHTWVtYmVyMwABAQgCAAAAKgAAAAoGAwAAAAI4NAs=", TargetFrameworkMoniker.netfx461) }); - - // Custom object with fields pointing to the same object - var objectWithIntStringUShortUIntULongAndCustomObjectFields = new ObjectWithIntStringUShortUIntULongAndCustomObjectFields - { - Member1 = 10, - Member2 = "hello", - _member3 = "hello", - Member4 = sealedObjectWithIntStringFields, - Member4shared = sealedObjectWithIntStringFields, - Member5 = new SealedObjectWithIntStringFields(), - Member6 = "Hello World", - str1 = "hello < world", - str2 = "<", - str3 = "< world", - str4 = "hello < world", - u16 = ushort.MaxValue, - u32 = uint.MaxValue, - u64 = ulong.MaxValue, - }; - yield return (objectWithIntStringUShortUIntULongAndCustomObjectFields, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAFhCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5PYmplY3RXaXRoSW50U3RyaW5nVVNob3J0VUludFVMb25nQW5kQ3VzdG9tT2JqZWN0RmllbGRzDgAAAAdNZW1iZXIxB01lbWJlcjIIX21lbWJlcjMHTWVtYmVyNA1NZW1iZXI0c2hhcmVkB01lbWJlcjUHTWVtYmVyNgRzdHIxBHN0cjIEc3RyMwRzdHI0A3UxNgN1MzIDdTY0AAEBBAQEAQEBAQEAAAAIQEJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlNlYWxlZE9iamVjdFdpdGhJbnRTdHJpbmdGaWVsZHMCAAAAQEJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlNlYWxlZE9iamVjdFdpdGhJbnRTdHJpbmdGaWVsZHMCAAAAQEJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlNlYWxlZE9iamVjdFdpdGhJbnRTdHJpbmdGaWVsZHMCAAAADg8QAgAAAAoAAAAGAwAAAAVoZWxsbwkDAAAACQQAAAAJBAAAAAkFAAAABgYAAAALSGVsbG8gV29ybGQGBwAAAA1oZWxsbyA8IHdvcmxkBggAAAABPAYJAAAABzwgd29ybGQJB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J5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU2VhbGVkT2JqZWN0V2l0aEludFN0cmluZ0ZpZWxkcwMAAAAHTWVtYmVyMQdNZW1iZXIyB01lbWJlcjMAAQEIAgAAAAAAAAAKCgEFAAAABAAAAAAAAAAKCgs=", TargetFrameworkMoniker.netfx461) }); - - // Simple type without a default ctor - var point = new Point(1, 2); - yield return (point, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAIAAAABAAAAAgAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAIAAAABAAAAAgAAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Collections - yield return (new BitArray(5, true), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQml0QXJyYXkDAAAAB21fYXJyYXkIbV9sZW5ndGgIX3ZlcnNpb24HAAAICAgJAgAAAAUAAAAAAAAADwIAAAABAAAACB8AAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQml0QXJyYXkDAAAAB21fYXJyYXkIbV9sZW5ndGgIX3ZlcnNpb24HAAAICAgJAgAAAAUAAAAAAAAADwIAAAABAAAACB8AAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(Enumerable.Range(1, 40).ToList()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAKAAAAAEAAAAQAgAAACgAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAKAAAAAEAAAAQAgAAACgAAAAICAEAAAAICAIAAAAICAMAAAAICAQAAAAICAUAAAAICAYAAAAICAcAAAAICAgAAAAICAkAAAAICAoAAAAICAsAAAAICAwAAAAICA0AAAAICA4AAAAICA8AAAAICBAAAAAICBEAAAAICBIAAAAICBMAAAAICBQAAAAICBUAAAAICBYAAAAICBcAAAAICBgAAAAICBkAAAAICBoAAAAICBsAAAAICBwAAAAICB0AAAAICB4AAAAICB8AAAAICCAAAAAICCEAAAAICCIAAAAICCMAAAAICCQAAAAICCUAAAAICCYAAAAICCcAAAAICCgAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ArrayList(10), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAoAAAANCgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAoAAAANCgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Comparer(new CultureInfo("")), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIBAAAAC0NvbXBhcmVJbmZvAyBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwkCAAAABAIAAAAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8DAAAABm1fbmFtZQ1tX1NvcnRWZXJzaW9uB2N1bHR1cmUBAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uU29ydFZlcnNpb24IBgMAAAAACn8AAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABtTeXN0ZW0uQ29sbGVjdGlvbnMuQ29tcGFyZXIBAAAAC0NvbXBhcmVJbmZvAyBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Db21wYXJlSW5mbwkCAAAABAIAAAAgU3lzdGVtLkdsb2JhbGl6YXRpb24uQ29tcGFyZUluZm8DAAAABm1fbmFtZQ1tX1NvcnRWZXJzaW9uB2N1bHR1cmUBAwAgU3lzdGVtLkdsb2JhbGl6YXRpb24uU29ydFZlcnNpb24IBgMAAAAACn8AAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new DictionaryEntry("key", 5), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uQ29sbGVjdGlvbnMuRGljdGlvbmFyeUVudHJ5AgAAAARfa2V5Bl92YWx1ZQICBgIAAAADa2V5CAgFAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uQ29sbGVjdGlvbnMuRGljdGlvbmFyeUVudHJ5AgAAAARfa2V5Bl92YWx1ZQICBgIAAAADa2V5CAgFAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (Comparer.Default, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAIkBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0NvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIkBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0NvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new HashSet(new[] { point }, new PointEqualityComparer()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1Ymxp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MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAA2tleQV2YWx1ZQABCAUAAAAGAgAAAARmaXZlCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAOMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAA2tleQV2YWx1ZQABCAUAAAAGAgAAAARmaXZlCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new LinkedList(new[] { point }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACnAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpbmtlZExpc3RgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOT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MuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgDAAAAAQAAAAIAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(NonCollection(Enumerable.Range(1, 25))), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAB/U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuUXVldWVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQUAAAAGX2FycmF5BV9oZWFkBV90YWlsBV9zaXplCF92ZXJzaW9uBwAAAAAICAgICAIAAAAJAwAAAAAAAAAZAAAAGQAAAAAAAAAPAwAAACAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAB/U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuUXVldWVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQUAAAAGX2FycmF5BV9oZWFkBV90YWlsBV9zaXplCF92ZXJzaW9uBwAAAAAICAgICAIAAAAJAwAAAAAAAAAZAAAAGQAAAAAAAAAPAwAAACAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Queue(50, 5.6f), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAAAwAgAAAAAAABACAAAAMgAAAA0yCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuUXVldWUGAAAABl9hcnJheQVfaGVhZAVfdGFpbAVfc2l6ZQtfZ3Jvd0ZhY3RvcghfdmVyc2lvbgUAAAAAAAgICAgICQIAAAAAAAAAAAAAAAAAAAAwAgAAAAAAABACAAAAMgAAAA0yCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedDictionary(pointDictionary, Comparer.Default), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACJAlN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZERpY3Rpb25hcnlgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW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0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5HZW5lcmljQ29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQAAAAAMBwAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFBQAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAcAAAABAAAAAQAAAAEGAAAABQAAAAIAAAACAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedSet(new[] { point, new Point(3, 5) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACmAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlNvcnRlZFNldGAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludCwgQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0EAAAABUNvdW50CENvbXBhcmVyB1ZlcnNpb24FSXRlbXMAAwAECKwBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaW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AAAAAAAJBAAAAAQDAAAAigFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5OdWxsYWJsZUNvbXBhcmVyYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAABwQAAAAAAQAAAAQAAAADblN5c3RlbS5OdWxsYWJsZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCggIAgAAAAgIBAAAAAgIBgAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(new[] { point, new Point(2, 2) }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACiAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLlN0YWNrYDFbW0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50LCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2FycmF5BV9zaXplCF92ZXJzaW9uBAAAKEJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50W10DAAAACAgCAAAACQQ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rameworkMoniker.netfx461) }); - yield return (new Hashtable(255), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKrwEAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU2l6ZQRLZXlzBlZhbHVlcwAAAwMABQULCBxTeXN0ZW0uQ29sbGVjdGlvbnMuSUNvbXBhcmVyJFN5c3RlbS5Db2xsZWN0aW9ucy5JSGFzaENvZGVQcm92aWRlcgjsUTg/AAAAAAoKrwEAAAkCAAAACQMAAAAQAgAAAAAAAAAQAwAAAAAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Hashtable(pointDictionary, 0.3f, EqualityComparer.Default), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCJEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0VxdWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00Lj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AwAAAA8DAAAAAgAAAAgiAAAANAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACAAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCAAAAAlhZGROZXdQb3MWcmFpc2VMaXN0Q2hhbmdlZEV2ZW50cxZyYWlzZUl0ZW1DaGFuZ2VkRXZlbnRzCGFsbG93TmV3CWFsbG93RWRpdAthbGxvd1JlbW92ZQ91c2VyU2V0QWxsb3dOZXcSQ29sbGVjdGlvbmAxK2l0ZW1zAAAAAAAAAAMIAQEBAQEBDlN5c3RlbS5JbnQzMltdAgAAAP////8BAAEBAQAJAwAAAA8DAAAAAgAAAAgiAAAANAAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new BindingList(new[] { point }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAACjAVN5c3RlbS5Db21wb25lbnRNb2RlbC5CaW5kaW5nTGlzdGAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludCwgQmluYXJ5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jE5MzRlMDg5XV0IAAAACWFkZE5ld1BvcxZyYWlzZUxpc3RDaGFuZ2VkRXZlbnRzFnJhaXNlSXRlbUNoYW5nZWRFdmVudHMIYWxsb3dOZXcJYWxsb3dFZGl0C2FsbG93UmVtb3ZlD3VzZXJTZXRBbGxvd05ldxJDb2xsZWN0aW9uYDEraXRlbXMAAAAAAAAABAgBAQEBAQEoQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnRbXQMAAAACAAAA/////wEAAAEBAAkEAAAABwQAAAAAAQAAAAEAAAAEJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AwAAAAkFAAAABQUAAAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgDAAAAAQAAAAIAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Stack(new[] { point }), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAABAAAAAQAAABACAAAACgAAAAkDAAAADQkMBAAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAwAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAQAAAABAAAAAgAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABhTeXN0ZW0uQ29sbGVjdGlvbnMuU3RhY2sDAAAABl9hcnJheQVfc2l6ZQhfdmVyc2lvbgUAAAgICQIAAAABAAAAAQAAABACAAAACgAAAAkDAAAADQkMBAAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAwAAACZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAABWAFZAAAICAQAAAABAAAAAgAAAAs=", TargetFrameworkMoniker.netfx461) }); - - var stringDictionary = new StringDictionary - { - { "key1", "val1" } - }; - yield return (stringDictionary, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0RpY3Rpb25hcnkBAAAACGNvbnRlbnRzAxxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlAgAAAAkDAAAABAMAAAAcU3lzdGVtLkNvbGxlY3Rpb25zLkhhc2h0YWJsZQcAAAAKTG9hZEZhY3RvcgdWZXJzaW9uCENvbXBhcmVyEEhhc2hDb2RlUHJvdmlkZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMDAAUFCwgcU3lzdGVtLkNvbGxlY3Rpb25zLklDb21wYXJlciRTeXN0ZW0uQ29sbGVjdGlvbnMuSUhhc2hDb2RlUHJvdmlkZXII7FE4PwEAAAAKCgMAAAAJBAAAAAkFAAAAEAQAAAABAAAABgYAAAAEa2V5MRAFAAAAAQAAAAYHAAAABHZhbDEL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0RpY3Rpb25hcnkBAAAACGNvbnRlbnRzAxxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlAgAAAAkDAAAABAMAAAAcU3lzdGVtLkNvbGxlY3Rpb25zLkhhc2h0YWJsZQcAAAAKTG9hZEZhY3RvcgdWZXJzaW9uCENvbXBhcmVyEEhhc2hDb2RlUHJvdmlkZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMDAAUFCwgcU3lzdGVtLkNvbGxlY3Rpb25zLklDb21wYXJlciRTeXN0ZW0uQ29sbGVjdGlvbnMuSUhhc2hDb2RlUHJvdmlkZXII7FE4PwEAAAAKCgMAAAAJBAAAAAkFAAAAEAQAAAABAAAABgYAAAAEa2V5MRAFAAAAAQAAAAYHAAAABHZhbDEL", TargetFrameworkMoniker.netfx461) }); - - var stringCollection = new StringCollection() - { - "asdf", - "bdes", - "Abd" - }; - yield return (stringCollection, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0NvbGxlY3Rpb24BAAAABGRhdGEDHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QCAAAACQMAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkEAAAAAwAAAAMAAAAQBAAAAAQAAAAGBQAAAARhc2RmBgYAAAAEYmRlcwYHAAAAA0FiZAoL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLlN0cmluZ0NvbGxlY3Rpb24BAAAABGRhdGEDHFN5c3RlbS5Db2xsZWN0aW9ucy5BcnJheUxpc3QCAAAACQMAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24FAAAICAkEAAAAAwAAAAMAAAAQBAAAAAQAAAAGBQAAAARhc2RmBgYAAAAEYmRlcwYHAAAAA0FiZAoL", TargetFrameworkMoniker.netfx461) }); - - var orderedDictionary = new OrderedDictionary(7) - { - { "key1", 34 }, - { "keyx", "s2" }, - { 22, "sample" } - }; - yield return (orderedDictionary, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABSRTeXN0ZW0uQ29sbGVjdGlvbnMuSUVxdWFsaXR5Q29tcGFyZXIBCAIAAAAKAAcAAAAJAwAAABADAAAAAwAAAAkEAAAACQUAAAAJBgAAAAQEAAAAIlN5c3RlbS5Db2xsZWN0aW9ucy5EaWN0aW9uYXJ5RW50cnkCAAAABF9rZXkGX3ZhbHVlAgIGBwAAAARrZXkxCAgiAAAAAQUAAAAEAAAABggAAAAEa2V5eAYJAAAAAnMyAQYAAAAEAAAACAgWAAAABgoAAAAGc2FtcGxlCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAwU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLk9yZGVyZWREaWN0aW9uYXJ5BAAAAAtLZXlDb21wYXJlcghSZWFkT25seQ9Jbml0aWFsQ2FwYWNpdHkJQXJyYXlMaXN0AwAABSRTeXN0ZW0uQ29sbGVjdGlvbnMuSUVxdWFsaXR5Q29tcGFyZXIBCAIAAAAKAAcAAAAJAwAAABADAAAAAwAAAAkEAAAACQUAAAAJBgAAAAQEAAAAIlN5c3RlbS5Db2xsZWN0aW9ucy5EaWN0aW9uYXJ5RW50cnkCAAAABF9rZXkGX3ZhbHVlAgIGBwAAAARrZXkxCAgiAAAAAQUAAAAEAAAABggAAAAEa2V5eAYJAAAAAnMyAQYAAAAEAAAACAgWAAAABgoAAAAGc2FtcGxlCw==", TargetFrameworkMoniker.netfx461) }); - - var listDictionary = new ListDictionary(StringComparer.Create(CultureInfo.InvariantCulture, false)) - { - { "key1", "value1" }, - { "keyx", "valuex" } - }; - yield return (listDictionary, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBtTeXN0ZW0uQ3VsdHVyZUF3YXJlQ29tcGFyZXICAAAACQMAAAACAAAAAgAAAAkEAAAABQMAAAA8U3lz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JlSW5mbwMAAAAGbV9uYW1lDW1fU29ydFZlcnNpb24HY3VsdHVyZQEDACBTeXN0ZW0uR2xvYmFsaXphdGlvbi5Tb3J0VmVyc2lvbggGDAAAAAAKfwAAAAs=", TargetFrameworkMoniker.netfx472_3260) }); - yield return (new ListDictionary(StringComparer.Ordinal), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAgAAAAoAAAAAAAAAAAkDAAAABAMAAAAWU3lzdGVtLk9yZGluYWxDb21wYXJlcgEAAAALX2lnbm9yZUNhc2UAAQAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAgAAAAoAAAAAAAAAAAkDAAAABAMAAAAWU3lzdGVtLk9yZGluYWxDb21wYXJlcgEAAAALX2lnbm9yZUNhc2UAAQAL", TargetFrameworkMoniker.netfx461) }); - yield return (new ListDictionary(StringComparer.OrdinalIgnoreCase), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAgAAAAoAAAAAAAAAAAkDAAAABAMAAAAWU3lzdGVtLk9yZGluYWxDb21wYXJlcgEAAAALX2lnbm9yZUNhc2UAAQEL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkxpc3REaWN0aW9uYXJ5BAAAAARoZWFkB3ZlcnNpb24FY291bnQIY29tcGFyZXIEAAADPFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZC5MaXN0RGljdGlvbmFyeStEaWN0aW9uYXJ5Tm9kZQIAAAAICBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyAgAAAAoAAAAAAAAAAAkDAAAABAMAAAAWU3lzdGVtLk9yZGluYWxDb21wYXJlcgEAAAALX2lnbm9yZUNhc2UAAQEL", TargetFrameworkMoniker.netfx461) }); - - var hybridDictionary = new HybridDictionary(10, true) - { - { "5d", 32 } - }; - yield return (hybridDictionary, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoJAwAAAAEEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyCOxROD8BAAAACQQAAAARAAAACQUAAAAJBgAAAAQEAAAAFlN5c3RlbS5PcmRpbmFsQ29tcGFyZXIBAAAAC19pZ25vcmVDYXNlAAEBEAUAAAABAAAABgcAAAACNWQQBgAAAAEAAAAICCAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAvU3lzdGVtLkNvbGxlY3Rpb25zLlNwZWNpYWxpemVkLkh5YnJpZERpY3Rpb25hcnkDAAAABGxpc3QJaGFzaHRhYmxlD2Nhc2VJbnNlbnNpdGl2ZQQDAC1TeXN0ZW0uQ29sbGVjdGlvbnMuU3BlY2lhbGl6ZWQuTGlzdERpY3Rpb25hcnkCAAAAHFN5c3RlbS5Db2xsZWN0aW9ucy5IYXNodGFibGUBAgAAAAoJAwAAAAEEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBgAAAApMb2FkRmFjdG9yB1ZlcnNpb24LS2V5Q29tcGFyZXIISGFzaFNpemUES2V5cwZWYWx1ZXMAAAMABQULCBZTeXN0ZW0uT3JkaW5hbENvbXBhcmVyCOxROD8BAAAACQQAAAARAAAACQUAAAAJBgAAAAQEAAAAFlN5c3RlbS5PcmRpbmFsQ29tcGFyZXIBAAAAC19pZ25vcmVDYXNlAAEBEAUAAAABAAAABgcAAAACNWQQBgAAAAEAAAAICCAAAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new SortedList(dictionary, Comparer.Default), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABVU3lzdGVtLkNvbGxlY3Rpb25zLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAA4QFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5Tb3J0ZWRMaXN0YDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0HAAAABGtleXMGdmFsdWVzBV9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ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAB/U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuUXVldWVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQUAAAAGX2FycmF5BV9oZWFkBV90YWlsBV9zaXplCF92ZXJzaW9uBwAAAAAICAgICAIAAAAJAwAAAAAAAAAKAAAACgAAAAAAAAAPAwAAABAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAB/U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuUXVldWVgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQUAAAAGX2FycmF5BV9oZWFkBV90YWlsBV9zaXplCF92ZXJzaW9uBwAAAAAICAgICAIAAAAJAwAAAAAAAAAKAAAACgAAAAAAAAAPAwAAABAAAAAIAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs=", TargetFrameworkMoniker.netfx461) }); - - // Passing an array to the IEnumerable cosntructor to hit its ICollection optimization, which causes all runtimes to - // produce the same internal state. Otherwise, they come up with different _version values - var observableCollection = new ObservableCollection(Enumerable.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Q3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAACQMAAAAJBAAAAAUDAAAAoAFTeXN0ZW0uQ29sbGVjdGlvbnMuT2JqZWN0TW9kZWwuT2JzZXJ2YWJsZUNvbGxlY3Rpb25gMStTaW1wbGVNb25pdG9yW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAApfYnVzeUNvdW50AAgCAAAAAAAAAAQEAAAAflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACAgICQUAAAAFAAAAAAAAAA8FAAAABQAAAAgBAAAAAgAAAAMAAAAEAAAABQAAAAs=", TargetFrameworkMoniker.netfx461) }); - yield return (new ReadOnlyObservableCollection(observableCollection), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAE5XaW5kb3dzQmFzZSwgVmVyc2lvbj0zLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzUFAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLlJlYWRPbmx5T2JzZXJ2YWJsZUNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAZUmVhZE9ubHlDb2xsZ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pemUIX3ZlcnNpb24HAAAICAgJBgAAAAUAAAAAAAAADwYAAAAFAAAACAEAAAACAAAAAwAAAAQAAAAFAAAACw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new ReadOnlyCollection(Enumerable.Range(1, 15).ToList()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAJABU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLlJlYWRPbmx5Q29sbGVjdGlvbmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAARsaXN0A35TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0JAgAAAAQCAAAAflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACAgICQMAAAAPAAAAAQAAAA8DAAAADwAAAAgBAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAJABU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLlJlYWRPbmx5Q29sbGVjdGlvbmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJ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RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBwAACAgICQMAAAAPAAAAAQAAAA8DAAAADwAAAAgBAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAL", TargetFrameworkMoniker.netfx461) }); - yield return (new Collection(Enumerable.Range(1, 20).ToList()), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAFaXRlbXMDflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQkCAAAABAIAAAB+U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24HAAAICAgJAwAAABQAAAABAAAADwMAAAAUAAAACAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAFaXRlbXMDflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQkCAAAABAIAAAB+U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24HAAAICAgJAwAAABQAAAABAAAADwMAAAAUAAAACAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIgBU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLkNvbGxlY3Rpb25gMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAAFaXRlbXMDflN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQkCAAAABAIAAAB+U3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24HAAAICAgJAwAAABQAAAABAAAADwMAAAAUAAAACAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new ReadOnlyDictionary(dictionary), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAO0BU3lzdGVtLkNvbGxlY3Rpb25zLk9iamVjdE1vZGVsLlJlYWRPbmx5RGljdGlvbmFyeWAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAxtX2RpY3Rpb25hcnkD4QFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5EaWN0aW9uYXJ5YDJbW1N5c3RlbS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LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0E+////+MBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0CAAAAA2tleQV2YWx1ZQABCAEAAAAGBgAAAAR0ZXN0Afn////7////AgAAAAYIAAAADGFub3RoZXIgdGVzdAs=", TargetFrameworkMoniker.netfx461) }); - - var simpleKeyedCollection = new SimpleKeyedCollection - { - point - }; - yield return (simpleKeyedCollection, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TaW1wbGVLZXllZENvbGxlY3Rpb24FAAAAGktleWVkQ29sbGVjdGlvbmAyK2NvbXBhcmVyFktleWVkQ29sbGVjdGlvbmAyK2RpY3QaS2V5ZWRDb2xsZWN0aW9uYDIra2V5Q291bnQbS2V5ZWRDb2xsZWN0aW9uYDIrdGhyZXNob2xkEkNvbGxlY3Rpb25gMStpdGVtcwMDAAADkQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5HZW5lcmljRXF1YWxpdHlDb21wYXJlcmAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsI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EJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBPf///+FAlN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLktleVZhbHVlUGFpcmAyW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50LCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAADa2V5BXZhbHVlAAQIJkJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlBvaW50AgAAAAIAAAAJCgAAAAcIAAAAAAEAAAAEAAAABCZCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Qb2ludAIAAAAJCgAAAA0DBQoAAAAmQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuUG9pbnQCAAAAAVgBWQAACAgCAAAAAQAAAAIAAAAL", TargetFrameworkMoniker.netfx461) }); - - // Graph without cycles - yield return (new Tree(42, null!, null!), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJza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dHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAIAAAAqAAAACgoL", TargetFrameworkMoniker.netfx461) }); - yield return (new Tree(1, new Tree(2, new Tree(3, null!, null!), null!), null!), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAABY8VmFsdWU+a19fQmFja2luZ0ZpZWxkFTxMZWZ0PmtfX0JhY2tpbmdGaWVsZBY8UmlnaHQ+a19fQmFja2luZ0ZpZWxkAAQECIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAg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jc3YTVjNTYxOTM0ZTA4OV1dAgAAAAIAAAABAAAACQMAAAAKAQMAAAABAAAAAgAAAAkEAAAACgEEAAAAAQAAAAMAAAAKCgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new Tree(Colors.Red, null!, new Tree(Colors.Blue, null!, new Tree(Colors.Green, null!, null!))), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAKgBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5Db2xvcnMsIEJpbmFyeUZvcm1hdFRlc3RzLCBWZXJzaW9uPTkuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAABY8VmFsdWU+a19fQmFja2luZ0ZpZWxkFTxMZWZ0PmtfX0JhY2tpbmdGaWVsZBY8UmlnaHQ+a19fQmFja2luZ0ZpZWxkBAQEJ0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkNvbG9ycwIAAACoAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlRyZWVgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuQ29sb3JzLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAACoAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlRyZWVgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0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wsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAACoAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlRyZWVgMVtbQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuQ29sb3JzLCBCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAACAAAABf3///8nQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuQ29sb3JzAQAAAAd2YWx1ZV9fAAgCAAAAAAAAAAoJBAAAAAEEAAAAAQAAAAH7/////f///wQAAAAKCQYAAAABBgAAAAEAAAAB+f////3///8DAAAACgoL", TargetFrameworkMoniker.netfx461) }); - yield return (new Tree(1, new Tree(2, new Tree(3, null!, null!), new Tree(4, null!, null!)), new Tree(5, null!, null!)), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAABY8VmFsdWU+a19fQmFja2luZ0ZpZWxkFTxMZWZ0PmtfX0JhY2tpbmdGaWVsZBY8UmlnaHQ+a19fQmFja2luZ0ZpZWxkAAQECIQBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG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mluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuVHJlZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAIAAAABAAAACQMAAAAJBAAAAAEDAAAAAQAAAAIAAAAJBQAAAAkGAAAAAQQAAAABAAAABQAAAAoKAQUAAAABAAAAAwAAAAoKAQYAAAABAAAABAAAAAoKCw==", TargetFrameworkMoniker.netfx461) }); - - // Graph with cycles - { - var a = new Graph { Value = 1 }; - var b = new Graph { Value = 2, Links = [a] }; - var c = new Graph { Value = 3, Links = [a, b] }; - var d = new Graph { Value = 3, Links = [a, b, c] }; - a.Links = [b, c, d]; // complete the cycle - yield return (a, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAIUBQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuR3JhcGhgMVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFVmFsdWUFTGlua3MABAiHAUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLkdyYXBoYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV1bXQIAAAACAAAAAQAAAAkDAAAABwMAAAAAAQAAAAMAAAAEhQFCaW5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bU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAJAQAAAAkEAAAABwkAAAAAAQAAAAMAAAAEhQFCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5HcmFwaGAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAAkBAAAACQQAAAAJBQAAAAs=", TargetFrameworkMoniker.netfx461) }); - } - - // Structs - yield return (new EmptyStruct(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACxCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5FbXB0eVN0cnVjdAAAAAACAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACxCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5FbXB0eVN0cnVjdAAAAAACAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StructWithIntField { X = 42 }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADNCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoSW50RmllbGQBAAAAAVgACAIAAAAqAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADNCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoSW50RmllbGQBAAAAAVgACAIAAAAqAAAACw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StructWithStringFields { String1 = "hello", String2 = "world" }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAdTdHJpbmcxB1N0cmluZzIBAQIAAAAGAwAAAAVoZWxsbwYEAAAABXdvcmxkCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAdTdHJpbmcxB1N0cmluZzIBAQIAAAAGAwAAAAVoZWxsbwYEAAAABXdvcmxkCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StructContainingOtherStructs { Nested1 = new StructWithStringFields { String1 = "a", String2 = "b" }, Nested2 = new StructWithStringFields { String1 = "3", String2 = "4" } }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzAgAAAAdOZXN0ZWQxB05lc3RlZDIEBDdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAADdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAIAAAAF/f///zdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAdTdHJpbmcxB1N0cmluZzIBAQIAAAAGBAAAAAFhBgUAAAABYgH6/////f///wYHAAAAATMGCAAAAAE0Cw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzAgAAAAdOZXN0ZWQxB05lc3RlZDIEBDdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAADdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAIAAAAF/f///zdCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RXaXRoU3RyaW5nRmllbGRzAgAAAAdTdHJpbmcxB1N0cmluZzIBAQIAAAAGBAAAAAFhBgUAAAABYgH6/////f///wYHAAAAATMGCAAAAAE0Cw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StructContainingArraysOfOtherStructs(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEVCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nQXJyYXlzT2ZPdGhlclN0cnVjdHMBAAAABk5lc3RlZAQ/QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ090aGVyU3RydWN0c1tdAgAAAAIAAAAKCw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEVCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nQXJyYXlzT2ZPdGhlclN0cnVjdHMBAAAABk5lc3RlZAQ/QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ090aGVyU3RydWN0c1tdAgAAAAIAAAAKCw==", TargetFrameworkMoniker.netfx461) }); - yield return (new StructContainingArraysOfOtherStructs { Nested = [] }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEVCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nQXJyYXlzT2ZPdGhlclN0cnVjdHMBAAAABk5lc3RlZAQ/QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ090aGVyU3RydWN0c1tdAgAAAAIAAAAJAwAAAAcDAAAAAAEAAAAAAAAABD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzAgAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEVCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nQXJyYXlzT2ZPdGhlclN0cnVjdHMBAAAABk5lc3RlZAQ/QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ090aGVyU3RydWN0c1tdAgAAAAIAAAAJAwAAAAcDAAAAAAEAAAAAAAAABD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzAgAAAAs=", TargetFrameworkMoniker.netfx461) }); - var s = new StructContainingArraysOfOtherStructs - { - Nested = - [ - new StructContainingOtherStructs { Nested1 = new StructWithStringFields { String1 = "a", String2 = "b" }, Nested2 = new StructWithStringFields { String1 = "3", String2 = "4" } }, - new StructContainingOtherStructs { Nested1 = new StructWithStringFields { String1 = "e", String2 = "f" }, Nested2 = new StructWithStringFields { String1 = "7", String2 = "8" } }, - ] - }; - yield return (s, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAEVCaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nQXJyYXlzT2ZPdGhlclN0cnVjdHMBAAAABk5lc3RlZAQ/QmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ090aGVyU3RydWN0c1tdAgAAAAIAAAAJAwAAAAcDAAAAAAEAAAACAAAABD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzAgAAAAX8////PUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdENvbnRhaW5pbmdPdGhlclN0cnVjdHMCAAAAB05lc3RlZDEHTmVzdGVkMgQEN0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdHJpbmdGaWVsZHMCAAAAN0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdH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vcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdHJpbmdGaWVsZHMCAAAAB1N0cmluZzEHU3RyaW5nMgEBAgAAAAYGAAAAAWEGBwAAAAFiAfj////7////BgkAAAABMwYKAAAAATQB9f////z///8B9P////v///8GDQAAAAFlBg4AAAABZgHx////+////wYQAAAAATcGEQAAAAE4Cw==", TargetFrameworkMoniker.netfx461) }); - yield return (new object[] { s, new StructContainingArraysOfOtherStructs?(s) }, new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAQAQAAAAIAAAAJAgAAAAkDAAAADAQAAABUQmluYXJ5Rm9ybWF0VGVzdHMsIFZlcnNpb249OS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQIAAABFQmluYXJ5Rm9ybWF0VGVzdHMuRm9ybWF0dGVyVGVzdHMuU3RydWN0Q29udGFpbmluZ0FycmF5c09mT3RoZXJTdHJ1Y3RzAQAAAAZOZXN0ZWQEP0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdENvbnRhaW5pbmdPdGhlclN0cnVjdHNbXQQAAAAEAAAACQUAAAABAwAAAAIAAAAJBQAAAAcFAAAAAAEAAAACAAAABD1CaW5hcnlGb3JtYXRUZXN0cy5Gb3JtYXR0ZXJUZXN0cy5TdHJ1Y3RDb250YWluaW5nT3RoZXJTdHJ1Y3RzBAAAAAX6////PUJpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdENvbnRhaW5pbmdPdGhlclN0cnVjdHMCAAAAB05lc3RlZDEHTmVzdGVkMgQEN0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdHJpbmdGaWVsZHMEAAAAN0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdHJpbmdGaWVsZHMEAAA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0JpbmFyeUZvcm1hdFRlc3RzLkZvcm1hdHRlclRlc3RzLlN0cnVjdFdpdGhTdHJpbmdGaWVsZHMCAAAAB1N0cmluZzEHU3RyaW5nMgEBBAAAAAYIAAAAAWEGCQAAAAFiAfb////5////BgsAAAABMwYMAAAAATQB8/////r///8B8v////n///8GDwAAAAFlBhAAAAABZgHv////+f///wYSAAAAATcGEwAAAAE4Cw==", TargetFrameworkMoniker.netfx461) }); - - // ISerializable - yield return (new BasicISerializableObject(1, "2"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADVGb3JtYXRUZXN0cy5Db21tb24uVGVzdFR5cGVzLkJhc2ljSVNlcmlhbGl6YWJsZU9iamVjdAIAAAAGVmFsdWUxBlZhbHVlMgABCAIAAAABAAAABgMAAAABMgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAADVGb3JtYXRUZXN0cy5Db21tb24uVGVzdFR5cGVzLkJhc2ljSVNlcmlhbGl6YWJsZU9iamVjdAIAAAAGVmFsdWUxBlZhbHVlMgABCAIAAAABAAAABgMAAAABMgs=", TargetFrameworkMoniker.netfx461) }); - yield return (new DerivedISerializableWithNonPublicDeserializationCtor(1, "2"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAFFGb3JtYXRUZXN0cy5Db21tb24uVGVzdFR5cGVzLkRlcml2ZWRJU2VyaWFsaXphYmxlV2l0aE5vblB1YmxpY0Rlc2VyaWFsaXphdGlvbkN0b3ICAAAABlZhbHVlMQZWYWx1ZTIAAQgCAAAAAQAAAAYDAAAAATIL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAFFGb3JtYXRUZXN0cy5Db21tb24uVGVzdFR5cGVzLkRlcml2ZWRJU2VyaWFsaXphYmxlV2l0aE5vblB1YmxpY0Rlc2VyaWFsaXphdGlvbkN0b3ICAAAABlZhbHVlMQZWYWx1ZTIAAQgCAAAAAQAAAAYDAAAAATIL", TargetFrameworkMoniker.netfx461) }); - - // Various other special cases - yield return (new TypeWithoutNamespace(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABRUeXBlV2l0aG91dE5hbWVzcGFjZQAAAAACAAAACw==", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAMAgAAAFRCaW5hcnlGb3JtYXRUZXN0cywgVmVyc2lvbj05LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABRUeXBlV2l0aG91dE5hbWVzcGFjZQAAAAACAAAACw==", TargetFrameworkMoniker.netfx461) }); - - yield return (new ValueTuple(), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAABFTeXN0ZW0uVmFsdWVUdXBsZQAAAAAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAABFTeXN0ZW0uVmFsdWVUdXBsZQAAAAAL", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAHBTeXN0ZW0uVmFsdWVUdXBsZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAVJdGVtMQAIAQAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAHBTeXN0ZW0uVmFsdWVUdXBsZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAVJdGVtMQAIAQAAAAs=", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1, "2"), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAM0BU3lzdGVtLlZhbHVlVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFSXRlbTEFSXRlbTIAAQgBAAAABgIAAAABMgs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAM0BU3lzdGVtLlZhbHVlVHVwbGVgMltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQIAAAAFSXRlbTEFSXRlbTIAAQgBAAAABgIAAAABMgs=", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1, "2", 3u), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAKoCU3lzdGVtLlZhbHVlVHVwbGVgM1tbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAFSXRlbTEFSXRlbTIFSXRlbTMAAQAIDwEAAAAGAgAAAAEyAwAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAKoCU3lzdGVtLlZhbHVlVHVwbGVgM1tbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQMAAAAFSXRlbTEFSXRlbTIFSXRlbTMAAQAIDwEAAAAGAgAAAAEyAwAAAAs=", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1, "2", 3u, 4L), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAIYDU3lzdGVtLlZhbHVlVHVwbGVgNFtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uSW50NjQsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBAAAAAVJdGVtMQVJdGVtMgVJdGVtMwVJdGVtNAABAAAIDwkBAAAABgIAAAABMgMAAAAEAAAAAAAAAAs=", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAIYDU3lzdGVtLlZhbHVlVHVwbGVgNFtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uSW50NjQsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBAAAAAVJdGVtMQVJdGVtMgVJdGVtMwVJdGVtNAABAAAIDwkBAAAABgIAAAABMgMAAAAEAAAAAAAAAAs=", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1, "2", 3u, 4L, 5.6), new TypeSerializableValue[] { new("AAEAAAD/////AQAAAAAAAAAEAQAAAOMDU3lzdGVtLlZhbHVlVHVwbGVgNVtbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUw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AAAAAABmZmZmZmYWQJqZ+UAL", TargetFrameworkMoniker.netcoreapp20), new("AAEAAAD/////AQAAAAAAAAAEAQAAAMAEU3lzdGVtLlZhbHVlVHVwbGVgNltbU3lzdGVtLkludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uVUludDMyLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uSW50NjQsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5Eb3VibGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TaW5nbGUsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBgAAAAVJdGVtMQVJdGVtMgVJdGVtMwVJdGVtNAVJdGVtNQVJdGVtNgABAAAAAAgPCQYLAQAAAAYCAAAAATIDAAAABAAAAAAAAABmZmZmZmYWQJqZ+UAL", TargetFrameworkMoniker.netfx471) }); - yield return (ValueTuple.Create(1, "2", 3u, 4L, 5.6, 7.8f, 9m), new TypeSerializableValue[] { new("AAEAAAD/////AQAAA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wbGVgMVtbU3lzdGVtLlR1cGxlYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAVJdGVtMQNrU3lzdGVtLlR1cGxlYDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0JBAAAAAQEAAAAa1N5c3RlbS5UdXBsZWAxW1tTeXN0ZW0uSW50MzIsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAQAAAAdtX0l0ZW0xAAgKAAAACw==", TargetFrameworkMoniker.netfx471) }); - } - - // *** NON AUTO UPDATED DATA *** - - private static T PopulateException(T exception, bool setHResult = true) - where T : Exception - { - exception.HelpLink = "http://msdn.microsoft.com"; - exception.Source = "Exception_Class_Samples"; - - exception.Data.Add("secret", true); - exception.Data.Add(1, "one"); - - typeof(Exception)! - .GetField("_stackTraceString", BindingFlags.Instance | BindingFlags.NonPublic)! - .SetValue(exception, "StackTrace string..."); - - if (setHResult) - { - typeof(Exception)! - .GetField("_HResult", BindingFlags.Instance | BindingFlags.NonPublic)! - .SetValue(exception, 1000); - } - - typeof(Exception)! - .GetField("_remoteStackTraceString", BindingFlags.Instance | BindingFlags.NonPublic)! - .SetValue(exception, "Remote StackTrace string..."); - - return exception; - } - - public static IEnumerable NonSerializableObjects() - { - yield return new NonSerializableStruct(); - yield return new NonSerializableClass(); - yield return new SerializableClassWithBadField(); - yield return new SerializableClassDerivedFromNonSerializableClass(); - yield return new object[] { 1, 2, 3, new NonSerializableClass() }; - } - - public static TheoryData NonSerializableTypes_MemberData => - NonSerializableTypes().ToTheoryData(); - - public static IEnumerable<(object, FormatterAssemblyStyle, FormatterTypeStyle)> NonSerializableTypes() - { - foreach (object obj in NonSerializableObjects()) - { - foreach (FormatterAssemblyStyle assemblyFormat in new[] { FormatterAssemblyStyle.Full, FormatterAssemblyStyle.Simple }) - { - foreach (FormatterTypeStyle typeFormat in new[] { FormatterTypeStyle.TypesAlways, FormatterTypeStyle.TypesWhenNeeded, FormatterTypeStyle.XsdString }) - { - yield return (obj, assemblyFormat, typeFormat); - } - } - } - } - - public static TheoryData FuzzInputs_MemberData() - { - TheoryData data = []; - var rand = new Random(42); - - foreach (var record in RawSerializableObjects()) - { - const int FuzzingsPerObject = 3; - for (int i = 0; i < FuzzingsPerObject; i++) - { - data.Add(record.Item1, rand); - } - } - - return data; - } - - public static IEnumerable CrossProcessObjects_MemberData() - { - // Just a few objects to verify we can roundtrip out of process memory - yield return new object[] { "test" }; - yield return new object[] { new List { 1, 2, 3, 4, 5 } }; - yield return new object[] { new Tree(1, new Tree(2, new Tree(3, null!, null!), new Tree(4, null!, null!)), new Tree(5, null!, null!)) }; - } - - private static IEnumerable NonCollection(IEnumerable enumerable) - { - foreach (T item in enumerable) - { - yield return item; - } - } -} - -#pragma warning restore CA2201 // Do not raise reserved exception types diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTests.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTests.cs deleted file mode 100644 index 607b45d6998..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/BinaryFormatterTests.cs +++ /dev/null @@ -1,422 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Imaging; -using System.Globalization; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using System.Text.RegularExpressions; - -namespace BinaryFormatTests.FormatterTests; - -public partial class BinaryFormatterTests -{ - [Theory] - [MemberData(nameof(SerializableObjects_MemberData))] - public void ValidateAgainstBlobs(object obj, TypeSerializableValue[] blobs) - => ValidateAndRoundtrip(obj, blobs, isEqualityComparer: false); - - [Theory] - [MemberData(nameof(SerializableEqualityComparers_MemberData))] - public void ValidateEqualityComparersAgainstBlobs(object obj, TypeSerializableValue[] blobs) - => ValidateAndRoundtrip(obj, blobs, isEqualityComparer: true); - - private static void ValidateAndRoundtrip(object obj, TypeSerializableValue[] blobs, bool isEqualityComparer) - { - if (obj is null) - { - throw new ArgumentNullException(nameof(obj), "The serializable object must not be null"); - } - - if (blobs is null || blobs.Length == 0) - { - throw new ArgumentOutOfRangeException($"Type {obj} has no blobs to deserialize and test equality against. Blob: " + - BinaryFormatterHelpers.ToBase64String(obj, FormatterAssemblyStyle.Full)); - } - - // Check if the passed in value in a serialization entry is assignable by the passed in type. - if (obj is ISerializable serializable) - { - CheckObjectTypeIntegrity(serializable); - } - - // TimeZoneInfo objects have three properties (DisplayName, StandardName, DaylightName) - // that are localized. Since the blobs were generated from the invariant culture, they - // will have English strings embedded. Thus, we can only test them against English - // language cultures or the invariant culture. - if (obj is TimeZoneInfo && ( - CultureInfo.CurrentUICulture.TwoLetterISOLanguageName != "en" || - CultureInfo.CurrentUICulture.Name.Length != 0)) - { - return; - } - - SanityCheckBlob(obj, blobs); - - if (!isEqualityComparer) - { - // Test moved to BasicObjectTests - return; - } - - // ReflectionTypeLoadException and LicenseException aren't deserializable from Desktop --> Core. - // Therefore we remove the second blob which is the one from Desktop. - if (obj is ReflectionTypeLoadException or LicenseException) - { - var tmpList = new List(blobs); - tmpList.RemoveAt(1); - - int index = tmpList.FindIndex(b => b.Platform.ToString().StartsWith("netfx", StringComparison.Ordinal)); - if (index >= 0) - tmpList.RemoveAt(index); - - blobs = [.. tmpList]; - } - - // We store our framework blobs in index 1 - int platformBlobIndex = blobs.GetPlatformIndex(); - for (int i = 0; i < blobs.Length; i++) - { - // Check if the current blob is from the current running platform. - bool isSamePlatform = i == platformBlobIndex; - - ValidateEqualityComparer(BinaryFormatterHelpers.FromBase64String(blobs[i].Base64Blob, FormatterAssemblyStyle.Simple)); - ValidateEqualityComparer(BinaryFormatterHelpers.FromBase64String(blobs[i].Base64Blob, FormatterAssemblyStyle.Full)); - } - } - - [Fact] - public void RegexExceptionSerializable() - { - try - { -#pragma warning disable RE0001 // Regex issue: {0} -#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'. - _ = new Regex("*"); // parsing "*" - Quantifier {x,y} following nothing. -#pragma warning restore SYSLIB1045 // Convert to 'GeneratedRegexAttribute'. -#pragma warning restore RE0001 // Regex issue: {0} - } - catch (ArgumentException ex) - { - Assert.Equal("RegexParseException", ex.GetType().Name); - ArgumentException clone = BinaryFormatterHelpers.Clone(ex); - Assert.IsType(clone); - } - } - - [Fact] - public void ArraySegmentDefaultCtor() - { - // This is workaround for Xunit bug which tries to pretty print test case name and enumerate this object. - // When inner array is not initialized it throws an exception when this happens. - object obj = new ArraySegment(); - string corefxBlob = "AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAoAAAAAAAAAAAs="; - string netfxBlob = "AAEAAAD/////AQAAAAAAAAAEAQAAAHJTeXN0ZW0uQXJyYXlTZWdtZW50YDFbW1N5c3RlbS5JbnQzMiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0DAAAABl9hcnJheQdfb2Zmc2V0Bl9jb3VudAcAAAgICAoAAAAAAAAAAAs="; - EqualityExtensions.CheckEquals(obj, BinaryFormatterHelpers.FromBase64String(corefxBlob, FormatterAssemblyStyle.Full), isSamePlatform: true); - EqualityExtensions.CheckEquals(obj, BinaryFormatterHelpers.FromBase64String(netfxBlob, FormatterAssemblyStyle.Full), isSamePlatform: true); - } - - [Fact(Skip = "Needs updated.")] - public void ValidateDeserializationOfObjectWithDifferentAssemblyVersion() - { - // To generate this properly, change AssemblyVersion to a value which is unlikely to happen in production and generate base64(serialized-data) - // For this test 9.98.7.987 is being used - var obj = new SomeType() { SomeField = 7 }; - string serializedObj = @"AAEAAAD/////AQAAAAAAAAAMAgAAAHBTeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLkZvcm1hdHRlcnMuVGVzdHMsIFZlcnNpb249NS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1jYzdiMTNmZmNkMmRkZDUxBQEAAAA2U3lzdGVtLlJ1bnRpbWUuU2VyaWFsaXphdGlvbi5Gb3JtYXR0ZXJzLlRlc3RzLlNvbWVUeXBlAQAAAAlTb21lRmllbGQACAIAAAAHAAAACw=="; - - var deserialized = (SomeType)BinaryFormatterHelpers.FromBase64String(serializedObj, FormatterAssemblyStyle.Simple); - Assert.Equal(obj, deserialized); - } - - [Fact(Skip = "Needs updated.")] - public void ValidateDeserializationOfObjectWithGenericTypeWhichGenericArgumentHasDifferentAssemblyVersion() - { - // To generate this properly, change AssemblyVersion to a value which is unlikely to happen in production and generate base64(serialized-data) - // For this test 9.98.7.987 is being used - var obj = new GenericTypeWithArg() { Test = new SomeType() { SomeField = 9 } }; - string serializedObj = @"AAEAAAD/////AQAAAAAAAAAMAgAAAHBTeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLkZvcm1hdHRlcnMuVGVzdHMsIFZlcnNpb249NS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1jYzdiMTNmZmNkMmRkZDUxBQEAAADuAVN5c3RlbS5SdW50aW1lLlNlcmlhbGl6YXRpb24uRm9ybWF0dGVycy5UZXN0cy5HZW5lcmljVHlwZVdpdGhBcmdgMVtbU3lzdGVtLlJ1bnRpbWUuU2VyaWFsaXphdGlvbi5Gb3JtYXR0ZXJzLlRlc3RzLlNvbWVUeXBlLCBTeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLkZvcm1hdHRlcnMuVGVzdHMsIFZlcnNpb249NS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1jYzdiMTNmZmNkMmRkZDUxXV0BAAAABFRlc3QENlN5c3RlbS5SdW50aW1lLlNlcmlhbGl6YXRpb24uRm9ybWF0dGVycy5UZXN0cy5Tb21lVHlwZQIAAAACAAAACQMAAAAFAwAAADZTeXN0ZW0uUnVudGltZS5TZXJpYWxpemF0aW9uLkZvcm1hdHRlcnMuVGVzdHMuU29tZVR5cGUBAAAACVNvbWVGaWVsZAAIAgAAAAkAAAAL"; - - var deserialized = (GenericTypeWithArg)BinaryFormatterHelpers.FromBase64String(serializedObj, FormatterAssemblyStyle.Simple); - Assert.Equal(obj, deserialized); - } - - [Theory] - [MemberData(nameof(NonSerializableTypes_MemberData))] - public void ValidateNonSerializableTypes(object obj, FormatterAssemblyStyle assemblyFormat, FormatterTypeStyle typeFormat) - { - var f = new BinaryFormatter() - { - AssemblyFormat = assemblyFormat, - TypeFormat = typeFormat - }; - - using var s = new MemoryStream(); - Assert.Throws(() => f.Serialize(s, obj)); - } - - [Fact] - public void SerializeDeserialize_InvalidArguments_ThrowsException() - { - var f = new BinaryFormatter(); - Assert.Throws(() => f.Serialize(null!, new object())); - Assert.Throws(() => f.Deserialize(null!)); - Assert.Throws(() => f.Deserialize(new MemoryStream())); // seekable, 0-length - } - - [Fact] - public void ObjectReference_RealObjectSerialized() - { - var obj = new ObjRefReturnsObj { Real = 42 }; - object real = BinaryFormatterHelpers.Clone(obj); - Assert.Equal(42, real); - } - - [Theory(Skip = "Crashes the runtime in some cases.")] - [MemberData(nameof(FuzzInputs_MemberData))] - public void Deserialize_FuzzInput(object obj, Random rand) - { - // Get the serialized data for the object - byte[] data = BinaryFormatterHelpers.ToByteArray(obj, FormatterAssemblyStyle.Simple); - - // Make some "random" changes to it - for (int i = 1; i < rand.Next(1, 100); i++) - { - data[rand.Next(data.Length)] = (byte)rand.Next(256); - } - - // Try to deserialize that. - try - { - BinaryFormatterHelpers.FromByteArray(data, FormatterAssemblyStyle.Simple); - // Since there's no checksum, it's possible we changed data that didn't corrupt the instance - } - catch (ArgumentOutOfRangeException) { } - catch (ArrayTypeMismatchException) { } - catch (DecoderFallbackException) { } - catch (FormatException) { } - catch (IndexOutOfRangeException) { } - catch (InvalidCastException) { } - catch (OutOfMemoryException) { } - catch (OverflowException) { } - catch (NullReferenceException) { } - catch (SerializationException) { } - catch (TargetInvocationException) { } - catch (ArgumentException) { } - catch (FileLoadException) { } - } - - [Fact] - public void Deserialize_EndOfStream_ThrowsException() - { - var f = new BinaryFormatter(); - var s = new MemoryStream(); - f.Serialize(s, 1024); - - for (long i = s.Length - 1; i >= 0; i--) - { - s.Position = 0; - byte[] data = new byte[i]; - Assert.Equal(data.Length, s.Read(data, 0, data.Length)); - Assert.Throws(() => f.Deserialize(new MemoryStream(data))); - } - } - - private static void ValidateEqualityComparer(object obj) - { - Type objType = obj.GetType(); - Assert.True(objType.IsGenericType, $"Type `{objType.FullName}` must be generic."); - Assert.Equal("System.Collections.Generic.ObjectEqualityComparer`1", objType.GetGenericTypeDefinition().FullName); - Assert.Equal(obj.GetType().GetGenericArguments()[0], objType.GetGenericArguments()[0]); - } - - private static void CheckObjectTypeIntegrity(ISerializable serializable) - { - SerializationInfo testData = new(serializable.GetType(), new FormatterConverter()); - serializable.GetObjectData(testData, new StreamingContext(StreamingContextStates.Other)); - - foreach (SerializationEntry entry in testData) - { - if (entry.Value is not null) - { - Assert.IsAssignableFrom(entry.ObjectType, entry.Value); - } - } - } - - private static void SanityCheckBlob(object obj, TypeSerializableValue[] blobs) - { - // These types are unstable during serialization and produce different blobs. - string name = obj.GetType().FullName!; - if (obj is WeakReference - || obj is System.Collections.Specialized.HybridDictionary - || obj is Color - || name == "System.Collections.SortedList+SyncSortedList" - - // Due to non-deterministic field ordering the types below will fail when using IL Emit-based Invoke. - // The types above may also be failing for the same reason. - // Remove these cases once https://github.com/dotnet/runtime/issues/46272 is fixed. - || name == "System.Collections.Comparer" - || name == "System.Collections.Hashtable" - || name == "System.Collections.SortedList" - || name == "System.Collections.Specialized.ListDictionary" - || name == "System.CultureAwareComparer" - || name == "System.Globalization.CompareInfo" - || name == "System.Net.Cookie" - || name == "System.Net.CookieCollection" - || name == "System.Net.CookieContainer") - { - return; - } - - // The blobs aren't identical because of different implementations on Unix vs. Windows. - if (obj is Bitmap or Icon or Metafile) - { - return; - } - - // In most cases exceptions in Core have a different layout than in Desktop, - // therefore we are skipping the string comparison of the blobs. - if (obj is Exception) - { - return; - } - - // Check if runtime generated blob is the same as the stored one - int frameworkBlobNumber = blobs.GetPlatformIndex(); - if (frameworkBlobNumber < blobs.Length) - { - string runtimeBlob = BinaryFormatterHelpers.ToBase64String(obj, FormatterAssemblyStyle.Full); - - string storedComparableBlob = CreateComparableBlobInfo(blobs[frameworkBlobNumber].Base64Blob); - string runtimeComparableBlob = CreateComparableBlobInfo(runtimeBlob); - - if (storedComparableBlob != runtimeComparableBlob) - { - Debug.WriteLine($"NEW BLOB {obj.GetType().FullName}: {runtimeBlob}"); - if (Debugger.IsAttached) - { - Debugger.Break(); - } - } - - Assert.True(storedComparableBlob == runtimeComparableBlob, $""" - The stored blob with index {frameworkBlobNumber} for type {obj.GetType().FullName} is outdated and needs to be updated. - - -------------------- Stored blob --------------------- - Encoded: {blobs[frameworkBlobNumber].Base64Blob} - Decoded: {storedComparableBlob} - - --------------- Runtime generated blob --------------- - Encoded: {runtimeBlob} - Decoded: {runtimeComparableBlob} - """); - } - } - - private static string CreateComparableBlobInfo(string base64Blob) - { - string lineSeparator = ((char)0x2028).ToString(); - string paragraphSeparator = ((char)0x2029).ToString(); - - byte[] data = Convert.FromBase64String(base64Blob); - base64Blob = Encoding.UTF8.GetString(data); - -#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'. - return Regex.Replace(base64Blob, @"Version=\d.\d.\d.\d.", "Version=0.0.0.0", RegexOptions.Multiline) - // Ignore the old Test key and Open public keys. - .Replace("PublicKeyToken=cc7b13ffcd2ddd51", "PublicKeyToken=null") - .Replace("PublicKeyToken=9d77cc7ad39b68eb", "PublicKeyToken=null") - .Replace("\r\n", string.Empty) - .Replace("\n", string.Empty) - .Replace("\r", string.Empty) - .Replace(lineSeparator, string.Empty) - .Replace(paragraphSeparator, string.Empty); -#pragma warning restore SYSLIB1045 // Convert to 'GeneratedRegexAttribute'. - } - - [Fact(Skip = "Only used to update test data.")] - public void UpdateTestData() - { - List serializedHashes = []; - foreach ((object obj, _) in SerializableEqualityComparers().Concat(SerializableObjects())) - { - BinaryFormatter bf = new(); - using MemoryStream ms = new(); - bf.Serialize(ms, obj); - string serializedHash = Convert.ToBase64String(ms.ToArray()); - serializedHashes.Add(serializedHash); - } - - string path = @"..\..\..\..\..\src\System.Private.Windows.Core\tests\BinaryFormatTests\FormatTests\Legacy\BinaryFormatterTestData.cs"; - string[] blobs = [.. serializedHashes]; - - UpdateCoreTypeBlobs(path, blobs); - } - - private static (int blobs, int foundBlobs, int updatedBlobs) UpdateCoreTypeBlobs(string testDataFilePath, string[] blobs) - { - // Replace existing test data blobs with updated ones - string[] testDataLines = File.ReadAllLines(testDataFilePath); - List updatedTestDataLines = []; - int numberOfBlobs = 0; - int numberOfFoundBlobs = 0; - int numberOfUpdatedBlobs = 0; - - for (int i = 0; i < testDataLines.Length; i++) - { - string testDataLine = testDataLines[i]; - if (!testDataLine.Trim().StartsWith("yield", StringComparison.Ordinal) || numberOfBlobs >= blobs.Length) - { - updatedTestDataLines.Add(testDataLine); - continue; - } - - string? replacement; - string? pattern; - - if (PlatformDetection.IsNetFramework) - { - pattern = ", \"AAEAAAD[^\"]+\"(?!,)"; - replacement = $", \"{blobs[numberOfBlobs]}\""; - } - else - { - pattern = "\"AAEAAAD[^\"]+\","; - replacement = $"\"{blobs[numberOfBlobs]}\","; - } - - Regex regex = new(pattern); - if (regex.IsMatch(testDataLine)) - { - numberOfFoundBlobs++; - } - - string updatedLine = regex.Replace(testDataLine, replacement); - if (testDataLine != updatedLine) - { - numberOfUpdatedBlobs++; - } - - testDataLine = updatedLine; - - updatedTestDataLines.Add(testDataLine); - numberOfBlobs++; - } - - // Check if all blobs were recognized and write updates to file - Assert.Equal(numberOfBlobs, blobs.Length); - File.WriteAllLines(testDataFilePath, updatedTestDataLines); - - return (numberOfBlobs, numberOfFoundBlobs, numberOfUpdatedBlobs); - } - - public struct MyStruct - { - public int A; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/EqualityExtensions.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/EqualityExtensions.cs deleted file mode 100644 index 1328d48d222..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/EqualityExtensions.cs +++ /dev/null @@ -1,1279 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Data; -using System.Data.SqlTypes; -using System.Drawing; -using System.Drawing.Imaging; -using System.Globalization; -using System.Net; -using System.Net.NetworkInformation; -using System.Net.Sockets; -using System.Reflection; -using System.Security; -using System.Runtime.Serialization; -using FormatTests.Common.TestTypes; -using System.Text.Json; -using System.Collections.Concurrent; - -namespace BinaryFormatTests.FormatterTests; - -public static class EqualityExtensions -{ - private static readonly ConcurrentDictionary s_extensionMethods = new(); - - private static readonly (MethodInfo Method, string FirstParameterName)[] s_equalityMethods = - ( - from method in typeof(EqualityExtensions).GetMethods()! - where method.Name == "IsEqual" && method.IsGenericMethodDefinition - let parameters = method.GetParameters() - where parameters.Length == 3 - select (method, parameters[0].ParameterType.Name) - ).ToArray(); - - private static MethodInfo? GetExtensionMethod(Type extendedType) - { - if (s_extensionMethods.TryGetValue(extendedType, out MethodInfo? existing)) - { - return existing; - } - - if (extendedType.IsGenericType) - { - MethodInfo? method = - ( - from m in s_equalityMethods - where m.FirstParameterName == extendedType.Name - select m.Method - ).SingleOrDefault(); - - // If extension method found, make it generic and return - if (method is not null) - { - return s_extensionMethods.GetOrAdd( - extendedType, - method.MakeGenericMethod(extendedType.GenericTypeArguments[0])); - } - } - - return s_extensionMethods.GetOrAdd( - extendedType, - typeof(EqualityExtensions).GetMethod("IsEqual", [extendedType, extendedType, typeof(bool)])); - } - - public static void CheckEquals(object? objA, object? objB, bool isSamePlatform = true) - { - if (objA is null && objB is null) - return; - - if (objA is not null && objB is not null) - { - Type objType = objA.GetType(); - - // Check if custom equality extension method is available - MethodInfo? customEqualityCheck = GetExtensionMethod(objType); - if (customEqualityCheck is not null) - { - customEqualityCheck.Invoke(objA, [objA, objB, isSamePlatform]); - return; - } - else - { - // Check if object.Equals(object) is overridden and if not check if there is a more concrete equality check implementation - bool equalsNotOverridden = objType.GetMethod("Equals", [typeof(object)])!.DeclaringType == typeof(object); - if (equalsNotOverridden) - { - // If type doesn't override Equals(object) method then check if there is a more concrete implementation - // e.g. if type implements IEquatable. - MethodInfo? equalsMethod = objType.GetMethod("Equals", [objType]); - if (equalsMethod is not null && equalsMethod.DeclaringType != typeof(object)) - { - bool equalityResult = (bool)equalsMethod.Invoke(objA, [objB])!; - Assert.True(equalityResult); - return; - } - } - } - } - - if (objA is IEnumerable objAEnumerable && objB is IEnumerable objBEnumerable) - { - CheckSequenceEquals(objAEnumerable, objBEnumerable, isSamePlatform); - return; - } - - bool equals = objA!.Equals(objB); - Assert.True(equals); - } - - public static void CheckSequenceEquals(this IEnumerable? @this, IEnumerable? other, bool isSamePlatform = true) - { - if (@this is null || other is null) - { - Assert.Equal(@this, other); - return; - } - - Assert.Equal(@this.GetType(), other.GetType()); - IEnumerator? eA = null; - IEnumerator? eB = null; - - try - { - eA = @this.GetEnumerator(); - eB = other.GetEnumerator(); - while (true) - { - bool moved = eA.MoveNext(); - if (moved != eB.MoveNext()) - return; - if (!moved) - return; - if (eA.Current is null && eB.Current is null) - return; - CheckEquals(eA.Current, eB.Current, isSamePlatform); - } - } - finally - { - (eA as IDisposable)?.Dispose(); - (eB as IDisposable)?.Dispose(); - } - } - - public static void IsEqual(this WeakReference @this, WeakReference other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.TrackResurrection, other.TrackResurrection); - - // When WeakReference is deserialized, the object it wraps may blip into and out of - // existence before we get a chance to compare it, since there are no strong references - // to it such that it can then be immediately collected. Therefore, if we can get both - // values, great, compare them. Otherwise, consider them equal. - object? a = @this.Target; - object? b = other.Target; - - if (a is not null && b is not null) - { - Assert.Equal(a, b); - } - } - - public static void IsEqual(this WeakReference? @this, WeakReference? other, bool isSamePlatform = true) - where T : class - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - - // When WeakReference is deserialized, the object it wraps may blip into and out of - // existence before we get a chance to compare it, since there are no strong references - // to it such that it can then be immediately collected. Therefore, if we can get both - // values, great, compare them. Otherwise, consider them equal. - if (@this.TryGetTarget(out T? thisTarget) && other.TryGetTarget(out T? otherTarget)) - { - Assert.Equal(thisTarget, otherTarget); - } - } - - public static void IsEqual(this Lazy? @this, Lazy? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - - // Force value creation for lazy original object - T thisVal = @this.Value; - T otherVal = other.Value; - - Assert.Equal(@this.IsValueCreated, other.IsValueCreated); - CheckEquals(thisVal, otherVal, isSamePlatform); - } - - public static void IsEqual(this StreamingContext @this, StreamingContext other, bool isSamePlatform = true) - { - Assert.Equal(@this.State, other.State); - CheckEquals(@this.Context, other.Context, isSamePlatform); - } - - public static void IsEqual(this CookieContainer? @this, CookieContainer? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Capacity, other.Capacity); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.MaxCookieSize, other.MaxCookieSize); - Assert.Equal(@this.PerDomainCapacity, other.PerDomainCapacity); - } - - public static void IsEqual(this DataSet? @this, DataSet? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.DataSetName, other.DataSetName); - Assert.Equal(@this.Namespace, other.Namespace); - Assert.Equal(@this.Prefix, other.Prefix); - Assert.Equal(@this.CaseSensitive, other.CaseSensitive); - Assert.Equal(@this.Locale.LCID, other.Locale.LCID); - Assert.Equal(@this.EnforceConstraints, other.EnforceConstraints); - Assert.Equal(@this.ExtendedProperties?.Count, other.ExtendedProperties?.Count); - CheckEquals(@this.ExtendedProperties, other.ExtendedProperties, isSamePlatform); - } - - public static void IsEqual(this DataTable? @this, DataTable? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.RemotingFormat, other.RemotingFormat); - Assert.Equal(@this.TableName, other.TableName); - Assert.Equal(@this.Namespace, other.Namespace); - Assert.Equal(@this.Prefix, other.Prefix); - Assert.Equal(@this.CaseSensitive, other.CaseSensitive); - Assert.Equal(@this.Locale.LCID, other.Locale.LCID); - Assert.Equal(@this.MinimumCapacity, other.MinimumCapacity); - } - - public static void IsEqual(this DateTime @this, DateTime other, bool isSamePlatform = true) - { - // DateTime's Equals ignores Kind - Assert.Equal(@this.Kind, other.Kind); - Assert.Equal(@this.Ticks, other.Ticks); - } - - public static void IsEqual(this Comparer? @this, Comparer? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - - // The compareInfos are internal and get reflection blocked on .NET Native, so use - // GetObjectData to get them - SerializationInfo thisInfo = new(typeof(Comparer), new FormatterConverter()); - @this.GetObjectData(thisInfo, new StreamingContext()); - CompareInfo thisCompareInfo = (CompareInfo)thisInfo.GetValue("CompareInfo", typeof(CompareInfo))!; - - SerializationInfo otherInfo = new(typeof(Comparer), new FormatterConverter()); - other.GetObjectData(otherInfo, new StreamingContext()); - CompareInfo otherCompareInfo = (CompareInfo)otherInfo.GetValue("CompareInfo", typeof(CompareInfo))!; - - Assert.Equal(thisCompareInfo, otherCompareInfo); - } - - public static void IsEqual(this DictionaryEntry @this, DictionaryEntry other, bool isSamePlatform = true) - { - CheckEquals(@this.Key, other.Key, isSamePlatform); - CheckEquals(@this.Value, other.Value, isSamePlatform); - } - - public static void IsEqual(this StringDictionary @this, StringDictionary other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - } - - public static void IsEqual(this ArrayList @this, ArrayList other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.Capacity, other.Capacity); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - - for (int i = 0; i < @this.Count; i++) - { - CheckEquals(@this[i], other[i], isSamePlatform); - } - } - - public static void IsEqual(this BitArray @this, BitArray other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Length, other.Length); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - CheckSequenceEquals(@this, other, isSamePlatform); - } - - public static void IsEqual(this Dictionary @this, Dictionary other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - CheckEquals(@this.Comparer, other.Comparer, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - - foreach (KeyValuePair kv in @this) - { - Assert.Equal(@this[kv.Key], other[kv.Key]); - } - } - - public static void IsEqual(this PointEqualityComparer? @this, PointEqualityComparer? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - } - - public static void IsEqual(this HashSet? @this, HashSet? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - CheckEquals(@this.Comparer, other.Comparer, isSamePlatform); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this LinkedListNode? @this, LinkedListNode? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - CheckEquals(@this.Value, other.Value, isSamePlatform); - } - - public static void IsEqual(this LinkedList? @this, LinkedList? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - CheckEquals(@this.First, other.First, isSamePlatform); - CheckEquals(@this.Last, other.Last, isSamePlatform); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this List? @this, List? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.Capacity, other.Capacity); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Queue? @this, Queue? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this SortedList? @this, SortedList? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Capacity, other.Capacity); - CheckEquals(@this.Comparer, other.Comparer, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this SortedSet? @this, SortedSet? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - CheckEquals(@this.Comparer, other.Comparer, isSamePlatform); - CheckEquals(@this.Min, other.Min, isSamePlatform); - CheckEquals(@this.Max, other.Max, isSamePlatform); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Stack? @this, Stack? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Hashtable? @this, Hashtable? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - - foreach (object? key in @this.Keys) - { - CheckEquals(@this[key], other[key], isSamePlatform); - } - } - - public static void IsEqual(this Collection? @this, Collection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this ObservableCollection? @this, ObservableCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this ReadOnlyCollection? @this, ReadOnlyCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this ReadOnlyDictionary? @this, ReadOnlyDictionary? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - - foreach (KeyValuePair kv in @this) - { - Assert.Equal(kv.Value, other[kv.Key]); - } - } - - public static void IsEqual(this ReadOnlyObservableCollection? @this, ReadOnlyObservableCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Queue? @this, Queue? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this SortedList? @this, SortedList? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Capacity, other.Capacity); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this HybridDictionary? @this, HybridDictionary? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - - foreach (object? key in @this.Keys) - { - CheckEquals(@this[key], other[key], isSamePlatform); - } - } - - public static void IsEqual(this ListDictionary? @this, ListDictionary? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - - foreach (object? key in @this.Keys) - { - CheckEquals(@this[key], other[key], isSamePlatform); - } - } - - public static void IsEqual(this NameValueCollection? @this, NameValueCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - @this.AllKeys.CheckSequenceEquals(other.AllKeys, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - - foreach (string? key in @this.AllKeys) - { - CheckEquals(@this[key], other[key], isSamePlatform); - } - } - - public static void IsEqual(this OrderedDictionary? @this, OrderedDictionary? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - CheckEquals(@this.Keys, other.Keys, isSamePlatform); - CheckEquals(@this.Values, other.Values, isSamePlatform); - - foreach (object? key in @this.Keys) - { - CheckEquals(@this[key], other[key], isSamePlatform); - } - } - - public static void IsEqual(this StringCollection? @this, StringCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Stack? @this, Stack? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this BindingList? @this, BindingList? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.RaiseListChangedEvents, other.RaiseListChangedEvents); - Assert.Equal(@this.AllowNew, other.AllowNew); - Assert.Equal(@this.AllowEdit, other.AllowEdit); - Assert.Equal(@this.AllowRemove, other.AllowRemove); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this BindingList? @this, BindingList? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.RaiseListChangedEvents, other.RaiseListChangedEvents); - Assert.Equal(@this.AllowNew, other.AllowNew); - Assert.Equal(@this.AllowEdit, other.AllowEdit); - Assert.Equal(@this.AllowRemove, other.AllowRemove); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this PropertyCollection? @this, PropertyCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.IsReadOnly, other.IsReadOnly); - Assert.Equal(@this.IsFixedSize, other.IsFixedSize); - Assert.Equal(@this.IsSynchronized, other.IsSynchronized); - @this.Keys.CheckSequenceEquals(other.Keys, isSamePlatform); - @this.Values.CheckSequenceEquals(other.Values, isSamePlatform); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this CompareInfo? @this, CompareInfo? other) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Name, other.Name); - Assert.Equal(@this.LCID, other.LCID); - - // we do not want to compare Version because it can change when changing OS - // we do want to make sure that they are either both null or both not null - Assert.True((@this.Version is not null) == (other.Version is not null)); - } - - public static void IsEqual(this SortVersion? @this, SortVersion? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.FullVersion, other.FullVersion); - Assert.Equal(@this.SortId, other.SortId); - } - - public static void IsEqual(this Cookie? @this, Cookie? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Comment, other.Comment); - IsEqual(@this.CommentUri, other.CommentUri); - Assert.Equal(@this.HttpOnly, other.HttpOnly); - Assert.Equal(@this.Discard, other.Discard); - Assert.Equal(@this.Domain, other.Domain); - Assert.Equal(@this.Expired, other.Expired); - CheckEquals(@this.Expires, other.Expires, isSamePlatform); - Assert.Equal(@this.Name, other.Name); - Assert.Equal(@this.Path, other.Path); - Assert.Equal(@this.Port, other.Port); - Assert.Equal(@this.Secure, other.Secure); - // This needs to have m_Timestamp set by reflection in order to roundtrip correctly - // otherwise this field will change each time you create an object and cause this to fail - CheckEquals(@this.TimeStamp, other.TimeStamp, isSamePlatform); - Assert.Equal(@this.Value, other.Value); - Assert.Equal(@this.Version, other.Version); - } - - public static void IsEqual(this CookieCollection @this, CookieCollection other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this BasicISerializableObject @this, BasicISerializableObject other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - } - - public static void IsEqual( - this DerivedISerializableWithNonPublicDeserializationCtor @this, - DerivedISerializableWithNonPublicDeserializationCtor other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - } - - private static void GetIdsForGraphDFS(Graph n, Dictionary, int> ids) - { - if (!ids.ContainsKey(n)) - { - ids[n] = ids.Count; - foreach (Graph link in n.Links!) - { - GetIdsForGraphDFS(link, ids); - } - } - } - - private static Dictionary> InvertDictionary(Dictionary, int> dict) - { - var ret = new Dictionary>(); - foreach (KeyValuePair, int> kv in dict) - { - Assert.False(ret.ContainsKey(kv.Value)); - ret[kv.Value] = kv.Key; - } - - return ret; - } - - /// - /// Flattens the graph - /// - /// node of a graph - /// returns ((id -> node), (node -> node[])) - private static Tuple>, List>> FlattenGraph(Graph n) - { - // ref -> id - var nodes = new Dictionary, int>(ReferenceEqualityComparer.Instance); - GetIdsForGraphDFS(n, nodes); - - // id -> list of ids - var edges = new List>(); - for (int i = 0; i < nodes.Count; i++) - { - edges.Add([]); - } - - foreach (KeyValuePair, int> kv in nodes) - { - List links = edges[kv.Value]; - foreach (Graph link in kv.Key.Links!) - { - links.Add(nodes[link]); - } - } - - return new Tuple>, List>>(InvertDictionary(nodes), edges); - } - - public static void IsEqual(this Graph @this, Graph other, bool isSamePlatform = true) - { - Tuple>, List>> thisFlattened = FlattenGraph(@this); - Tuple>, List>> otherFlattened = FlattenGraph(other); - - Assert.Equal(thisFlattened.Item1.Count, otherFlattened.Item1.Count); - Assert.Equal(thisFlattened.Item2.Count, otherFlattened.Item2.Count); - Assert.Equal(thisFlattened.Item1.Values, otherFlattened.Item1.Values); - CheckEquals(thisFlattened.Item2, otherFlattened.Item2, isSamePlatform); - } - - public static void IsEqual(this ArraySegment @this, ArraySegment other, bool isSamePlatform = true) - { - Assert.True((@this.Array is not null) == (other.Array is not null)); - Assert.Equal(@this.Count, other.Count); - Assert.Equal(@this.Offset, other.Offset); - if (@this.Array is not null) - { - @this.CheckSequenceEquals(other, isSamePlatform); - } - } - - public static void IsEqual(this ObjectWithArrays? @this, ObjectWithArrays? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - CheckEquals(@this.IntArray, other.IntArray, isSamePlatform); - CheckEquals(@this.StringArray, other.StringArray, isSamePlatform); - CheckEquals(@this.ByteArray, other.ByteArray, isSamePlatform); - CheckEquals(@this.JaggedArray, other.JaggedArray, isSamePlatform); - CheckEquals(@this.MultiDimensionalArray, other.MultiDimensionalArray, isSamePlatform); - } - - public static void IsEqual( - this ObjectWithIntStringUShortUIntULongAndCustomObjectFields? @this, - ObjectWithIntStringUShortUIntULongAndCustomObjectFields? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Member1, other.Member1); - Assert.Equal(@this.Member2, other.Member2); - Assert.Equal(@this._member3, other._member3); - IsEqual(@this.Member4, other.Member4); - IsEqual(@this.Member4shared, other.Member4shared); - IsEqual(@this.Member5, other.Member5); - Assert.Equal(@this.Member6, other.Member6); - Assert.Equal(@this.str1, other.str1); - Assert.Equal(@this.str2, other.str2); - Assert.Equal(@this.str3, other.str3); - Assert.Equal(@this.str4, other.str4); - Assert.Equal(@this.u16, other.u16); - Assert.Equal(@this.u32, other.u32); - Assert.Equal(@this.u64, other.u64); - } - - public static void IsEqual(this Point @this, Point other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.X, other.X); - Assert.Equal(@this.Y, other.Y); - } - - public static void IsEqual(this SqlGuid @this, SqlGuid other, bool isSamePlatform = true) - { - Assert.Equal(@this.IsNull, other.IsNull); - Assert.True(@this.IsNull || @this.Value == other.Value); - } - - public static void IsEqual(this SealedObjectWithIntStringFields? @this, SealedObjectWithIntStringFields? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Member1, other.Member1); - Assert.Equal(@this.Member2, other.Member2); - Assert.Equal(@this.Member3, other.Member3); - } - - public static void IsEqual(this SimpleKeyedCollection? @this, SimpleKeyedCollection? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Comparer, other.Comparer); - Assert.Equal(@this.Count, other.Count); - @this.CheckSequenceEquals(other, isSamePlatform); - } - - public static void IsEqual(this Tree? @this, Tree? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Value, other.Value); - IsEqual(@this.Left, other.Left, isSamePlatform); - IsEqual(@this.Right, other.Right, isSamePlatform); - } - - public static void IsEqual(this TimeZoneInfo? @this, TimeZoneInfo? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Id, other.Id); - - if (isSamePlatform) - { - // These properties can change in between TFMs. - Assert.Equal(@this.DisplayName, other.DisplayName); - Assert.Equal(@this.StandardName, other.StandardName); - Assert.Equal(@this.DaylightName, other.DaylightName); - } - - Assert.Equal(@this.BaseUtcOffset, other.BaseUtcOffset); - Assert.Equal(@this.SupportsDaylightSavingTime, other.SupportsDaylightSavingTime); - } - - public static void IsEqual(this Tuple? @this, Tuple? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - } - - public static void IsEqual(this Tuple? @this, Tuple? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - } - - public static void IsEqual(this Tuple? @this, Tuple? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - } - - public static void IsEqual( - this Tuple? @this, - Tuple? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - Assert.Equal(@this.Item4, other.Item4); - } - - public static void IsEqual( - this Tuple? @this, - Tuple? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - Assert.Equal(@this.Item4, other.Item4); - Assert.Equal(@this.Item5, other.Item5); - } - - public static void IsEqual( - this Tuple? @this, - Tuple? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - Assert.Equal(@this.Item4, other.Item4); - Assert.Equal(@this.Item5, other.Item5); - Assert.Equal(@this.Item6, other.Item6); - } - - public static void IsEqual( - this Tuple? @this, - Tuple? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - Assert.Equal(@this.Item4, other.Item4); - Assert.Equal(@this.Item5, other.Item5); - Assert.Equal(@this.Item6, other.Item6); - Assert.Equal(@this.Item7, other.Item7); - } - - public static void IsEqual( - this Tuple>>? @this, - Tuple>>? other, - bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Item1, other.Item1); - Assert.Equal(@this.Item2, other.Item2); - Assert.Equal(@this.Item3, other.Item3); - Assert.Equal(@this.Item4, other.Item4); - Assert.Equal(@this.Item5, other.Item5); - Assert.Equal(@this.Item6, other.Item6); - Assert.Equal(@this.Item7, other.Item7); - Assert.Equal(@this.Rest.Item1.Item1, other.Rest.Item1.Item1); - } - - public static void IsEqual(this Uri? @this, Uri? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.AbsolutePath, other.AbsolutePath); - Assert.Equal(@this.AbsoluteUri, other.AbsoluteUri); - Assert.Equal(@this.LocalPath, other.LocalPath); - Assert.Equal(@this.Authority, other.Authority); - Assert.Equal(@this.HostNameType, other.HostNameType); - Assert.Equal(@this.IsDefaultPort, other.IsDefaultPort); - Assert.Equal(@this.IsFile, other.IsFile); - Assert.Equal(@this.IsLoopback, other.IsLoopback); - Assert.Equal(@this.PathAndQuery, other.PathAndQuery); - Assert.True(@this.Segments.SequenceEqual(other.Segments)); - Assert.Equal(@this.IsUnc, other.IsUnc); - Assert.Equal(@this.Host, other.Host); - Assert.Equal(@this.Port, other.Port); - Assert.Equal(@this.Query, other.Query); - Assert.Equal(@this.Fragment, other.Fragment); - Assert.Equal(@this.Scheme, other.Scheme); - Assert.Equal(@this.DnsSafeHost, other.DnsSafeHost); - Assert.Equal(@this.IdnHost, other.IdnHost); - Assert.Equal(@this.IsAbsoluteUri, other.IsAbsoluteUri); - Assert.Equal(@this.UserEscaped, other.UserEscaped); - Assert.Equal(@this.UserInfo, other.UserInfo); - } - - public static void IsEqual(this Version @this, Version other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Major, other.Major); - Assert.Equal(@this.Minor, other.Minor); - Assert.Equal(@this.Build, other.Build); - Assert.Equal(@this.Revision, other.Revision); - Assert.Equal(@this.MajorRevision, other.MajorRevision); - Assert.Equal(@this.MinorRevision, other.MinorRevision); - } - - public static void IsEqual(this Exception? @this, Exception? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - @this.Data.CheckSequenceEquals(other.Data, isSamePlatform); - - // Different by design for those exceptions - if (!((@this is SecurityException || @this is ThreadAbortException) && !isSamePlatform)) - { - if (@this is not (SocketException or NetworkInformationException)) - { - Assert.Equal(@this.Message, other.Message); - } - } - - Assert.Equal(@this.Source, other.Source); - - Assert.Equal(@this.HelpLink, other.HelpLink); - - // Different by design for those exceptions - if (!(false && !isSamePlatform)) - { - CheckEquals(@this.InnerException, other.InnerException, isSamePlatform); - } - - if (!PlatformDetection.IsNetFramework) - { - // Different by design for those exceptions - if (!((@this is NetworkInformationException || @this is SocketException) && !isSamePlatform)) - { - Assert.Equal(@this.StackTrace, other.StackTrace); - } - - // Different by design for those exceptions - if (!((@this is SecurityException || @this is ThreadAbortException) && !isSamePlatform)) - { - if (@this is not (NetworkInformationException or SocketException)) - { - Assert.Equal(@this.ToString(), other.ToString()); - } - } - } - - // Different by design for those exceptions - if (!((@this is NetworkInformationException || @this is SocketException) && !isSamePlatform)) - { - Assert.Equal(@this.HResult, other.HResult); - } - } - - public static void IsEqual(this AggregateException @this, AggregateException other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - IsEqual(@this, other as Exception, isSamePlatform); - @this.InnerExceptions.CheckSequenceEquals(other.InnerExceptions, isSamePlatform); - } - -#if NETCOREAPP - public static void IsEqual(this JsonException? @this, JsonException? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - IsEqual(@this, other as Exception, isSamePlatform); - Assert.Equal(@this.Path, other.Path); - Assert.Equal(@this.LineNumber, other.LineNumber); - Assert.Equal(@this.BytePositionInLine, other.BytePositionInLine); - } -#endif - - public static void IsEqual(this EventArgs? @this, EventArgs? other, bool isSamePlatform = true) - { - Assert.NotNull(@this); - Assert.NotNull(other); - } - - public static void IsEqual(this Bitmap? @this, Bitmap? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Width, other.Width); - Assert.Equal(@this.Height, other.Height); - Assert.Equal(@this.Flags, other.Flags); - Assert.Equal(@this.HorizontalResolution, other.HorizontalResolution); - Assert.Equal(@this.PhysicalDimension, other.PhysicalDimension); - Assert.Equal(@this.PixelFormat, other.PixelFormat); - Assert.Equal(@this.RawFormat, other.RawFormat); - Assert.Equal(@this.VerticalResolution, other.VerticalResolution); - } - - public static void IsEqual(this Metafile? @this, Metafile? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Width, other.Width); - Assert.Equal(@this.Height, other.Height); - } - - public static void IsEqual(this Icon? @this, Icon? other, bool isSamePlatform = true) - { - if (@this is null && other is null) - return; - - Assert.NotNull(@this); - Assert.NotNull(other); - Assert.Equal(@this.Width, other.Width); - Assert.Equal(@this.Height, other.Height); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.Windows.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.Windows.cs deleted file mode 100644 index 1f06bab228d..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.Windows.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; - -namespace System; - -public static partial class PlatformDetectionMe -{ - public static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - public static bool IsNetFramework => RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase); -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.cs deleted file mode 100644 index 00e952eaee1..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformDetection.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System; - -public static partial class PlatformDetectionMe -{ - // Drawing is not supported on non windows platforms in .NET 7.0+. It also isn't supported on Windows Nano Server and Core skus. - public static bool IsDrawingSupported => IsWindows; - - private static volatile Tuple? s_lazyNonZeroLowerBoundArraySupported; - - public static bool IsNonZeroLowerBoundArraySupported - { - get - { - if (s_lazyNonZeroLowerBoundArraySupported is null) - { - bool nonZeroLowerBoundArraysSupported = false; - try - { - Array.CreateInstance(typeof(int), [5], [5]); - nonZeroLowerBoundArraysSupported = true; - } - catch (PlatformNotSupportedException) - { - } - - s_lazyNonZeroLowerBoundArraySupported = Tuple.Create(nonZeroLowerBoundArraysSupported); - } - - return s_lazyNonZeroLowerBoundArraySupported.Item1; - } - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformExtensions.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformExtensions.cs deleted file mode 100644 index 5a53c1f2ded..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/PlatformExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace BinaryFormatTests.FormatterTests; - -internal static class PlatformExtensions -{ - public static int GetPlatformIndex(this TypeSerializableValue[] blobs) - { - List blobList = [.. blobs]; - int index; - - // Check if a specialized blob for >=netcoreapp3.0 is present and return if found. - index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp30); - if (index >= 0) - { - return index; - } - - // Check if a specialized blob for netcoreapp2.1 is present and return if found. - index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp21); - if (index >= 0) - { - return index; - } - - // If no newer blob for >=netcoreapp2.1 is present use existing one. - // If no netcoreapp blob is present then -1 will be returned. - return blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp20); - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/SerializationTypes.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/SerializationTypes.cs deleted file mode 100644 index 611e61d089f..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/SerializationTypes.cs +++ /dev/null @@ -1,451 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace BinaryFormatTests.FormatterTests; - -[Serializable] -public sealed class SealedObjectWithIntStringFields -{ - public int Member1; - - public string? Member2; - public string? Member3; - - public override bool Equals(object? obj) - { - if (obj is not SealedObjectWithIntStringFields o) - return false; - return - EqualityComparer.Default.Equals(Member1, o.Member1) && - EqualityComparer.Default.Equals(Member2, o.Member2) && - EqualityComparer.Default.Equals(Member3, o.Member3); - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public class ObjectWithIntStringUShortUIntULongAndCustomObjectFields -{ - public int Member1; - public string? Member2; - public string? _member3; - public SealedObjectWithIntStringFields? Member4; - public SealedObjectWithIntStringFields? Member4shared; - public SealedObjectWithIntStringFields? Member5; - public string? Member6; - public string? str1; - public string? str2; - public string? str3; - public string? str4; - public ushort u16; - public uint u32; - public ulong u64; - - public override bool Equals(object? obj) - { - if (obj is not ObjectWithIntStringUShortUIntULongAndCustomObjectFields o) - return false; - - return - EqualityComparer.Default.Equals(Member1, o.Member1) && - EqualityComparer.Default.Equals(Member2, o.Member2) && - EqualityComparer.Default.Equals(_member3, o._member3) && - EqualityComparer.Default.Equals(Member4, o.Member4) && - EqualityComparer.Default.Equals(Member4shared, o.Member4shared) && - EqualityComparer.Default.Equals(Member5, o.Member5) && - EqualityComparer.Default.Equals(Member6, o.Member6) && - EqualityComparer.Default.Equals(str1, o.str1) && - EqualityComparer.Default.Equals(str2, o.str2) && - EqualityComparer.Default.Equals(str3, o.str3) && - EqualityComparer.Default.Equals(str4, o.str4) && - EqualityComparer.Default.Equals(u16, o.u16) && - EqualityComparer.Default.Equals(u16, o.u16) && - EqualityComparer.Default.Equals(u64, o.u64) && - // make sure shared members are the same object - ReferenceEquals(Member4, Member4shared) && - ReferenceEquals(o.Member4, o.Member4shared); - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public class Point : IComparable, IEquatable -{ - public int X; - public int Y; - - public Point(int x, int y) - { - X = x; - Y = y; - } - - public int CompareTo(object obj) => CompareTo(obj as Point); - - public int CompareTo(Point? other) - { - return other is null ? 1 : 0; - } - - public override bool Equals(object? obj) => Equals(obj as Point); - - public bool Equals(Point? other) - { - return other is not null && - X == other.X && - Y == other.Y; - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public class Tree -{ - public Tree(T value, Tree left, Tree right) - { - Value = value; - Left = left; - Right = right; - } - - public T Value { get; } - public Tree Left { get; } - public Tree Right { get; } - - public override bool Equals(object? obj) - { - if (obj is not Tree o) - return false; - - return - EqualityComparer.Default.Equals(Value, o.Value) && - EqualityComparer>.Default.Equals(Left, o.Left) && - EqualityComparer>.Default.Equals(Right, o.Right) && - // make sure the branches aren't actually the exact same object - (Left is null || !ReferenceEquals(Left, o.Left)) && - (Right is null || !ReferenceEquals(Right, o.Right)); - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public class Graph -{ - public T? Value; - public Graph[]? Links; - - public override bool Equals(object? obj) - { - if (obj is not Graph o) - return false; - - var toExplore = new Stack, Graph>>(); - toExplore.Push(new KeyValuePair, Graph>(this, o)); - var seen1 = new HashSet>(ReferenceEqualityComparer.Instance); - while (toExplore.Count > 0) - { - var cur = toExplore.Pop(); - if (!seen1.Add(cur.Key)) - { - continue; - } - - if (!EqualityComparer.Default.Equals(cur.Key.Value, cur.Value.Value)) - { - return false; - } - - if (Links is null || o.Links is null) - { - if (Links != o.Links) - return false; - continue; - } - - if (Links.Length != o.Links.Length) - { - return false; - } - - for (int i = 0; i < Links.Length; i++) - { - toExplore.Push(new KeyValuePair, Graph>(Links[i], o.Links[i])); - } - } - - return true; - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public sealed class ObjectWithArrays -{ - public int[]? IntArray; - public string[]? StringArray; - public Tree[]? TreeArray; - public byte[]? ByteArray; - public int[][]? JaggedArray; - public int[,]? MultiDimensionalArray; - - public override bool Equals(object? obj) - { - if (obj is not ObjectWithArrays o) - return false; - - return - EqualityHelpers.ArraysAreEqual(IntArray, o.IntArray) && - EqualityHelpers.ArraysAreEqual(StringArray, o.StringArray) && - EqualityHelpers.ArraysAreEqual(TreeArray, o.TreeArray) && - EqualityHelpers.ArraysAreEqual(ByteArray, o.ByteArray) && - EqualityHelpers.ArraysAreEqual(JaggedArray, o.JaggedArray) && - EqualityHelpers.ArraysAreEqual(MultiDimensionalArray, o.MultiDimensionalArray); - } - - public override int GetHashCode() => 1; -} - -[Serializable] -public enum Colors -{ - Red, - Orange, - Yellow, - Green, - Blue, - Purple -} - -[Serializable] public enum ByteEnum : byte { } -[Serializable] public enum SByteEnum : sbyte { } -[Serializable] public enum Int16Enum : short { } -[Serializable] public enum UInt16Enum : ushort { } -[Serializable] public enum Int32Enum : int { } -[Serializable] public enum UInt32Enum : uint { } -[Serializable] public enum Int64Enum : long { } -[Serializable] public enum UInt64Enum : ulong { } - -public struct NonSerializableStruct -{ - public int Value; -} - -public class NonSerializableClass -{ - public int Value; -} - -[Serializable] -public class SerializableClassDerivedFromNonSerializableClass : NonSerializableClass -{ - public int AnotherValue; -} - -[Serializable] -public class SerializableClassWithBadField -{ - public NonSerializableClass? Value; -} - -[Serializable] -public struct EmptyStruct { } - -[Serializable] -public struct StructWithIntField -{ - public int X; -} - -[Serializable] -public struct StructWithStringFields -{ - public string String1; - public string String2; -} - -[Serializable] -public struct StructContainingOtherStructs -{ - public StructWithStringFields Nested1; - public StructWithStringFields Nested2; -} - -[Serializable] -public struct StructContainingArraysOfOtherStructs -{ - public StructContainingOtherStructs[] Nested; - - public override readonly bool Equals(object? obj) - { - return obj is StructContainingArraysOfOtherStructs sca && EqualityHelpers.ArraysAreEqual(Nested, sca.Nested); - } - - public override readonly int GetHashCode() => 1; -} - -[Serializable] -public sealed class ObjRefReturnsObj : IObjectReference -{ - public object? Real; - public object GetRealObject(StreamingContext context) => Real!; -} - -[Serializable] -public class ObjectWithStateAndMethod -{ - public int State; - public int GetState() => State; -} - -[Serializable] -public sealed class PointEqualityComparer : IEqualityComparer -{ - public bool Equals(Point? x, Point? y) - { - return x is null ? y is null : y is not null && (x.X == y.X) && (x.Y == y.Y); - } - - public int GetHashCode(Point obj) => RuntimeHelpers.GetHashCode(obj); -} - -[Serializable] -public class SimpleKeyedCollection : System.Collections.ObjectModel.KeyedCollection -{ - protected override int GetKeyForItem(Point item) - { - return item.Y; - } -} - -[Serializable] -internal class GenericTypeWithArg -{ - public T? Test; - - public override bool Equals(object? obj) - { - if (obj is null || GetType() != obj.GetType()) - return false; - - var p = (GenericTypeWithArg)obj; - return Test!.Equals(p.Test); - } - - public override int GetHashCode() - { - return Test is null ? 0 : Test.GetHashCode(); - } -} - -[Serializable] -internal class SomeType -{ - public int SomeField; - - public override bool Equals(object? obj) - { - if (obj is null || GetType() != obj.GetType()) - return false; - - var p = (SomeType)obj; - return SomeField.Equals(p.SomeField); - } - - public override int GetHashCode() - { - return SomeField; - } -} - -internal static class EqualityHelpers -{ - public static bool ArraysAreEqual(T[]? array1, T[]? array2) - { - if (array1 is null || array2 is null) - return array1 == array2; - if (array1.Length != array2.Length) - return false; - for (int i = 0; i < array1.Length; i++) - { - if (!EqualityComparer.Default.Equals(array1[i], array2[i])) - { - return false; - } - } - - return true; - } - - public static bool ArraysAreEqual(Array? array1, Array? array2) - { - if (array1 is null || array2 is null) - return array1 == array2; - if (array1.Length != array2.Length) - return false; - if (array1.Rank != array2.Rank) - return false; - - for (int i = 0; i < array1.Rank; i++) - { - if (array1.GetLength(i) != array2.GetLength(i)) - return false; - } - - var e1 = array1.GetEnumerator(); - var e2 = array2.GetEnumerator(); - while (e1.MoveNext()) - { - e2.MoveNext(); - if (!EqualityComparer.Default.Equals(e1.Current, e2.Current)) - { - return false; - } - } - - return true; - } - - public static bool ArraysAreEqual(T[][]? array1, T[][]? array2) - { - if (array1 is null || array2 is null) - return array1 == array2; - if (array1.Length != array2.Length) - return false; - for (int i = 0; i < array1.Length; i++) - { - T[] sub1 = array1[i], sub2 = array2[i]; - if (sub1 is null || (sub2 is null && (sub1 != sub2))) - return false; - if (sub1.Length != sub2.Length) - return false; - for (int j = 0; j < sub1.Length; j++) - { - if (!EqualityComparer.Default.Equals(sub1[j], sub2[j])) - { - return false; - } - } - } - - return true; - } -} - -#pragma warning disable 0618 // obsolete warning -[Serializable] -internal class HashCodeProvider : IHashCodeProvider -{ - public int GetHashCode(object obj) - { - return 8; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TargetFrameworkMoniker.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TargetFrameworkMoniker.cs deleted file mode 100644 index edbdaba7475..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TargetFrameworkMoniker.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace BinaryFormatTests; - -// The values represent platforms where there was change in the serialization for one or more types. -public enum TargetFrameworkMoniker -{ - netfx461, - netfx471, - netfx472, - netfx472_3260, - netcoreapp20, - netcoreapp21, - netcoreapp30 -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeSerializableValue.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeSerializableValue.cs deleted file mode 100644 index c7fa08a0ae6..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeSerializableValue.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace BinaryFormatTests; - -public readonly struct TypeSerializableValue -{ - public string Base64Blob { get; } - - // This is the minimum version, when the blob changed. - public readonly TargetFrameworkMoniker Platform { get; } - - public TypeSerializableValue(string base64Blob, TargetFrameworkMoniker platform) - { - Base64Blob = base64Blob; - Platform = platform; - } -} diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeWithoutNamespace.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeWithoutNamespace.cs deleted file mode 100644 index 6721a319a91..00000000000 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/FormatTests/Legacy/TypeWithoutNamespace.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -[Serializable] -#pragma warning disable CA1050 // Declare types in namespaces -public struct TypeWithoutNamespace { } -#pragma warning restore CA1050 diff --git a/src/System.Private.Windows.Core/tests/BinaryFormatTests/GlobalUsings.cs b/src/System.Private.Windows.Core/tests/BinaryFormatTests/GlobalUsings.cs index 9faf2564332..74547c2dd47 100644 --- a/src/System.Private.Windows.Core/tests/BinaryFormatTests/GlobalUsings.cs +++ b/src/System.Private.Windows.Core/tests/BinaryFormatTests/GlobalUsings.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -global using System.Diagnostics; global using System.Private.Windows.Core; global using Xunit; global using FluentAssertions; diff --git a/src/System.Windows.Forms.Primitives/tests/TestUtilities/System/Windows/Forms/BinaryFormat/BinaryFormatTestExtensions.cs b/src/System.Windows.Forms.Primitives/tests/TestUtilities/System/Windows/Forms/BinaryFormat/BinaryFormatTestExtensions.cs index cc9d5e4faee..c7f79ac8352 100644 --- a/src/System.Windows.Forms.Primitives/tests/TestUtilities/System/Windows/Forms/BinaryFormat/BinaryFormatTestExtensions.cs +++ b/src/System.Windows.Forms.Primitives/tests/TestUtilities/System/Windows/Forms/BinaryFormat/BinaryFormatTestExtensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; +using System.Formats.Nrbf; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; @@ -10,12 +11,12 @@ namespace System.Private.Windows.Core.BinaryFormat; internal static class BinaryFormatTestExtensions { /// - /// Serializes the object using the and reads it into a . + /// Serializes the object using the and reads it into a . /// - public static BinaryFormattedObject SerializeAndParse(this object source) + public static SerializationRecord SerializeAndDecode(this object source) { using Stream stream = source.Serialize(); - return new(stream); + return NrbfDecoder.Decode(stream); } /// diff --git a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs index 078d630a19e..127a7d9ba9e 100644 --- a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs +++ b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs @@ -4,13 +4,14 @@ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; +using System.Formats.Nrbf; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Text; -using System.Private.Windows.Core.BinaryFormat; using System.Xml; +using System.Windows.Forms.Nrbf; using System.Windows.Forms.BinaryFormat; namespace System.Resources; @@ -428,8 +429,8 @@ Type ResolveTypeName(string typeName) try { - BinaryFormattedObject format = new(stream); - if (format.TryGetObject(out object? value)) + SerializationRecord rootRecord = stream.Decode(); + if (rootRecord.TryGetObject(out object? value)) { return value; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs index 6e0f2c6ba4e..8f0e9360fd4 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs @@ -2,11 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Formats.Nrbf; using System.Runtime.Serialization.Formatters.Binary; using System.Private.Windows.Core.BinaryFormat; using Windows.Win32.System.Com; using Windows.Win32.System.Com.StructuredStorage; using Windows.Win32.System.Variant; +using System.Windows.Forms.Nrbf; namespace System.Windows.Forms; @@ -23,8 +25,8 @@ internal PropertyBagStream(Stream stream) long position = stream.Position; try { - BinaryFormattedObject format = new(stream); - if (format.TryGetPrimitiveHashtable(out _bag!)) + SerializationRecord rootRecord = stream.Decode(); + if (rootRecord.TryGetPrimitiveHashtable(out _bag!)) { return; } @@ -34,7 +36,7 @@ internal PropertyBagStream(Stream stream) // Don't usually expect to fall into this case as we should usually not have anything // in the stream other than primitive VARIANTs, which are handled. If there are arrays or // interface pointers we'd hit this. - Debug.WriteLine($"PropertyBagStream: {nameof(BinaryFormattedObject)} failed with {ex.Message}"); + Debug.WriteLine($"PropertyBagStream: {nameof(NrbfDecoder)} failed with {ex.Message}"); } try @@ -103,7 +105,7 @@ internal void Save(Stream stream) } catch (Exception ex) when (!ex.IsCriticalException()) { - Debug.WriteLine($"PropertyBagStream.Save: {nameof(BinaryFormattedObject)} failed with {ex.Message}"); + Debug.WriteLine($"PropertyBagStream.Save: {nameof(NrbfDecoder)} failed with {ex.Message}"); stream.Position = position; #pragma warning disable SYSLIB0011 // Type or member is obsolete diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs index 028fd564add..3c2779785c6 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs @@ -2,7 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Formats.Nrbf; using System.Private.Windows.Core.BinaryFormat; +using System.Windows.Forms.Nrbf; using Windows.Win32.System.Com; using Windows.Win32.System.Com.StructuredStorage; using Windows.Win32.System.Variant; @@ -27,8 +29,8 @@ internal void Read(IStream* istream) try { - BinaryFormattedObject format = new(stream); - success = format.TryGetPrimitiveHashtable(out _bag!); + SerializationRecord rootRecord = stream.Decode(); + success = rootRecord.TryGetPrimitiveHashtable(out _bag!); } catch (Exception e) when (!e.IsCriticalException()) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs index 06113663b6f..bbb34638ee9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using System.ComponentModel; using System.Drawing; +using System.Formats.Nrbf; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; @@ -12,14 +13,14 @@ using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Text; -using System.Private.Windows.Core.BinaryFormat; using Windows.Win32.System.Com; using Windows.Win32.System.Com.StructuredStorage; using Windows.Win32.System.Ole; using Windows.Win32.System.Variant; using Windows.Win32.UI.Input.KeyboardAndMouse; -using System.Windows.Forms.BinaryFormat; +using System.Windows.Forms.Nrbf; using RECTL = Windows.Win32.Foundation.RECTL; +using System.Windows.Forms.BinaryFormat; namespace System.Windows.Forms; @@ -1140,8 +1141,8 @@ bool SetValue(PropertyDescriptor currentProperty, object data) object? deserialized = null; try { - BinaryFormattedObject format = new(stream); - success = format.TryGetObject(out deserialized); + SerializationRecord rootRecord = stream.Decode(); + success = rootRecord.TryGetObject(out deserialized); } catch (Exception ex) when (!ex.IsCriticalException()) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectExtensions.cs b/src/System.Windows.Forms/src/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectExtensions.cs deleted file mode 100644 index 64443593a36..00000000000 --- a/src/System.Windows.Forms/src/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Drawing; -using System.Private.Windows.Core.BinaryFormat; - -namespace System.Windows.Forms.BinaryFormat; - -internal static class WinFormsBinaryFormattedObjectExtensions -{ - /// - /// Tries to get this object as a binary formatted . - /// - public static bool TryGetImageListStreamer( - this BinaryFormattedObject format, - out object? imageListStreamer) - { - return BinaryFormattedObjectExtensions.TryGet(Get, format, out imageListStreamer); - - static bool Get(BinaryFormattedObject format, [NotNullWhen(true)] out object? imageListStreamer) - { - imageListStreamer = null; - - if (format.RootRecord is not ClassWithMembersAndTypes types - || types.ClassInfo.Name != typeof(ImageListStreamer).FullName - || format[3] is not ArraySinglePrimitive data) - { - return false; - } - - Debug.Assert(data.ArrayObjects is byte[]); - imageListStreamer = new ImageListStreamer((byte[])data.ArrayObjects); - return true; - } - } - - /// - /// Tries to get this object as a binary formatted . - /// - public static bool TryGetBitmap(this BinaryFormattedObject format, out object? bitmap) - { - bitmap = null; - - if (format.RootRecord is not ClassWithMembersAndTypes types - || types.ClassInfo.Name != typeof(Bitmap).FullName - || format[3] is not ArraySinglePrimitive data) - { - return false; - } - - Debug.Assert(data.ArrayObjects is byte[]); - bitmap = new Bitmap(new MemoryStream((byte[])data.ArrayObjects)); - return true; - } - - /// - /// Try to get a supported object. - /// - public static bool TryGetObject(this BinaryFormattedObject format, [NotNullWhen(true)] out object? value) => - format.TryGetFrameworkObject(out value) - || format.TryGetBitmap(out value) - || format.TryGetImageListStreamer(out value); -} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Nrbf/WinFormsSerializationRecordExtensions.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Nrbf/WinFormsSerializationRecordExtensions.cs new file mode 100644 index 00000000000..bd3bd48eb24 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Nrbf/WinFormsSerializationRecordExtensions.cs @@ -0,0 +1,63 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Drawing; +using System.Formats.Nrbf; + +namespace System.Windows.Forms.Nrbf; + +internal static class WinFormsSerializationRecordExtensions +{ + /// + /// Tries to get this object as a binary formatted . + /// + public static bool TryGetImageListStreamer( + this SerializationRecord record, + out object? imageListStreamer) + { + return SerializationRecordExtensions.TryGet(Get, record, out imageListStreamer); + + static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? imageListStreamer) + { + imageListStreamer = null; + + if (record is not ClassRecord types + || !types.TypeNameMatches(typeof(ImageListStreamer)) + || !types.HasMember("Data") + || types.GetRawValue("Data") is not SZArrayRecord data) + { + return false; + } + + imageListStreamer = new ImageListStreamer(data.GetArray()); + return true; + } + } + + /// + /// Tries to get this object as a binary formatted . + /// + public static bool TryGetBitmap(this SerializationRecord record, out object? bitmap) + { + bitmap = null; + + if (record is not ClassRecord types + || !types.TypeNameMatches(typeof(Bitmap)) + || !types.HasMember("Data") + || types.GetRawValue("Data") is not SZArrayRecord data) + { + return false; + } + + bitmap = new Bitmap(new MemoryStream(data.GetArray())); + return true; + } + + /// + /// Try to get a supported object. + /// + public static bool TryGetObject(this SerializationRecord record, [NotNullWhen(true)] out object? value) => + record.TryGetFrameworkObject(out value) + || record.TryGetBitmap(out value) + || record.TryGetImageListStreamer(out value); +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs index f93fd8778aa..44ac7aa28aa 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs @@ -4,7 +4,6 @@ using System.Drawing; using System.Reflection; using System.Runtime.Serialization; -using System.Private.Windows.Core.BinaryFormat; namespace System.Windows.Forms; @@ -16,7 +15,7 @@ public partial class DataObject /// /// /// - /// This gets skipped when our code handles its known types. + /// This gets skipped when our code handles its known types. /// While there are more types allowed (such as , they are all safe. /// /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs index 98020dee8ae..bda6d4149e9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs @@ -6,10 +6,9 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters; using System.Text; -using System.Private.Windows.Core.BinaryFormat; using Com = Windows.Win32.System.Com; using System.Drawing; -using System.Windows.Forms.BinaryFormat; +using System.Windows.Forms.Nrbf; namespace System.Windows.Forms; @@ -183,7 +182,7 @@ static object ReadObjectFromHandleDeserializer(Stream stream, bool restrictDeser long startPosition = stream.Position; try { - if (new BinaryFormattedObject(stream).TryGetObject(out object? value)) + if (stream.Decode().TryGetObject(out object? value)) { return value; } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectTests.cs index 32e3d794f23..b5f1f35fe42 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormat/WinFormsBinaryFormattedObjectTests.cs @@ -5,8 +5,10 @@ using System.ComponentModel; using System.Drawing; +using System.Formats.Nrbf; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms.BinaryFormat; +using System.Windows.Forms.Nrbf; namespace System.Private.Windows.Core.BinaryFormat.Tests; @@ -18,14 +20,14 @@ public class WinFormsBinaryFormattedObjectTests public void BinaryFormattedObject_Bitmap_FromBinaryFormatter() { using Bitmap bitmap = new(10, 10); - BinaryFormattedObject format = bitmap.SerializeAndParse(); - ClassWithMembersAndTypes root = format.RootRecord.Should().BeOfType().Subject; - root.Name.Should().Be(typeof(Bitmap).FullName); - format[root.LibraryId].Should().BeOfType().Which - .LibraryName.Should().Be(AssemblyRef.SystemDrawing); - MemberReference reference = root["Data"].Should().BeOfType().Subject; - format[reference].Should().BeOfType>(); - format.TryGetBitmap(out object? result).Should().BeTrue(); + SerializationRecord rootRecord = bitmap.SerializeAndDecode(); + Formats.Nrbf.ClassRecord root = rootRecord.Should().BeAssignableTo().Subject; + root.TypeNameMatches(typeof(Bitmap)).Should().BeTrue(); + root.TypeName.FullName.Should().Be(typeof(Bitmap).FullName); + root.TypeName.AssemblyName!.FullName.Should().Be(AssemblyRef.SystemDrawing); + Formats.Nrbf.ArrayRecord arrayRecord = root.GetArrayRecord("Data")!; + arrayRecord.Should().BeAssignableTo>(); + rootRecord.TryGetBitmap(out object? result).Should().BeTrue(); using Bitmap deserialized = result.Should().BeOfType().Which; deserialized.Size.Should().Be(bitmap.Size); } @@ -38,9 +40,9 @@ public void BinaryFormattedObject_Bitmap_RoundTrip() WinFormsBinaryFormatWriter.WriteBitmap(stream, bitmap); stream.Position = 0; - BinaryFormattedObject binary = new(stream); + SerializationRecord rootRecord = NrbfDecoder.Decode(stream); - binary.TryGetBitmap(out object? result).Should().BeTrue(); + rootRecord.TryGetBitmap(out object? result).Should().BeTrue(); using Bitmap deserialized = result.Should().BeOfType().Which; deserialized.Size.Should().Be(bitmap.Size); } @@ -73,15 +75,13 @@ public void BinaryFormattedObject_ImageListStreamer_FromBinaryFormatter() sourceList.Images.Add(image); using ImageListStreamer stream = sourceList.ImageStream!; - BinaryFormattedObject format = stream.SerializeAndParse(); - ClassWithMembersAndTypes root = format.RootRecord.Should().BeOfType().Subject; - root.Name.Should().Be(typeof(ImageListStreamer).FullName); - format[root.LibraryId].Should().BeOfType().Which - .LibraryName.Should().Be(typeof(WinFormsBinaryFormatWriter).Assembly.FullName); - MemberReference reference = root["Data"].Should().BeOfType().Subject; - format[reference].Should().BeOfType>(); + SerializationRecord rootRecord = stream.SerializeAndDecode(); + Formats.Nrbf.ClassRecord root = rootRecord.Should().BeAssignableTo().Subject; + root.TypeName.FullName.Should().Be(typeof(ImageListStreamer).FullName); + root.TypeName.AssemblyName!.FullName.Should().Be(typeof(WinFormsBinaryFormatWriter).Assembly.FullName); + root.GetArrayRecord("Data")!.Should().BeAssignableTo>(); - format.TryGetImageListStreamer(out object? result).Should().BeTrue(); + rootRecord.TryGetImageListStreamer(out object? result).Should().BeTrue(); using ImageListStreamer deserialized = result.Should().BeOfType().Which; using ImageList newList = new(); newList.ImageStream = deserialized; @@ -101,9 +101,9 @@ public void BinaryFormattedObject_ImageListStreamer_RoundTrip() using MemoryStream memoryStream = new(); WinFormsBinaryFormatWriter.WriteImageListStreamer(memoryStream, stream); memoryStream.Position = 0; - BinaryFormattedObject binary = new(memoryStream); + SerializationRecord rootRecord = NrbfDecoder.Decode(memoryStream); - binary.TryGetImageListStreamer(out object? result).Should().BeTrue(); + rootRecord.TryGetImageListStreamer(out object? result).Should().BeTrue(); using ImageListStreamer deserialized = result.Should().BeOfType().Which; using ImageList newList = new(); newList.ImageStream = deserialized; @@ -114,12 +114,12 @@ public void BinaryFormattedObject_ImageListStreamer_RoundTrip() [Theory] [MemberData(nameof(BinaryFormattedObjects_TestData))] - public void BinaryFormattedObjects_SuccessfullyParse(object value) + public void NrbfDecoder_SuccessfullyDecode(object value) { // Check that we can parse types that would hit the BinaryFormatter for property serialization. using (value as IDisposable) { - var format = value.SerializeAndParse(); + var format = value.SerializeAndDecode(); } } From c3cb9b32248120efadca5e2a686b41f863717f67 Mon Sep 17 00:00:00 2001 From: Leaf Shi <132890443+LeafShi1@users.noreply.github.com> Date: Thu, 25 Jul 2024 04:58:12 +0800 Subject: [PATCH 268/342] Add binary Formatter package to DemoConsole (#11741) * Add binary Formatter package to DemoConsole * Removing extra space * Update DemoConsole.csproj --- .../DesignSurface/DemoConsole/DemoConsole.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/System.Windows.Forms/tests/IntegrationTests/DesignSurface/DemoConsole/DemoConsole.csproj b/src/System.Windows.Forms/tests/IntegrationTests/DesignSurface/DemoConsole/DemoConsole.csproj index 81ba51cbcaf..71527d2012e 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/DesignSurface/DemoConsole/DemoConsole.csproj +++ b/src/System.Windows.Forms/tests/IntegrationTests/DesignSurface/DemoConsole/DemoConsole.csproj @@ -22,6 +22,10 @@ true + + + + From 84d2f99773945013bc94a0111e1737ba71deb323 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 24 Jul 2024 16:24:43 -0700 Subject: [PATCH 269/342] Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2501881 (#11709) * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2497975 * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2499303 * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2500034 * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2501843 --- src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf | 4 ++-- src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf | 4 ++-- src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf | 4 ++-- src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index c862c23824b..4f97a54feb9 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Použití deserializace BinaryFormatter se v aplikacích s pročištěným kódem nepodporuje. + Serializace a deserializace BinaryFormatter jsou v této aplikaci zakázané. Další informace najdete na https://aka.ms/binaryformatter. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index 0275c7c105b..8087afad687 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Die Verwendung von BinaryFormatter wird in gekürzten Anwendungen nicht unterstützt. + Die Serialisierung und Deserialisierung von BinaryFormatter sind in dieser Anwendung deaktiviert. Weitere Informationen finden Sie unter https://aka.ms/binaryformatter. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index 922b63065e5..0371065311e 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - No se admite el uso de BinaryFormatter en aplicaciones recortadas. + La serialización y deserialización de BinaryFormatter están deshabilitadas en esta aplicación. Consulte https://aka.ms/binaryformatter para obtener más información. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index ee2a5b709b4..3b1771b16d8 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - L’utilisation de BinaryFormatter n’est pas prise en charge dans les applications tronquées. + La sérialisation et la désérialisation binaryFormatter sont désactivées dans cette application. Pour plus d’informations, consultez https://aka.ms/binaryformatter. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index 5b435a95c32..ef0690ba0aa 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - L'uso di BinaryFormatter non è supportato nelle applicazioni tagliate. + La serializzazione e la deserializzazione di BinaryFormatter sono disabilitate in questa applicazione. Per altre informazioni, vedere https://aka.ms/binaryformatter. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index 0e6badc366e..d2d1d7cf835 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - BinaryFormatter の使用は、トリミングされたアプリケーションではサポートされていません。 + BinaryFormatter のシリアル化と逆シリアル化は、このアプリケーションでは無効です。詳細については、https://aka.ms/binaryformatter を参照してください。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index f7fc8cee8b9..57fddd139db 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - 트리밍된 애플리케이션에서는 BinaryFormatter를 사용할 수 없습니다. + 이 애플리케이션 내에서 BinaryFormatter 직렬화 및 역직렬화를 사용할 수 없습니다. 자세한 내용은 https://aka.ms/binaryformatter 페이지를 참조하세요. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index 1dd214c1492..aefe67576f7 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Używanie klasy BinaryFormatter nie jest obsługiwane w przyciętych aplikacjach. + Serializacji BinaryFormatter i deserializacji są wyłączone w tej aplikacji. Aby uzyskać więcej informacji, zobacz https://aka.ms/binaryformatter. @@ -9706,7 +9706,7 @@ Stos śledzenia, w którym wystąpiła zabroniona operacja: Allows the control to be interacted when window does not have focus. - Allows the control to be interacted when window does not have focus. + Umożliwia interakcję kontrolki, gdy okno nie ma fokusu. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index 9ebad890c70..35ed4d3d1cf 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Não há suporte para o uso do BinaryFormatter em aplicativos cortados. + A serialização e a desserialização de BinaryFormatter estão desabilitadas neste aplicativo. Consulte https://aka.ms/binaryformatter para obter mais informações. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index 0b21438ee11..89bf91f5453 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Использование BinaryFormatter не поддерживается в обрезанных приложениях. + Сериализация и десериализация BinaryFormatter отключены в этом приложении. Дополнительные сведения см. https://aka.ms/binaryformatter. @@ -9707,7 +9707,7 @@ Stack trace where the illegal operation occurred was: Allows the control to be interacted when window does not have focus. - Allows the control to be interacted when window does not have focus. + Позволяет взаимодействовать с элементом управления, если окно не имеет фокуса. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 856b5daf6bf..1ccb6b8cc93 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - Kırpılmış uygulamalarda BinaryFormatter’ın kullanımı desteklenmiyor. + BinaryFormatter serileştirme ve seri durumdan çıkarma işlemleri bu uygulamada devre dışı. Daha fazla bilgi için https://aka.ms/binaryformatter sayfasına bakın. @@ -9706,7 +9706,7 @@ Geçersiz işlemin gerçekleştiği yığın izi: Allows the control to be interacted when window does not have focus. - Allows the control to be interacted when window does not have focus. + Pencerenin odağı olmadığında kontrolün etkileşime girmesine izin verir. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index 017ca16d249..759ada01525 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - 已剪裁的应用程序中不支持使用 BinaryFormatter。 + 此应用程序中已禁用 BinaryFormatter 序列化和反序列化。有关详细信息,请参阅 https://aka.ms/binaryformatter。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index 1a60065a3da..2ada131f238 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -289,7 +289,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. - 修剪後的應用程式不支援使用 BinaryFormatter。 + 此應用程式內已停用 BinaryFormatter 序列化和還原序列化。如需詳細資訊,請參閱 https://aka.ms/binaryformatter。 From 36f51ab734b380e8495ec0519f88f467516450b2 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Jul 2024 16:54:55 -0700 Subject: [PATCH 270/342] Use NameOf where possible Cleanup formatting of Network files to match C# --- .../Devices/Network/NetworkDownload.vb | 52 ++--- .../Devices/Network/NetworkDownloadAsync.vb | 200 ++++++++++-------- .../Devices/Network/NetworkPing.vb | 5 +- .../Devices/Network/NetworkUpload.vb | 81 +++++-- .../VisualBasic/Helpers/VBInputBox.vb | 2 +- .../src/Microsoft/VisualBasic/Interaction.vb | 4 +- 6 files changed, 210 insertions(+), 134 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 36c29599827..7c7a5fda4e4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -25,8 +25,8 @@ Namespace Microsoft.VisualBasic.Devices Public Sub DownloadFile(address As String, destinationFileName As String) Try DownloadFileAsync( - address, - destinationFileName, + address, + destinationFileName, userName:=DEFAULT_USERNAME, password:=DEFAULT_PASSWORD, dialog:=Nothing, @@ -56,10 +56,10 @@ Namespace Microsoft.VisualBasic.Devices Try DownloadFileAsync( - address, - destinationFileName, - userName, - password, + address, + destinationFileName, + userName, + password, dialog:=Nothing, connectionTimeout:=DEFAULT_TIMEOUT, overwrite:=False).Wait() @@ -180,13 +180,13 @@ Namespace Microsoft.VisualBasic.Devices End If Dim t As Task = DownloadFileAsync( - addressUri, - destinationFileName, - networkCredentials, + addressUri, + destinationFileName, + networkCredentials, dialog, - connectionTimeout, - overwrite, - onUserCancel) + connectionTimeout, + overwrite, + onUserCancel) If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad @@ -234,11 +234,11 @@ Namespace Microsoft.VisualBasic.Devices Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync( - address, - destinationFileName, + addressUri:=address, + destinationFileName, networkCredentials, dialog, - connectionTimeout, + connectionTimeout, overwrite) If t.IsFaulted Then @@ -293,13 +293,13 @@ Namespace Microsoft.VisualBasic.Devices Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync( - address, - destinationFileName, - networkCredentials, + addressUri:=address, + destinationFileName, + networkCredentials, dialog, - connectionTimeout, - overwrite, - onUserCancel) + connectionTimeout, + overwrite, + onUserCancel) If t.IsFaulted Then ' IsFaulted will be true if any parameters are bad @@ -350,12 +350,12 @@ Namespace Microsoft.VisualBasic.Devices Try dialog = GetProgressDialog(address.AbsolutePath, destinationFileName, showUI) Dim t As Task = DownloadFileAsync( - address, - destinationFileName, - networkCredentials, + addressUri:=address, + destinationFileName, + networkCredentials, dialog, - connectionTimeout, - overwrite, + connectionTimeout, + overwrite, onUserCancel:=UICancelOption.ThrowException) If t.IsFaulted Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb index 4da09ddfc63..7bea1d7abaf 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownloadAsync.vb @@ -24,13 +24,14 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' - Friend Shared Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + Friend Shared Function DownloadFileAsync( + addressUri As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task Dim clientHandler As HttpClientHandler = If(networkCredentials Is Nothing, New HttpClientHandler, @@ -55,24 +56,29 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing. ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(addressUri, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + Friend Shared Async Function DownloadFileAsync( + addressUri As Uri, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) + + Await DownloadFileAsync( + addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function +#If False Then ' This is here of API review determains its needed + ''' ''' Downloads a file from the network to the specified path. ''' @@ -84,26 +90,29 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + Friend Shared Async Function DownloadFileAsync( + addressUri As Uri, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) + Await DownloadFileAsync( + addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) End Function +#End If ''' ''' Downloads a file from the network to the specified path. @@ -116,16 +125,17 @@ Namespace Microsoft.VisualBasic.Devices ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). ''' Calls to all the other overloads will come through here. - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - clientHandler As HttpClientHandler, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + Friend Shared Async Function DownloadFileAsync( + addressUri As Uri, + destinationFileName As String, + clientHandler As HttpClientHandler, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task + If connectionTimeout <= 0 Then - ' DO NOT USE NameOf(connectionTimeout) - Throw ExUtils.GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout) + Throw ExUtils.GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If addressUri Is Nothing Then @@ -190,22 +200,24 @@ Namespace Microsoft.VisualBasic.Devices ''' A ProgressDialog or Nothing. ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. - Friend Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(address, - destinationFileName, - userName, - password, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + Friend Shared Async Function DownloadFileAsync( + address As String, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync( + address, + destinationFileName, + userName, + password, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function ''' @@ -219,14 +231,15 @@ Namespace Microsoft.VisualBasic.Devices ''' Time allotted before giving up on a connection. ''' Indicates whether or not the file should be overwritten if local file already exists. ''' Indicates what to do if user cancels dialog (either throw or do nothing). - Friend Shared Async Function DownloadFileAsync(address As String, - destinationFileName As String, - userName As String, - password As String, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean, - onUserCancel As UICancelOption) As Task + Friend Shared Async Function DownloadFileAsync( + address As String, + destinationFileName As String, + userName As String, + password As String, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean, + onUserCancel As UICancelOption) As Task If String.IsNullOrWhiteSpace(address) Then Throw ExUtils.GetArgumentNullException(NameOf(address)) @@ -237,13 +250,14 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) + Await DownloadFileAsync( + addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel).ConfigureAwait(continueOnCapturedContext:=False) End Function ''' @@ -258,20 +272,22 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Function will Throw on unhandled exceptions. ''' - Friend Shared Async Function DownloadFileAsync(addressUri As Uri, - destinationFileName As String, - networkCredentials As ICredentials, - dialog As ProgressDialog, - connectionTimeout As Integer, - overwrite As Boolean) As Task - - Await DownloadFileAsync(addressUri, - destinationFileName, - networkCredentials, - dialog, - connectionTimeout, - overwrite, - onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) + Friend Shared Async Function DownloadFileAsync( + addressUri As Uri, + destinationFileName As String, + networkCredentials As ICredentials, + dialog As ProgressDialog, + connectionTimeout As Integer, + overwrite As Boolean) As Task + + Await DownloadFileAsync( + addressUri, + destinationFileName, + networkCredentials, + dialog, + connectionTimeout, + overwrite, + onUserCancel:=UICancelOption.ThrowException).ConfigureAwait(continueOnCapturedContext:=False) End Function End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb index 621fc81c5ba..0f1f76a89a4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkPing.vb @@ -72,7 +72,10 @@ Namespace Microsoft.VisualBasic.Devices End If Dim pingMaker As New NetInfoAlias.Ping - Dim reply As NetInfoAlias.PingReply = pingMaker.Send(hostNameOrAddress, timeout, PingBuffer) + Dim reply As NetInfoAlias.PingReply = pingMaker.Send( + hostNameOrAddress, + timeout, + PingBuffer) If reply.Status = NetInfoAlias.IPStatus.Success Then Return True End If diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb index 50e9ffb722d..04f55602b99 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkUpload.vb @@ -16,7 +16,13 @@ Namespace Microsoft.VisualBasic.Devices ''' The file to be uploaded. ''' The full name and path of the host destination. Public Sub UploadFile(sourceFileName As String, address As String) - UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) + UploadFile( + sourceFileName, + address, + userName:=DEFAULT_USERNAME, + password:=DEFAULT_PASSWORD, + showUI:=False, + connectionTimeout:=DEFAULT_TIMEOUT) End Sub ''' @@ -25,7 +31,13 @@ Namespace Microsoft.VisualBasic.Devices ''' The file to be uploaded. ''' Uri representing the destination. Public Sub UploadFile(sourceFileName As String, address As Uri) - UploadFile(sourceFileName, address, DEFAULT_USERNAME, DEFAULT_PASSWORD, False, DEFAULT_TIMEOUT) + UploadFile( + sourceFileName, + address, + userName:=DEFAULT_USERNAME, + password:=DEFAULT_PASSWORD, + showUI:=False, + connectionTimeout:=DEFAULT_TIMEOUT) End Sub ''' @@ -41,7 +53,13 @@ Namespace Microsoft.VisualBasic.Devices userName As String, password As String) - UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) + UploadFile( + sourceFileName, + address, + userName, + password, + showUI:=False, + connectionTimeout:=DEFAULT_TIMEOUT) End Sub ''' @@ -57,7 +75,13 @@ Namespace Microsoft.VisualBasic.Devices userName As String, password As String) - UploadFile(sourceFileName, address, userName, password, False, DEFAULT_TIMEOUT) + UploadFile( + sourceFileName, + address, + userName, + password, + showUI:=False, + connectionTimeout:=DEFAULT_TIMEOUT) End Sub ''' @@ -77,7 +101,14 @@ Namespace Microsoft.VisualBasic.Devices showUI As Boolean, connectionTimeout As Integer) - UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) + UploadFile( + sourceFileName, + address, + userName, + password, + showUI, + connectionTimeout, + onUserCancel:=UICancelOption.ThrowException) End Sub ''' @@ -104,7 +135,7 @@ Namespace Microsoft.VisualBasic.Devices ' We're safe from UploadFile(Nothing, ...) due to overload failure (UploadFile(String,...) vs. UploadFile(Uri,...)). ' However, it is good practice to verify address before calling address.Trim. If String.IsNullOrWhiteSpace(address) Then - Throw GetArgumentNullException("address") + Throw GetArgumentNullException(NameOf(address)) End If ' Getting a uri will validate the form of the host address @@ -115,7 +146,14 @@ Namespace Microsoft.VisualBasic.Devices Throw GetInvalidOperationException(SR.Network_UploadAddressNeedsFilename) End If - UploadFile(sourceFileName, addressUri, userName, password, showUI, connectionTimeout, onUserCancel) + UploadFile( + sourceFileName, + address:=addressUri, + userName, + password, + showUI, + connectionTimeout, + onUserCancel) End Sub @@ -136,7 +174,14 @@ Namespace Microsoft.VisualBasic.Devices showUI As Boolean, connectionTimeout As Integer) - UploadFile(sourceFileName, address, userName, password, showUI, connectionTimeout, UICancelOption.ThrowException) + UploadFile( + sourceFileName, + address, + userName, + password, + showUI, + connectionTimeout, + onUserCancel:=UICancelOption.ThrowException) End Sub ''' @@ -163,7 +208,13 @@ Namespace Microsoft.VisualBasic.Devices ' Get network credentials Dim networkCredentials As ICredentials = GetNetworkCredentials(userName, password) - UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, onUserCancel) + UploadFile( + sourceFileName, + address, + networkCredentials, + showUI, + connectionTimeout, + onUserCancel) End Sub @@ -182,7 +233,13 @@ Namespace Microsoft.VisualBasic.Devices showUI As Boolean, connectionTimeout As Integer) - UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, UICancelOption.ThrowException) + UploadFile( + sourceFileName, + address, + networkCredentials, + showUI, + connectionTimeout, + onUserCancel:=UICancelOption.ThrowException) End Sub ''' @@ -212,11 +269,11 @@ Namespace Microsoft.VisualBasic.Devices End If If connectionTimeout <= 0 Then - Throw GetArgumentExceptionWithArgName("connectionTimeout", SR.Network_BadConnectionTimeout) + Throw GetArgumentExceptionWithArgName(NameOf(connectionTimeout), SR.Network_BadConnectionTimeout) End If If address Is Nothing Then - Throw GetArgumentNullException("address") + Throw GetArgumentNullException(NameOf(address)) End If Using client As New WebClientExtended() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index a2e78f58b76..45985477409 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -101,7 +101,7 @@ Namespace Microsoft.VisualBasic.CompilerServices If labelSizeNeeded.Height > Label.Height Then 'The current label size is not large enough to accommodate the prompt. We need ' to expand the label and the dialog, and move the textbox to make room. - Dim dialogHeightChange As Integer = CInt(labelSizeNeeded.Height) - Label.Height + Dim dialogHeightChange As Integer = CInt(labelSizeNeeded.Height - Label.Height) Label.Height += dialogHeightChange TextBox.Top += dialogHeightChange Height += dialogHeightChange diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 23ea4248dbc..f3fc50eda46 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -25,11 +25,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, NameOf(PathName))) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, NameOf(Style))) End If NativeMethods.GetStartupInfo(startupInfo) From 4c0c0c27a0c3e6ac4889a76ca849335e3b5ae163 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Jul 2024 17:18:48 -0700 Subject: [PATCH 271/342] Mergecode cleanup with Add-Tests-for-VB-Runtime-Review-2nd --- .../ApplicationServices/ApplicationBase.vb | 4 +- .../ApplyApplicationDefaultsEventArgs.vb | 14 +- .../ApplicationServices/AssemblyInfo.vb | 95 ++++-- .../CantStartSingleInstanceException.vb | 6 +- .../ConsoleApplicationBase.vb | 19 +- .../NoStartupFormException.vb | 2 +- .../ApplicationServices/StartupEventArgs.vb | 2 +- .../Microsoft/VisualBasic/Devices/Clock.vb | 2 +- .../Microsoft/VisualBasic/Devices/Computer.vb | 69 +++-- .../VisualBasic/Devices/ComputerInfo.vb | 236 ++++++++------ .../Microsoft/VisualBasic/Devices/Keyboard.vb | 94 +++--- .../VisualBasic/Devices/ServerComputer.vb | 55 ++-- .../VisualBasic/Helpers/FileSystemUtils.vb | 88 +++--- .../Microsoft/VisualBasic/Helpers/IVbHost.vb | 5 + .../VisualBasic/Helpers/VBInputBox.vb | 22 +- .../src/Microsoft/VisualBasic/Interaction.vb | 290 +++++++++--------- .../src/Microsoft/VisualBasic/Logging/Log.vb | 189 ++++++------ .../VisualBasic/MyServices/ClipboardProxy.vb | 188 ++++++------ .../VisualBasic/MyServices/FileSystemProxy.vb | 249 +++++++-------- .../MyServices/Internal/ContextValue.vb | 21 +- .../MyServices/Internal/ProgressDialog.vb | 284 ++++++++--------- .../VisualBasic/MyServices/RegistryProxy.vb | 32 +- .../MyServices/SpecialDirectoriesProxy.vb | 48 +-- 23 files changed, 1072 insertions(+), 942 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 995e0150bff..65615492c04 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -49,8 +49,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Provides access to logging capability. ''' ''' - ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging to OS log, debug window - ''' and a delimited text file or xml log. + ''' Returns a Microsoft.VisualBasic.Windows.Log object used for logging + ''' to OS log, debug window and a delimited text file or xml log. ''' Public ReadOnly Property Log() As Logging.Log Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 7c6ac816137..3d82b0c4e50 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -22,16 +22,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. + ''' Setting this property inside the event handler causes a new default + ''' Font for Forms and UserControls to be set. ''' ''' - ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the - ''' application is applied by setting this property with a value different than nothing. + ''' When the ApplyApplicationDefault event is raised, this property contains + ''' nothing. A new default Font for the application is applied by setting + ''' this property with a value different than nothing. ''' Public Property Font As Font ''' - ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. + ''' Setting this Property inside the event handler determines the general + ''' HighDpiMode for the application. ''' ''' ''' The default value for this property is SystemAware. @@ -39,7 +42,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property HighDpiMode As HighDpiMode ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. + ''' Setting this Property inside the event handler determines how long + ''' an application's Splash dialog is displayed at a minimum. ''' Public Property MinimumSplashScreenDisplayTime As Integer = WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb index 5afb2636fcc..7f7bb8dab2f 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/AssemblyInfo.vb @@ -9,13 +9,13 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' A class that contains the information about an Application. This information can be - ''' specified using the assembly attributes (contained in AssemblyInfo.vb file in case of - ''' a VB project in Visual Studio .NET). + ''' A class that contains the information about an Application. This information + ''' can be specified using the assembly attributes (contained in AssemblyInfo.vb + ''' file in case of a VB project in Visual Studio .NET). ''' ''' - ''' This class is based on the class of the framework, but - ''' reduced to a number of relevant properties. + ''' This class is based on the class of the + ''' framework, but reduced to a number of relevant properties. ''' Public Class AssemblyInfo @@ -66,8 +66,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the company name associated with the assembly. ''' - ''' A String containing the AssemblyCompanyAttribute associated with the assembly. - ''' if the AssemblyCompanyAttribute is not defined. + ''' + ''' A String containing the + ''' associated with the assembly. + ''' + ''' + ''' Thrown if is not defined. + ''' Public ReadOnly Property CompanyName() As String Get If _companyName Is Nothing Then @@ -86,8 +91,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the copyright notices associated with the assembly. ''' - ''' A String containing the AssemblyCopyrightAttribute associated with the assembly. - ''' if the AssemblyCopyrightAttribute is not defined. + ''' + ''' A String containing the + ''' associated with the assembly. + ''' + ''' + ''' Thrown if is not defined. + ''' Public ReadOnly Property Copyright() As String Get If _copyright Is Nothing Then @@ -105,8 +115,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the description associated with the assembly. ''' - ''' A String containing the AssemblyDescriptionAttribute associated with the assembly. - ''' if the AssemblyDescriptionAttribute is not defined. + ''' + ''' String containing the + ''' associated with the assembly. + ''' + ''' + ''' Thrown if is not defined. + ''' Public ReadOnly Property Description() As String Get If _description Is Nothing Then @@ -134,8 +149,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Returns the names of all assemblies loaded by the current application. ''' - ''' A ReadOnlyCollection(Of Assembly) containing all the loaded assemblies. - ''' attempt on an unloaded application domain. + ''' + ''' A containing all the loaded assemblies. + ''' + ''' + ''' Attempt on an unloaded application domain. + ''' Public ReadOnly Property LoadedAssemblies() As ReadOnlyCollection(Of Assembly) Get Dim result As New Collection(Of Assembly) @@ -149,8 +168,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the product name associated with the assembly. ''' - ''' A String containing the AssemblyProductAttribute associated with the assembly. - ''' if the AssemblyProductAttribute is not defined. + ''' + ''' String containing the associated + ''' with the assembly. + ''' + ''' + ''' Thrown if is not defined. + ''' Public ReadOnly Property ProductName() As String Get If _productName Is Nothing Then @@ -168,8 +192,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Returns the current stack trace information. ''' - ''' A string containing stack trace information. Value can be String.Empty. - ''' The requested stack trace information is out of range. + ''' + ''' String containing stack trace information. Value can be . + ''' + ''' + ''' Thrown if the requested stack trace information is out of range. + ''' Public ReadOnly Property StackTrace() As String Get Return Environment.StackTrace @@ -179,8 +207,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the company name associated with the assembly. ''' - ''' A String containing the AssemblyTitleAttribute associated with the assembly. - ''' if the AssemblyTitleAttribute is not defined. + ''' + ''' String containing the + ''' associated with the assembly. + ''' + ''' + ''' Thrown if is not defined. Public ReadOnly Property Title() As String Get If _title Is Nothing Then @@ -199,8 +231,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the trademark notices associated with the assembly. ''' - ''' A String containing the AssemblyTrademarkAttribute associated with the assembly. - ''' if the AssemblyTrademarkAttribute is not defined. + ''' + ''' String containing the associated + ''' with the assembly. + ''' + ''' + ''' Thrown if the is not defined. + ''' Public ReadOnly Property Trademark() As String Get If _trademark Is Nothing Then @@ -218,8 +255,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets the version number of the assembly. ''' - ''' A System.Version class containing the version number of the assembly.> - ''' Cannot use AssemblyVersionAttribute since it always return Nothing. + ''' + ''' A class containing the version number of the assembly. + ''' > + ''' + ''' Cannot use since it always return Nothing. + ''' Public ReadOnly Property Version() As Version Get Return _assembly.GetName().Version @@ -230,7 +271,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Gets the amount of physical memory mapped to the process context. ''' ''' - ''' A 64-bit signed integer containing the size of physical memory mapped to the process context, in bytes. + ''' A 64-bit signed integer containing the size of physical memory mapped + ''' to the process context, in bytes. ''' Public ReadOnly Property WorkingSet() As Long Get @@ -239,11 +281,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Gets an attribute from the assembly and throw exception if the attribute does not exist. + ''' Gets an from the assembly and throws exception + ''' if the attribute does not exist. ''' ''' The type of the required attribute. ''' - ''' The attribute with the given type gotten from the assembly, or Nothing. + ''' The with the given type gotten from the assembly, or Nothing. ''' Private Function GetAttribute(attributeType As Type) As Object diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb index f05ab60a321..d3e09ebeee7 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/CantStartSingleInstanceException.vb @@ -8,8 +8,8 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices ''' - ''' Exception for when we launch a single-instance application and it can't connect with the - ''' original instance. + ''' Exception for when we launch a single-instance application and it can't + ''' connect with the original instance. ''' @@ -23,7 +23,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Creates a new exception + ''' Creates a new . ''' Public Sub New() MyBase.New(ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb index 1c4819c065b..1fdc0ce4d92 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ConsoleApplicationBase.vb @@ -18,17 +18,19 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Constructs the application Shutdown/Startup model object ''' ''' - ''' We have to have a parameterless constructor because the platform specific Application - ''' object derives from this one and it doesn't define a constructor. The partial class generated by the - ''' designer defines the constructor in order to configure the application. + ''' We have to have a parameterless constructor because the platform + ''' specific Application object derives from this one and it doesn't define + ''' a constructor. The partial class generated by the designer defines + ''' the constructor in order to configure the application. ''' Public Sub New() MyBase.New() End Sub ''' - ''' Allows derived classes to set what the command line should look like. calls this - ''' for instance because we snag the command line from Main(). + ''' Allows derived classes to set what the command line should look like. + ''' calls this for instance + ''' because we snag the command line from Main(). ''' Protected WriteOnly Property InternalCommandLine() As ObjectModel.ReadOnlyCollection(Of String) @@ -41,8 +43,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Returns the command line arguments for the current application. ''' ''' - ''' This function differs from in that the - ''' path of the executing file (the 0th entry) is omitted from the returned collection + ''' This function differs from + ''' in that the path of the executing file (the 0th entry) is omitted from + ''' the returned collection ''' Public ReadOnly Property CommandLineArgs() As ObjectModel.ReadOnlyCollection(Of String) Get @@ -61,5 +64,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Get End Property - End Class 'ApplicationBase + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb index 49f9d9a2a56..19aaf953bc8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/NoStartupFormException.vb @@ -22,7 +22,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Creates a new exception + ''' Creates a new exception. ''' Public Sub New() MyBase.New(ExUtils.GetResourceString(SR.AppModel_NoStartupForm)) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb index f99c8d63713..9c9cccfbd25 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/StartupEventArgs.vb @@ -26,7 +26,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Returns the command line sent to this application + ''' Returns the command line sent to this application. ''' Public ReadOnly Property CommandLine() As ReadOnlyCollection(Of String) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb index ee2d35811f1..fd5721fc500 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Clock.vb @@ -45,5 +45,5 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - End Class 'Clock + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb index 59507783f17..50c6d1c42cf 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Computer.vb @@ -17,16 +17,32 @@ Namespace Microsoft.VisualBasic.Devices ''' Public Class Computer : Inherits ServerComputer - 'NOTE: The .Net design guidelines state that access to Instance members does not have to be thread-safe. Access to Shared members does have to be thread-safe. - 'Since My.Computer creates the instance of Computer in a thread-safe way, access to the Computer will necessarily be thread-safe. - 'There is nothing to prevent a user from passing our computer object across threads or creating their own instance and then getting into trouble. - ' But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. - ' If you dim them up yourself, you are responsible for managing the threading. + ' The .Net design guidelines state that access to Instance members does not + ' have to be thread-safe. Access to Shared members does have to be thread-safe. + ' Since My.Computer creates the instance of Computer in a thread-safe way, + ' access to the Computer will necessarily be thread-safe. There is nothing to + ' prevent a user from passing our computer object across threads or creating + ' their own instance and then getting into trouble. But that is completely + ' consistent with the rest of the FX design. It is MY.* that is thread safe + ' and leads to best practice access to these objects. If you Dim them up yourself, + ' you are responsible for managing the threading. + + 'Lazy initialized cache for the clipboard class. (proxies can be shared - they have no state) + Private Shared s_clipboard As ClipboardProxy + + 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class + Private Shared s_keyboardInstance As Keyboard + + 'Lazy initialized cache for the Mouse class. SHARED because Mouse behaves as a ReadOnly singleton class + Private Shared s_mouse As Mouse + + 'Lazy initialized cache for the Audio class. + Private _audio As Audio ''' ''' Gets an Audio object which can play sound files or resources. ''' - ''' A sound object. + ''' A object. Public ReadOnly Property Audio() As Audio Get If _audio IsNot Nothing Then Return _audio @@ -36,9 +52,9 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' A thin wrapper for System.Windows.Forms.Clipboard + ''' A thin wrapper for . ''' - ''' An object representing the clipboard. + ''' An object representing the . Public ReadOnly Property Clipboard() As ClipboardProxy Get If s_clipboard Is Nothing Then @@ -50,35 +66,35 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' This property returns the Mouse object containing information about - ''' the physical mouse installed to the machine. + ''' This property returns the object + ''' representing some keyboard properties and a send keys method ''' - ''' An instance of the Mouse class. - Public ReadOnly Property Mouse() As Mouse + ''' An instance of the class. + Public ReadOnly Property Keyboard() As Keyboard Get - If s_mouse IsNot Nothing Then Return s_mouse - s_mouse = New Mouse - Return s_mouse + If s_keyboardInstance IsNot Nothing Then Return s_keyboardInstance + s_keyboardInstance = New Keyboard + Return s_keyboardInstance End Get End Property ''' - ''' This property returns the Keyboard object representing some - ''' keyboard properties and a send keys method + ''' This property returns the Mouse object containing information about + ''' the physical mouse installed to the machine. ''' - ''' An instance of the Keyboard class. - Public ReadOnly Property Keyboard() As Keyboard + ''' An instance of the class. + Public ReadOnly Property Mouse() As Mouse Get - If s_keyboardInstance IsNot Nothing Then Return s_keyboardInstance - s_keyboardInstance = New Keyboard - Return s_keyboardInstance + If s_mouse IsNot Nothing Then Return s_mouse + s_mouse = New Mouse + Return s_mouse End Get End Property ''' ''' This property returns the primary display screen. ''' - ''' A System.Windows.Forms.Screen object as the primary screen. + ''' A object as the primary screen. Public ReadOnly Property Screen() As Screen Get 'Don't cache this. The Screen class responds to display resolution changes by nulling out AllScreens, which @@ -88,10 +104,5 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - Private _audio As Audio 'Lazy initialized cache for the Audio class. - Private Shared s_clipboard As ClipboardProxy 'Lazy initialized cache for the clipboard class. (proxies can be shared - they have no state) - Private Shared s_mouse As Mouse 'Lazy initialized cache for the Mouse class. SHARED because Mouse behaves as a ReadOnly singleton class - Private Shared s_keyboardInstance As Keyboard 'Lazy initialized cache for the Keyboard class. SHARED because Keyboard behaves as a ReadOnly singleton class - - End Class 'Computer + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb index 63e05043f72..564313e50e0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ComputerInfo.vb @@ -7,13 +7,17 @@ Imports Microsoft.VisualBasic.CompilerServices Namespace Microsoft.VisualBasic.Devices ''' - ''' Provides configuration information about the current computer and the current process. + ''' Provides configuration information about the current computer and the + ''' current process. ''' Public Class ComputerInfo ' Keep the debugger proxy current as you change this class - see the nested ComputerInfoDebugView below. + ' Cache our InternalMemoryStatus + Private _internalMemoryStatus As InternalMemoryStatus + ''' ''' Default constructor ''' @@ -21,23 +25,29 @@ Namespace Microsoft.VisualBasic.Devices End Sub #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:=" + ''' - ''' Gets the total size of physical memory on the machine. + ''' Gets the whole memory information details. ''' - ''' A 64-bit unsigned integer containing the size of total physical memory on the machine, in bytes. - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 + ''' An InternalMemoryStatus class. + Private ReadOnly Property MemoryStatus() As InternalMemoryStatus Get - Return MemoryStatus.TotalPhysicalMemory + If _internalMemoryStatus Is Nothing Then + _internalMemoryStatus = New InternalMemoryStatus + End If + Return _internalMemoryStatus End Get End Property ''' ''' Gets the total size of free physical memory on the machine. ''' - ''' A 64-bit unsigned integer containing the size of free physical memory on the machine, in bytes. - ''' If we are unable to obtain the memory status. + ''' A 64-bit unsigned integer containing the size of free + ''' physical memory on the machine, in bytes. + ''' + ''' + ''' Throw if we are unable to obtain the memory status. + ''' Public ReadOnly Property AvailablePhysicalMemory() As UInt64 Get @@ -45,36 +55,22 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - ''' - ''' Gets the total size of user potion of virtual address space for calling process. - ''' - ''' - ''' A 64-bit unsigned integer containing the size of user potion of virtual address space for calling process, - ''' in bytes. - ''' - ''' If we are unable to obtain the memory status. - - Public ReadOnly Property TotalVirtualMemory() As UInt64 - Get - Return MemoryStatus.TotalVirtualMemory - End Get - End Property - ''' ''' Gets the total size of free user potion of virtual address space for calling process. ''' ''' - ''' A 64-bit unsigned integer containing the size of free user potion of virtual address space for calling process, - ''' in bytes. + ''' A 64-bit unsigned integer containing the size of free user potion of + ''' virtual address space for calling process, in bytes. ''' - ''' If we are unable to obtain the memory status. + ''' + ''' Throw if we are unable to obtain the memory status. + ''' Public ReadOnly Property AvailableVirtualMemory() As UInt64 Get Return MemoryStatus.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references ''' ''' Gets the current UICulture installed on the machine. @@ -99,8 +95,13 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the platform OS name. ''' - ''' A string containing a Platform ID like "Win32NT", "Win32S", "Win32Windows". See PlatformID enum. - ''' If cannot obtain the OS Version information. + ''' + ''' A string containing a Platform ID like "Win32NT", "Win32S", + ''' "Win32Windows". See PlatformID enum. + ''' + ''' + ''' Thrown if cannot obtain the OS Version information. + ''' Public ReadOnly Property OSPlatform() As String Get Return Environment.OSVersion.Platform.ToString @@ -110,8 +111,11 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the current version number of the operating system. ''' - ''' A string contains the current version number of the operating system. - ''' If cannot obtain the OS Version information. + ''' + ''' A string contains the current version number of the operating system. + ''' + ''' If cannot obtain the OS Version information. + ''' Public ReadOnly Property OSVersion() As String Get Return Environment.OSVersion.Version.ToString @@ -119,33 +123,112 @@ Namespace Microsoft.VisualBasic.Devices End Property ''' - ''' Debugger proxy for the ComputerInfo class. The problem is that OSFullName can time out the debugger - ''' so we offer a view that doesn't have that field. + ''' Gets the total size of physical memory on the machine. ''' - Friend NotInheritable Class ComputerInfoDebugView - Public Sub New(RealClass As ComputerInfo) - _instanceBeingWatched = RealClass + ''' + ''' A 64-bit unsigned integer containing the size of total physical + ''' memory on the machine, in bytes. + ''' + ''' + ''' Throw if we are unable to obtain the memory status. + ''' + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Return MemoryStatus.TotalPhysicalMemory + End Get + End Property + + ''' + ''' Gets the total size of user potion of virtual address space for calling process. + ''' + ''' + ''' A 64-bit unsigned integer containing the size of user potion of virtual + ''' address space for calling process, in bytes. + ''' + ''' + ''' Throw if we are unable to obtain the memory status. + ''' + + Public ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Return MemoryStatus.TotalVirtualMemory + End Get + End Property + +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references + + ''' + ''' Calls GlobalMemoryStatusEx and returns the correct value. + ''' + Private NotInheritable Class InternalMemoryStatus + Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX + + Friend Sub New() End Sub #Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= - - Public ReadOnly Property TotalPhysicalMemory() As UInt64 + + Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalPhysicalMemory + Refresh() + Return _memoryStatusEx.ullAvailPhys End Get End Property - - Public ReadOnly Property AvailablePhysicalMemory() As UInt64 + Friend ReadOnly Property AvailableVirtualMemory() As UInt64 Get - Return _instanceBeingWatched.AvailablePhysicalMemory + Refresh() + Return _memoryStatusEx.ullAvailVirtual + End Get + End Property + + Friend ReadOnly Property TotalPhysicalMemory() As UInt64 + Get + Refresh() + Return _memoryStatusEx.ullTotalPhys + End Get + End Property + + Friend ReadOnly Property TotalVirtualMemory() As UInt64 + Get + Refresh() + Return _memoryStatusEx.ullTotalVirtual End Get End Property +#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references + + Private Sub Refresh() + _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX + _memoryStatusEx.Init() + If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then + Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) + End If + End Sub + + End Class + + ''' + ''' Debugger proxy for the class. The problem + ''' is that OSFullName can time out the debugger so we offer a view + ''' that doesn't have that field. + ''' + Friend NotInheritable Class ComputerInfoDebugView + + + Private ReadOnly _instanceBeingWatched As ComputerInfo + + Public Sub New(RealClass As ComputerInfo) + _instanceBeingWatched = RealClass + End Sub + +#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= + - Public ReadOnly Property TotalVirtualMemory() As UInt64 + Public ReadOnly Property AvailablePhysicalMemory() As UInt64 Get - Return _instanceBeingWatched.TotalVirtualMemory + Return _instanceBeingWatched.AvailablePhysicalMemory End Get End Property @@ -155,7 +238,6 @@ Namespace Microsoft.VisualBasic.Devices Return _instanceBeingWatched.AvailableVirtualMemory End Get End Property -#Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references Public ReadOnly Property InstalledUICulture() As Globalization.CultureInfo @@ -178,71 +260,21 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - - Private ReadOnly _instanceBeingWatched As ComputerInfo - End Class - - ''' - ''' Gets the whole memory information details. - ''' - ''' An InternalMemoryStatus class. - Private ReadOnly Property MemoryStatus() As InternalMemoryStatus - Get - If _internalMemoryStatus Is Nothing Then - _internalMemoryStatus = New InternalMemoryStatus - End If - Return _internalMemoryStatus - End Get - End Property - - Private _internalMemoryStatus As InternalMemoryStatus ' Cache our InternalMemoryStatus - - ''' - ''' Calls GlobalMemoryStatusEx and returns the correct value. - ''' - Private NotInheritable Class InternalMemoryStatus - Friend Sub New() - End Sub - -#Disable Warning IDE0049 ' Use language keywords instead of framework type names for type references, Justification:= - Friend ReadOnly Property TotalPhysicalMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullTotalPhys - End Get - End Property - - Friend ReadOnly Property AvailablePhysicalMemory() As UInt64 - Get - Refresh() - Return _memoryStatusEx.ullAvailPhys - End Get - End Property - - Friend ReadOnly Property TotalVirtualMemory() As UInt64 + + Public ReadOnly Property TotalPhysicalMemory() As UInt64 Get - Refresh() - Return _memoryStatusEx.ullTotalVirtual + Return _instanceBeingWatched.TotalPhysicalMemory End Get End Property - Friend ReadOnly Property AvailableVirtualMemory() As UInt64 + + Public ReadOnly Property TotalVirtualMemory() As UInt64 Get - Refresh() - Return _memoryStatusEx.ullAvailVirtual + Return _instanceBeingWatched.TotalVirtualMemory End Get End Property #Enable Warning IDE0049 ' Use language keywords instead of framework type names for type references - Private Sub Refresh() - _memoryStatusEx = New NativeMethods.MEMORYSTATUSEX - _memoryStatusEx.Init() - If (Not NativeMethods.GlobalMemoryStatusEx(_memoryStatusEx)) Then - Throw ExceptionUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) - End If - End Sub - - Private _memoryStatusEx As NativeMethods.MEMORYSTATUSEX End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb index eb1d8110b33..182d924841d 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb @@ -13,46 +13,27 @@ Namespace Microsoft.VisualBasic.Devices Public Class Keyboard ''' - ''' Sends keys to the active window as if typed as keyboard with wait = false. - ''' - ''' A string containing the keys to be sent (typed). - Public Sub SendKeys(keys As String) - SendKeys(keys, False) - End Sub - - ''' - ''' Sends keys to the active window as if typed at keyboard. This overloaded - ''' version uses the same conventions as the VB6 SendKeys. - ''' - ''' A string containing the keys to be sent (typed). - ''' Wait for messages to be processed before returning. - Public Sub SendKeys(keys As String, wait As Boolean) - If wait Then - System.Windows.Forms.SendKeys.SendWait(keys) - Else - System.Windows.Forms.SendKeys.Send(keys) - End If - End Sub - - ''' - ''' Gets the state (up or down) of the Shift key. + ''' Gets the state (up or down) of the Alt key. ''' ''' True if the key is down otherwise false. - Public ReadOnly Property ShiftKeyDown() As Boolean + Public ReadOnly Property AltKeyDown() As Boolean Get Dim keys As Keys = Control.ModifierKeys - Return CType(keys And Keys.Shift, Boolean) + Return CType(keys And Keys.Alt, Boolean) End Get End Property ''' - ''' Gets the state (up or down) of the Alt key. + ''' Gets the toggle state of the Caps Lock key. ''' ''' True if the key is down otherwise false. - Public ReadOnly Property AltKeyDown() As Boolean + Public ReadOnly Property CapsLock() As Boolean Get - Dim keys As Keys = Control.ModifierKeys - Return CType(keys And Keys.Alt, Boolean) + 'Security Note: Only the state of the Caps Lock is returned + + 'The low order byte of the return value from + 'GetKeyState is 1 if the key is toggled on. + Return CType((UnsafeNativeMethods.GetKeyState(Keys.CapsLock) And 1), Boolean) End Get End Property @@ -67,20 +48,6 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - ''' - ''' Gets the toggle state of the Caps Lock key. - ''' - ''' True if the key is down otherwise false. - Public ReadOnly Property CapsLock() As Boolean - Get - 'Security Note: Only the state of the Caps Lock is returned - - 'The low order byte of the return value from GetKeyState is 1 if the key is - 'toggled on. - Return CType((UnsafeNativeMethods.GetKeyState(Keys.CapsLock) And 1), Boolean) - End Get - End Property - ''' ''' Gets the toggle state of the Num Lock key. ''' @@ -89,8 +56,8 @@ Namespace Microsoft.VisualBasic.Devices Get 'Security Note: Only the state of the Num Lock is returned - 'The low order byte of the return value from GetKeyState is 1 if the key is - 'toggled on. + 'The low order byte of the return value from + 'GetKeyState is 1 if the key is toggled on. Return CType((UnsafeNativeMethods.GetKeyState(Keys.NumLock) And 1), Boolean) End Get End Property @@ -103,11 +70,44 @@ Namespace Microsoft.VisualBasic.Devices Get 'Security Note: Only the state of the Scroll Lock is returned - 'The low order byte of the return value from GetKeyState is 1 if the key is - 'toggled on. + 'The low order byte of the return value from + 'GetKeyState is 1 if the key is toggled on. Return CType((UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1), Boolean) End Get End Property + ''' + ''' Gets the state (up or down) of the Shift key. + ''' + ''' True if the key is down otherwise false. + Public ReadOnly Property ShiftKeyDown() As Boolean + Get + Dim keys As Keys = Control.ModifierKeys + Return CType(keys And Keys.Shift, Boolean) + End Get + End Property + + ''' + ''' Sends keys to the active window as if typed as keyboard with wait = false. + ''' + ''' A string containing the keys to be sent (typed). + Public Sub SendKeys(keys As String) + SendKeys(keys, False) + End Sub + + ''' + ''' Sends keys to the active window as if typed at keyboard. This overloaded + ''' version uses the same conventions as the VB6 SendKeys. + ''' + ''' A string containing the keys to be sent (typed). + ''' Wait for messages to be processed before returning. + Public Sub SendKeys(keys As String, wait As Boolean) + If wait Then + System.Windows.Forms.SendKeys.SendWait(keys) + Else + System.Windows.Forms.SendKeys.Send(keys) + End If + End Sub + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb index 6a806f24b60..78cf0797a2b 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/ServerComputer.vb @@ -18,6 +18,21 @@ Namespace Microsoft.VisualBasic.Devices 'But that is completely consistent with the rest of the FX design. It is MY.* that is thread safe and leads to best practice access to these objects. 'If you dim them up yourself, you are responsible for managing the threading. + 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class + Private Shared s_clock As Clock + + 'Lazy initialized cache for ComputerInfo + Private _computerInfo As ComputerInfo + + 'Lazy initialized cache for the FileSystem. + Private _fileIO As FileSystemProxy + + 'Lazy initialized cache for the Network class. + Private _network As Network + + 'Lazy initialized cache for the Registry class + Private _registryInstance As RegistryProxy + ''' ''' Returns the Clock object which contains the LocalTime and GMTTime. ''' @@ -33,7 +48,9 @@ Namespace Microsoft.VisualBasic.Devices ''' Gets the object representing the file system of the computer. ''' ''' A System.IO.FileSystem object. - ''' The instance returned by this property is lazy initialized and cached. + ''' + ''' The instance returned by this property is lazy initialized and cached. + ''' Public ReadOnly Property FileSystem() As FileSystemProxy Get If _fileIO Is Nothing Then @@ -46,8 +63,10 @@ Namespace Microsoft.VisualBasic.Devices ''' ''' Gets the object representing information about the computer's state ''' - ''' A Microsoft.VisualBasic.MyServices.ComputerInfo object. - ''' The instance returned by this property is lazy initialized and cached. + ''' A object. + ''' + ''' The instance returned by this property is lazy initialized and cached. + ''' Public ReadOnly Property Info() As ComputerInfo Get If _computerInfo Is Nothing Then @@ -57,6 +76,17 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property + ''' + ''' This property wraps the property + ''' in the .NET framework to return the name of the computer. + ''' + ''' A string containing the name of the computer. + Public ReadOnly Property Name() As String + Get + Return Environment.MachineName + End Get + End Property + ''' ''' This property returns the Network object containing information about ''' the network the machine is part of. @@ -70,17 +100,6 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - ''' - ''' This property wraps the property - ''' in the .NET framework to return the name of the computer. - ''' - ''' A string containing the name of the computer. - Public ReadOnly Property Name() As String - Get - Return Environment.MachineName - End Get - End Property - ''' ''' Gets the Registry object, which can be used to read, set and ''' enumerate keys and values in the system registry. @@ -94,11 +113,5 @@ Namespace Microsoft.VisualBasic.Devices End Get End Property - Private _computerInfo As ComputerInfo 'Lazy initialized cache for ComputerInfo - Private _fileIO As FileSystemProxy 'Lazy initialized cache for the FileSystem. - Private _network As Network 'Lazy initialized cache for the Network class. - Private _registryInstance As RegistryProxy 'Lazy initialized cache for the Registry class - Private Shared s_clock As Clock 'Lazy initialized cache for the Clock class. SHARED because Clock behaves as a readonly singleton class - - End Class 'MyServerComputer + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb index c1c848a9580..eda2298da34 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/FileSystemUtils.vb @@ -13,46 +13,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Friend NotInheritable Class FileSystemUtils - ''' - ''' Normalize the path, but throw exception if the path ends with separator. - ''' - ''' The input path. - ''' The parameter name to include in the exception if one is raised. - ''' The normalized path. - Friend Shared Function NormalizeFilePath(path As String, - paramName As String) As String - CheckFilePathTrailingSeparator(path, paramName) - Return NormalizePath(path) - End Function - - ''' - ''' Get full path, get long format, and remove any pending separator. - ''' - ''' The path to be normalized. - ''' The normalized path. - ''' See IO.Path.GetFullPath for possible exceptions. - ''' Keep this function since we might change the implementation / behavior later. - Friend Shared Function NormalizePath(path As String) As String - Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) - End Function - - ''' - ''' Throw if the file path ends with a separator. - ''' - ''' The file path. - ''' The parameter name to include in . - Friend Shared Sub CheckFilePathTrailingSeparator(path As String, - paramName As String) - ' Check for argument null - If String.IsNullOrEmpty(path) Then - Throw ExUtils.GetArgumentNullException(paramName) - End If - If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or - path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then - Throw ExUtils.GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) - End If - End Sub - ''' ''' Returns the given path in long format (v.s 8.3 format) if the path exists. ''' @@ -151,5 +111,53 @@ Namespace Microsoft.VisualBasic.CompilerServices Return path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) End Function + ''' + ''' Throw if the file path ends with a separator. + ''' + ''' The file path. + ''' The parameter name to include in . + Friend Shared Sub CheckFilePathTrailingSeparator(path As String, + paramName As String) + ' Check for argument null + If String.IsNullOrEmpty(path) Then + Throw ExUtils.GetArgumentNullException(paramName) + End If + If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or + path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then + Throw ExUtils.GetArgumentExceptionWithArgName(paramName, SR.IO_FilePathException) + End If + End Sub + + ''' + ''' Normalize the path, but throw exception if the path ends with separator. + ''' + ''' The input path. + ''' The parameter name to include in the + ''' exception if one is raised. + ''' + ''' The normalized path. + Friend Shared Function NormalizeFilePath( + path As String, + paramName As String) As String + + CheckFilePathTrailingSeparator(path, paramName) + Return NormalizePath(path) + End Function + + ''' + ''' Get full path, get long format, and remove any pending separator. + ''' + ''' The path to be normalized. + ''' The normalized path. + ''' + ''' for possible exceptions. + ''' + ''' + ''' Keep this function since we might change the implementation / behavior later. + ''' + Friend Shared Function NormalizePath(path As String) As String + Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path))) + End Function + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb index d663cace0fe..e047c07acf9 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/IVbHost.vb @@ -2,9 +2,14 @@ ' The .NET Foundation licenses this file to you under the MIT license. Namespace Microsoft.VisualBasic.CompilerServices + Public Interface IVbHost + Function GetParentWindow() As System.Windows.Forms.IWin32Window + Function GetWindowTitle() As String + End Interface + End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb index 45985477409..fbbe10ebd85 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/VBInputBox.vb @@ -13,10 +13,10 @@ Namespace Microsoft.VisualBasic.CompilerServices #Disable Warning IDE1006 ' Naming Styles, Justification:= Private ReadOnly components As Container - Private TextBox As TextBox Private Label As Label - Private OKButton As Button Private MyCancelButton As Button + Private OKButton As Button + Private TextBox As TextBox #Enable Warning IDE1006 ' Naming Styles Public Output As String = String.Empty @@ -32,13 +32,6 @@ Namespace Microsoft.VisualBasic.CompilerServices InitializeInputBox(prompt, title, defaultResponse, xPos, yPos) End Sub - Protected Overloads Overrides Sub Dispose(disposing As Boolean) - If disposing Then - components?.Dispose() - End If - MyBase.Dispose(disposing) - End Sub - Private Sub InitializeComponent() Dim resources As New ComponentResourceManager(GetType(VBInputBox)) OKButton = New Button @@ -118,13 +111,20 @@ Namespace Microsoft.VisualBasic.CompilerServices End If End Sub + Private Sub MyCancelButton_Click(sender As Object, e As EventArgs) + Close() + End Sub + Private Sub OKButton_Click(sender As Object, e As EventArgs) Output = TextBox.Text Close() End Sub - Private Sub MyCancelButton_Click(sender As Object, e As EventArgs) - Close() + Protected Overloads Overrides Sub Dispose(disposing As Boolean) + If disposing Then + components?.Dispose() + End If + MyBase.Dispose(disposing) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index f3fc50eda46..4904d1f1750 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -16,79 +16,86 @@ Namespace Microsoft.VisualBasic ' Do not change this API without also updating that dependent module. Friend Module _Interaction - Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer - Dim startupInfo As New NativeTypes.STARTUPINFO - Dim processInfo As New NativeTypes.PROCESS_INFORMATION - Dim ok As Integer - Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() - Dim errorCode As Integer = 0 + Private Sub AppActivateHelper(hwndApp As IntPtr, processId As String) + ' if no window with name (full or truncated) or task id, return an error + ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible + Dim hwndOwned As IntPtr + If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then + ' scan to the next window until failure + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) + If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then + If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then + hwndApp = hwndOwned + hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) + Else + Exit Do + End If + End If + hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) + Loop - If (PathName Is Nothing) Then - Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, NameOf(PathName))) - End If + ' if scan failed, return an error + If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then + Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, processId)) + End If - If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, NameOf(Style))) + ' set active window to the owned one + hwndApp = hwndOwned End If - NativeMethods.GetStartupInfo(startupInfo) - Try - startupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. - startupInfo.wShowWindow = Style + ' SetActiveWindow on Win32 only activates the Window - it does + ' not bring to to the foreground unless the window belongs to + ' the current thread. NativeMethods.SetForegroundWindow() activates the + ' window, moves it to the foreground, and bumps the priority + ' of the thread which owns the window. - 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant - 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version - 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't - 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory - 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, startupInfo, processInfo) - If ok = 0 Then - errorCode = Marshal.GetLastWin32Error() - End If - If processInfo.hProcess <> IntPtr.Zero AndAlso processInfo.hProcess <> NativeTypes.s_invalidHandle Then - safeProcessHandle.InitialSetHandle(processInfo.hProcess) - End If - If processInfo.hThread <> IntPtr.Zero AndAlso processInfo.hThread <> NativeTypes.s_invalidHandle Then - safeThreadHandle.InitialSetHandle(processInfo.hThread) - End If + ' Attach ourselves to the window we want to set focus to + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) + ' Make it foreground and give it focus, this will occur + ' synchronously because we are attached. + NativeMethods.SetForegroundWindow(hwndApp) + NativeMethods.SetFocus(hwndApp) + ' Unattached ourselves from the window + NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) + End Sub - Try - If (ok <> 0) Then - If Wait Then - ' Is infinite wait okay here ? - ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights - ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + Private Function GetTitleFromAssembly(callingAssembly As Reflection.Assembly) As String - If ok = 0 Then 'succeeded - 'Process ran to completion - Shell = 0 - Else - 'Wait timed out - Shell = processInfo.dwProcessId - End If - Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Shell = processInfo.dwProcessId - End If - Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If errorCode = ERROR_ACCESS_DENIED Then - Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) - End If + Dim title As String - Throw ExUtils.VbMakeException(vbErrors.FileNotFound) - End If - Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. - safeThreadHandle.Close() - End Try - Finally - startupInfo.Dispose() + 'Get the Assembly name of the calling assembly + 'Assembly.GetName requires PathDiscovery permission so we try this first + 'and if it throws we catch the security exception and parse the name + 'from the full assembly name + Try + title = callingAssembly.GetName().Name + Catch ex As SecurityException + Dim fullName As String = callingAssembly.FullName + + 'Find the text up to the first comma. Note, this fails if the assembly has + 'a comma in its name + Dim firstCommaLocation As Integer = fullName.IndexOf(","c) + If firstCommaLocation >= 0 Then + title = fullName.Substring(0, firstCommaLocation) + Else + 'The name is not in the format we're expecting so return an empty string + title = String.Empty + End If End Try + + Return title + + End Function + + Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String + Dim box As New VBInputBox(prompt, title, defaultResponse, xPos, yPos) + box.ShowDialog(parentWindow) + + InternalInputBox = box.Output + box.Dispose() End Function Public Sub AppActivateByProcessId(ProcessId As Integer) @@ -191,52 +198,6 @@ Namespace Microsoft.VisualBasic End If End Sub - Private Sub AppActivateHelper(hwndApp As IntPtr, processId As String) - ' if no window with name (full or truncated) or task id, return an error - ' if the window is not enabled or not visible, get the first window owned by it that is not enabled or not visible - Dim hwndOwned As IntPtr - If (Not SafeNativeMethods.IsWindowEnabled(hwndApp) OrElse Not SafeNativeMethods.IsWindowVisible(hwndApp)) Then - ' scan to the next window until failure - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Do While IntPtr.op_Inequality(hwndOwned, IntPtr.Zero) - If IntPtr.op_Equality(NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_OWNER), hwndApp) Then - If (Not SafeNativeMethods.IsWindowEnabled(hwndOwned) OrElse Not SafeNativeMethods.IsWindowVisible(hwndOwned)) Then - hwndApp = hwndOwned - hwndOwned = NativeMethods.GetWindow(hwndApp, NativeTypes.GW_HWNDFIRST) - Else - Exit Do - End If - End If - hwndOwned = NativeMethods.GetWindow(hwndOwned, NativeTypes.GW_HWNDNEXT) - Loop - - ' if scan failed, return an error - If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(GetResourceString(SR.ProcessNotFound, processId)) - End If - - ' set active window to the owned one - hwndApp = hwndOwned - End If - - ' SetActiveWindow on Win32 only activates the Window - it does - ' not bring to to the foreground unless the window belongs to - ' the current thread. NativeMethods.SetForegroundWindow() activates the - ' window, moves it to the foreground, and bumps the priority - ' of the thread which owns the window. - - Dim dwDummy As Integer ' dummy arg for SafeNativeMethods.GetWindowThreadProcessId - - ' Attach ourselves to the window we want to set focus to - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 1) - ' Make it foreground and give it focus, this will occur - ' synchronously because we are attached. - NativeMethods.SetForegroundWindow(hwndApp) - NativeMethods.SetFocus(hwndApp) - ' Unattached ourselves from the window - NativeMethods.AttachThreadInput(0, SafeNativeMethods.GetWindowThreadProcessId(hwndApp, dwDummy), 0) - End Sub - Public Function InputBox(Prompt As String, Title As String, DefaultResponse As String, XPos As Integer, YPos As Integer) As String Dim vbHost As IVbHost Dim parentWindow As IWin32Window = Nothing @@ -273,42 +234,6 @@ Namespace Microsoft.VisualBasic End If End Function - Private Function GetTitleFromAssembly(callingAssembly As Reflection.Assembly) As String - - Dim title As String - - 'Get the Assembly name of the calling assembly - 'Assembly.GetName requires PathDiscovery permission so we try this first - 'and if it throws we catch the security exception and parse the name - 'from the full assembly name - Try - title = callingAssembly.GetName().Name - Catch ex As SecurityException - Dim fullName As String = callingAssembly.FullName - - 'Find the text up to the first comma. Note, this fails if the assembly has - 'a comma in its name - Dim firstCommaLocation As Integer = fullName.IndexOf(","c) - If firstCommaLocation >= 0 Then - title = fullName.Substring(0, firstCommaLocation) - Else - 'The name is not in the format we're expecting so return an empty string - title = String.Empty - End If - End Try - - Return title - - End Function - - Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String - Dim box As New VBInputBox(prompt, title, defaultResponse, xPos, yPos) - box.ShowDialog(parentWindow) - - InternalInputBox = box.Output - box.Dispose() - End Function - Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String @@ -372,5 +297,80 @@ Namespace Microsoft.VisualBasic MsgBoxResult) End Function + Public Function Shell(PathName As String, Style As AppWinStyle, Wait As Boolean, Timeout As Integer) As Integer + Dim startupInfo As New NativeTypes.STARTUPINFO + Dim processInfo As New NativeTypes.PROCESS_INFORMATION + Dim ok As Integer + Dim safeProcessHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim safeThreadHandle As New NativeTypes.LateInitSafeHandleZeroOrMinusOneIsInvalid() + Dim errorCode As Integer = 0 + + If (PathName Is Nothing) Then + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, NameOf(PathName))) + End If + + If (Style < 0 OrElse Style > 9) Then + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, NameOf(Style))) + End If + + NativeMethods.GetStartupInfo(startupInfo) + Try + startupInfo.dwFlags = NativeTypes.STARTF_USESHOWWINDOW ' we want to specify the initial window style (minimized, etc) so set this bit. + startupInfo.wShowWindow = Style + + 'We have to have unmanaged permissions to do this, so asking for path permissions would be redundant + 'Note: We are using the StartupInfo (defined in NativeTypes.StartupInfo) in CreateProcess() even though this version + 'of the StartupInfo type uses IntPtr instead of String because GetStartupInfo() above requires that version so we don't + 'free the string fields since the API manages it instead. But its OK here because we are just passing along the memory + 'that GetStartupInfo() allocated along to CreateProcess() which just reads the string fields. + + ok = NativeMethods.CreateProcess(Nothing, PathName, Nothing, Nothing, False, NativeTypes.NORMAL_PRIORITY_CLASS, Nothing, Nothing, startupInfo, processInfo) + If ok = 0 Then + errorCode = Marshal.GetLastWin32Error() + End If + If processInfo.hProcess <> IntPtr.Zero AndAlso processInfo.hProcess <> NativeTypes.s_invalidHandle Then + safeProcessHandle.InitialSetHandle(processInfo.hProcess) + End If + If processInfo.hThread <> IntPtr.Zero AndAlso processInfo.hThread <> NativeTypes.s_invalidHandle Then + safeThreadHandle.InitialSetHandle(processInfo.hThread) + End If + + Try + If (ok <> 0) Then + If Wait Then + ' Is infinite wait okay here ? + ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights + ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) + + If ok = 0 Then 'succeeded + 'Process ran to completion + Shell = 0 + Else + 'Wait timed out + Shell = processInfo.dwProcessId + End If + Else + NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) + Shell = processInfo.dwProcessId + End If + Else + 'Check for a win32 error access denied. If it is, make and throw the exception. + 'If not, throw FileNotFound + Const ERROR_ACCESS_DENIED As Integer = 5 + If errorCode = ERROR_ACCESS_DENIED Then + Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) + End If + + Throw ExUtils.VbMakeException(vbErrors.FileNotFound) + End If + Finally + safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. + safeThreadHandle.Close() + End Try + Finally + startupInfo.Dispose() + End Try + End Function + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 9863624b4f0..176ebe0b3a3 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -10,10 +10,22 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.Logging ''' - ''' Enables logging to configured TraceListeners + ''' Enables logging to configured TraceListeners. ''' Public Class Log + ' Taken from appConfig + Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" + + ' Names of TraceSources + Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" + + ' A table of default id values + Private Shared ReadOnly s_idHash As Dictionary(Of TraceEventType, Integer) = InitializeIDHash() + + ' The underlying TraceSource for the log + Private ReadOnly _traceSource As DefaultTraceSource + ''' ''' Creates a Log and the underlying TraceSource based on the platform. ''' @@ -39,6 +51,81 @@ Namespace Microsoft.VisualBasic.Logging End If End Sub + ''' + ''' Returns the file log trace listener we create for the Log. + ''' + ''' The file log trace listener. + Public ReadOnly Property DefaultFileLogWriter() As FileLogTraceListener + Get + Return CType(TraceSource.Listeners(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME), FileLogTraceListener) + End Get + End Property + + ''' + ''' Gives access to the log's underlying TraceSource. + ''' + ''' The log's underlying TraceSource. + + Public ReadOnly Property TraceSource() As TraceSource + Get + 'Note, this is a downcast from the DefaultTraceSource class we are using + Return _traceSource + End Get + End Property + + ''' + ''' Adds the default id values. + ''' + ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline. + Private Shared Function InitializeIDHash() As Dictionary(Of TraceEventType, Integer) + Dim result As New Dictionary(Of TraceEventType, Integer)(10) + + ' Populate table with the fx pre defined ids + With result + .Add(TraceEventType.Information, 0) + .Add(TraceEventType.Warning, 1) + .Add(TraceEventType.Error, 2) + .Add(TraceEventType.Critical, 3) + .Add(TraceEventType.Start, 4) + .Add(TraceEventType.Stop, 5) + .Add(TraceEventType.Suspend, 6) + .Add(TraceEventType.Resume, 7) + .Add(TraceEventType.Verbose, 8) + .Add(TraceEventType.Transfer, 9) + End With + + Return result + End Function + + ''' + ''' Converts a TraceEventType to an Id. + ''' + ''' + ''' The Id. + Private Shared Function TraceEventTypeToId(traceEventValue As TraceEventType) As Integer + Dim id As Integer = 0 + s_idHash.TryGetValue(traceEventValue, id) + Return id + End Function + + ''' + ''' Make sure we flush the log on exit. + ''' + Private Sub CloseOnProcessExit(sender As Object, e As EventArgs) + RemoveHandler AppDomain.CurrentDomain.ProcessExit, AddressOf CloseOnProcessExit + TraceSource.Close() + End Sub + + ''' + ''' When there is no config file to configure the trace source, this function is called in order to + ''' configure the trace source according to the defaults they would have had in a default AppConfig. + ''' + Protected Friend Overridable Sub InitializeWithDefaultsSinceNoConfigExists() + 'By default, you get a file log listener that picks everything from level Information on up. + _traceSource.Listeners.Add(New FileLogTraceListener(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME)) + _traceSource.Switch.Level = SourceLevels.Information + End Sub + ''' ''' Has the TraceSource fire a TraceEvent for all of its listeners. ''' @@ -79,8 +166,9 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information - ''' in an exception to form the message and appending additional info. + ''' Has the fire a TraceEvent for all listeners + ''' using information in an exception to form the message and appending + ''' additional info. ''' ''' The exception being logged. ''' The type of message (error, info, etc...). @@ -90,8 +178,8 @@ Namespace Microsoft.VisualBasic.Logging End Sub ''' - ''' Has the TraceSource fire a TraceEvent for all listeners using information in - ''' an exception to form the message and appending additional info. + ''' Has the TraceSource fire a TraceEvent for all listeners using + ''' information in an exception to form the message and appending additional info. ''' ''' The exception being logged. ''' The type of message (error, info, etc...). @@ -115,28 +203,6 @@ Namespace Microsoft.VisualBasic.Logging End Sub - ''' - ''' Gives access to the log's underlying TraceSource. - ''' - ''' The log's underlying TraceSource. - - Public ReadOnly Property TraceSource() As TraceSource - Get - 'Note, this is a downcast from the DefaultTraceSource class we are using - Return _traceSource - End Get - End Property - - ''' - ''' Returns the file log trace listener we create for the Log. - ''' - ''' The file log trace listener. - Public ReadOnly Property DefaultFileLogWriter() As FileLogTraceListener - Get - Return CType(TraceSource.Listeners(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME), FileLogTraceListener) - End Get - End Property - ''' ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that ''' it knows if it was initialized using a config file or not. @@ -144,6 +210,8 @@ Namespace Microsoft.VisualBasic.Logging Friend NotInheritable Class DefaultTraceSource Inherits TraceSource + Private _listenerAttributes As StringDictionary + ''' ''' TraceSource has other constructors, this is the only one we care about ''' for this internal class. @@ -169,73 +237,6 @@ Namespace Microsoft.VisualBasic.Logging End Get End Property - Private _listenerAttributes As StringDictionary - End Class - - ''' - ''' When there is no config file to configure the trace source, this function is called in order to - ''' configure the trace source according to the defaults they would have had in a default AppConfig. - ''' - Protected Friend Overridable Sub InitializeWithDefaultsSinceNoConfigExists() - 'By default, you get a file log listener that picks everything from level Information on up. - _traceSource.Listeners.Add(New FileLogTraceListener(DEFAULT_FILE_LOG_TRACE_LISTENER_NAME)) - _traceSource.Switch.Level = SourceLevels.Information - End Sub - - ''' - ''' Make sure we flush the log on exit. - ''' - Private Sub CloseOnProcessExit(sender As Object, e As EventArgs) - RemoveHandler AppDomain.CurrentDomain.ProcessExit, AddressOf CloseOnProcessExit - TraceSource.Close() - End Sub - - ''' - ''' Adds the default id values. - ''' - ''' Fix FxCop violation InitializeReferenceTypeStaticFieldsInline. - Private Shared Function InitializeIDHash() As Dictionary(Of TraceEventType, Integer) - Dim result As New Dictionary(Of TraceEventType, Integer)(10) - - ' Populate table with the fx pre defined ids - With result - .Add(TraceEventType.Information, 0) - .Add(TraceEventType.Warning, 1) - .Add(TraceEventType.Error, 2) - .Add(TraceEventType.Critical, 3) - .Add(TraceEventType.Start, 4) - .Add(TraceEventType.Stop, 5) - .Add(TraceEventType.Suspend, 6) - .Add(TraceEventType.Resume, 7) - .Add(TraceEventType.Verbose, 8) - .Add(TraceEventType.Transfer, 9) - End With - - Return result - End Function - - ''' - ''' Converts a TraceEventType to an Id. - ''' - ''' - ''' The Id. - Private Shared Function TraceEventTypeToId(traceEventValue As TraceEventType) As Integer - Dim id As Integer = 0 - s_idHash.TryGetValue(traceEventValue, id) - Return id - End Function - - ' The underlying TraceSource for the log - Private ReadOnly _traceSource As DefaultTraceSource - - ' A table of default id values - Private Shared ReadOnly s_idHash As Dictionary(Of TraceEventType, Integer) = InitializeIDHash() - - ' Names of TraceSources - Private Const WINAPP_SOURCE_NAME As String = "DefaultSource" - ' Taken from appConfig - Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb index 4e62ce9122e..75d5457501a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb @@ -23,20 +23,43 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets text from the clipboard. + ''' Removes everything from the clipboard. ''' - ''' The text as a String. - Public Function GetText() As String - Return Clipboard.GetText() + Public Sub Clear() + Clipboard.Clear() + End Sub + + ''' + ''' Indicates whether or not there's an audio stream saved to the clipboard. + ''' + ''' True if an audio stream is available, otherwise False. + Public Function ContainsAudio() As Boolean + Return Clipboard.ContainsAudio() End Function ''' - ''' Gets text from the clipboard saved in the passed in format. + ''' Indicates whether or not there is data on the clipboard in the passed in format. ''' - ''' The type of text to get. - ''' The text as a String. - Public Function GetText(format As TextDataFormat) As String - Return Clipboard.GetText(format) + ''' + ''' True if there's data in the passed in format, otherwise False. + Public Function ContainsData(format As String) As Boolean + Return Clipboard.ContainsData(format) + End Function + + ''' + ''' Indicates whether or not a file drop list has been saved to the clipboard. + ''' + ''' True if a file drop list is available, otherwise False. + Public Function ContainsFileDropList() As Boolean + Return Clipboard.ContainsFileDropList() + End Function + + ''' + ''' Indicate whether or not an image has been saved to the clipboard. + ''' + ''' True if an image is available, otherwise False. + Public Function ContainsImage() As Boolean + Return Clipboard.ContainsImage() End Function ''' @@ -58,60 +81,63 @@ Namespace Microsoft.VisualBasic.MyServices End Function ''' - ''' Saves the passed in String to the clipboard. + ''' Gets an audio stream from the clipboard. ''' - ''' The String to save. - Public Sub SetText(text As String) - Clipboard.SetText(text) - End Sub + ''' The audio stream as a Stream. + Public Function GetAudioStream() As Stream + Return Clipboard.GetAudioStream() + End Function ''' - ''' Saves the passed in String to the clipboard in the passed in format. + ''' Gets data from the clipboard that's been saved in the passed in format. ''' - ''' The String to save. - ''' The format in which to save the String. - Public Sub SetText(text As String, format As TextDataFormat) - Clipboard.SetText(text, format) - End Sub + ''' The type of data being sought. + ''' The data. + Public Function GetData(format As String) As Object + Return Clipboard.GetData(format) + End Function ''' - ''' Gets an Image from the clipboard. + ''' Gets a from the clipboard. ''' - ''' The image. - Public Function GetImage() As Image - Return Clipboard.GetImage() + ''' The data object. + ''' This gives the ability to save an object in multiple formats. + + Public Function GetDataObject() As IDataObject + Return Clipboard.GetDataObject() End Function ''' - ''' Indicate whether or not an image has been saved to the clipboard. + ''' Gets a file drop list from the clipboard. ''' - ''' True if an image is available, otherwise False. - Public Function ContainsImage() As Boolean - Return Clipboard.ContainsImage() + ''' The list of file paths as a . + Public Function GetFileDropList() As StringCollection + Return Clipboard.GetFileDropList() End Function ''' - ''' Saves the passed in image to the clipboard. + ''' Gets an Image from the clipboard. ''' - ''' The image to be saved. - Public Sub SetImage(image As Image) - Clipboard.SetImage(image) - End Sub + ''' The image. + Public Function GetImage() As Image + Return Clipboard.GetImage() + End Function ''' - ''' Gets an audio stream from the clipboard. + ''' Gets text from the clipboard. ''' - ''' The audio stream as a Stream. - Public Function GetAudioStream() As Stream - Return Clipboard.GetAudioStream() + ''' The text as a String. + Public Function GetText() As String + Return Clipboard.GetText() End Function ''' - ''' Indicates whether or not there's an audio stream saved to the clipboard. + ''' Gets text from the clipboard saved in the passed in format. ''' - ''' True if an audio stream is available, otherwise False. - Public Function ContainsAudio() As Boolean - Return Clipboard.ContainsAudio() + ''' The type of text to get. + ''' The text as a String. + Public Function GetText(format As TextDataFormat) As String + Return Clipboard.GetText(format) End Function ''' @@ -131,81 +157,55 @@ Namespace Microsoft.VisualBasic.MyServices End Sub ''' - ''' Gets a file drop list from the clipboard. + ''' Saves the passed in data to the clipboard in the passed in format. ''' - ''' The list of file paths as a StringCollection. - Public Function GetFileDropList() As StringCollection - Return Clipboard.GetFileDropList() - End Function + ''' The format in which to save the data. + ''' The data to be saved. + Public Sub SetData(format As String, data As Object) + Clipboard.SetData(format, data) + End Sub ''' - ''' Indicates whether or not a file drop list has been saved to the clipboard. + ''' Saves a to the clipboard. ''' - ''' True if a file drop list is available, otherwise False. - Public Function ContainsFileDropList() As Boolean - Return Clipboard.ContainsFileDropList() - End Function + ''' The data object to be saved. + ''' This gives the ability to save an object in multiple formats. + + Public Sub SetDataObject(data As DataObject) + Clipboard.SetDataObject(data) + End Sub ''' ''' Saves the passed in file drop list to the clipboard. ''' - ''' The file drop list as a StringCollection. + ''' The file drop list as a . Public Sub SetFileDropList(filePaths As StringCollection) Clipboard.SetFileDropList(filePaths) End Sub ''' - ''' Gets data from the clipboard that's been saved in the passed in format. - ''' - ''' The type of data being sought. - ''' The data. - Public Function GetData(format As String) As Object - Return Clipboard.GetData(format) - End Function - - ''' - ''' Indicates whether or not there is data on the clipboard in the passed in format. - ''' - ''' - ''' True if there's data in the passed in format, otherwise False. - Public Function ContainsData(format As String) As Boolean - Return Clipboard.ContainsData(format) - End Function - - ''' - ''' Saves the passed in data to the clipboard in the passed in format. + ''' Saves the passed in to the clipboard. ''' - ''' The format in which to save the data. - ''' The data to be saved. - Public Sub SetData(format As String, data As Object) - Clipboard.SetData(format, data) + ''' The to be saved. + Public Sub SetImage(image As Image) + Clipboard.SetImage(image) End Sub ''' - ''' Removes everything from the clipboard. + ''' Saves the passed in String to the clipboard. ''' - Public Sub Clear() - Clipboard.Clear() + ''' The String to save. + Public Sub SetText(text As String) + Clipboard.SetText(text) End Sub ''' - ''' Gets a from the clipboard. - ''' - ''' The data object. - ''' This gives the ability to save an object in multiple formats. - - Public Function GetDataObject() As IDataObject - Return Clipboard.GetDataObject() - End Function - - ''' - ''' Saves a to the clipboard. + ''' Saves the passed in String to the clipboard in the passed in format. ''' - ''' The data object to be saved. - ''' This gives the ability to save an object in multiple formats. - - Public Sub SetDataObject(data As DataObject) - Clipboard.SetDataObject(data) + ''' The String to save. + ''' The format in which to save the String. + Public Sub SetText(text As String, format As TextDataFormat) + Clipboard.SetText(text, format) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb index f755d24a944..064b5117e54 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb @@ -14,6 +14,23 @@ Namespace Microsoft.VisualBasic.MyServices Public Class FileSystemProxy + Private _specialDirectoriesProxy As SpecialDirectoriesProxy + + ''' + ''' Proxy class can only created by internal classes. + ''' + Friend Sub New() + End Sub + + Public Property CurrentDirectory() As String + Get + Return FileIO.FileSystem.CurrentDirectory + End Get + Set(value As String) + FileIO.FileSystem.CurrentDirectory = value + End Set + End Property + Public ReadOnly Property Drives() As ReadOnlyCollection(Of IO.DriveInfo) Get Return FileIO.FileSystem.Drives @@ -29,57 +46,36 @@ Namespace Microsoft.VisualBasic.MyServices End Get End Property - Public Property CurrentDirectory() As String - Get - Return FileIO.FileSystem.CurrentDirectory - End Get - Set(value As String) - FileIO.FileSystem.CurrentDirectory = value - End Set - End Property - - Public Function DirectoryExists(directory As String) As Boolean - Return FileIO.FileSystem.DirectoryExists(directory) + Public Function CombinePath(baseDirectory As String, relativePath As String) As String + Return FileIO.FileSystem.CombinePath(baseDirectory, relativePath) End Function - Public Function FileExists(file As String) As Boolean - Return FileIO.FileSystem.FileExists(file) - End Function + Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String) + FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName) + End Sub + + Public Sub CopyFile(sourceFileName As String, destinationFileName As String) + FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName) + End Sub Public Sub CreateDirectory(directory As String) FileIO.FileSystem.CreateDirectory(directory) End Sub - Public Function GetDirectoryInfo(directory As String) As IO.DirectoryInfo - Return FileIO.FileSystem.GetDirectoryInfo(directory) - End Function - - Public Function GetFileInfo(file As String) As IO.FileInfo - Return FileIO.FileSystem.GetFileInfo(file) - End Function - - Public Function GetDriveInfo(drive As String) As IO.DriveInfo - Return FileIO.FileSystem.GetDriveInfo(drive) - End Function - - Public Function GetFiles(directory As String) As ReadOnlyCollection(Of String) - Return FileIO.FileSystem.GetFiles(directory) - End Function - - Public Function GetFiles(directory As String, searchType As SearchOption, - ParamArray wildcards() As String) As ReadOnlyCollection(Of String) + Public Sub DeleteDirectory(directory As String, onDirectoryNotEmpty As DeleteDirectoryOption) + FileIO.FileSystem.DeleteDirectory(directory, onDirectoryNotEmpty) + End Sub - Return FileIO.FileSystem.GetFiles(directory, searchType, wildcards) - End Function + Public Sub DeleteFile(file As String) + FileIO.FileSystem.DeleteFile(file) + End Sub - Public Function GetDirectories(directory As String) As ReadOnlyCollection(Of String) - Return FileIO.FileSystem.GetDirectories(directory) + Public Function DirectoryExists(directory As String) As Boolean + Return FileIO.FileSystem.DirectoryExists(directory) End Function - Public Function GetDirectories(directory As String, searchType As SearchOption, - ParamArray wildcards() As String) As ReadOnlyCollection(Of String) - - Return FileIO.FileSystem.GetDirectories(directory, searchType, wildcards) + Public Function FileExists(file As String) As Boolean + Return FileIO.FileSystem.FileExists(file) End Function Public Function FindInFiles(directory As String, @@ -94,82 +90,80 @@ Namespace Microsoft.VisualBasic.MyServices Return FileIO.FileSystem.FindInFiles(directory, containsText, ignoreCase, searchType, fileWildcards) End Function - Public Function GetParentPath(path As String) As String - Return FileIO.FileSystem.GetParentPath(path) + Public Function GetDirectories(directory As String) As ReadOnlyCollection(Of String) + Return FileIO.FileSystem.GetDirectories(directory) End Function - Public Function CombinePath(baseDirectory As String, relativePath As String) As String - Return FileIO.FileSystem.CombinePath(baseDirectory, relativePath) + Public Function GetDirectoryInfo(directory As String) As IO.DirectoryInfo + Return FileIO.FileSystem.GetDirectoryInfo(directory) End Function - Public Function GetName(path As String) As String - Return FileIO.FileSystem.GetName(path) + Public Function GetDriveInfo(drive As String) As IO.DriveInfo + Return FileIO.FileSystem.GetDriveInfo(drive) End Function - Public Function GetTempFileName() As String - Return FileIO.FileSystem.GetTempFileName() + Public Function GetFileInfo(file As String) As IO.FileInfo + Return FileIO.FileSystem.GetFileInfo(file) End Function - Public Function ReadAllText(file As String) As String - Return FileIO.FileSystem.ReadAllText(file) + Public Function GetFiles(directory As String) As ReadOnlyCollection(Of String) + Return FileIO.FileSystem.GetFiles(directory) End Function - Public Function ReadAllText(file As String, encoding As Encoding) As String - Return FileIO.FileSystem.ReadAllText(file, encoding) + Public Function GetName(path As String) As String + Return FileIO.FileSystem.GetName(path) End Function - Public Function ReadAllBytes(file As String) As Byte() - Return FileIO.FileSystem.ReadAllBytes(file) + Public Function GetParentPath(path As String) As String + Return FileIO.FileSystem.GetParentPath(path) End Function - Public Sub WriteAllText(file As String, text As String, append As Boolean) - FileIO.FileSystem.WriteAllText(file, text, append) - End Sub - - Public Sub WriteAllText(file As String, text As String, append As Boolean, - encoding As Encoding) + Public Function GetTempFileName() As String + Return FileIO.FileSystem.GetTempFileName() + End Function - FileIO.FileSystem.WriteAllText(file, text, append, encoding) + Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String) + FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName) End Sub - Public Sub WriteAllBytes(file As String, data() As Byte, append As Boolean) - FileIO.FileSystem.WriteAllBytes(file, data, append) + Public Sub MoveFile(sourceFileName As String, destinationFileName As String) + FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName) End Sub - Public Sub CopyFile(sourceFileName As String, destinationFileName As String) - FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName) - End Sub + Public Function OpenTextFieldParser(file As String) As TextFieldParser + Return FileIO.FileSystem.OpenTextFieldParser(file) + End Function - Public Sub CopyFile(sourceFileName As String, destinationFileName As String, overwrite As Boolean) - FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, overwrite) - End Sub + Public Function OpenTextFileReader(file As String) As IO.StreamReader + Return FileIO.FileSystem.OpenTextFileReader(file) + End Function - Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) - End Sub + Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter + Return FileIO.FileSystem.OpenTextFileWriter(file, append) + End Function - Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) - End Sub + Public Function ReadAllBytes(file As String) As Byte() + Return FileIO.FileSystem.ReadAllBytes(file) + End Function - Public Sub MoveFile(sourceFileName As String, destinationFileName As String) - FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName) - End Sub + Public Function ReadAllText(file As String) As String + Return FileIO.FileSystem.ReadAllText(file) + End Function - Public Sub MoveFile(sourceFileName As String, destinationFileName As String, overwrite As Boolean) - FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, overwrite) + Public Sub RenameDirectory(directory As String, newName As String) + FileIO.FileSystem.RenameDirectory(directory, newName) End Sub - Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) - FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) + Public Sub RenameFile(file As String, newName As String) + FileIO.FileSystem.RenameFile(file, newName) End Sub - Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) - FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) + Public Sub WriteAllBytes(file As String, data() As Byte, append As Boolean) + FileIO.FileSystem.WriteAllBytes(file, data, append) End Sub - Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String) - FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName) + Public Sub WriteAllText(file As String, text As String, append As Boolean) + FileIO.FileSystem.WriteAllText(file, text, append) End Sub Public Sub CopyDirectory(sourceDirectoryName As String, destinationDirectoryName As String, overwrite As Boolean) @@ -184,24 +178,27 @@ Namespace Microsoft.VisualBasic.MyServices FileIO.FileSystem.CopyDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) End Sub - Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String) - FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName) + Public Sub CopyFile(sourceFileName As String, destinationFileName As String, overwrite As Boolean) + FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, overwrite) End Sub - Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, overwrite As Boolean) - FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, overwrite) + Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI) End Sub - Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) - FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + Public Sub CopyFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + FileIO.FileSystem.CopyFile(sourceFileName, destinationFileName, showUI, onUserCancel) End Sub - Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) - FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) + Public Sub DeleteDirectory(directory As String, showUI As UIOption, recycle As RecycleOption) + + FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle) End Sub - Public Sub DeleteFile(file As String) - FileIO.FileSystem.DeleteFile(file) + Public Sub DeleteDirectory(directory As String, + showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + + FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) End Sub Public Sub DeleteFile(file As String, showUI As UIOption, recycle As RecycleOption) @@ -214,32 +211,41 @@ Namespace Microsoft.VisualBasic.MyServices FileIO.FileSystem.DeleteFile(file, showUI, recycle, onUserCancel) End Sub - Public Sub DeleteDirectory(directory As String, onDirectoryNotEmpty As DeleteDirectoryOption) - FileIO.FileSystem.DeleteDirectory(directory, onDirectoryNotEmpty) - End Sub + Public Function GetDirectories(directory As String, searchType As SearchOption, + ParamArray wildcards() As String) As ReadOnlyCollection(Of String) - Public Sub DeleteDirectory(directory As String, showUI As UIOption, recycle As RecycleOption) + Return FileIO.FileSystem.GetDirectories(directory, searchType, wildcards) + End Function - FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle) + Public Function GetFiles(directory As String, searchType As SearchOption, + ParamArray wildcards() As String) As ReadOnlyCollection(Of String) + + Return FileIO.FileSystem.GetFiles(directory, searchType, wildcards) + End Function + + Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, overwrite As Boolean) + FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, overwrite) End Sub - Public Sub DeleteDirectory(directory As String, - showUI As UIOption, recycle As RecycleOption, onUserCancel As UICancelOption) + Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption) + FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI) + End Sub - FileIO.FileSystem.DeleteDirectory(directory, showUI, recycle, onUserCancel) + Public Sub MoveDirectory(sourceDirectoryName As String, destinationDirectoryName As String, showUI As UIOption, onUserCancel As UICancelOption) + FileIO.FileSystem.MoveDirectory(sourceDirectoryName, destinationDirectoryName, showUI, onUserCancel) End Sub - Public Sub RenameFile(file As String, newName As String) - FileIO.FileSystem.RenameFile(file, newName) + Public Sub MoveFile(sourceFileName As String, destinationFileName As String, overwrite As Boolean) + FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, overwrite) End Sub - Public Sub RenameDirectory(directory As String, newName As String) - FileIO.FileSystem.RenameDirectory(directory, newName) + Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption) + FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI) End Sub - Public Function OpenTextFieldParser(file As String) As TextFieldParser - Return FileIO.FileSystem.OpenTextFieldParser(file) - End Function + Public Sub MoveFile(sourceFileName As String, destinationFileName As String, showUI As UIOption, onUserCancel As UICancelOption) + FileIO.FileSystem.MoveFile(sourceFileName, destinationFileName, showUI, onUserCancel) + End Sub Public Function OpenTextFieldParser(file As String, ParamArray delimiters As String()) As TextFieldParser Return FileIO.FileSystem.OpenTextFieldParser(file, delimiters) @@ -249,30 +255,25 @@ Namespace Microsoft.VisualBasic.MyServices Return FileIO.FileSystem.OpenTextFieldParser(file, fieldWidths) End Function - Public Function OpenTextFileReader(file As String) As IO.StreamReader - Return FileIO.FileSystem.OpenTextFileReader(file) - End Function - Public Function OpenTextFileReader(file As String, encoding As Encoding) As IO.StreamReader Return FileIO.FileSystem.OpenTextFileReader(file, encoding) End Function - Public Function OpenTextFileWriter(file As String, append As Boolean) As IO.StreamWriter - Return FileIO.FileSystem.OpenTextFileWriter(file, append) - End Function - Public Function OpenTextFileWriter(file As String, append As Boolean, encoding As Encoding) As IO.StreamWriter Return FileIO.FileSystem.OpenTextFileWriter(file, append, encoding) End Function - ''' - ''' Proxy class can only created by internal classes. - ''' - Friend Sub New() + Public Function ReadAllText(file As String, encoding As Encoding) As String + Return FileIO.FileSystem.ReadAllText(file, encoding) + End Function + + Public Sub WriteAllText(file As String, text As String, append As Boolean, + encoding As Encoding) + + FileIO.FileSystem.WriteAllText(file, text, append, encoding) End Sub - Private _specialDirectoriesProxy As SpecialDirectoriesProxy End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb index 833f0475505..fcadcdd3286 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ContextValue.vb @@ -19,6 +19,11 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Public Class ContextValue(Of T) + Private Shared s_threadLocal As ThreadLocal(Of IDictionary) + + 'An item is stored in the dictionary by a GUID which this string maintains + Private ReadOnly _contextKey As String + Public Sub New() _contextKey = Guid.NewGuid.ToString End Sub @@ -26,10 +31,16 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' ''' Get the object from the correct thread-appropriate location. ''' - Public Property Value() As T 'No SyncLocks required because we are operating upon instance data and the object is not shared across threads + ''' + ''' No SyncLocks required because we are operating upon instance data + ''' and the object is not shared across threads + ''' + Public Property Value() As T Get Dim dictionary As IDictionary = GetDictionary() - Return DirectCast(dictionary(_contextKey), T) 'Note, IDictionary(key) can return Nothing and that's OK + + 'Note, IDictionary(key) can return Nothing and that's OK + Return DirectCast(dictionary(_contextKey), T) End Get Set(value As T) Dim dictionary As IDictionary = GetDictionary() @@ -44,9 +55,5 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Return s_threadLocal.Value End Function - Private ReadOnly _contextKey As String 'An item is stored in the dictionary by a GUID which this string maintains - - Private Shared s_threadLocal As ThreadLocal(Of IDictionary) - - End Class 'ContextValue + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index c21f4b4d595..a1446e64f3a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -14,10 +14,34 @@ Namespace Microsoft.VisualBasic.MyServices.Internal Friend NotInheritable Class ProgressDialog Inherits Form - ''' - ''' Event raised when user cancels the dialog or closes it before the operation is completed. - ''' - Public Event UserHitCancel() + Friend WithEvents ButtonCloseDialog As Button + + Friend WithEvents LabelInfo As Label + + Friend WithEvents ProgressBarWork As ProgressBar + + ' Border area for label (10 pixels on each side) + Private Const BORDER_SIZE As Integer = 20 + + ' Constant used to get re-sizable dialog with border style set to fixed dialog. + Private Const WS_THICKFRAME As Integer = &H40000 + + 'Required by the Windows Form Designer + Private ReadOnly _components As System.ComponentModel.IContainer + + ' Indicates whether or not the user has canceled the copy + Private _canceled As Boolean + + ' Indicates CloseDialog has been called + Private _closeDialogInvoked As Boolean + + ' Indicates whether or not the dialog is closing + Private _closing As Boolean + + ' Used to signal when the dialog is in a closable state. The dialog is in a closable + ' state when it has been activated or when it has been flagged to be closed before + ' ShowDialog has been called + Private _formClosableSemaphore As New ManualResetEvent(False) ''' ''' Constructor @@ -28,55 +52,19 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub ''' - ''' Increments the progress bar by the passed in amount. - ''' - ''' The amount to increment the bar. - ''' - ''' This method should never be called directly. It should be called with - ''' an InvokeBegin by a secondary thread. - ''' - Public Sub Increment(incrementAmount As Integer) - ProgressBarWork.Increment(incrementAmount) - End Sub - - ''' - ''' Closes the Progress Dialog. - ''' - ''' - ''' This method should never be called directly. It should be called with - ''' an InvokeBegin by a secondary thread. - ''' - Public Sub CloseDialog() - _closeDialogInvoked = True - Close() - End Sub - - ''' - ''' Displays the progress dialog modally + ''' Event raised when user cancels the dialog or closes it before the operation is completed. ''' - ''' This method should be called on the main thread after the worker thread has been started. - Public Sub ShowProgressDialog() - Try - If Not _closing Then - ShowDialog() - End If - Finally - FormClosableSemaphore.Set() - End Try - End Sub + Public Event UserHitCancel() ''' - ''' Sets the text of the label (usually something like Copying x to y). + ''' This enables a dialog with a close button, sizable borders, and no icon ''' - ''' The value to set the label to. - ''' This should only be called on the main thread before showing the dialog. - Public Property LabelText() As String + Protected Overrides ReadOnly Property CreateParams() As CreateParams Get - Return LabelInfo.Text + Dim cp As CreateParams = MyBase.CreateParams + cp.Style = cp.Style Or WS_THICKFRAME + Return cp End Get - Set(Value As String) - LabelInfo.Text = Value - End Set End Property ''' @@ -91,16 +79,18 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Property ''' - ''' Inform the dialog that CloseDialog will soon be called. + ''' Sets the text of the label (usually something like Copying x to y). ''' - ''' - ''' This method should be called directly from the secondary thread. We want - ''' to indicate we're closing as soon as we can so w don't show the dialog when we - ''' don't need to (when the work is finished before we can show the dialog). - ''' - Public Sub IndicateClosing() - _closing = True - End Sub + ''' The value to set the label to. + ''' This should only be called on the main thread before showing the dialog. + Public Property LabelText() As String + Get + Return LabelInfo.Text + End Get + Set(Value As String) + LabelInfo.Text = Value + End Set + End Property ''' ''' Indicated if the user has clicked the cancel button. @@ -116,17 +106,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Get End Property - ''' - ''' This enables a dialog with a close button, sizable borders, and no icon - ''' - Protected Overrides ReadOnly Property CreateParams() As CreateParams - Get - Dim cp As CreateParams = MyBase.CreateParams - cp.Style = cp.Style Or WS_THICKFRAME - Return cp - End Get - End Property - ''' ''' Handles user clicking Cancel. Sets a flag read by secondary thread. ''' @@ -138,6 +117,58 @@ Namespace Microsoft.VisualBasic.MyServices.Internal RaiseEvent UserHitCancel() End Sub + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) + LabelInfo = New Label + ProgressBarWork = New ProgressBar + ButtonCloseDialog = New Button + SuspendLayout() + ' + 'LabelInfo + ' + resources.ApplyResources(LabelInfo, "LabelInfo", CultureInfo.CurrentUICulture) + LabelInfo.MaximumSize = New Size(300, 0) + LabelInfo.Name = "LabelInfo" + ' + 'ProgressBarWork + ' + resources.ApplyResources(ProgressBarWork, "ProgressBarWork", CultureInfo.CurrentUICulture) + ProgressBarWork.Name = "ProgressBarWork" + ' + 'ButtonCloseDialog + ' + resources.ApplyResources(ButtonCloseDialog, "ButtonCloseDialog", CultureInfo.CurrentUICulture) + ButtonCloseDialog.Name = "ButtonCloseDialog" + ' + 'ProgressDialog + ' + resources.ApplyResources(Me, "$this", CultureInfo.CurrentUICulture) + Controls.Add(ButtonCloseDialog) + Controls.Add(ProgressBarWork) + Controls.Add(LabelInfo) + FormBorderStyle = FormBorderStyle.FixedDialog + MaximizeBox = False + MinimizeBox = False + Name = "ProgressDialog" + ShowInTaskbar = False + ResumeLayout(False) + PerformLayout() + + End Sub + + ''' + ''' Exits the monitor when we're activated. + ''' + ''' Dialog + ''' Arguments + Private Sub ProgressDialog_Activated(sender As Object, e As EventArgs) Handles Me.Shown + _formClosableSemaphore.Set() + End Sub + ''' ''' Indicates the form is closing ''' @@ -176,35 +207,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal LabelInfo.MaximumSize = New Size(ClientSize.Width - BORDER_SIZE, 0) End Sub - ''' - ''' Exits the monitor when we're activated. - ''' - ''' Dialog - ''' Arguments - Private Sub ProgressDialog_Activated(sender As Object, e As EventArgs) Handles Me.Shown - _formClosableSemaphore.Set() - End Sub - - ' Indicates whether or not the dialog is closing - Private _closing As Boolean - - ' Indicates whether or not the user has canceled the copy - Private _canceled As Boolean - - ' Used to signal when the dialog is in a closable state. The dialog is in a closable - ' state when it has been activated or when it has been flagged to be closed before - ' ShowDialog has been called - Private _formClosableSemaphore As New ManualResetEvent(False) - - ' Indicates CloseDialog has been called - Private _closeDialogInvoked As Boolean - - ' Constant used to get re-sizable dialog with border style set to fixed dialog. - Private Const WS_THICKFRAME As Integer = &H40000 - - ' Border area for label (10 pixels on each side) - Private Const BORDER_SIZE As Integer = 20 - 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(disposing As Boolean) If disposing Then @@ -217,54 +219,54 @@ Namespace Microsoft.VisualBasic.MyServices.Internal MyBase.Dispose(disposing) End Sub - Friend WithEvents LabelInfo As Label - Friend WithEvents ProgressBarWork As ProgressBar - Friend WithEvents ButtonCloseDialog As Button + ''' + ''' Closes the Progress Dialog. + ''' + ''' + ''' This method should never be called directly. It should be called with + ''' an InvokeBegin by a secondary thread. + ''' + Public Sub CloseDialog() + _closeDialogInvoked = True + Close() + End Sub - 'Required by the Windows Form Designer - Private ReadOnly _components As System.ComponentModel.IContainer + ''' + ''' Increments the progress bar by the passed in amount. + ''' + ''' The amount to increment the bar. + ''' + ''' This method should never be called directly. It should be called with + ''' an InvokeBegin by a secondary thread. + ''' + Public Sub Increment(incrementAmount As Integer) + ProgressBarWork.Increment(incrementAmount) + End Sub - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - - Private Sub InitializeComponent() - Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(ProgressDialog)) - LabelInfo = New Label - ProgressBarWork = New ProgressBar - ButtonCloseDialog = New Button - SuspendLayout() - ' - 'LabelInfo - ' - resources.ApplyResources(LabelInfo, "LabelInfo", CultureInfo.CurrentUICulture) - LabelInfo.MaximumSize = New Size(300, 0) - LabelInfo.Name = "LabelInfo" - ' - 'ProgressBarWork - ' - resources.ApplyResources(ProgressBarWork, "ProgressBarWork", CultureInfo.CurrentUICulture) - ProgressBarWork.Name = "ProgressBarWork" - ' - 'ButtonCloseDialog - ' - resources.ApplyResources(ButtonCloseDialog, "ButtonCloseDialog", CultureInfo.CurrentUICulture) - ButtonCloseDialog.Name = "ButtonCloseDialog" - ' - 'ProgressDialog - ' - resources.ApplyResources(Me, "$this", CultureInfo.CurrentUICulture) - Controls.Add(ButtonCloseDialog) - Controls.Add(ProgressBarWork) - Controls.Add(LabelInfo) - FormBorderStyle = FormBorderStyle.FixedDialog - MaximizeBox = False - MinimizeBox = False - Name = "ProgressDialog" - ShowInTaskbar = False - ResumeLayout(False) - PerformLayout() + ''' + ''' Inform the dialog that CloseDialog will soon be called. + ''' + ''' + ''' This method should be called directly from the secondary thread. We want + ''' to indicate we're closing as soon as we can so w don't show the dialog when we + ''' don't need to (when the work is finished before we can show the dialog). + ''' + Public Sub IndicateClosing() + _closing = True + End Sub + ''' + ''' Displays the progress dialog modally + ''' + ''' This method should be called on the main thread after the worker thread has been started. + Public Sub ShowProgressDialog() + Try + If Not _closing Then + ShowDialog() + End If + Finally + FormClosableSemaphore.Set() + End Try End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb index 505da1308a5..dd649e45ddc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/RegistryProxy.vb @@ -12,27 +12,33 @@ Namespace Microsoft.VisualBasic.MyServices Public Class RegistryProxy - Public ReadOnly Property CurrentUser() As RegistryKey + ''' + ''' Proxy class can only created by internal classes. + ''' + Friend Sub New() + End Sub + + Public ReadOnly Property ClassesRoot() As RegistryKey Get - Return Registry.CurrentUser + Return Registry.ClassesRoot End Get End Property - Public ReadOnly Property LocalMachine() As RegistryKey + Public ReadOnly Property CurrentConfig() As RegistryKey Get - Return Registry.LocalMachine + Return Registry.CurrentConfig End Get End Property - Public ReadOnly Property ClassesRoot() As RegistryKey + Public ReadOnly Property CurrentUser() As RegistryKey Get - Return Registry.ClassesRoot + Return Registry.CurrentUser End Get End Property - Public ReadOnly Property Users() As RegistryKey + Public ReadOnly Property LocalMachine() As RegistryKey Get - Return Registry.Users + Return Registry.LocalMachine End Get End Property @@ -42,9 +48,9 @@ Namespace Microsoft.VisualBasic.MyServices End Get End Property - Public ReadOnly Property CurrentConfig() As RegistryKey + Public ReadOnly Property Users() As RegistryKey Get - Return Registry.CurrentConfig + Return Registry.Users End Get End Property @@ -64,11 +70,5 @@ Namespace Microsoft.VisualBasic.MyServices Registry.SetValue(keyName, valueName, value, valueKind) End Sub - ''' - ''' Proxy class can only created by internal classes. - ''' - Friend Sub New() - End Sub - End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb index 4fad8e379de..781103586d4 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb @@ -12,21 +12,21 @@ Namespace Microsoft.VisualBasic.MyServices Public Class SpecialDirectoriesProxy - Public ReadOnly Property MyDocuments() As String - Get - Return SpecialDirectories.MyDocuments - End Get - End Property + ''' + ''' Proxy class can only created by internal classes. + ''' + Friend Sub New() + End Sub - Public ReadOnly Property MyMusic() As String + Public ReadOnly Property AllUsersApplicationData() As String Get - Return SpecialDirectories.MyMusic + Return SpecialDirectories.AllUsersApplicationData End Get End Property - Public ReadOnly Property MyPictures() As String + Public ReadOnly Property CurrentUserApplicationData() As String Get - Return SpecialDirectories.MyPictures + Return SpecialDirectories.CurrentUserApplicationData End Get End Property @@ -36,41 +36,41 @@ Namespace Microsoft.VisualBasic.MyServices End Get End Property - Public ReadOnly Property Programs() As String + Public ReadOnly Property MyDocuments() As String Get - Return SpecialDirectories.Programs + Return SpecialDirectories.MyDocuments End Get End Property - Public ReadOnly Property ProgramFiles() As String + Public ReadOnly Property MyMusic() As String Get - Return SpecialDirectories.ProgramFiles + Return SpecialDirectories.MyMusic End Get End Property - Public ReadOnly Property Temp() As String + Public ReadOnly Property MyPictures() As String Get - Return SpecialDirectories.Temp + Return SpecialDirectories.MyPictures End Get End Property - Public ReadOnly Property CurrentUserApplicationData() As String + Public ReadOnly Property ProgramFiles() As String Get - Return SpecialDirectories.CurrentUserApplicationData + Return SpecialDirectories.ProgramFiles End Get End Property - Public ReadOnly Property AllUsersApplicationData() As String + Public ReadOnly Property Programs() As String Get - Return SpecialDirectories.AllUsersApplicationData + Return SpecialDirectories.Programs End Get End Property - ''' - ''' Proxy class can only created by internal classes. - ''' - Friend Sub New() - End Sub + Public ReadOnly Property Temp() As String + Get + Return SpecialDirectories.Temp + End Get + End Property End Class End Namespace From 33d4a2b0ce3d9870bb39d6d7c38b3edd75b3eb49 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Jul 2024 17:26:51 -0700 Subject: [PATCH 272/342] More Syncing with Add-Tests-for-VB-Runtime-Review-2nd --- .../ApplicationServices/ApplicationBase.vb | 2 +- .../Logging/Log.DefaultTraceSource.vb | 48 ++++ .../src/Microsoft/VisualBasic/Logging/Log.vb | 38 +-- .../MyServices/Internal/ProgressDialog.vb | 3 - .../MyServices/Internal/WebClientCopy.vb | 6 +- .../tests/UnitTests/TextBoxBaseTests.cs | 234 ------------------ 6 files changed, 53 insertions(+), 278 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.DefaultTraceSource.vb diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb index 65615492c04..9a9a7142375 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb @@ -118,5 +118,5 @@ Namespace Microsoft.VisualBasic.ApplicationServices Return variableValue End Function - End Class 'ApplicationBase + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.DefaultTraceSource.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.DefaultTraceSource.vb new file mode 100644 index 00000000000..2e76df7639f --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.DefaultTraceSource.vb @@ -0,0 +1,48 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.Specialized + +Namespace Microsoft.VisualBasic.Logging + + Partial Public Class Log + + ''' + ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that + ''' it knows if it was initialized using a config file or not. + ''' + Friend NotInheritable Class DefaultTraceSource + Inherits TraceSource + + Private _listenerAttributes As StringDictionary + + ''' + ''' TraceSource has other constructors, this is the only one we care about + ''' for this internal class. + ''' + ''' + Public Sub New(name As String) + MyBase.New(name) + End Sub + + ''' + ''' Tells us whether this TraceSource found a config file to configure itself from. + ''' + ''' True - The TraceSource was configured from a config file. + Public ReadOnly Property HasBeenConfigured() As Boolean + Get + ' This forces initialization of the attributes list + If _listenerAttributes Is Nothing Then + _listenerAttributes = Attributes + End If + + ' TODO: This is a temporary fix, which will break configuring logging via + ' file for the time being. See: https://github.com/dotnet/winforms/pull/7590 + ' REVIEWERS: Is this still true and should it be fixed? + Return False + End Get + End Property + + End Class + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb index 176ebe0b3a3..66705ccf7d2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/Log.vb @@ -1,7 +1,6 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. -Imports System.Collections.Specialized Imports System.ComponentModel Imports System.Text @@ -12,7 +11,7 @@ Namespace Microsoft.VisualBasic.Logging ''' ''' Enables logging to configured TraceListeners. ''' - Public Class Log + Partial Public Class Log ' Taken from appConfig Private Const DEFAULT_FILE_LOG_TRACE_LISTENER_NAME As String = "FileLog" @@ -203,40 +202,5 @@ Namespace Microsoft.VisualBasic.Logging End Sub - ''' - ''' Encapsulates a System.Diagnostics.TraceSource. The value add is that - ''' it knows if it was initialized using a config file or not. - ''' - Friend NotInheritable Class DefaultTraceSource - Inherits TraceSource - - Private _listenerAttributes As StringDictionary - - ''' - ''' TraceSource has other constructors, this is the only one we care about - ''' for this internal class. - ''' - ''' - Public Sub New(name As String) - MyBase.New(name) - End Sub - - ''' - ''' Tells us whether this TraceSource found a config file to configure itself from. - ''' - ''' True - The TraceSource was configured from a config file. - Public ReadOnly Property HasBeenConfigured() As Boolean - Get - ' This forces initialization of the attributes list - If _listenerAttributes Is Nothing Then - _listenerAttributes = Attributes - End If - - ' TODO: This is a temporary fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590 - Return False - End Get - End Property - - End Class End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb index a1446e64f3a..95d7d0344a8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/ProgressDialog.vb @@ -43,9 +43,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' ShowDialog has been called Private _formClosableSemaphore As New ManualResetEvent(False) - ''' - ''' Constructor - ''' Friend Sub New() MyBase.New() InitializeComponent() diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 4ee2b6e27f8..3a0f52ea171 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -24,9 +24,6 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ' The percentage of the operation completed Private _percentage As Integer - ' Used for invoking ProgressDialog.Increment - Private Delegate Sub DoIncrement(Increment As Integer) - ''' ''' Creates an instance of a WebClientCopy, used to download or upload a file. ''' @@ -41,6 +38,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal End Sub + ' Used for invoking ProgressDialog.Increment + Private Delegate Sub DoIncrement(Increment As Integer) + ''' ''' Posts a message to close the progress dialog. ''' diff --git a/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs b/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs index a286fdc57c9..cc00f3d323d 100644 --- a/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/TextBoxBaseTests.cs @@ -4131,136 +4131,6 @@ public void TextBoxBase_ClearUndo_InvokeWithHandle_Success() Assert.Equal(0, createdCallCount); } - [ActiveIssue("https://github.com/dotnet/winforms/issues/11497")] - [WinFormsFact] - [SkipOnArchitecture(TestArchitectures.X86, - "Flaky tests, see: https://github.com/dotnet/winforms/issues/11497")] - public void TextBoxBase_ClearUndo_CanUndo_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - control.Copy(); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - - control.ClearUndo(); - control.Undo(); - Assert.Equal("bcxt", control.Text); - } - - [WinFormsFact] - public void TextBoxBase_Copy_PasteEmpty_Success() - { - using SubTextBox control = new(); - control.Copy(); - Assert.Empty(control.Text); - Assert.True(control.IsHandleCreated); - - control.Text = "text"; - control.SelectionLength = 2; - Assert.Equal("text", control.Text); - Assert.True(control.IsHandleCreated); - } - - [ActiveIssue("https://github.com/dotnet/winforms/issues/11558")] - [WinFormsFact] - [SkipOnArchitecture(TestArchitectures.X86, - "Flaky tests, see: https://github.com/dotnet/winforms/issues/11558")] - public void TextBoxBase_Copy_PasteNotEmpty_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - control.Copy(); - Assert.Equal("abc", control.Text); - Assert.True(control.IsHandleCreated); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - Assert.True(control.CanUndo); - Assert.True(control.Modified); - Assert.True(control.IsHandleCreated); - } - - [WinFormsFact] - public void TextBoxBase_Copy_PasteEmptyWithHandle_Success() - { - using SubTextBox control = new(); - Assert.NotEqual(IntPtr.Zero, control.Handle); - int invalidatedCallCount = 0; - control.Invalidated += (sender, e) => invalidatedCallCount++; - int styleChangedCallCount = 0; - control.StyleChanged += (sender, e) => styleChangedCallCount++; - int createdCallCount = 0; - control.HandleCreated += (sender, e) => createdCallCount++; - - control.Copy(); - Assert.Empty(control.Text); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - - control.Text = "text"; - control.SelectionLength = 2; - Assert.Equal("text", control.Text); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - } - - [ActiveIssue("https://github.com/dotnet/winforms/issues/11498")] - [WinFormsFact] - [SkipOnArchitecture(TestArchitectures.X86, - "Flaky tests, see: https://github.com/dotnet/winforms/issues/11498")] - public void TextBoxBase_Copy_PasteNotEmptyWithHandle_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - Assert.NotEqual(IntPtr.Zero, control.Handle); - int invalidatedCallCount = 0; - control.Invalidated += (sender, e) => invalidatedCallCount++; - int styleChangedCallCount = 0; - control.StyleChanged += (sender, e) => styleChangedCallCount++; - int createdCallCount = 0; - control.HandleCreated += (sender, e) => createdCallCount++; - - control.Copy(); - Assert.Equal("abc", control.Text); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - Assert.True(control.CanUndo); - Assert.True(control.Modified); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - } - [WinFormsFact] public void TextBoxBase_CreateHandle_Invoke_Success() { @@ -4309,28 +4179,6 @@ public void TextBoxBase_Cut_PasteEmpty_Success() Assert.True(control.IsHandleCreated); } - [WinFormsFact] - public void TextBoxBase_Cut_PasteNotEmpty_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - control.Cut(); - Assert.Equal("a", control.Text); - Assert.True(control.IsHandleCreated); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - Assert.True(control.CanUndo); - Assert.True(control.Modified); - Assert.True(control.IsHandleCreated); - } - [WinFormsFact] public void TextBoxBase_Cut_PasteEmptyWithHandle_Success() { @@ -4359,42 +4207,6 @@ public void TextBoxBase_Cut_PasteEmptyWithHandle_Success() Assert.Equal(0, createdCallCount); } - [WinFormsFact] - public void TextBoxBase_Cut_PasteNotEmptyWithHandle_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - Assert.NotEqual(IntPtr.Zero, control.Handle); - int invalidatedCallCount = 0; - control.Invalidated += (sender, e) => invalidatedCallCount++; - int styleChangedCallCount = 0; - control.StyleChanged += (sender, e) => styleChangedCallCount++; - int createdCallCount = 0; - control.HandleCreated += (sender, e) => createdCallCount++; - - control.Cut(); - Assert.Equal("a", control.Text); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - Assert.True(control.CanUndo); - Assert.True(control.Modified); - Assert.True(control.IsHandleCreated); - Assert.Equal(0, invalidatedCallCount); - Assert.Equal(0, styleChangedCallCount); - Assert.Equal(0, createdCallCount); - } - [WinFormsFact] public void TextBoxBase_DeselectAll_InvokeEmpty_Success() { @@ -5987,29 +5799,6 @@ public void TextBoxBase_OnTextChanged_Invoke_CallsTextChanged(EventArgs eventArg Assert.False(control.IsHandleCreated); } - [WinFormsFact] - public void TextBoxBase_Paste_InvokeEmpty_Success() - { - using SubTextBox control = new(); - control.Paste(); - Assert.NotNull(control.Text); - Assert.True(control.IsHandleCreated); - } - - [WinFormsFact] - public void TextBoxBase_Paste_InvokeNotEmpty_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - control.Paste(); - Assert.Equal("abc", control.Text); - Assert.True(control.IsHandleCreated); - } - public static IEnumerable ProcessCmdKey_TestData() { foreach (bool shortcutsEnabled in new bool[] { true, false }) @@ -7138,29 +6927,6 @@ public void TextBoxBase_Undo_InvokeNotEmptyWithHandle_Success() Assert.Equal(0, createdCallCount); } - [ActiveIssue("https://github.com/dotnet/winforms/issues/11559")] - [WinFormsFact] - [SkipOnArchitecture(TestArchitectures.X86, - "Flaky tests, see: https://github.com/dotnet/winforms/issues/11559")] - public void TextBoxBase_Undo_CanUndo_Success() - { - using SubTextBox control = new() - { - Text = "abc", - SelectionStart = 1, - SelectionLength = 2 - }; - control.Copy(); - - control.Text = "text"; - control.SelectionLength = 2; - control.Paste(); - Assert.Equal("bcxt", control.Text); - - control.Undo(); - Assert.Equal("text", control.Text); - } - public static IEnumerable WndProc_ContextMenuWithoutContextMenuStrip_TestData() { foreach (bool shortcutsEnabled in new bool[] { true, false }) From 00ef62695dfbb154f4fbb864a68f25eb0a6d816c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Jul 2024 17:45:48 -0700 Subject: [PATCH 273/342] More code foormatting cleanup --- .../VisualBasic/Devices/Network/NetworkDownload.vb | 12 ++++++------ .../MyServices/Internal/WebClientCopy.vb | 13 +++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb index 7c7a5fda4e4..1ba6b9a364c 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network/NetworkDownload.vb @@ -95,13 +95,13 @@ Namespace Microsoft.VisualBasic.Devices dialog = GetProgressDialog(address, destinationFileName, showUI) Dim t As Task = DownloadFileAsync( - address, - destinationFileName, - userName, - password, + address, + destinationFileName, + userName, + password, dialog, - connectionTimeout, - overwrite, + connectionTimeout, + overwrite, onUserCancel:=UICancelOption.ThrowException) If t.IsFaulted Then diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb index 3a0f52ea171..74cc32eab3a 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/Internal/WebClientCopy.vb @@ -88,7 +88,9 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' the actual file transfer cancel event comes through and do it there. ''' Private Sub m_ProgressDialog_UserCancelledEvent() Handles m_ProgressDialog.UserHitCancel - m_WebClient.CancelAsync() 'cancel the upload/download transfer. We'll close the ProgressDialog as soon as the WebClient cancels the xfer. + 'cancel the upload/download transfer. We'll close the ProgressDialog + 'as soon as the WebClient cancels the xfer. + m_WebClient.CancelAsync() End Sub ''' @@ -98,7 +100,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal ''' Private Sub m_WebClient_UploadFileCompleted(sender As Object, e As UploadFileCompletedEventArgs) Handles m_WebClient.UploadFileCompleted - ' If the upload was interrupted by an exception, keep track of the exception, which we'll throw from the main thread + ' If the upload was interrupted by an exception, keep track of the + ' exception, which we'll throw from the main thread Try If e.Error IsNot Nothing Then _exceptionEncounteredDuringFileTransfer = e.Error @@ -107,7 +110,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal InvokeIncrement(100) End If Finally - 'We don't close the dialog until we receive the WebClient.DownloadFileCompleted event + 'We don't close the dialog until we receive the + 'WebClient.DownloadFileCompleted event CloseProgressDialog() End Try End Sub @@ -140,7 +144,8 @@ Namespace Microsoft.VisualBasic.MyServices.Internal m_WebClient.UploadFile(address, sourceFileName) End If - 'Now that we are back on the main thread, throw the exception we encountered if the user didn't cancel. + 'Now that we are back on the main thread, throw the exception we + 'encountered if the user didn't cancel. If _exceptionEncounteredDuringFileTransfer IsNot Nothing Then If m_ProgressDialog Is Nothing OrElse Not m_ProgressDialog.UserCanceledTheDialog Then Throw _exceptionEncounteredDuringFileTransfer From 73cc00d8c92ba1f781455025191fae8eb951bd07 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Wed, 24 Jul 2024 17:49:58 -0700 Subject: [PATCH 274/342] Sort Clipboard tests --- .../MyServices/ClipboardProxyTests.cs | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 9977d6ec803..63af4b299f5 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -12,48 +12,47 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [CollectionDefinition("Sequential", DisableParallelization = true)] public class ClipboardProxyTests { + private static string GetUniqueText() => Guid.NewGuid().ToString("D"); + [WinFormsFact] - public void Clear() + public void Audio() { var clipboard = (new Computer()).Clipboard; - string text = GetUniqueText(); - clipboard.SetText(text); - Assert.True(System.Windows.Forms.Clipboard.ContainsText()); - clipboard.Clear(); - Assert.False(System.Windows.Forms.Clipboard.ContainsText()); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); + // Not tested: + // Public Function GetAudioStream() As Stream + // Public Sub SetAudio(audioBytes As Byte()) + // Public Sub SetAudio(audioStream As Stream) } [WinFormsFact] - public void Text() + public void Clear() { var clipboard = (new Computer()).Clipboard; string text = GetUniqueText(); - clipboard.SetText(text, TextDataFormat.UnicodeText); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); - Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.SetText(text); + Assert.True(System.Windows.Forms.Clipboard.ContainsText()); + clipboard.Clear(); + Assert.False(System.Windows.Forms.Clipboard.ContainsText()); } [WinFormsFact] - public void Image() + public void Data() { var clipboard = (new Computer()).Clipboard; - Bitmap image = new(2, 2); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsImage(), clipboard.ContainsImage()); - Assert.Equal(System.Windows.Forms.Clipboard.GetImage(), clipboard.GetImage()); - clipboard.SetImage(image); + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); + Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); + clipboard.SetData(DataFormats.UnicodeText, data); } [WinFormsFact] - public void Audio() + public void DataObject() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); - // Not tested: - // Public Function GetAudioStream() As Stream - // Public Sub SetAudio(audioBytes As Byte()) - // Public Sub SetAudio(audioStream As Stream) + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); + clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); } [WinFormsFact] @@ -67,23 +66,24 @@ public void FileDropList() } [WinFormsFact] - public void Data() + public void Image() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); - Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); - clipboard.SetData(DataFormats.UnicodeText, data); + Bitmap image = new(2, 2); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsImage(), clipboard.ContainsImage()); + Assert.Equal(System.Windows.Forms.Clipboard.GetImage(), clipboard.GetImage()); + clipboard.SetImage(image); } [WinFormsFact] - public void DataObject() + public void Text() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); - clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); + string text = GetUniqueText(); + clipboard.SetText(text, TextDataFormat.UnicodeText); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); + Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); + Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); + Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); } - - private static string GetUniqueText() => Guid.NewGuid().ToString("D"); } From 6e62e66f6a6481ceb0202b0c01c2ae4f6a9cee29 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:37:08 +0000 Subject: [PATCH 275/342] [main] Update dependencies from dotnet/arcade (#11755) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- global.json | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 42662468249..09a9bc08e08 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -187,29 +187,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f diff --git a/eng/Versions.props b/eng/Versions.props index 4552d42da3b..c4a7db006d6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24372.7 - 9.0.0-beta.24372.7 - 9.0.0-beta.24372.7 + 9.0.0-beta.24374.3 + 9.0.0-beta.24374.3 + 9.0.0-beta.24374.3 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index beef8bc793a..f796e97c283 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24372.7", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24372.7", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24372.7", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24374.3", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24374.3", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24374.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24373.8" }, From 95c930236735772220d806723fc48a06afae207b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:37:27 +0000 Subject: [PATCH 276/342] [main] Update dependencies from dotnet/runtime (#11756) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 09a9bc08e08..15c28835793 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a - + https://github.com/dotnet/runtime - 2c99cc5f2bf4dfa40920f9456836158bccdb9b1d + 4072e7377aa84559e725e450ddf1bf10d6fdf00a diff --git a/eng/Versions.props b/eng/Versions.props index c4a7db006d6..1c5a132393f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 5.0.0-preview.7.20320.5 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 6.0.0 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 - 9.0.0-preview.7.24373.8 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24374.13 diff --git a/global.json b/global.json index f796e97c283..cf6d875ace4 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24374.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24374.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-preview.7.24373.8" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24374.13" }, "native-tools": { "cmake": "latest" From 28b22a29c49c031d0adaafac82852ccd466f0ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20L=C3=B6ffelmann?= <9663150+KlausLoeffelmann@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:36:26 -0700 Subject: [PATCH 277/342] Add WinForms Analyzer and CodeFixes Infrastructure for C# and Visual Basic (#11515) * Refactor existing Analyzers in prep. to add VB Project. * Introduce first C# security analyzer and refactor projects accordingly. * Bump up Roslyn/Analyzer NuGet package versions. * Fix formatting in resource files and inconsistencies in unshipped files. * Setup remaining analyzer projects. * Finalize analyzer configuration. * Add VB CodeFixes project, correct namespaces. * Bump up XUnit NuGets to latest version (fixes unit tests). * Correct analyzer IDs and clean up resource files. * Patch build props to correctly include new Analyzer projects. * Include new Analyzers in build definition. * Change language folders in package content targets. * Add basic test infra for CSharp Analyzers and CodeFixes. * Add tests for ControlPropertySerialization analyzer. * Bump up XUnit Verifier version and fix breaking changes. * Update CSharp Verifier. * Streamline DiagnosticDescriptor factories. * Refactor identifier names, namespaces, analyzer tests. * Eliminate legacy verifiers. * Add Visual Basic Analyzer and Code Fix tests; fix up folder structure. * Fix VB CodeFix result file. * Fix merge issues. * Address review feedback. --- Directory.Build.props | 6 +- Winforms.sln | 76 ++++++++ .../Microsoft.Private.Winforms.csproj | 3 + ...tem.Windows.Forms.FileClassification.props | 5 +- .../src/AnalyzerReleases.Shipped.md | 2 +- .../src/AnalyzerReleases.Unshipped.md | 12 ++ .../src/DiagnosticDescriptors.cs | 48 ----- .../src/Resources/SR.resx | 85 +++++++- .../src/Resources/xlf/SR.cs.xlf | 42 ++-- .../src/Resources/xlf/SR.de.xlf | 42 ++-- .../src/Resources/xlf/SR.es.xlf | 42 ++-- .../src/Resources/xlf/SR.fr.xlf | 42 ++-- .../src/Resources/xlf/SR.it.xlf | 42 ++-- .../src/Resources/xlf/SR.ja.xlf | 42 ++-- .../src/Resources/xlf/SR.ko.xlf | 42 ++-- .../src/Resources/xlf/SR.pl.xlf | 42 ++-- .../src/Resources/xlf/SR.pt-BR.xlf | 42 ++-- .../src/Resources/xlf/SR.ru.xlf | 42 ++-- .../src/Resources/xlf/SR.tr.xlf | 42 ++-- .../src/Resources/xlf/SR.zh-Hans.xlf | 42 ++-- .../src/Resources/xlf/SR.zh-Hant.xlf | 42 ++-- ...stem.Windows.Forms.Analyzers.CSharp.csproj | 18 +- .../CSharpDiagnosticDescriptors.cs | 44 +++++ ...pertySerializationConfigurationAnalyzer.cs | 80 ++++++++ .../ApplicationConfigurationGenerator.cs | 85 ++++---- ...plicationConfigurationInitializeBuilder.cs | 2 +- .../ProjectFileReader.FontConverter.cs | 8 +- .../ProjectFileReader.cs | 57 +++--- ...indows.Forms.Analyzers.CSharp.Tests.csproj | 6 +- ...ertySerializationDiagnosticAnalyzerTest.cs | 183 ++++++++++++++++++ ...SharpIncrementalSourceGeneratorVerifier.cs | 4 +- .../Verifiers/CSharpSourceGeneratorTest`1.cs | 5 +- .../Verifiers/CSharpVerifierHelper.cs | 2 +- .../ApplicationConfigurationGeneratorTests.cs | 127 ++++++------ ...tionConfigurationInitializeBuilderTests.cs | 4 +- .../ProjectFileReaderTests.FontConverter.cs | 4 +- .../Generators/ProjectFileReaderTests.cs | 12 +- .../Verifiers/CSharpVerifierHelper.cs | 27 --- .../Properties/AssemblyInfo.cs | 6 + .../Resources/SR.resx | 123 ++++++++++++ .../Resources/xlf/SR.cs.xlf | 12 ++ .../Resources/xlf/SR.de.xlf | 12 ++ .../Resources/xlf/SR.es.xlf | 12 ++ .../Resources/xlf/SR.fr.xlf | 12 ++ .../Resources/xlf/SR.it.xlf | 12 ++ .../Resources/xlf/SR.ja.xlf | 12 ++ .../Resources/xlf/SR.ko.xlf | 12 ++ .../Resources/xlf/SR.pl.xlf | 12 ++ .../Resources/xlf/SR.pt-BR.xlf | 12 ++ .../Resources/xlf/SR.ru.xlf | 12 ++ .../Resources/xlf/SR.tr.xlf | 12 ++ .../Resources/xlf/SR.zh-Hans.xlf | 12 ++ .../Resources/xlf/SR.zh-Hant.xlf | 12 ++ ...ws.Forms.Analyzers.CodeFixes.CSharp.csproj | 32 +++ ...rSerializationVisibilityCodeFixProvider.cs | 131 +++++++++++++ .../Properties/AssemblyInfo.vb | 6 + .../Resources/SR.resx | 123 ++++++++++++ .../Resources/xlf/SR.cs.xlf | 12 ++ .../Resources/xlf/SR.de.xlf | 12 ++ .../Resources/xlf/SR.es.xlf | 12 ++ .../Resources/xlf/SR.fr.xlf | 12 ++ .../Resources/xlf/SR.it.xlf | 12 ++ .../Resources/xlf/SR.ja.xlf | 12 ++ .../Resources/xlf/SR.ko.xlf | 12 ++ .../Resources/xlf/SR.pl.xlf | 12 ++ .../Resources/xlf/SR.pt-BR.xlf | 12 ++ .../Resources/xlf/SR.ru.xlf | 12 ++ .../Resources/xlf/SR.tr.xlf | 12 ++ .../Resources/xlf/SR.zh-Hans.xlf | 12 ++ .../Resources/xlf/SR.zh-Hant.xlf | 12 ++ ...rms.Analyzers.CodeFixes.VisualBasic.vbproj | 32 +++ ...rSerializationVisibilityCodeFixProvider.vb | 141 ++++++++++++++ ...Windows.Forms.Analyzers.VisualBasic.vbproj | 34 ++++ .../src/AnalyzerReleases.Shipped.md | 2 + .../src/AnalyzerReleases.Unshipped.md | 7 + .../src/GlobalSuppressions.vb | 8 + .../src/Properties/AssemblyInfo.vb | 6 + .../src/Resources/SR.resx | 129 ++++++++++++ .../src/Resources/xlf/SR.cs.xlf | 22 +++ .../src/Resources/xlf/SR.de.xlf | 22 +++ .../src/Resources/xlf/SR.es.xlf | 22 +++ .../src/Resources/xlf/SR.fr.xlf | 22 +++ .../src/Resources/xlf/SR.it.xlf | 22 +++ .../src/Resources/xlf/SR.ja.xlf | 22 +++ .../src/Resources/xlf/SR.ko.xlf | 22 +++ .../src/Resources/xlf/SR.pl.xlf | 22 +++ .../src/Resources/xlf/SR.pt-BR.xlf | 22 +++ .../src/Resources/xlf/SR.ru.xlf | 22 +++ .../src/Resources/xlf/SR.tr.xlf | 22 +++ .../src/Resources/xlf/SR.zh-Hans.xlf | 22 +++ .../src/Resources/xlf/SR.zh-Hant.xlf | 22 +++ ...Windows.Forms.Analyzers.VisualBasic.vbproj | 34 ++++ ...lizationConfigurationDiagnosticAnalyzer.vb | 83 ++++++++ .../VisualBasicDiagnosticDescriptors.vb | 19 ++ ...s.Forms.Analyzers.VisualBasic.Tests.vbproj | 37 ++++ ...ySerializationConfigurationAnalyzerTest.vb | 172 ++++++++++++++++ .../src/AnalyzerReleases.Shipped.md | 2 +- .../src/AnalyzerReleases.Unshipped.md | 8 + .../src/DiagnosticDescriptors.cs | 33 ---- .../src/Properties/AssemblyInfo.cs | 5 + .../src/Resources/SR.resx | 67 ++++++- .../src/Resources/xlf/SR.cs.xlf | 12 +- .../src/Resources/xlf/SR.de.xlf | 12 +- .../src/Resources/xlf/SR.es.xlf | 12 +- .../src/Resources/xlf/SR.fr.xlf | 12 +- .../src/Resources/xlf/SR.it.xlf | 12 +- .../src/Resources/xlf/SR.ja.xlf | 12 +- .../src/Resources/xlf/SR.ko.xlf | 12 +- .../src/Resources/xlf/SR.pl.xlf | 12 +- .../src/Resources/xlf/SR.pt-BR.xlf | 12 +- .../src/Resources/xlf/SR.ru.xlf | 12 +- .../src/Resources/xlf/SR.tr.xlf | 12 +- .../src/Resources/xlf/SR.zh-Hans.xlf | 12 +- .../src/Resources/xlf/SR.zh-Hant.xlf | 12 +- .../src/System.Windows.Forms.Analyzers.csproj | 5 +- ...AnalyzerConfigOptionsProviderExtensions.cs | 4 +- .../{ => Analyzers}/AppManifestAnalyzer.cs | 41 ++-- .../ApplicationConfig.FontDescriptor.cs | 0 .../ApplicationConfig.FontStyle.cs | 4 + .../ApplicationConfig.GraphicsUnit.cs | 6 + .../Forms/Analyzers/ApplicationConfig.cs | 33 ++++ .../Diagnostics/DiagnosticCategories.cs | 11 ++ .../Analyzers/Diagnostics/DiagnosticIDs.cs | 22 +++ .../SharedDiagnosticDescriptors.cs | 26 +++ .../Windows/Forms/Analyzers/IsExternalInit.cs | 16 ++ .../System/Windows/Forms/ApplicationConfig.cs | 41 ---- .../UnitTests/Properties/AssemblyInfo.cs | 7 + ...ystem.Windows.Forms.Analyzers.Tests.csproj | 6 +- .../Analyzers/AppManifestAnalyzerTests.cs | 100 ++++++---- .../ApplicationConfigTests.FontDescriptor.cs | 26 ++- .../CSharpAnalyzerVerifier`1+Test.cs | 32 --- .../Verifiers/CSharpAnalyzerVerifier`1.cs | 38 ---- .../Verifiers/CSharpCodeFixVerifier`2+Test.cs | 34 ---- .../Verifiers/CSharpCodeFixVerifier`2.cs | 61 ------ .../CSharpCodeRefactoringVerifier`1+Test.cs | 32 --- .../CSharpCodeRefactoringVerifier`1.cs | 36 ---- .../VisualBasicAnalyzerVerifier`1+Test.cs | 21 -- .../VisualBasicAnalyzerVerifier`1.cs | 38 ---- .../VisualBasicCodeFixVerifier`2+Test.cs | 18 -- .../Verifiers/VisualBasicCodeFixVerifier`2.cs | 61 ------ ...sualBasicCodeRefactoringVerifier`1+Test.cs | 16 -- .../VisualBasicCodeRefactoringVerifier`1.cs | 36 ---- .../UserControlWithFontNameEditor.cs | 8 + .../UserControlWithObjectCollectionEditor.cs | 1 + 144 files changed, 3195 insertions(+), 1030 deletions(-) delete mode 100644 src/System.Windows.Forms.Analyzers.CSharp/src/DiagnosticDescriptors.cs create mode 100644 src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/Diagnostics/CSharpDiagnosticDescriptors.cs create mode 100644 src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzer.cs rename src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/{Generators => CSharp/Generators/ApplicationConfiguration}/ApplicationConfigurationGenerator.cs (50%) rename src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/{Generators => CSharp/Generators/ApplicationConfiguration}/ApplicationConfigurationInitializeBuilder.cs (97%) rename src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/{Generators => CSharp/Generators/ApplicationConfiguration}/ProjectFileReader.FontConverter.cs (96%) rename src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/{Generators => CSharp/Generators/ApplicationConfiguration}/ProjectFileReader.cs (66%) create mode 100644 src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{ => System/Windows/Forms/Analyzers}/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs (96%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{ => System/Windows/Forms/Analyzers}/Verifiers/CSharpSourceGeneratorTest`1.cs (73%) rename src/{System.Windows.Forms.Analyzers/tests/UnitTests => System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers}/Verifiers/CSharpVerifierHelper.cs (96%) delete mode 100644 src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Properties/AssemblyInfo.cs create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System.Windows.Forms.Analyzers.CodeFixes.CSharp.csproj create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System/Windows/Forms/CSharp/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.cs create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Properties/AssemblyInfo.vb create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/SR.resx create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic.vbproj create mode 100644 src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/System.Windows.Forms.Analyzers.VisualBasic.vbproj create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Shipped.md create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Unshipped.md create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/GlobalSuppressions.vb create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Properties/AssemblyInfo.vb create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/SR.resx create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj create mode 100644 src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb delete mode 100644 src/System.Windows.Forms.Analyzers/src/DiagnosticDescriptors.cs rename src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/{ => Analyzers}/AnalyzerConfigOptionsProviderExtensions.cs (85%) rename src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/{ => Analyzers}/AppManifestAnalyzer.cs (61%) rename src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/{ => Analyzers}/ApplicationConfig.FontDescriptor.cs (100%) rename src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/{ => Analyzers}/ApplicationConfig.FontStyle.cs (99%) rename src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/{ => Analyzers}/ApplicationConfig.GraphicsUnit.cs (99%) create mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.cs create mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticCategories.cs create mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs create mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/SharedDiagnosticDescriptors.cs create mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/IsExternalInit.cs delete mode 100644 src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.cs create mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Properties/AssemblyInfo.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1+Test.cs delete mode 100644 src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1.cs diff --git a/Directory.Build.props b/Directory.Build.props index 513ce0cde9a..a2e55343c14 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,7 +18,11 @@ false true diff --git a/Winforms.sln b/Winforms.sln index 0ac5ab2ac2f..9d6bcb221ed 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -177,6 +177,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimTestBinaryDeserializati EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryFormatTests", "src\System.Private.Windows.Core\tests\BinaryFormatTests\BinaryFormatTests.csproj", "{57EC5288-9513-46CF-8FB7-626199690D90}" EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "System.Windows.Forms.Analyzers.VisualBasic", "src\System.Windows.Forms.Analyzers.VisualBasic\src\System.Windows.Forms.Analyzers.VisualBasic.vbproj", "{FF211812-FCCC-4B6B-B536-C4D754195750}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Analyzers.CodeFixes.CSharp", "src\System.Windows.Forms.Analyzers.CodeFixes.CSharp\System.Windows.Forms.Analyzers.CodeFixes.CSharp.csproj", "{1F836B14-D13D-42E0-BEAF-A821DD75DE49}" +EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "System.Windows.Forms.Analyzers.CodeFixes.VisualBasic", "src\System.Windows.Forms.Analyzers.CodeFixes.VisualBasic\System.Windows.Forms.Analyzers.CodeFixes.VisualBasic.vbproj", "{C4C031D5-F79A-44B6-811E-0797E7D5C1C1}" +EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "System.Windows.Forms.Analyzers.VisualBasic.Tests", "src\System.Windows.Forms.Analyzers.VisualBasic\tests\UnitTests\System.Windows.Forms.Analyzers.VisualBasic.Tests\System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj", "{0FD53580-3175-4F8F-8372-BE46C9122EE0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -981,6 +989,70 @@ Global {57EC5288-9513-46CF-8FB7-626199690D90}.Release|x64.Build.0 = Release|Any CPU {57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.ActiveCfg = Release|Any CPU {57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.Build.0 = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|arm64.ActiveCfg = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|arm64.Build.0 = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|x64.ActiveCfg = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|x64.Build.0 = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|x86.ActiveCfg = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Debug|x86.Build.0 = Debug|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|Any CPU.Build.0 = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|arm64.ActiveCfg = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|arm64.Build.0 = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|x64.ActiveCfg = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|x64.Build.0 = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|x86.ActiveCfg = Release|Any CPU + {FF211812-FCCC-4B6B-B536-C4D754195750}.Release|x86.Build.0 = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|arm64.ActiveCfg = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|arm64.Build.0 = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|x64.Build.0 = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|x86.ActiveCfg = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Debug|x86.Build.0 = Debug|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|Any CPU.Build.0 = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|arm64.ActiveCfg = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|arm64.Build.0 = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|x64.ActiveCfg = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|x64.Build.0 = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|x86.ActiveCfg = Release|Any CPU + {1F836B14-D13D-42E0-BEAF-A821DD75DE49}.Release|x86.Build.0 = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|arm64.ActiveCfg = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|arm64.Build.0 = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|x64.ActiveCfg = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|x64.Build.0 = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|x86.ActiveCfg = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Debug|x86.Build.0 = Debug|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|Any CPU.Build.0 = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|arm64.ActiveCfg = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|arm64.Build.0 = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|x64.ActiveCfg = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|x64.Build.0 = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|x86.ActiveCfg = Release|Any CPU + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1}.Release|x86.Build.0 = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|arm64.ActiveCfg = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|arm64.Build.0 = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|x64.ActiveCfg = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|x64.Build.0 = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|x86.ActiveCfg = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Debug|x86.Build.0 = Debug|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|Any CPU.Build.0 = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|arm64.ActiveCfg = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|arm64.Build.0 = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|x64.ActiveCfg = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|x64.Build.0 = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|x86.ActiveCfg = Release|Any CPU + {0FD53580-3175-4F8F-8372-BE46C9122EE0}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1044,6 +1116,10 @@ Global {55F3174F-C1FE-4C8F-AF71-2512630088F8} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} {CFBCC732-C988-4FE7-A21B-98A142365374} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} {57EC5288-9513-46CF-8FB7-626199690D90} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} + {FF211812-FCCC-4B6B-B536-C4D754195750} = {E4C6C5F5-46E9-4C63-9628-26752B4D9C11} + {1F836B14-D13D-42E0-BEAF-A821DD75DE49} = {E4C6C5F5-46E9-4C63-9628-26752B4D9C11} + {C4C031D5-F79A-44B6-811E-0797E7D5C1C1} = {E4C6C5F5-46E9-4C63-9628-26752B4D9C11} + {0FD53580-3175-4F8F-8372-BE46C9122EE0} = {D3AD0BF9-F5E2-4913-9AE3-9C4998F95EA1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} diff --git a/pkg/Microsoft.Private.Winforms/Microsoft.Private.Winforms.csproj b/pkg/Microsoft.Private.Winforms/Microsoft.Private.Winforms.csproj index 2a753eb0bee..afbc33ac246 100644 --- a/pkg/Microsoft.Private.Winforms/Microsoft.Private.Winforms.csproj +++ b/pkg/Microsoft.Private.Winforms/Microsoft.Private.Winforms.csproj @@ -107,6 +107,9 @@ --> + + + diff --git a/pkg/Microsoft.Private.Winforms/sdk/dotnet-windowsdesktop/System.Windows.Forms.FileClassification.props b/pkg/Microsoft.Private.Winforms/sdk/dotnet-windowsdesktop/System.Windows.Forms.FileClassification.props index 44c1a321336..4bca48e101e 100644 --- a/pkg/Microsoft.Private.Winforms/sdk/dotnet-windowsdesktop/System.Windows.Forms.FileClassification.props +++ b/pkg/Microsoft.Private.Winforms/sdk/dotnet-windowsdesktop/System.Windows.Forms.FileClassification.props @@ -10,12 +10,15 @@ + + + + - diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Shipped.md b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Shipped.md index a53bdf80ee0..939253f8758 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Shipped.md +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Shipped.md @@ -1,7 +1,7 @@ ; Shipped analyzer releases ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md -## Release .NET 6.0 RC2 +## Release 6.0.0 ### New Rules diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md index 6640189c3f3..25f28635322 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md @@ -2,5 +2,17 @@ ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md ### New Rules + Rule ID | Category | Severity | Notes --------|----------|----------|------- +WFO0001 | Application Configuration | Error | CSharpDiagnosticDescriptors +WFO0002 | Application Configuration | Error | CSharpDiagnosticDescriptors +WFO1000 | WinForms Security | Error | CSharpDiagnosticDescriptors + +### Removed Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|-------------------- +WFAC001 | Application Configuration | Error | ApplicationConfigurationGenerator, [Documentation](https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md) +WFAC002 | Application Configuration | Error | ApplicationConfigurationGenerator, [Documentation](https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md) + diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/DiagnosticDescriptors.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/DiagnosticDescriptors.cs deleted file mode 100644 index d4754eff009..00000000000 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/DiagnosticDescriptors.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; - -namespace System.Windows.Forms.Analyzers; - -internal static class DiagnosticDescriptors -{ - private const string Category = "ApplicationConfiguration"; - - private static readonly LocalizableString s_localizableWFAC001Title - = new LocalizableResourceString(nameof(SR.WFAC001Title), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC001Message - = new LocalizableResourceString(nameof(SR.WFAC001Message), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC002Title - = new LocalizableResourceString(nameof(SR.WFAC002Title), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC002Message - = new LocalizableResourceString(nameof(SR.WFAC002Message), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC002MessageWithReason - = new LocalizableResourceString(nameof(SR.WFAC002MessageWithReason), SR.ResourceManager, typeof(SR)); - - public static readonly DiagnosticDescriptor s_errorUnsupportedProjectType - = new(id: "WFAC001", - title: s_localizableWFAC001Title, - messageFormat: s_localizableWFAC001Message, - category: Category, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true); - - public static readonly DiagnosticDescriptor s_propertyCantBeSetToValue - = new(id: "WFAC002", - title: s_localizableWFAC002Title, - messageFormat: s_localizableWFAC002Message, - category: Category, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true); - - public static readonly DiagnosticDescriptor s_propertyCantBeSetToValueWithReason - = new(id: "WFAC002", - title: s_localizableWFAC002Title, -#pragma warning disable RS1032 // Define diagnostic message correctly. Justification - exception messages end with a comma. - messageFormat: s_localizableWFAC002MessageWithReason, -#pragma warning restore RS1032 // Define diagnostic message correctly - category: Category, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true); -} diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/SR.resx index ab1ebe5e0da..db337ade04f 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/SR.resx +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/SR.resx @@ -1,5 +1,64 @@  + @@ -58,20 +117,20 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Unsupported project type - + Only projects with 'OutputType={0}' supported - + Unsupported property value - + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. Text "{0}" cannot be parsed. The expected text format is "{1}". @@ -85,4 +144,16 @@ Only TrueType fonts are supported. '{0}' is not a TrueType font. - + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + Missing code serialization configuration for property content + + + Property '{0}' does not configure the code serialization for its property content + + + Add DesignerSerializationVisibilityAttribute to property + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf index af6b542d46d..b7da4fa74d4 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Písmo {0} nebylo nalezeno. @@ -22,29 +27,44 @@ Analýza textu "{0}" se nezdařila. Byl očekáván text ve formátu {1}. - + Only projects with 'OutputType={0}' supported - Podporované jsou jen projekty, kde OutputType={0}. + Only projects with 'OutputType={0}' supported - + Unsupported project type - Nepodporovaný typ projektu + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Vlastnost projektu {0} nemůžete nastavit na {1}. + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: Vlastnost projektu {0} nemůžete nastavit na {1}. Důvod: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Nepodporovaná hodnota vlastnosti + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf index 0cfa8aa8e2c..2fc05fab64e 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Die Schriftart {0} kann nicht gefunden werden. @@ -22,29 +27,44 @@ Der Text {0} kann nicht analysiert werden. Textformat {1} erwartet. - + Only projects with 'OutputType={0}' supported - Nur Projekte mit "OutputType={0}" werden unterstützt. + Only projects with 'OutputType={0}' supported - + Unsupported project type - Nicht unterstützter Projekttyp + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Die Projekteigenschaft "{0}" kann nicht auf "{1}" festgelegt werden. + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: Die Projekteigenschaft "{0}" kann nicht auf "{1}" festgelegt werden. Grund: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Nicht unterstützter Eigenschaftswert + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf index 2a1fa1e3604..b35d9e057e6 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. No se puede encontrar la fuente '{0}'. @@ -22,29 +27,44 @@ No se pudo analizar el texto "{0}". Se esperaba el formato de texto "{1}". - + Only projects with 'OutputType={0}' supported - Solo se admiten proyectos con "OutputType={0}". + Only projects with 'OutputType={0}' supported - + Unsupported project type - Tipo de proyecto incompatible + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: la propiedad de proyecto '{0}' no se puede establecer en '{1}' + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: la propiedad de proyecto '{0}' no se puede establecer en '{1}'. Motivo: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Valor de propiedad no admitido + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf index 87dc6c91f7b..24dcdcf1ad0 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Impossible de trouver la police '{0}'. @@ -22,29 +27,44 @@ Impossible d'analyser le texte "{0}". Le format du texte attendu est "{1}". - + Only projects with 'OutputType={0}' supported - Seuls les projets avec «OutputType={0}» pris en charge + Only projects with 'OutputType={0}' supported - + Unsupported project type - Type de projet non pris en charge + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException : la propriété de projet «{0}» ne peut pas être définie sur «{1}» + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException : la propriété de projet «{0}» ne peut pas être définie sur «{1}». Raison : {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Valeur de propriété non prise en charge + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf index bf2c832aa7c..7d50d6648d8 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Impossibile trovare il tipo di carattere '{0}'. @@ -22,29 +27,44 @@ Impossibile analizzare Text "{0}". Testo previsto nel formato "{1}". - + Only projects with 'OutputType={0}' supported - Sono supportati solo i progetti con 'OutputType={0}' + Only projects with 'OutputType={0}' supported - + Unsupported project type - Tipo di progetto non supportato + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: la proprietà di progetto '{0}' non può essere impostata su '{1}' + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: la proprietà di progetto '{0}' non può essere impostata su '{1}'. Motivo: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Valore di proprietà non supportato + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf index 3401eb36eaa..8a882ad8d6c 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. フォント '{0}' が見つかりません。 @@ -22,29 +27,44 @@ テキスト "{0}" を解析できません。必要なテキストの形式は "{1}" です。 - + Only projects with 'OutputType={0}' supported - 'OutputType ={0}' のプロジェクトのみがサポートされています + Only projects with 'OutputType={0}' supported - + Unsupported project type - サポートされていないプロジェクトの種類 + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: プロジェクト プロパティ '{0}' を '{1}' に設定することはできません + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: プロジェクト プロパティ '{0}' を '{1}' に設定することはできません。理由: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - サポートされていないプロパティの値 + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf index 84db4db0686..a5565e3958d 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. '{0}' 글꼴을 찾을 수 없습니다. @@ -22,29 +27,44 @@ 텍스트 "{0}"을(를) 구문 분석할 수 없습니다. 필요한 텍스트 형식은 "{1}"입니다. - + Only projects with 'OutputType={0}' supported - 'OutputType={0}'인 프로젝트만 지원됨 + Only projects with 'OutputType={0}' supported - + Unsupported project type - 지원되지 않는 프로젝트 유형 + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: 프로젝트 속성 '{0}'을(를) '{1}'(으)로 설정할 수 없음 + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: 프로젝트 속성 '{0}'을(를) '{1}'(으)로 설정할 수 없습니다. 이유: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - 지원되지 않는 속성 값 + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf index c87c66a4637..6329a26a159 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Nie można odnaleźć czcionki „{0}”. @@ -22,29 +27,44 @@ Nie można dokonać analizy elementu Text „{0}”. Oczekiwano tekstu w formacie „{1}”. - + Only projects with 'OutputType={0}' supported - Obsługiwane są tylko projekty z parametrem „OutputType={0}” + Only projects with 'OutputType={0}' supported - + Unsupported project type - Nieobsługiwany typ projektu + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Właściwość projektu „{0}” nie może mieć wartości „{1}” + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: Właściwość projektu „{0}” nie może mieć wartości „{1}”. Przyczyna: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Nieobsługiwana wartość właściwości + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf index 7bbb40bb5bd..0e7c307b8b0 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. A fonte '{0}' não pode ser encontrada. @@ -22,29 +27,44 @@ O texto "{0}" não pode ser analisado. O formato de texto esperado é "{1}". - + Only projects with 'OutputType={0}' supported - Apenas projetos com 'OutputType={0}' suportados + Only projects with 'OutputType={0}' supported - + Unsupported project type - Tipo de projeto não suportado + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: A propriedade do projeto '{0}' não pode ser definida como '{1}' + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: A propriedade do projeto '{0}' não pode ser definida como '{1}'. Motivo: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Valor de propriedade não suportado + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf index 61ea40a78e4..c018b1f9397 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. Шрифт '{0}' не найден. @@ -22,29 +27,44 @@ Не удается разобрать текст "{0}". Ожидаемый формат текста: "{1}". - + Only projects with 'OutputType={0}' supported - Поддерживаются только проекты с "OutputType ={0}" + Only projects with 'OutputType={0}' supported - + Unsupported project type - Неподдерживаемый тип проекта + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: свойство проекта "{0}" не может иметь значение "{1}" + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: свойство проекта "{0}" не может иметь значение "{1}". Причина: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Не поддерживаемое значение свойства + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf index 7d9627c26e0..fa738d9bc45 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. '{0}' yazı tipi bulunamıyor. @@ -22,29 +27,44 @@ {0} metni ayrıştırılamıyor. Beklenen metin biçimi: "{1}". - + Only projects with 'OutputType={0}' supported - Yalnızca 'OutputType={0}' çıkış türüne sahip projeler destekleniyor + Only projects with 'OutputType={0}' supported - + Unsupported project type - Desteklenmeyen proje türü + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: '{0}' proje özelliği '{1}' olarak ayarlanamıyor + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: '{0}' proje özelliği '{1}' olarak ayarlanamıyor. Neden: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - Desteklenmeyen özellik değeri + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf index 388b6508ecd..012f5c98de4 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. 无法找到字体“{0}”。 @@ -22,29 +27,44 @@ 无法分析文本“{0}”。文本格式应为“{1}”。 - + Only projects with 'OutputType={0}' supported - 仅支持“OutputType={0}”的项目 + Only projects with 'OutputType={0}' supported - + Unsupported project type - 不支持的项目类型 + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: 无法将项目属性“{0}”设置为“{1}” + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: 无法将项目属性“{0}”设置为“{1}”。原因: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - 不支持的属性值 + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf index 5e2f1751dec..30f6ca73680 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf @@ -2,6 +2,11 @@ + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + Font '{0}' cannot be found. 找不到字型 '{0}'。 @@ -22,29 +27,44 @@ 文字 "{0}" 無法剖析。預期的文字格式是 "{1}"。 - + Only projects with 'OutputType={0}' supported - 只支援 'OutputType={0}' 的專案 + Only projects with 'OutputType={0}' supported - + Unsupported project type - 不支援的專案類型 + Unsupported project type - + ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: 專案屬性 '{0}' 不能設定為 '{1}' + ArgumentException: Project property '{0}' cannot be set to '{1}' - - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2} - ArgumentException: 專案屬性 '{0}' 不能設定為 '{1}'。理由: {2} + + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - + Unsupported property value - 不支援的屬性值 + Unsupported property value + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj b/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj index ebf9ca26f2d..f697a6c7b9c 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj @@ -5,33 +5,33 @@ netstandard2.0 Preview enable - $(NoWarn);RS2007 true - - - - - - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + true - System + System.Windows.Forms.Analyzers.CSharp.Resources diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/Diagnostics/CSharpDiagnosticDescriptors.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/Diagnostics/CSharpDiagnosticDescriptors.cs new file mode 100644 index 00000000000..be27d8e6a00 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/Diagnostics/CSharpDiagnosticDescriptors.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Windows.Forms.Analyzers.CSharp.Resources; +using System.Windows.Forms.Analyzers.Diagnostics; +using Microsoft.CodeAnalysis; + +namespace System.Windows.Forms.CSharp.Analyzers.Diagnostics; + +internal static class CSharpDiagnosticDescriptors +{ + public static readonly DiagnosticDescriptor s_errorUnsupportedProjectType = + new(id: DiagnosticIDs.UnsupportedProjectType, + title: new LocalizableResourceString(nameof(SR.WFO0001Title), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO0001Message), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.ApplicationConfiguration, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true); + + public static readonly DiagnosticDescriptor s_propertyCantBeSetToValue = + new(id: DiagnosticIDs.PropertyCantBeSetToValue, + title: new LocalizableResourceString(nameof(SR.WFO0002Title), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO0002Message), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.ApplicationConfiguration, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true); + + public static readonly DiagnosticDescriptor s_propertyCantBeSetToValueWithReason = + new(id: DiagnosticIDs.PropertyCantBeSetToValue, + title: new LocalizableResourceString(nameof(SR.WFO0002Title), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO0002MessageWithReason), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.ApplicationConfiguration, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true); + + public static readonly DiagnosticDescriptor s_missingPropertySerializationConfiguration = + new(id: DiagnosticIDs.MissingPropertySerializationConfiguration, + title: new LocalizableResourceString(nameof(SR.WFO1000AnalyzerTitle), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO1000AnalyzerMessageFormat), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.WinFormsSecurity, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: new LocalizableResourceString(nameof(SR.WFO1000AnalyzerDescription), SR.ResourceManager, typeof(SR))); +} diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzer.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzer.cs new file mode 100644 index 00000000000..52a79db8897 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzer.cs @@ -0,0 +1,80 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Immutable; +using System.ComponentModel; +using System.Windows.Forms.CSharp.Analyzers.Diagnostics; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace System.Windows.Forms.CSharp.Analyzers.MissingPropertySerializationConfiguration; + +[DiagnosticAnalyzer(LanguageNames.CSharp)] +public class MissingPropertySerializationConfigurationAnalyzer : DiagnosticAnalyzer +{ + public override ImmutableArray SupportedDiagnostics + => [CSharpDiagnosticDescriptors.s_missingPropertySerializationConfiguration]; + + public override void Initialize(AnalysisContext context) + { + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); + context.EnableConcurrentExecution(); + context.RegisterSymbolAction(AnalyzeSymbol, SymbolKind.Property); + } + + private static void AnalyzeSymbol(SymbolAnalysisContext context) + { + // We analyze only properties. + var propertySymbol = (IPropertySymbol)context.Symbol; + + // Does the property belong to a class which derives from Component? + if (propertySymbol.ContainingType is null + || !propertySymbol + .ContainingType + .AllInterfaces + .Any(i => i.Name == nameof(IComponent))) + { + return; + } + + // Is the property read/write and at least internal? + if (propertySymbol.SetMethod is null + || propertySymbol.DeclaredAccessibility < Accessibility.Internal) + { + return; + } + + // Is the property attributed with DesignerSerializationVisibility or DefaultValue? + if (propertySymbol.GetAttributes() + .Any(a => a?.AttributeClass?.Name is (nameof(DesignerSerializationVisibilityAttribute)) + or (nameof(DefaultValueAttribute)))) + { + return; + } + + // Now, it get's a bit more tedious: + // If the Serialization is managed via ShouldSerialize and Reset methods, we are also fine, + // so let's check for that. First, let's get the class of the property: + INamedTypeSymbol classSymbol = propertySymbol.ContainingType; + + // Now, let's check if the class has a method ShouldSerialize method: + IMethodSymbol? shouldSerializeMethod = classSymbol + .GetMembers() + .OfType() + .FirstOrDefault(m => m.Name == $"ShouldSerialize{propertySymbol.Name}"); + + // Let's make sure the method returns a bool and has no parameters: + if (shouldSerializeMethod is null + || shouldSerializeMethod.ReturnType.SpecialType != SpecialType.System_Boolean + || shouldSerializeMethod.Parameters.Length > 0) + { + // For ALL such other symbols, produce a diagnostic. + var diagnostic = Diagnostic.Create( + descriptor: CSharpDiagnosticDescriptors.s_missingPropertySerializationConfiguration, + location: propertySymbol.Locations[0], + messageArgs: propertySymbol.Name); + + context.ReportDiagnostic(diagnostic); + } + } +} diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationGenerator.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationGenerator.cs similarity index 50% rename from src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationGenerator.cs rename to src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationGenerator.cs index 42bcefedd46..33607a4b953 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationGenerator.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationGenerator.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Windows.Forms.Analyzers; +using System.Windows.Forms.CSharp.Analyzers.Diagnostics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace System.Windows.Forms.Generators; +namespace System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; [Generator(LanguageNames.CSharp)] internal class ApplicationConfigurationGenerator : IIncrementalGenerator @@ -39,11 +40,15 @@ private static void Execute( // https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/5.0/automatically-infer-winexe-output-type and not OutputKind.ConsoleApplication) { - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.s_errorUnsupportedProjectType, Location.None, nameof(OutputKind.WindowsApplication))); + context.ReportDiagnostic(Diagnostic.Create( + CSharpDiagnosticDescriptors.s_errorUnsupportedProjectType, + Location.None, nameof(OutputKind.WindowsApplication))); + return; } string? code = ApplicationConfigurationInitializeBuilder.GenerateInitialize(projectNamespace, applicationConfig); + if (code is not null) { context.AddSource("ApplicationConfiguration.g.cs", code); @@ -54,7 +59,9 @@ private static void Execute( { string? ns = null; - if (node.Ancestors().FirstOrDefault(a => a is NamespaceDeclarationSyntax) is NamespaceDeclarationSyntax namespaceSyntax) + if (node + .Ancestors() + .FirstOrDefault(a => a is NamespaceDeclarationSyntax) is NamespaceDeclarationSyntax namespaceSyntax) { ns = namespaceSyntax.Name.ToString(); } @@ -64,53 +71,59 @@ private static void Execute( public void Initialize(IncrementalGeneratorInitializationContext context) { - var outputKindProvider = context.CompilationProvider.Select((compilation, _) => compilation.Options.OutputKind); - var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + IncrementalValueProvider outputKindProvider = context.CompilationProvider.Select((compilation, _) + => compilation.Options.OutputKind); + + IncrementalValuesProvider syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( predicate: static (syntaxNode, _) => IsSupportedSyntaxNode(syntaxNode), transform: static (generatorSyntaxContext, _) => GetUserProjectNamespace(generatorSyntaxContext.Node)); - var globalConfig = ProjectFileReader.ReadApplicationConfig(context.AnalyzerConfigOptionsProvider); + IncrementalValueProvider<(ApplicationConfig? ApplicationConfig, Diagnostic? Diagnostic)> globalConfig + = ProjectFileReader.ReadApplicationConfig(context.AnalyzerConfigOptionsProvider); - var inputs = outputKindProvider + IncrementalValueProvider<(OutputKind OutputKind, Collections.Immutable.ImmutableArray ProjectNamespaces, ApplicationConfig? ApplicationConfig, Diagnostic? ApplicationConfigDiagnostics)> inputs + = outputKindProvider .Combine(syntaxProvider.Collect()) .Combine(globalConfig) .Select((data, cancellationToken) => (OutputKind: data.Left.Left, ProjectNamespaces: data.Left.Right, - ApplicationConfig: data.Right.ApplicationConfig, + data.Right.ApplicationConfig, ApplicationConfigDiagnostics: data.Right.Diagnostic)); context.RegisterSourceOutput( inputs, - (context, source) => Execute(context, source.ProjectNamespaces.Length > 0, source.ProjectNamespaces.Length > 0 ? source.ProjectNamespaces[0] : null, source.OutputKind, source.ApplicationConfig, source.ApplicationConfigDiagnostics)); + (context, source) + => Execute( + context: context, + hasSupportedSyntaxNode: source.ProjectNamespaces.Length > 0, + projectNamespace: source.ProjectNamespaces.Length > 0 + ? source.ProjectNamespaces[0] + : null, + outputKind: source.OutputKind, + applicationConfig: source.ApplicationConfig, + applicationConfigDiagnostics: source.ApplicationConfigDiagnostics)); } - public static bool IsSupportedSyntaxNode(SyntaxNode syntaxNode) - { -#pragma warning disable SA1513 // Closing brace should be followed by blank line - if (syntaxNode is InvocationExpressionSyntax - { - ArgumentList.Arguments.Count: 0, - Expression: MemberAccessExpressionSyntax - { - Name.Identifier.ValueText: "Initialize", - Expression: - MemberAccessExpressionSyntax // For: SourceGenerated.ApplicationConfiguration.Initialize() - { - Name.Identifier.ValueText: "ApplicationConfiguration" - } - or - IdentifierNameSyntax // For: ApplicationConfiguration.Initialize() with a using statement - { - Identifier.ValueText: "ApplicationConfiguration" - } - } - }) + public static bool IsSupportedSyntaxNode(SyntaxNode syntaxNode) => + syntaxNode is InvocationExpressionSyntax { - return true; - } -#pragma warning restore SA1513 // Closing brace should be followed by blank line - - return false; - } + ArgumentList.Arguments.Count: 0, + Expression: MemberAccessExpressionSyntax + { + Name.Identifier.ValueText: "Initialize", + Expression: + MemberAccessExpressionSyntax // For: SourceGenerated.ApplicationConfiguration.Initialize() + { + Name.Identifier.ValueText: "ApplicationConfiguration" + } + + or + + IdentifierNameSyntax // For: ApplicationConfiguration.Initialize() with a using statement + { + Identifier.ValueText: "ApplicationConfiguration" + } + } + }; } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilder.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationInitializeBuilder.cs similarity index 97% rename from src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilder.cs rename to src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationInitializeBuilder.cs index fdb9d7ae931..0e11caa168c 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilder.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ApplicationConfigurationInitializeBuilder.cs @@ -4,7 +4,7 @@ using System.Text; using System.Windows.Forms.Analyzers; -namespace System.Windows.Forms.Generators; +namespace System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; internal static class ApplicationConfigurationInitializeBuilder { diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.FontConverter.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.FontConverter.cs similarity index 96% rename from src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.FontConverter.cs rename to src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.FontConverter.cs index 66929f17079..67a8da49123 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.FontConverter.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.FontConverter.cs @@ -3,9 +3,10 @@ using System.ComponentModel; using System.Globalization; +using System.Windows.Forms.Analyzers.CSharp.Resources; using static System.Windows.Forms.Analyzers.ApplicationConfig; -namespace System.Windows.Forms.Generators; +namespace System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; internal static partial class ProjectFileReader { @@ -78,8 +79,8 @@ internal static class FontConverter { // Exception from converter is too generic. throw new ArgumentException(string.Format(SR.TextParseFailedFormat, - font, - $"name{separator} size[units[{separator} style=style1[{separator} style2{separator} ...]]]")); + font, + $"name{separator} size[units[{separator} style=style1[{separator} style2{separator} ...]]]")); } } @@ -157,6 +158,7 @@ private static (string?, string?) ParseSizeTokens(string text, char separator) if (splitPoint > 0) { size = text.Substring(0, splitPoint); + // Trimming spaces between size and units. size = size.Trim(trimChars); } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.cs b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.cs similarity index 66% rename from src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.cs rename to src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.cs index 6b74a36189b..8e60cdcbced 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/Generators/ProjectFileReader.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System/Windows/Forms/CSharp/Generators/ApplicationConfiguration/ProjectFileReader.cs @@ -2,32 +2,37 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Windows.Forms.Analyzers; +using System.Windows.Forms.CSharp.Analyzers.Diagnostics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using static System.Windows.Forms.Analyzers.ApplicationConfig; -namespace System.Windows.Forms.Generators; +namespace System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; internal static partial class ProjectFileReader { - public static IncrementalValueProvider<(ApplicationConfig? ApplicationConfig, Diagnostic? Diagnostic)> ReadApplicationConfig(IncrementalValueProvider configOptionsProvider) - => configOptionsProvider.Select( + public static IncrementalValueProvider<(ApplicationConfig? ApplicationConfig, Diagnostic? Diagnostic)> ReadApplicationConfig(IncrementalValueProvider configOptionsProvider) => + configOptionsProvider.Select( (analyzerConfigOptions, cancellationToken) => { - Diagnostic? diagnostic; if (!TryReadBool(analyzerConfigOptions, PropertyNameCSharp.EnableVisualStyles, - defaultValue: PropertyDefaultValue.EnableVisualStyles, - out bool enableVisualStyles, out diagnostic) || - !TryReadBool(analyzerConfigOptions, PropertyNameCSharp.UseCompatibleTextRendering, - defaultValue: PropertyDefaultValue.UseCompatibleTextRendering, - out bool useCompatibleTextRendering, out diagnostic) || - !TryReadFont(analyzerConfigOptions, out FontDescriptor? font, out diagnostic) || - !TryReadHighDpiMode(analyzerConfigOptions, out HighDpiMode highDpiMode, out diagnostic)) + defaultValue: PropertyDefaultValue.EnableVisualStyles, + out bool enableVisualStyles, out Diagnostic? diagnostic) + || !TryReadBool(analyzerConfigOptions, PropertyNameCSharp.UseCompatibleTextRendering, + defaultValue: PropertyDefaultValue.UseCompatibleTextRendering, + out bool useCompatibleTextRendering, out diagnostic) + || !TryReadFont(analyzerConfigOptions, out FontDescriptor? font, out diagnostic) + || !TryReadHighDpiMode(analyzerConfigOptions, out HighDpiMode highDpiMode, out diagnostic)) { return ((ApplicationConfig?)null, diagnostic); } - ApplicationConfig projectConfig = new(enableVisualStyles, font?.ToString(), highDpiMode, useCompatibleTextRendering); + ApplicationConfig projectConfig = new( + EnableVisualStyles: enableVisualStyles, + DefaultFont: font?.ToString(), + HighDpiMode: highDpiMode, + UseCompatibleTextRendering: useCompatibleTextRendering); + return (projectConfig, null); }); @@ -45,10 +50,11 @@ private static bool TryReadBool(AnalyzerConfigOptionsProvider configOptions, str if (!bool.TryParse(rawValue, out value)) { - diagnostic = Diagnostic.Create(DiagnosticDescriptors.s_propertyCantBeSetToValue, - Location.None, - propertyName, - rawValue); + diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue, + Location.None, + propertyName, + rawValue); + value = defaultValue; return false; } @@ -80,11 +86,11 @@ private static bool TryReadFont(AnalyzerConfigOptionsProvider configOptions, out } catch (Exception ex) { - diagnostic = Diagnostic.Create(DiagnosticDescriptors.s_propertyCantBeSetToValueWithReason, - Location.None, - PropertyNameCSharp.DefaultFont, - rawValue, - ex.Message); + diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValueWithReason, + Location.None, + PropertyNameCSharp.DefaultFont, + rawValue, + ex.Message); } return false; @@ -105,10 +111,11 @@ private static bool TryReadHighDpiMode(AnalyzerConfigOptionsProvider configOptio if (!Enum.TryParse(rawValue, true, out highDpiMode) || !Enum.IsDefined(typeof(HighDpiMode), highDpiMode)) { - diagnostic = Diagnostic.Create(DiagnosticDescriptors.s_propertyCantBeSetToValue, - Location.None, - PropertyNameCSharp.HighDpiMode, - rawValue); + diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue, + Location.None, + PropertyNameCSharp.HighDpiMode, + rawValue); + highDpiMode = PropertyDefaultValue.DpiMode; return false; } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj index 53b7a42f399..103ea05e9d6 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj @@ -1,4 +1,4 @@ - + enable @@ -9,6 +9,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -20,6 +21,9 @@ + + + diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs new file mode 100644 index 00000000000..e501bdda55f --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs @@ -0,0 +1,183 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Windows.Forms.CSharp.Analyzers.MissingPropertySerializationConfiguration; +using System.Windows.Forms.CSharp.CodeFixes.AddDesignerSerializationVisibility; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Testing; +using Microsoft.CodeAnalysis.Testing; + +namespace System.Windows.Forms.Analyzers.Test; + +public class ControlPropertySerializationDiagnosticAnalyzerTest +{ + private const string ProblematicCode = """ + using System.Drawing; + using System.Windows.Forms; + + namespace CSharpControls; + + public static class Program + { + public static void Main() + { + var control = new ScalableControl(); + + // We deliberately format this weirdly, to make sure we only format code our code fix touches. + control.ScaleFactor = 1.5f; + control.ScaledSize = new SizeF(100, 100); + control.ScaledLocation = new PointF(10, 10); + } + } + + // We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it, + // since this is nothing our code fix touches. + public class ScalableControl : System.Windows.Forms.Control + { + public float [|ScaleFactor|] { get; set; } = 1.0f; + + public SizeF [|ScaledSize|] { get; set; } + + public PointF [|ScaledLocation|] { get; set; } + } + + """; + + private const string CorrectCode = """ + using System.ComponentModel; + using System.Drawing; + using System.Windows.Forms; + + namespace CSharpControls; + + public static class Program + { + public static void Main() + { + var control = new ScalableControl(); + + control.ScaleFactor = 1.5f; + control.ScaledSize = new SizeF(100, 100); + control.ScaledLocation = new PointF(10, 10); + } + } + + public class ScalableControl : Control + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public float ScaleFactor { get; set; } = 1.0f; + + [DefaultValue(typeof(SizeF), "0,0")] + public SizeF ScaledSize { get; set; } + + public PointF ScaledLocation { get; set; } + private bool ShouldSerializeScaledLocation() => this.ScaledLocation != PointF.Empty; + } + + """; + + private const string FixedCode = """ + using System.ComponentModel; + using System.Drawing; + using System.Windows.Forms; + + namespace CSharpControls; + + public static class Program + { + public static void Main() + { + var control = new ScalableControl(); + + // We deliberately format this weirdly, to make sure we only format code our code fix touches. + control.ScaleFactor = 1.5f; + control.ScaledSize = new SizeF(100, 100); + control.ScaledLocation = new PointF(10, 10); + } + } + + // We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it, + // since this is nothing our code fix touches. + public class ScalableControl : System.Windows.Forms.Control + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public float ScaleFactor { get; set; } = 1.0f; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public SizeF ScaledSize { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public PointF ScaledLocation { get; set; } + } + + """; + + // We are testing the analyzer with all versions of the .NET SDK from 6.0 on. + public static IEnumerable GetReferenceAssemblies() + { + yield return [ReferenceAssemblies.Net.Net60Windows]; + yield return [ReferenceAssemblies.Net.Net70Windows]; + yield return [ReferenceAssemblies.Net.Net80Windows]; + yield return [ReferenceAssemblies.Net.Net90Windows]; + } + + [Theory] + [MemberData(nameof(GetReferenceAssemblies))] + public async Task CS_ControlPropertySerializationConfigurationAnalyzer(ReferenceAssemblies referenceAssemblies) + { + var context = new CSharpAnalyzerTest + + { + TestCode = CorrectCode, + TestState = + { + OutputKind = OutputKind.WindowsApplication, + }, + ReferenceAssemblies = referenceAssemblies + }; + + await context.RunAsync(); + } + + [Theory] + [MemberData(nameof(GetReferenceAssemblies))] + public async Task CS_MissingControlPropertySerializationConfigurationAnalyzer(ReferenceAssemblies referenceAssemblies) + { + var context = new CSharpAnalyzerTest + + { + TestCode = ProblematicCode, + TestState = + { + OutputKind = OutputKind.WindowsApplication, + }, + ReferenceAssemblies = referenceAssemblies + }; + + await context.RunAsync(); + } + + [Theory] + [MemberData(nameof(GetReferenceAssemblies))] + public async Task CS_AddDesignerSerializationVisibilityCodeFix(ReferenceAssemblies referenceAssemblies) + { + var context = new CSharpCodeFixTest + + { + TestCode = ProblematicCode, + FixedCode = FixedCode, + TestState = + { + OutputKind = OutputKind.WindowsApplication, + }, + ReferenceAssemblies = referenceAssemblies, + NumberOfFixAllIterations = 2 + }; + + await context.RunAsync(); + } +} diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs similarity index 96% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs index 530188736a5..1ee6dd1fa7b 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs @@ -5,7 +5,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Testing; -namespace System.Windows.Forms.Analyzers.Tests; +namespace System.Windows.Forms.Analyzers.Tests.Verifiers; // Note: this is bleeding edge, eventually this can be removed once it is all baked in to Roslyn SDK. public static partial class CSharpIncrementalSourceGeneratorVerifier @@ -18,8 +18,10 @@ public Test() SolutionTransforms.Add((solution, projectId) => { var compilationOptions = solution.GetProject(projectId)!.CompilationOptions; + compilationOptions = compilationOptions!.WithSpecificDiagnosticOptions( compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings)); + solution = solution.WithProjectCompilationOptions(projectId, compilationOptions); return solution; diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpSourceGeneratorTest`1.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs similarity index 73% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpSourceGeneratorTest`1.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs index 7d1fbe564b6..e7f403a6479 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpSourceGeneratorTest`1.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs @@ -6,9 +6,10 @@ using Microsoft.CodeAnalysis.Testing.Verifiers; using static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies; -namespace System.Windows.Forms.Analyzers.Tests; +namespace System.Windows.Forms.Analyzers.Tests.Verifiers; -public class CSharpSourceGeneratorTest : CSharpSourceGeneratorTest +public class CSharpSourceGeneratorTest + : CSharpSourceGeneratorTest where TSourceGenerator : ISourceGenerator, new() { public CSharpSourceGeneratorTest() diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpVerifierHelper.cs similarity index 96% rename from src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpVerifierHelper.cs index ed83b9308ea..8620970cdab 100644 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpVerifierHelper.cs @@ -5,7 +5,7 @@ using Microsoft.CodeAnalysis.CSharp; using System.Collections.Immutable; -namespace System.Windows.Forms.Analyzers.Tests; +namespace System.Windows.Forms.Analyzers.Tests.Verifiers; internal static class CSharpVerifierHelper { diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs index d9ba63add69..064935b03e2 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs @@ -2,39 +2,44 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Text; -using System.Windows.Forms.Analyzers; -using System.Windows.Forms.Analyzers.Tests; +using System.Windows.Forms.Analyzers.Diagnostics; +using System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using static System.Windows.Forms.Analyzers.ApplicationConfig; -namespace System.Windows.Forms.Generators.Tests; +namespace System.Windows.Forms.Analyzers.Tests; public partial class ApplicationConfigurationGeneratorTests { - private const string SourceCompilable = @" -namespace MyProject -{ - class Program - { - static void Main() + private const string SourceCompilable = """ + namespace MyProject { - ApplicationConfiguration.Initialize(); + class Program + { + static void Main() + { + ApplicationConfiguration.Initialize(); + } + } } - } -}"; - private const string SourceCompilationFailed = @" -namespace MyProject -{ - class Program - { - static void Main() + + """; + + private const string SourceCompilationFailed = """ + namespace MyProject { - {|CS0103:ApplicationConfiguration|}.Initialize(); + class Program + { + static void Main() + { + {|CS0103:ApplicationConfiguration|}.Initialize(); + } + } } - } -}"; + + """; public static TheoryData UnsupportedProjectTypes_TestData() { @@ -54,9 +59,9 @@ public static TheoryData UnsupportedProjectTypes_TestData() [Theory] [MemberData(nameof(UnsupportedProjectTypes_TestData))] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_fails_if_project_type_unsupported(OutputKind projectType) + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_fails_if_project_type_unsupported(OutputKind projectType) { - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -64,7 +69,7 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_fails_if_ Sources = { SourceCompilationFailed }, ExpectedDiagnostics = { - DiagnosticResult.CompilerError("WFAC001").WithArguments("WindowsApplication"), + DiagnosticResult.CompilerError(DiagnosticIDs.UnsupportedProjectType).WithArguments("WindowsApplication"), } }, }; @@ -75,11 +80,11 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_fails_if_ [Theory] [InlineData(OutputKind.ConsoleApplication)] [InlineData(OutputKind.WindowsApplication)] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_pass_if_supported_project_type(OutputKind projectType) + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_pass_if_supported_project_type(OutputKind projectType) { SourceText generatedCode = LoadFileContent("GenerateInitialize_default_boilerplate"); - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -96,11 +101,11 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_pass_if_s } [Fact] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_default_boilerplate() + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_default_boilerplate() { SourceText generatedCode = LoadFileContent("GenerateInitialize_default_boilerplate"); - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -117,11 +122,11 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_default_b } [Fact] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_settings_boilerplate() + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_user_settings_boilerplate() { SourceText generatedCode = LoadFileContent("GenerateInitialize_user_settings_boilerplate"); - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -129,13 +134,15 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_sett Sources = { SourceCompilable }, AnalyzerConfigFiles = { - ("/.globalconfig", $@"is_global = true - -build_property.{PropertyNameCSharp.DefaultFont} = Microsoft Sans Serif, 8.25px -build_property.{PropertyNameCSharp.EnableVisualStyles} = -build_property.{PropertyNameCSharp.HighDpiMode} = {HighDpiMode.DpiUnawareGdiScaled} -build_property.{PropertyNameCSharp.UseCompatibleTextRendering} = true -"), + ("/.globalconfig", + $""" + is_global = true + + build_property.{PropertyNameCSharp.DefaultFont} = Microsoft Sans Serif, 8.25px + build_property.{PropertyNameCSharp.EnableVisualStyles} = + build_property.{PropertyNameCSharp.HighDpiMode} = {HighDpiMode.DpiUnawareGdiScaled} + build_property.{PropertyNameCSharp.UseCompatibleTextRendering} = true + """), }, GeneratedSources = { @@ -148,15 +155,16 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_sett } [Fact] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_default_top_level() + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_default_top_level() { - const string source = @" -ApplicationConfiguration.Initialize(); -"; + const string source = + """ + ApplicationConfiguration.Initialize(); + """; SourceText generatedCode = LoadFileContent("GenerateInitialize_default_top_level"); - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -173,15 +181,16 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_default_t } [Fact] - public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_settings_top_level() + public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_user_settings_top_level() { - const string source = @" -ApplicationConfiguration.Initialize(); -"; + const string source = + """ + ApplicationConfiguration.Initialize(); + """; SourceText generatedCode = LoadFileContent("GenerateInitialize_user_top_level"); - var test = new CSharpIncrementalSourceGeneratorVerifier.Test + var test = new Verifiers.CSharpIncrementalSourceGeneratorVerifier.Test { TestState = { @@ -189,13 +198,15 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_sett Sources = { source }, AnalyzerConfigFiles = { - ("/.globalconfig", $@"is_global = true - -build_property.{PropertyNameCSharp.DefaultFont} = Microsoft Sans Serif, 8.25px -build_property.{PropertyNameCSharp.EnableVisualStyles} = -build_property.{PropertyNameCSharp.HighDpiMode} = {HighDpiMode.DpiUnawareGdiScaled} -build_property.{PropertyNameCSharp.UseCompatibleTextRendering} = true -"), + ("/.globalconfig", + $""" + is_global = true + + build_property.{PropertyNameCSharp.DefaultFont} = Microsoft Sans Serif, 8.25px + build_property.{PropertyNameCSharp.EnableVisualStyles} = + build_property.{PropertyNameCSharp.HighDpiMode} = {HighDpiMode.DpiUnawareGdiScaled} + build_property.{PropertyNameCSharp.UseCompatibleTextRendering} = true + """), }, GeneratedSources = { @@ -207,8 +218,8 @@ public async Task ApplicationConfigurationGenerator_GenerateInitialize_user_sett await test.RunAsync(); } - private SourceText LoadFileContent(string testName) - => SourceText.From( - File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{testName}.cs"), - Encoding.UTF8); + private SourceText LoadFileContent(string testName) => + SourceText.From( + File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{testName}.cs"), + Encoding.UTF8); } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs index 4b749add46c..ff3595863ee 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; -using System.Windows.Forms.Analyzers; +using System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; using static System.Windows.Forms.Analyzers.ApplicationConfig; -namespace System.Windows.Forms.Generators.Tests; +namespace System.Windows.Forms.Analyzers.Tests; public partial class ApplicationConfigurationInitializeBuilderTests { diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs index 86dff73254b..f506d5fa375 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs @@ -4,9 +4,9 @@ using System.ComponentModel; using System.Globalization; using static System.Windows.Forms.Analyzers.ApplicationConfig; -using static System.Windows.Forms.Generators.ProjectFileReader; +using static System.Windows.Forms.CSharp.Generators.ApplicationConfiguration.ProjectFileReader; -namespace System.Windows.Forms.Generators.Tests; +namespace System.Windows.Forms.Analyzers.Tests; public partial class ProjectFileReaderTests { diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs index e9007c09a55..2d56a0fef94 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs @@ -3,14 +3,14 @@ using System.Collections.Immutable; using System.Globalization; -using System.Windows.Forms.Analyzers; -using System.Windows.Forms.Analyzers.Tests; +using System.Windows.Forms.CSharp.Analyzers.Diagnostics; +using System.Windows.Forms.CSharp.Generators.ApplicationConfiguration; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using Xunit.Abstractions; using static System.Windows.Forms.Analyzers.ApplicationConfig; -namespace System.Windows.Forms.Generators.Tests; +namespace System.Windows.Forms.Analyzers.Tests; public partial class ProjectFileReaderTests { @@ -54,7 +54,7 @@ public void ProjectFileReader_TryReadBool_value_invalid(string value) Assert.False(result); Assert.False(returnedValue); Assert.NotNull(diagnostic); - Assert.Equal(DiagnosticDescriptors.s_propertyCantBeSetToValue, diagnostic!.Descriptor); + Assert.Equal(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue, diagnostic!.Descriptor); _output.WriteLine(diagnostic.ToString()); } @@ -118,7 +118,7 @@ public void ProjectFileReader_TryReadFont_value_invalid(string font) Assert.False(result); Assert.Null(returnedValue); Assert.NotNull(diagnostic); - Assert.Equal(DiagnosticDescriptors.s_propertyCantBeSetToValueWithReason, diagnostic!.Descriptor); + Assert.Equal(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValueWithReason, diagnostic!.Descriptor); _output.WriteLine(diagnostic.ToString()); } @@ -177,7 +177,7 @@ public void ProjectFileReader_TryReadHighDpiMode_value_invalid(string value) Assert.False(result); Assert.Equal(PropertyDefaultValue.DpiMode, returnedValue); Assert.NotNull(diagnostic); - Assert.Equal(DiagnosticDescriptors.s_propertyCantBeSetToValue, diagnostic!.Descriptor); + Assert.Equal(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue, diagnostic!.Descriptor); _output.WriteLine(diagnostic.ToString()); } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs deleted file mode 100644 index 979f076581a..00000000000 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Verifiers/CSharpVerifierHelper.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Immutable; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; - -namespace System.Windows.Forms.Analyzers.Tests; - -internal static class CSharpVerifierHelper -{ - /// - /// By default, the compiler reports diagnostics for nullable reference types at - /// , and the analyzer test framework defaults to only validating - /// diagnostics at . This map contains all compiler diagnostic IDs - /// related to nullability mapped to , which is then used to enable all - /// of these warnings for default validation during analyzer and code fix tests. - /// - internal static ImmutableDictionary NullableWarnings { get; } = GetNullableWarningsFromCompiler(); - - private static ImmutableDictionary GetNullableWarningsFromCompiler() - { - string[] args = ["/warnaserror:nullable"]; - var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory); - return commandLineArguments.CompilationOptions.SpecificDiagnosticOptions; - } -} diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Properties/AssemblyInfo.cs b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..18c78a00dd6 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx new file mode 100644 index 00000000000..cf5f0ae9db7 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add DesignerSerializationVisibilityAttribute to property + + diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf new file mode 100644 index 00000000000..a83842a2112 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf new file mode 100644 index 00000000000..49c8b221cfa --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf new file mode 100644 index 00000000000..7380b5cd7bc --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf new file mode 100644 index 00000000000..b7cf14b2a10 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf new file mode 100644 index 00000000000..c0af323b86a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf new file mode 100644 index 00000000000..338d0fd1fc7 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf new file mode 100644 index 00000000000..e1690c6d59d --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf new file mode 100644 index 00000000000..dad0b68d4ab --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf new file mode 100644 index 00000000000..6f3842c4160 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf new file mode 100644 index 00000000000..90ca9eedf16 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf new file mode 100644 index 00000000000..9dbbad8001d --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf new file mode 100644 index 00000000000..f599260bdec --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf new file mode 100644 index 00000000000..8cf4f2161cb --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System.Windows.Forms.Analyzers.CodeFixes.CSharp.csproj b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System.Windows.Forms.Analyzers.CodeFixes.CSharp.csproj new file mode 100644 index 00000000000..41c0d892c8e --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System.Windows.Forms.Analyzers.CodeFixes.CSharp.csproj @@ -0,0 +1,32 @@ + + + + System.Windows.Forms.Analyzers + netstandard2.0 + Preview + enable + $(NoWarn);CA1812 + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + true + System.Windows.Forms.Analyzers.CodeFixes.Resources + + + + diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System/Windows/Forms/CSharp/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.cs b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System/Windows/Forms/CSharp/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.cs new file mode 100644 index 00000000000..62efeee2cd1 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System/Windows/Forms/CSharp/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.cs @@ -0,0 +1,131 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Immutable; +using System.Composition; +using System.Windows.Forms.Analyzers.Diagnostics; +using System.Windows.Forms.Analyzers.CodeFixes.Resources; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CodeActions; +using Microsoft.CodeAnalysis.CodeFixes; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using System.Diagnostics; +using Microsoft.CodeAnalysis.Simplification; +using Microsoft.CodeAnalysis.Formatting; + +namespace System.Windows.Forms.CSharp.CodeFixes.AddDesignerSerializationVisibility; + +[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AddDesignerSerializationVisibilityCodeFixProvider)), Shared] +internal sealed class AddDesignerSerializationVisibilityCodeFixProvider : CodeFixProvider +{ + private const string SystemComponentModelName = "System.ComponentModel"; + private const string DesignerSerializationVisibilityAttributeName = "DesignerSerializationVisibility"; + + public sealed override ImmutableArray FixableDiagnosticIds + => [DiagnosticIDs.MissingPropertySerializationConfiguration]; + + public sealed override FixAllProvider GetFixAllProvider() + => WellKnownFixAllProviders.BatchFixer; + + public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) + { + // Cannot be null - otherwise we wouldn't have a diagnostic of that ID. + SyntaxNode root = (await context + .Document + .GetSyntaxRootAsync(context.CancellationToken) + .ConfigureAwait(false))!; + + Diagnostic diagnostic = context.Diagnostics.First(); + TextSpan diagnosticSpan = diagnostic.Location.SourceSpan; + + // Find the type declaration identified by the diagnostic. + PropertyDeclarationSyntax? propertyDeclaration = root.FindToken(diagnosticSpan.Start) + .Parent! + .AncestorsAndSelf() + .OfType() + .First(); + + // Register a code action that will invoke the fix. + context.RegisterCodeFix( + CodeAction.Create( + title: SR.AddDesignerSerializationVisibilityCodeFixTitle, + createChangedDocument: c => AddDesignerSerializationAttribute(context.Document, propertyDeclaration, c), + equivalenceKey: nameof(SR.AddDesignerSerializationVisibilityCodeFixTitle)), + diagnostic); + } + + private static async Task AddDesignerSerializationAttribute( + Document document, + PropertyDeclarationSyntax propertyDeclarationSyntax, + CancellationToken cancellationToken) + { + if (propertyDeclarationSyntax is null) + { + return document; + } + + // Let's make sure, the attribute we want to add is not already there: + if (propertyDeclarationSyntax.AttributeLists + .SelectMany(al => al.Attributes) + .Any(a => a.Name.ToString() == DesignerSerializationVisibilityAttributeName)) + { + Debug.Fail("The attribute should not be there."); + + return document; + } + + // Generate the Attribute we need to put on the property + AttributeSyntax designerSerializationVisibilityAttribute = SyntaxFactory.Attribute( + SyntaxFactory.ParseName(DesignerSerializationVisibilityAttributeName), + SyntaxFactory.ParseAttributeArgumentList("(DesignerSerializationVisibility.Hidden)")); + + // Make sure, we keep the white spaces before and after the property + SyntaxTriviaList leadingTrivia = propertyDeclarationSyntax.GetLeadingTrivia(); + SyntaxTriviaList trailingTrivia = propertyDeclarationSyntax.GetTrailingTrivia(); + + // Add the attribute to the property: + PropertyDeclarationSyntax newProperty = propertyDeclarationSyntax + .AddAttributeLists( + SyntaxFactory.AttributeList( + SyntaxFactory.SingletonSeparatedList(designerSerializationVisibilityAttribute))); + + // Let's format the property, so the attribute is on top of it: + newProperty = newProperty.NormalizeWhitespace(); + + // Let's restore the original trivia: + newProperty = newProperty.WithLeadingTrivia(leadingTrivia); + newProperty = newProperty.WithTrailingTrivia(trailingTrivia); + newProperty = newProperty.WithAdditionalAnnotations(Formatter.Annotation); + + // Let's check, if we already have the using directive or if we need to add it: + // (Remember: We can't throw here, as we are in a code fixer. But this also cannot be null.) + SyntaxNode root = (await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false))!; + + // Produce a new root, which has the updated property with the attribute. + root = root.ReplaceNode(propertyDeclarationSyntax, newProperty); + + // Let's check if we already have the using directive: + if (!root.DescendantNodes() + .OfType() + .Any(u => u?.Name?.ToString() == SystemComponentModelName)) + { + UsingDirectiveSyntax usingDirective = SyntaxFactory + .UsingDirective(SyntaxFactory.ParseName(SystemComponentModelName)); + + usingDirective = usingDirective + .WithAdditionalAnnotations(Simplifier.Annotation) + .WithAdditionalAnnotations(Formatter.Annotation); + + // We need to add the using directive: + SyntaxNode firstNode = root.DescendantNodes().First(); + root = root.InsertNodesBefore(firstNode, [usingDirective]); + } + + document = document.WithSyntaxRoot(root); + + // Generate the new document: + return document; + } +} diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Properties/AssemblyInfo.vb b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Properties/AssemblyInfo.vb new file mode 100644 index 00000000000..fd74a3a67bb --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Properties/AssemblyInfo.vb @@ -0,0 +1,6 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.CompilerServices + + diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/SR.resx new file mode 100644 index 00000000000..cf5f0ae9db7 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/SR.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add DesignerSerializationVisibilityAttribute to property + + diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf new file mode 100644 index 00000000000..a83842a2112 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf new file mode 100644 index 00000000000..49c8b221cfa --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf new file mode 100644 index 00000000000..7380b5cd7bc --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf new file mode 100644 index 00000000000..b7cf14b2a10 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf new file mode 100644 index 00000000000..c0af323b86a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf new file mode 100644 index 00000000000..338d0fd1fc7 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf new file mode 100644 index 00000000000..e1690c6d59d --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf new file mode 100644 index 00000000000..dad0b68d4ab --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf new file mode 100644 index 00000000000..6f3842c4160 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf new file mode 100644 index 00000000000..90ca9eedf16 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf new file mode 100644 index 00000000000..9dbbad8001d --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf new file mode 100644 index 00000000000..f599260bdec --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf new file mode 100644 index 00000000000..8cf4f2161cb --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf @@ -0,0 +1,12 @@ + + + + + + Add DesignerSerializationVisibilityAttribute to property + Add DesignerSerializationVisibilityAttribute to property + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic.vbproj b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic.vbproj new file mode 100644 index 00000000000..124b0018b67 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic.vbproj @@ -0,0 +1,32 @@ + + + + System.Windows.Forms.Analyzers + netstandard2.0 + true + + 15.5 + $(NoWarn);CA1812 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + true + System.Windows.Forms.Analyzers.CodeFixes.Resources + + + + diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb new file mode 100644 index 00000000000..6f0d84fde73 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb @@ -0,0 +1,141 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.Immutable +Imports System.Composition +Imports System.Threading +Imports System.Windows.Forms.Analyzers.CodeFixes.Resources +Imports System.Windows.Forms.Analyzers.Diagnostics +Imports Microsoft.CodeAnalysis +Imports Microsoft.CodeAnalysis.CodeActions +Imports Microsoft.CodeAnalysis.CodeFixes +Imports Microsoft.CodeAnalysis.Formatting +Imports Microsoft.CodeAnalysis.Simplification +Imports Microsoft.CodeAnalysis.Text +Imports Microsoft.CodeAnalysis.VisualBasic +Imports Microsoft.CodeAnalysis.VisualBasic.Syntax + +Namespace Global.System.Windows.Forms.VisualBasic.CodeFixes.AddDesignerSerializationVisibility + + + Friend NotInheritable Class AddDesignerSerializationVisibilityCodeFixProvider + Inherits CodeFixProvider + + Private Const SystemComponentModelName As String = "System.ComponentModel" + Private Const DesignerSerializationVisibilityAttributeName As String = "DesignerSerializationVisibility" + + Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) + Get + Return ImmutableArray.Create(DiagnosticIDs.MissingPropertySerializationConfiguration) + End Get + End Property + + Public Overrides Function GetFixAllProvider() As FixAllProvider + Return WellKnownFixAllProviders.BatchFixer + End Function + + Public Overrides Async Function RegisterCodeFixesAsync(context As CodeFixContext) As Task + ' Cannot be null - otherwise we wouldn't have a diagnostic of that ID. + Dim root As SyntaxNode = Await context. + Document. + GetSyntaxRootAsync(context.CancellationToken). + ConfigureAwait(False) + + Dim diagnostic As Diagnostic = context.Diagnostics.First() + Dim diagnosticSpan As TextSpan = diagnostic.Location.SourceSpan + + ' Find the type declaration identified by the diagnostic. + Dim propertyDeclaration As PropertyStatementSyntax = root. + FindToken(diagnosticSpan.Start). + Parent.AncestorsAndSelf(). + OfType(Of PropertyStatementSyntax)(). + First() + + ' Register a code action that will invoke the fix. + context.RegisterCodeFix( + CodeAction.Create( + title:=SR.AddDesignerSerializationVisibilityCodeFixTitle, + createChangedDocument:=Function(c) AddDesignerSerializationAttribute( + document:=context.Document, + propertyDeclarationSyntax:=propertyDeclaration, + cancellationToken:=c), + equivalenceKey:=NameOf(SR.AddDesignerSerializationVisibilityCodeFixTitle)), + diagnostic) + + End Function + + Private Shared Async Function AddDesignerSerializationAttribute( + document As Document, + propertyDeclarationSyntax As PropertyStatementSyntax, + cancellationToken As CancellationToken) As Task(Of Document) + + If propertyDeclarationSyntax Is Nothing Then + Return document + End If + + ' Let's make sure, the attribute we want to add is not already there: + If propertyDeclarationSyntax.AttributeLists.SelectMany( + Function(al) al.Attributes).Any( + Function(a) a.Name.ToString() = DesignerSerializationVisibilityAttributeName) Then + + Debug.Assert(False, "The attribute should not be there.") + Return document + End If + + ' Generate the Attribute we need to put on the property + Dim designerSerializationVisibilityAttribute As AttributeSyntax = + SyntaxFactory.Attribute( + Nothing, + SyntaxFactory.ParseTypeName("DesignerSerializationVisibility"), + SyntaxFactory.ParseArgumentList("(DesignerSerializationVisibility.Hidden)")) + + ' Make sure, we keep the white spaces before and after the property + Dim leadingTrivia As SyntaxTriviaList = propertyDeclarationSyntax.GetLeadingTrivia() + Dim trailingTrivia As SyntaxTriviaList = propertyDeclarationSyntax.GetTrailingTrivia() + + ' Add the attribute to the property: + Dim newProperty As PropertyStatementSyntax = propertyDeclarationSyntax.AddAttributeLists( + SyntaxFactory.AttributeList( + SyntaxFactory.SingletonSeparatedList(designerSerializationVisibilityAttribute))) + + ' Let's format the property, so the attribute is on top of it: + newProperty = newProperty.NormalizeWhitespace() + + ' Let's restore the original trivia: + newProperty = newProperty. + WithLeadingTrivia(leadingTrivia). + WithTrailingTrivia(trailingTrivia). + WithAdditionalAnnotations(Formatter.Annotation) + + ' Let's check, if we already have the imports statement or if we need to add it: + ' (Remember: We can't throw here, as we are in a code fixer. But this also cannot be null.) + Dim root As SyntaxNode = Await document. + GetSyntaxRootAsync(cancellationToken). + ConfigureAwait(False) + + ' Produce a new root, which has the updated property with the attribute. + root = root.ReplaceNode(propertyDeclarationSyntax, newProperty) + + ' Let's check if we already have the imports statement: + If Not root.DescendantNodes().OfType(Of ImportsStatementSyntax)(). + Any(Function(u) u.ImportsClauses.OfType(Of SimpleImportsClauseSyntax)(). + Any(Function(i) i.Name.ToString() = SystemComponentModelName)) Then + + Dim importsStatement As ImportsStatementSyntax = SyntaxFactory. + ImportsStatement(SyntaxFactory.SingletonSeparatedList(Of ImportsClauseSyntax)( + SyntaxFactory.SimpleImportsClause( + SyntaxFactory.ParseName(SystemComponentModelName)))). + WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation) + + ' We need to add the imports statement: + Dim firstNode As SyntaxNode = root.DescendantNodes().First() + root = root.InsertNodesBefore(firstNode, {importsStatement}) + End If + + document = document.WithSyntaxRoot(root) + + ' Generate the new document: + Return document + End Function + End Class +End Namespace diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/System.Windows.Forms.Analyzers.VisualBasic.vbproj b/src/System.Windows.Forms.Analyzers.VisualBasic/System.Windows.Forms.Analyzers.VisualBasic.vbproj new file mode 100644 index 00000000000..3f082b28e88 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/System.Windows.Forms.Analyzers.VisualBasic.vbproj @@ -0,0 +1,34 @@ + + + + System.Windows.Forms.Analyzers + netstandard2.0 + true + + 15.5 + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + true + System.Windows.Forms.Analyzers.VisualBasic.Resources + + + + diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Shipped.md b/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Shipped.md new file mode 100644 index 00000000000..180738cfdec --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Shipped.md @@ -0,0 +1,2 @@ +; Shipped analyzer releases +; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Unshipped.md b/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Unshipped.md new file mode 100644 index 00000000000..b618d7b263a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/AnalyzerReleases.Unshipped.md @@ -0,0 +1,7 @@ +; Unshipped analyzer release +; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + +### New Rules +Rule ID | Category | Severity | Notes +--------|----------|----------|------- +WFO1000 | WinForms Security | Error | VisualBasicDiagnosticDescriptors diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/GlobalSuppressions.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/GlobalSuppressions.vb new file mode 100644 index 00000000000..0695e8a0b95 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/GlobalSuppressions.vb @@ -0,0 +1,8 @@ +' This file is used by Code Analysis to maintain SuppressMessage +' attributes that are applied to this project. +' Project-level suppressions either have no target or are given +' a specific target and scoped to a namespace, type, member, etc. + +Imports System.Diagnostics.CodeAnalysis + + diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Properties/AssemblyInfo.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Properties/AssemblyInfo.vb new file mode 100644 index 00000000000..fd74a3a67bb --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Properties/AssemblyInfo.vb @@ -0,0 +1,6 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.CompilerServices + + diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/SR.resx new file mode 100644 index 00000000000..b85c817719b --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/SR.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + Missing code serialization configuration for property content + + + Property '{0}' does not configure the code serialization for its property content + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf new file mode 100644 index 00000000000..524e3bded45 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf new file mode 100644 index 00000000000..be4cdfec4ab --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf new file mode 100644 index 00000000000..dcfd72f230a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf new file mode 100644 index 00000000000..99eac544e11 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf new file mode 100644 index 00000000000..b64798e47a7 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf new file mode 100644 index 00000000000..7c5de5cff90 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf new file mode 100644 index 00000000000..71349ef0c2a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf new file mode 100644 index 00000000000..dd2eb4d6a38 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf new file mode 100644 index 00000000000..a8ec4b7736a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf new file mode 100644 index 00000000000..e096b18db92 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf new file mode 100644 index 00000000000..629ce04899e --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf new file mode 100644 index 00000000000..5d73d81a966 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf new file mode 100644 index 00000000000..ebee57c24ac --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf @@ -0,0 +1,22 @@ + + + + + + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + + + + Property '{0}' does not configure the code serialization for its property content + Property '{0}' does not configure the code serialization for its property content + + + + Missing code serialization configuration for property content + Missing code serialization configuration for property content + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj new file mode 100644 index 00000000000..6aedac3dbcf --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj @@ -0,0 +1,34 @@ + + + + System.Windows.Forms.Analyzers + netstandard2.0 + true + + 15.5 + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + true + System.Windows.Forms.Analyzers.VisualBasic.Resources + + + + diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb new file mode 100644 index 00000000000..e452925f644 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb @@ -0,0 +1,83 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Collections.Immutable +Imports System.ComponentModel +Imports Microsoft.CodeAnalysis +Imports Microsoft.CodeAnalysis.Diagnostics + +Namespace System.Windows.Forms.VisualBasic.Analyzers.MissingPropertySerializationConfiguration + + + Public Class MissingPropertySerializationConfigurationAnalyzer + Inherits DiagnosticAnalyzer + + Public Overrides ReadOnly Property SupportedDiagnostics As ImmutableArray(Of DiagnosticDescriptor) + Get + Return ImmutableArray.Create(s_missingPropertySerializationConfiguration) + End Get + End Property + + Public Overrides Sub Initialize(context As AnalysisContext) + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None) + context.EnableConcurrentExecution() + context.RegisterSymbolAction(AddressOf AnalyzeSymbol, SymbolKind.Property) + End Sub + + Private Shared Sub AnalyzeSymbol(context As SymbolAnalysisContext) + + ' We analyze only properties. + Dim propertySymbol As IPropertySymbol = TryCast(context.Symbol, IPropertySymbol) + If propertySymbol Is Nothing Then + Return + End If + + ' Does the property belong to a class which derives from Component? + If propertySymbol.ContainingType Is Nothing OrElse + Not propertySymbol.ContainingType.AllInterfaces.Any( + Function(i) i.Name = NameOf(IComponent)) Then + + Return + End If + + ' Is the property read/write and at least internal? + If propertySymbol.SetMethod Is Nothing OrElse + propertySymbol.DeclaredAccessibility < Accessibility.Internal Then + + Return + End If + + ' Is the property attributed with DesignerSerializationVisibility or DefaultValue? + If propertySymbol.GetAttributes().Any( + Function(a) a?.AttributeClass?.Name = NameOf(DesignerSerializationVisibilityAttribute) OrElse + a?.AttributeClass?.Name = NameOf(DefaultValueAttribute)) Then + + Return + End If + + ' Now, it gets a bit more tedious: + ' If the Serialization is managed via ShouldSerialize and Reset methods, we are also fine, + ' so let's check for that. First, let's get the class of the property: + Dim classSymbol As INamedTypeSymbol = propertySymbol.ContainingType + + ' Now, let's check if the class has a method ShouldSerialize method: + Dim shouldSerializeMethod As IMethodSymbol = classSymbol.GetMembers(). + OfType(Of IMethodSymbol)(). + FirstOrDefault(Function(m) m.Name = $"ShouldSerialize{propertySymbol.Name}") + + ' Let's make sure the method returns a bool and has no parameters: + If shouldSerializeMethod Is Nothing OrElse + shouldSerializeMethod.ReturnType.SpecialType <> SpecialType.System_Boolean OrElse + shouldSerializeMethod.Parameters.Length > 0 Then + + ' For ALL such other symbols, produce a diagnostic. + Dim diagnostic As Diagnostic = Diagnostic.Create( + descriptor:=s_missingPropertySerializationConfiguration, + location:=propertySymbol.Locations(0), + propertySymbol.Name) + + context.ReportDiagnostic(diagnostic) + End If + End Sub + End Class +End Namespace diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb new file mode 100644 index 00000000000..529bf940d6f --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb @@ -0,0 +1,19 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports Microsoft.CodeAnalysis +Imports System.Windows.Forms.Analyzers.Diagnostics +Imports System.Windows.Forms.Analyzers.VisualBasic.Resources + +Friend Module VisualBasicDiagnosticDescriptors + + Public ReadOnly s_missingPropertySerializationConfiguration As New DiagnosticDescriptor( + id:=DiagnosticIDs.MissingPropertySerializationConfiguration, + title:=New LocalizableResourceString(NameOf(SR.WFO1000AnalyzerTitle), SR.ResourceManager, GetType(SR)), + messageFormat:=New LocalizableResourceString(NameOf(SR.WFO1000AnalyzerMessageFormat), SR.ResourceManager, GetType(SR)), + category:=DiagnosticCategories.WinFormsSecurity, + defaultSeverity:=DiagnosticSeverity.Error, + isEnabledByDefault:=True, + description:=New LocalizableResourceString(NameOf(SR.WFO1000AnalyzerDescription), SR.ResourceManager, GetType(SR))) + +End Module diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj new file mode 100644 index 00000000000..c59dd663ee6 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj @@ -0,0 +1,37 @@ + + + + enable + 15.5 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb new file mode 100644 index 00000000000..a5531428dc1 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb @@ -0,0 +1,172 @@ +Imports System.Windows.Forms.VisualBasic.Analyzers.MissingPropertySerializationConfiguration +Imports System.Windows.Forms.VisualBasic.CodeFixes.AddDesignerSerializationVisibility +Imports Microsoft.CodeAnalysis +Imports Microsoft.CodeAnalysis.Testing +Imports Microsoft.CodeAnalysis.VisualBasic.Testing +Imports Xunit + +Public Class ControlPropertySerializationDiagnosticAnalyzerTest + + Private Const ProblematicCode As String = +" +Imports System.Drawing +Imports System.Windows.Forms + +Namespace VBControls + + Public Module Program + Public Sub Main() + Dim control As New ScalableControl() + + ' We deliberately format this weirdly, to make sure we only format code our code fix touches. + control.ScaleFactor = 1.5F + control.ScaledSize = New SizeF(100, 100) + control.ScaledLocation = New PointF(10, 10) + End Sub + End Module + + ' We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it, + ' since this is nothing our code fix touches. + Public Class ScalableControl + Inherits System.Windows.Forms.Control + + Public Property [|ScaleFactor|] As Single = 1.0F + + Public Property [|ScaledSize|] As SizeF + + Public Property [|ScaledLocation|] As PointF + End Class + +End Namespace +" + + Private Const CorrectCode As String = +"Imports System.ComponentModel +Imports System.Drawing +Imports System.Windows.Forms + +Namespace VBControls + + Public Module Program + Public Sub Main() + Dim control As New ScalableControl() + + control.ScaleFactor = 1.5F + control.ScaledSize = New SizeF(100, 100) + control.ScaledLocation = New PointF(10, 10) + End Sub + End Module + + Public Class ScalableControl + Inherits Control + + + Public Property ScaleFactor As Single = 1.0F + + + Public Property ScaledSize As SizeF + + Public Property ScaledLocation As PointF + Private Function ShouldSerializeScaledLocation() As Boolean + Return Me.ScaledLocation <> PointF.Empty + End Function + End Class + +End Namespace +" + + Private Const FixedCode As String = +"Imports System.ComponentModel +Imports System.Drawing +Imports System.Windows.Forms + +Namespace VBControls + + Public Module Program + Public Sub Main() + Dim control As New ScalableControl() + + ' We deliberately format this weirdly, to make sure we only format code our code fix touches. + control.ScaleFactor = 1.5F + control.ScaledSize = New SizeF(100, 100) + control.ScaledLocation = New PointF(10, 10) + End Sub + End Module + + ' We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it, + ' since this is nothing our code fix touches. + Public Class ScalableControl + Inherits System.Windows.Forms.Control + + + Public Property ScaleFactor As Single = 1.0F + + + Public Property ScaledSize As SizeF + + + Public Property ScaledLocation As PointF + End Class + +End Namespace +" + + ' We are testing the analyzer with all versions of the .NET SDK from 6.0 on. + Public Shared Iterator Function GetReferenceAssemblies() As IEnumerable(Of Object()) + Yield New Object() {ReferenceAssemblies.Net.Net60Windows} + Yield New Object() {ReferenceAssemblies.Net.Net70Windows} + Yield New Object() {ReferenceAssemblies.Net.Net80Windows} + Yield New Object() {ReferenceAssemblies.Net.Net90Windows} + End Function + + + + Public Async Function VB_ControlPropertySerializationConfigurationAnalyzer(referenceAssemblies As ReferenceAssemblies) As Task + Dim context = New VisualBasicAnalyzerTest(Of + MissingPropertySerializationConfigurationAnalyzer, + DefaultVerifier) With + { + .TestCode = CorrectCode, + .ReferenceAssemblies = referenceAssemblies + } + + context.TestState.OutputKind = OutputKind.WindowsApplication + + Await context.RunAsync() + End Function + + + + Public Async Function VB_MissingControlPropertySerializationConfigurationAnalyzer(referenceAssemblies As ReferenceAssemblies) As Task + Dim context = New VisualBasicAnalyzerTest(Of + MissingPropertySerializationConfigurationAnalyzer, + DefaultVerifier) With + { + .TestCode = ProblematicCode, + .ReferenceAssemblies = referenceAssemblies + } + + context.TestState.OutputKind = OutputKind.WindowsApplication + + Await context.RunAsync() + End Function + + + + Public Async Function VB_AddDesignerSerializationVisibilityCodeFix(referenceAssemblies As ReferenceAssemblies) As Task + Dim context = New VisualBasicCodeFixTest(Of + MissingPropertySerializationConfigurationAnalyzer, + AddDesignerSerializationVisibilityCodeFixProvider, + DefaultVerifier) With + { + .TestCode = ProblematicCode, + .FixedCode = FixedCode, + .ReferenceAssemblies = referenceAssemblies, + .NumberOfFixAllIterations = 2 + } + + context.TestState.OutputKind = OutputKind.WindowsApplication + + Await context.RunAsync() + End Function +End Class diff --git a/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Shipped.md b/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Shipped.md index 56804e0f287..b8d4f9becf4 100644 --- a/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Shipped.md +++ b/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Shipped.md @@ -1,7 +1,7 @@ ; Shipped analyzer releases ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md -## Release .NET 6.0 RC2 +## Release 6.0.0 ### New Rules diff --git a/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Unshipped.md b/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Unshipped.md index 6640189c3f3..5bab43163c0 100644 --- a/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Unshipped.md +++ b/src/System.Windows.Forms.Analyzers/src/AnalyzerReleases.Unshipped.md @@ -2,5 +2,13 @@ ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md ### New Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|------- +WFO0003 | Application Configuration | Warning | SharedDiagnosticDescriptors + +### Removed Rules + Rule ID | Category | Severity | Notes --------|----------|----------|------- +WFAC010 | Application Configuration | Warning | DiagnosticDescriptors diff --git a/src/System.Windows.Forms.Analyzers/src/DiagnosticDescriptors.cs b/src/System.Windows.Forms.Analyzers/src/DiagnosticDescriptors.cs deleted file mode 100644 index 7106437ba1b..00000000000 --- a/src/System.Windows.Forms.Analyzers/src/DiagnosticDescriptors.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; - -namespace System.Windows.Forms.Analyzers; - -internal static class DiagnosticDescriptors -{ - private const string Category = "ApplicationConfiguration"; - - private static readonly LocalizableString s_localizableWFAC010Title - = new LocalizableResourceString(nameof(SR.WFAC010Title), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC010Message_CS - = new LocalizableResourceString(nameof(SR.WFAC010Message_CS), SR.ResourceManager, typeof(SR)); - private static readonly LocalizableString s_localizableWFAC010Message_VB - = new LocalizableResourceString(nameof(SR.WFAC010Message_VB), SR.ResourceManager, typeof(SR)); - - internal static readonly DiagnosticDescriptor s_migrateHighDpiSettings_CSharp - = new(id: "WFAC010", - title: s_localizableWFAC010Title, - messageFormat: s_localizableWFAC010Message_CS, - category: Category, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true); - internal static readonly DiagnosticDescriptor s_migrateHighDpiSettings_VB - = new(id: "WFAC010", - title: s_localizableWFAC010Title, - messageFormat: s_localizableWFAC010Message_VB, - category: Category, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true); -} diff --git a/src/System.Windows.Forms.Analyzers/src/Properties/AssemblyInfo.cs b/src/System.Windows.Forms.Analyzers/src/Properties/AssemblyInfo.cs index ba34ad5403a..8fb9954a11e 100644 --- a/src/System.Windows.Forms.Analyzers/src/Properties/AssemblyInfo.cs +++ b/src/System.Windows.Forms.Analyzers/src/Properties/AssemblyInfo.cs @@ -4,3 +4,8 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CSharp, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CodeFixes.CSharp, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.VisualBasic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CodeFixes.VisualBasic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/SR.resx b/src/System.Windows.Forms.Analyzers/src/Resources/SR.resx index 7a282f6dddf..8a45c4409c0 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/SR.resx +++ b/src/System.Windows.Forms.Analyzers/src/Resources/SR.resx @@ -1,5 +1,64 @@  + @@ -58,13 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Unsupported high DPI configuration - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + \ No newline at end of file diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf index de9ee8fa977..53504c96e5a 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Odeberte z {0} nastavení vysokého rozlišení DPI a použijte ke konfiguraci rozhraní API Application.SetHighDpiMode nebo vlastnost projektu {1}. + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Odeberte z {0} nastavení vysokého rozlišení DPI a použijte ke konfiguraci vlastnost {1} v aplikačním frameworku. + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Nepodporovaná konfigurace vysokého rozlišení DPI + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf index a33b44ac27f..e00efde08ce 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Entfernen Sie Einstellungen mit hohem DPI-Wert aus {0} und konfigurieren Sie sie über die Application.SetHighDpiMode-API oder die Projekteigenschaft "{1}". + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Entfernen Sie Einstellungen mit hohem DPI-Wert aus {0} und konfigurieren Sie sie über die Eigenschaft "{1}" in Application Framework. + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Nicht unterstützte Konfiguration mit hohem DPI-Wert + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf index 102db0aeca9..6dfdb4380d9 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Quitar la configuración con valores altos de PPP de {0} y configurar a través de la aplicación API SetHighDpiMode o a través de la propiedad del proyecto '{1}'. + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Quitar la configuración con valores altos de PPP de {0} y configurar a través de la propiedad '{1}' en el marco de trabajo de la aplicación + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Configuración de PPP alta no admitida + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf index 8460e887c93..1c0851279af 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Supprimez les paramètres haute résolution de {0} et configurez-les via l’API Application.SetHighDpiMode ou la propriété de projet «{1}» + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Supprimer les paramètres haute résolution de {0} et configurer via la propriété «{1}» dans Application Framework + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Configuration haute résolution non prise en charge + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf index 4fcccb79370..6555d0e84fd 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Rimuovere le impostazioni della risoluzione elevata da {0} e configurare tramite l'API Application.SetHighDpiMode o la proprietà di progetto '{1}' + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Rimuovere le impostazioni della risoluzione elevata da {0} e configurare tramite la proprietà '{1}' in Framework applicazione + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Configurazione per risoluzione elevata non supportata + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf index 9ffc947d930..fc2364f2d5c 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - 高 DPI 設定を {0} から削除し、Application.SetHighDpiMode API または '{1}' プロジェクト プロパティを使用して構成します + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - 高 DPI 設定を {0} から削除し、アプリケーション フレームワークの '{1}' プロパティを使用して構成します + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - サポートされていない高 DPI 構成 + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf index 8faeb1774be..35064e57ee1 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - {0}에서 높은 DPI 설정을 제거하고 Application.SetHighDpiMode API 또는 '{1}' 프로젝트 속성을 통해 구성 + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - {0}에서 높은 DPI 설정을 제거하고 Application Framework의 '{1}' 속성을 통해 구성 + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - 지원되지 않는 높은 DPI 구성 + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf index d1c5fef543f..68e4f9ab65f 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Usuń ustawienia wysokiej rozdzielczości DPI z {0}i skonfiguruj za pomocą interfejsu API Application.SetHighDpiMode lub właściwości projektu „{1}” + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Usuń ustawienia wysokiej rozdzielczości DPI z {0}and skonfiguruj za pomocą właściwości „{1}” w programie Application Framework + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Nieobsługiwana konfiguracja wysokiej rozdzielczości DPI + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf index dbb1235ee59..285c0002c2e 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remova as configurações de DPI alto de {0} e configure por meio da API Application.SetHighDpiMode ou da propriedade do projeto '{1}' + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remova as configurações de DPI alto de {0} e configure por meio da propriedade '{1}' no Application Framework + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Configuração de alta DPI não suportada + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf index 01307e0834e..2a1b5f2fd2f 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Удалить параметры высокого DPI из "{0}" и настроить через API приложения Application.SetHighDpiMode или свойство проекта "{1}" + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Удалить параметры высокого DPI из {0} и настроить через свойство "{1}" в исполняющей среде + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Неподдерживаемая конфигурация высокого DPI + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf index 0aaf8f804f9..2a8b4a55f7e 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Yüksek DPI ayarlarını {0} bileşeninden kaldırın ve Application.SetHighDpiMode API’si veya '{1}' proje özelliği aracılığıyla yapılandırın + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Yüksek DPI ayarlarını {0} bileşeninden kaldırın ve Uygulama Çerçevesi’ndeki '{1}' özelliği aracılığıyla yapılandırın + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - Desteklenmeyen yüksek DPI yapılandırması + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf index bf16f1a8e80..ae612122627 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - 从 {0} 中删除高 DPI 设置,并通过 Application.SetHighDpiMode API 或“{1}”项目属性进行配置 + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - 从 {0} 中删除高 DPI 设置,并通过应用程序框架中的“{1}”属性进行配置 + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - 不支持的高 DPI 配置 + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf index bbb3f960b82..fd34c52dba4 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf @@ -2,19 +2,19 @@ - + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - 從 {0} 移除高 DPI 設定,並透過Application.SetHighDpiMode API 或 '{1}' 專案屬性進行設定 + Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - 從 {0} 移除高 DPI 設定,並透過應用程式架構中的 '{1}' 屬性進行設定 + Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - + Unsupported high DPI configuration - 不支援的高 DPI 設定 + Unsupported high DPI configuration diff --git a/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj b/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj index f7a4ba390b4..8fcd7ea3fa2 100644 --- a/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj +++ b/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj @@ -4,12 +4,11 @@ netstandard2.0 Preview enable - $(NoWarn);RS2007 true - + @@ -25,7 +24,7 @@ true - System + System.Windows.Forms.Analyzers.Resources diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AnalyzerConfigOptionsProviderExtensions.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AnalyzerConfigOptionsProviderExtensions.cs similarity index 85% rename from src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AnalyzerConfigOptionsProviderExtensions.cs rename to src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AnalyzerConfigOptionsProviderExtensions.cs index 9495f028900..6b75e96b8d8 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AnalyzerConfigOptionsProviderExtensions.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AnalyzerConfigOptionsProviderExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.CodeAnalysis.Diagnostics; @@ -10,7 +10,7 @@ internal static class AnalyzerConfigOptionsProviderExtensions /// /// Attempts to read a value for the requested MSBuild property. /// - /// The global optins. + /// The global options. /// The name of the property to read the value for. /// The property's value. /// if the property is present; otherwise . diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AppManifestAnalyzer.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AppManifestAnalyzer.cs similarity index 61% rename from src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AppManifestAnalyzer.cs rename to src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AppManifestAnalyzer.cs index aa504c345aa..33c98037dd2 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/AppManifestAnalyzer.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/AppManifestAnalyzer.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; +using System.Windows.Forms.Analyzers.Diagnostics; using System.Xml; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -10,17 +11,17 @@ namespace System.Windows.Forms.Analyzers; [DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)] -public partial class AppManifestAnalyzer : DiagnosticAnalyzer +internal partial class AppManifestAnalyzer : DiagnosticAnalyzer { public override ImmutableArray SupportedDiagnostics - => ImmutableArray.Create(DiagnosticDescriptors.s_migrateHighDpiSettings_CSharp, - DiagnosticDescriptors.s_migrateHighDpiSettings_VB); + => [SharedDiagnosticDescriptors.s_cSharpMigrateHighDpiSettings, SharedDiagnosticDescriptors.s_visualBasicMigrateHighDpiSettings]; public override void Initialize(AnalysisContext context) { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze + | GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.EnableConcurrentExecution(); context.RegisterAdditionalFileAction(AdditionalFileAction); } @@ -30,8 +31,6 @@ private void AdditionalFileAction(AdditionalFileAnalysisContext context) { VerifyAppManifest(context, context.AdditionalFile); } - - // TODO: look for app.config? } private static void VerifyAppManifest(AdditionalFileAnalysisContext context, AdditionalText appManifest) @@ -54,27 +53,29 @@ private static void VerifyAppManifest(AdditionalFileAnalysisContext context, Add return; } - XmlNamespaceManager nsmgr = new(doc.NameTable); - nsmgr.AddNamespace("v1", "urn:schemas-microsoft-com:asm.v1"); - nsmgr.AddNamespace("v3", "urn:schemas-microsoft-com:asm.v3"); - nsmgr.AddNamespace("v3ws", "http://schemas.microsoft.com/SMI/2005/WindowsSettings"); + XmlNamespaceManager nsMgr = new(doc.NameTable); + nsMgr.AddNamespace("v1", "urn:schemas-microsoft-com:asm.v1"); + nsMgr.AddNamespace("v3", "urn:schemas-microsoft-com:asm.v3"); + nsMgr.AddNamespace("v3ws", "http://schemas.microsoft.com/SMI/2005/WindowsSettings"); - if (doc.DocumentElement.SelectSingleNode("//v3:application/v3:windowsSettings/v3ws:dpiAware", nsmgr) is not null) + if (doc.DocumentElement.SelectSingleNode("//v3:application/v3:windowsSettings/v3ws:dpiAware", nsMgr) is not null) { switch (context.Compilation.Language) { case LanguageNames.CSharp: - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.s_migrateHighDpiSettings_CSharp, - Location.None, - appManifest.Path, - ApplicationConfig.PropertyNameCSharp.HighDpiMode)); + context.ReportDiagnostic(Diagnostic.Create(SharedDiagnosticDescriptors.s_cSharpMigrateHighDpiSettings, + Location.None, + appManifest.Path, + ApplicationConfig.PropertyNameCSharp.HighDpiMode)); break; + case LanguageNames.VisualBasic: - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.s_migrateHighDpiSettings_VB, - Location.None, - appManifest.Path, - ApplicationConfig.PropertyNameVisualBasic.HighDpiMode)); + context.ReportDiagnostic(Diagnostic.Create(SharedDiagnosticDescriptors.s_visualBasicMigrateHighDpiSettings, + Location.None, + appManifest.Path, + ApplicationConfig.PropertyNameVisualBasic.HighDpiMode)); break; + default: throw new NotSupportedException(); } diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontDescriptor.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.FontDescriptor.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontDescriptor.cs rename to src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.FontDescriptor.cs diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontStyle.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.FontStyle.cs similarity index 99% rename from src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontStyle.cs rename to src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.FontStyle.cs index f5af959ce99..f283070732a 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontStyle.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.FontStyle.cs @@ -13,18 +13,22 @@ public enum FontStyle /// Normal text. /// Regular = 0, + /// /// Bold text. /// Bold = 1, + /// /// Italic text. /// Italic = 2, + /// /// Underlined text. /// Underline = 4, + /// /// Text with a line through the middle. /// diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.GraphicsUnit.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.GraphicsUnit.cs similarity index 99% rename from src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.GraphicsUnit.cs rename to src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.GraphicsUnit.cs index 22dce2e37f6..693f8a2a9ac 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.GraphicsUnit.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.GraphicsUnit.cs @@ -12,26 +12,32 @@ public enum GraphicsUnit /// Specifies the world unit as the unit of measure. /// World = 0, + /// /// Specifies 1/75 inch as the unit of measure. /// Display = 1, + /// /// Specifies a device pixel as the unit of measure. /// Pixel = 2, + /// /// Specifies a printer's point (1/72 inch) as the unit of measure. /// Point = 3, + /// /// Specifies the inch as the unit of measure. /// Inch = 4, + /// /// Specifies the document unit (1/300 inch) as the unit of measure. /// Document = 5, + /// /// Specifies the millimeter as the unit of measure. /// diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.cs new file mode 100644 index 00000000000..4d77c4ebdf0 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/ApplicationConfig.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Windows.Forms.Analyzers; + +internal partial record ApplicationConfig( + bool EnableVisualStyles, + string? DefaultFont, + HighDpiMode HighDpiMode, + bool UseCompatibleTextRendering) +{ + public static class PropertyNameCSharp + { + public const string EnableVisualStyles = "ApplicationVisualStyles"; + public const string DefaultFont = "ApplicationDefaultFont"; + public const string HighDpiMode = "ApplicationHighDpiMode"; + public const string UseCompatibleTextRendering = "ApplicationUseCompatibleTextRendering"; + } + + public static class PropertyNameVisualBasic + { + public const string EnableVisualStyles = "EnableVisualStyles"; + public const string HighDpiMode = "HighDpiMode"; + } + + public static class PropertyDefaultValue + { + public const bool EnableVisualStyles = true; + public const float FontSize = 9f; + public const HighDpiMode DpiMode = HighDpiMode.SystemAware; + public const bool UseCompatibleTextRendering = false; + } +} diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticCategories.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticCategories.cs new file mode 100644 index 00000000000..50753ac0540 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticCategories.cs @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Windows.Forms.Analyzers.Diagnostics; + +internal static class DiagnosticCategories +{ + public const string ApplicationConfiguration = "Application Configuration"; + public const string WinFormsSecurity = "WinForms Security"; + public const string WinFormsUsage = "WinForms Usage"; +} diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs new file mode 100644 index 00000000000..10381e1b716 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Windows.Forms.Analyzers.Diagnostics; + +internal static class DiagnosticIDs +{ + // Application Configuration, number group 0001+ + public const string UnsupportedProjectType = "WFO0001"; + public const string PropertyCantBeSetToValue = "WFO0002"; + public const string MigrateHighDpiSettings = "WFO0003"; + + // Security, number group 1000+ + public const string MissingPropertySerializationConfiguration = "WFO1000"; + + // WinForms best practize, number group 2000+ + public const string DisposeModalDialog = "WFO2000"; + + // Experimental, number group 9000+ + public const string ExperimentalVisualStyles = "WFO9000"; + public const string ExperimentalDarkMode = "WFO9001"; +} diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/SharedDiagnosticDescriptors.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/SharedDiagnosticDescriptors.cs new file mode 100644 index 00000000000..27a3e490921 --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/SharedDiagnosticDescriptors.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Windows.Forms.Analyzers.Resources; +using Microsoft.CodeAnalysis; + +namespace System.Windows.Forms.Analyzers.Diagnostics; + +internal static partial class SharedDiagnosticDescriptors +{ + internal static readonly DiagnosticDescriptor s_cSharpMigrateHighDpiSettings = + new(id: DiagnosticIDs.MigrateHighDpiSettings, + title: new LocalizableResourceString(nameof(SR.WFO0003Title), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO0003Message_CS), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.ApplicationConfiguration, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true); + + internal static readonly DiagnosticDescriptor s_visualBasicMigrateHighDpiSettings = + new(id: DiagnosticIDs.MigrateHighDpiSettings, + title: new LocalizableResourceString(nameof(SR.WFO0003Title), SR.ResourceManager, typeof(SR)), + messageFormat: new LocalizableResourceString(nameof(SR.WFO0003Message_VB), SR.ResourceManager, typeof(SR)), + category: DiagnosticCategories.ApplicationConfiguration, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true); +} diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/IsExternalInit.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/IsExternalInit.cs new file mode 100644 index 00000000000..67ccfa8252f --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/IsExternalInit.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Runtime.CompilerServices +{ + /// + /// Reserved to be used by the compiler for tracking metadata. + /// This class should not be used by developers in source code. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class IsExternalInit + { + } +} diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.cs deleted file mode 100644 index 3d97028fae6..00000000000 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.CompilerServices -{ - internal static class IsExternalInit - { - } -} - -namespace System.Windows.Forms.Analyzers -{ - internal partial record ApplicationConfig( - bool EnableVisualStyles, - string? DefaultFont, - HighDpiMode HighDpiMode, - bool UseCompatibleTextRendering) - { - public static class PropertyNameCSharp - { - public const string EnableVisualStyles = "ApplicationVisualStyles"; - public const string DefaultFont = "ApplicationDefaultFont"; - public const string HighDpiMode = "ApplicationHighDpiMode"; - public const string UseCompatibleTextRendering = "ApplicationUseCompatibleTextRendering"; - } - - public static class PropertyNameVisualBasic - { - public const string EnableVisualStyles = "EnableVisualStyles"; - public const string HighDpiMode = "HighDpiMode"; - } - - public static class PropertyDefaultValue - { - public const bool EnableVisualStyles = true; - public const float FontSize = 9f; - public const HighDpiMode DpiMode = HighDpiMode.SystemAware; - public const bool UseCompatibleTextRendering = false; - } - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Properties/AssemblyInfo.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..cfb75a1f62a --- /dev/null +++ b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +// [assembly: InternalsVisibleTo("System.Windows.Forms.Analyzers.VisualBasic.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System.Windows.Forms.Analyzers.Tests.csproj b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System.Windows.Forms.Analyzers.Tests.csproj index 45d417503e7..949bc02cc24 100644 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System.Windows.Forms.Analyzers.Tests.csproj +++ b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System.Windows.Forms.Analyzers.Tests.csproj @@ -11,11 +11,7 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/AppManifestAnalyzerTests.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/AppManifestAnalyzerTests.cs index 800eaf6ee0c..2832d5abefd 100644 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/AppManifestAnalyzerTests.cs +++ b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/AppManifestAnalyzerTests.cs @@ -1,51 +1,55 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Windows.Forms.Analyzers.Diagnostics; +using Microsoft.CodeAnalysis.CSharp.Testing; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; +using Microsoft.CodeAnalysis.VisualBasic.Testing; using Xunit; -using VerifyCS = System.Windows.Forms.Analyzers.Tests.CSharpAnalyzerVerifier< - System.Windows.Forms.Analyzers.AppManifestAnalyzer>; -using VerifyVB = System.Windows.Forms.Analyzers.Tests.VisualBasicAnalyzerVerifier< - System.Windows.Forms.Analyzers.AppManifestAnalyzer>; namespace System.Windows.Forms.Analyzers.Tests; public class AppManifestAnalyzerTests { - private const string CSharCode = @" - namespace ConsoleApplication1 - { - class {|#0:TypeName|} - { + private const string CSharpCode = + """ + namespace ConsoleApplication1 + { + class {|#0:TypeName|} + { + } } - }"; - private const string VbCode = @" -Namespace ConsoleApplication1 - Class {|#0:TypeName|} - End Class -End Namespace"; + """; + + private const string VbCode = + """ + Namespace ConsoleApplication1 + Class {|#0:TypeName|} + End Class + End Namespace + """; [Fact] - public async Task AppManifestAnalyzer_noop_if_no_manifest_file() - { - await new VerifyCS.Test + public async Task AppManifestAnalyzer_no_op_if_no_manifest_file() => + await new CSharpAnalyzerTest() { - TestCode = CSharCode, + TestCode = CSharpCode, TestState = { AdditionalFiles = { } } }.RunAsync(); - } [Fact] - public async Task AppManifestAnalyzer_noop_if_manifest_file_has_no_dpi_info() + public async Task AppManifestAnalyzer_no_op_if_manifest_file_has_no_dpi_info() { - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\nodpi.manifest")); - await new VerifyCS.Test + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\nodpi.manifest")); + + await new CSharpAnalyzerTest() { - TestCode = CSharCode, + TestCode = CSharpCode, TestState = { AdditionalFiles = { (@"C:\temp\app.manifest", manifestFile) } @@ -56,10 +60,12 @@ public async Task AppManifestAnalyzer_noop_if_manifest_file_has_no_dpi_info() [Fact] public async Task AppManifestAnalyzer_noop_if_manifest_file_corrupt() { - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\invalid.manifest")); - await new VerifyCS.Test + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\invalid.manifest")); + + await new CSharpAnalyzerTest() { - TestCode = CSharCode, + TestCode = CSharpCode, TestState = { AdditionalFiles = { (@"C:\temp\app.manifest", manifestFile) } @@ -71,17 +77,20 @@ public async Task AppManifestAnalyzer_noop_if_manifest_file_corrupt() public async Task AppManifestAnalyzer_warn_if_manifest_file_has_dpi_info_CSharp() { const string manifestFilePath = @"C:\temp\app.manifest"; - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); - await new VerifyCS.Test + + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); + + await new CSharpAnalyzerTest() { - TestCode = CSharCode, + TestCode = CSharpCode, TestState = { AdditionalFiles = { (manifestFilePath, manifestFile) } }, ExpectedDiagnostics = { - new DiagnosticResult(DiagnosticDescriptors.s_migrateHighDpiSettings_CSharp) + new DiagnosticResult(SharedDiagnosticDescriptors.s_cSharpMigrateHighDpiSettings) .WithArguments(manifestFilePath, ApplicationConfig.PropertyNameCSharp.HighDpiMode) } }.RunAsync(); @@ -91,8 +100,11 @@ public async Task AppManifestAnalyzer_warn_if_manifest_file_has_dpi_info_CSharp( public async Task AppManifestAnalyzer_warn_if_manifest_file_has_dpi_info_VB() { const string manifestFilePath = @"C:\temp\app.manifest"; - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); - await new VerifyVB.Test + + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); + + await new VisualBasicAnalyzerTest() { TestCode = VbCode, TestState = @@ -101,7 +113,7 @@ public async Task AppManifestAnalyzer_warn_if_manifest_file_has_dpi_info_VB() }, ExpectedDiagnostics = { - new DiagnosticResult(DiagnosticDescriptors.s_migrateHighDpiSettings_VB) + new DiagnosticResult(SharedDiagnosticDescriptors.s_visualBasicMigrateHighDpiSettings) .WithArguments(manifestFilePath, ApplicationConfig.PropertyNameVisualBasic.HighDpiMode) } }.RunAsync(); @@ -111,14 +123,17 @@ public async Task AppManifestAnalyzer_warn_if_manifest_file_has_dpi_info_VB() public async Task AppManifestAnalyzer_can_suppressed_if_manifest_file_has_dpi_info_CSharp() { const string manifestFilePath = @"C:\temp\app.manifest"; - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); - await new VerifyCS.Test + + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); + + await new CSharpAnalyzerTest() { - TestCode = CSharCode, + TestCode = CSharpCode, TestState = { AdditionalFiles = { (manifestFilePath, manifestFile) }, - AnalyzerConfigFiles = { ("/.globalconfig", $"is_global = true\r\ndotnet_diagnostic.WFAC010.severity = none") } + AnalyzerConfigFiles = { ("/.globalconfig", $"is_global = true\r\ndotnet_diagnostic.{DiagnosticIDs.MigrateHighDpiSettings}.severity = none") } } }.RunAsync(); } @@ -127,14 +142,17 @@ public async Task AppManifestAnalyzer_can_suppressed_if_manifest_file_has_dpi_in public async Task AppManifestAnalyzer_can_suppressed_if_manifest_file_has_dpi_info_VB() { const string manifestFilePath = @"C:\temp\app.manifest"; - SourceText manifestFile = SourceText.From(File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); - await new VerifyVB.Test + + SourceText manifestFile = SourceText.From( + File.ReadAllText(@"System\Windows\Forms\Analyzers\MockData\dpi.manifest")); + + await new VisualBasicAnalyzerTest() { TestCode = VbCode, TestState = { AdditionalFiles = { (manifestFilePath, manifestFile) }, - AnalyzerConfigFiles = { ("/.globalconfig", $"is_global = true\r\ndotnet_diagnostic.WFAC010.severity = none") } + AnalyzerConfigFiles = { ("/.globalconfig", $"is_global = true\r\ndotnet_diagnostic.{DiagnosticIDs.MigrateHighDpiSettings}.severity = none") } } }.RunAsync(); } diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/ApplicationConfigTests.FontDescriptor.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/ApplicationConfigTests.FontDescriptor.cs index ffaa924630b..e605c0021e6 100644 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/ApplicationConfigTests.FontDescriptor.cs +++ b/src/System.Windows.Forms.Analyzers/tests/UnitTests/System/Windows/Forms/Analyzers/ApplicationConfigTests.FontDescriptor.cs @@ -22,7 +22,11 @@ public FontDescriptorTests(ITestOutputHelper output) [Fact] public void FontDescriptor_ctor() { - FontDescriptor descriptor = new("fontName", 10f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point); + FontDescriptor descriptor = new( + fontName: "fontName", + emSize: 10f, + style: FontStyle.Bold | FontStyle.Italic, + unit: GraphicsUnit.Point); Assert.Equal("fontName", descriptor.Name); Assert.Equal(10f, descriptor.Size); @@ -41,7 +45,11 @@ public void FontDescriptor_ctor() [InlineData("Name with \r\n lines", "new global::System.Drawing.Font(new global::System.Drawing.FontFamily(\"Name with lines\"), 10f, (global::System.Drawing.FontStyle)3, (global::System.Drawing.GraphicsUnit)3)")] public void FontDescriptor_ToString(string fontName, string expected) { - FontDescriptor descriptor = new(fontName, 10f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point); + FontDescriptor descriptor = new( + fontName: fontName, + emSize: 10f, + style: FontStyle.Bold | FontStyle.Italic, + unit: GraphicsUnit.Point); _output.WriteLine(descriptor.ToString()); Assert.Equal(expected, descriptor.ToString()); @@ -61,10 +69,20 @@ public void FontDescriptor_ToString_culture_agnostic(string cultureName) { Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName); - FontDescriptor descriptor = new("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point); + FontDescriptor descriptor = new( + fontName: "Microsoft Sans Serif", + emSize: 8.25f, + style: FontStyle.Bold | FontStyle.Italic, + unit: GraphicsUnit.Point); _output.WriteLine(descriptor.ToString()); - Assert.Equal("new global::System.Drawing.Font(new global::System.Drawing.FontFamily(\"Microsoft Sans Serif\"), 8.25f, (global::System.Drawing.FontStyle)3, (global::System.Drawing.GraphicsUnit)3)", descriptor.ToString()); + + Assert.Equal( + expected: "new global::System.Drawing.Font(" + + "new global::System.Drawing.FontFamily(\"Microsoft Sans Serif\"), " + + "8.25f, (global::System.Drawing.FontStyle)3, " + + "(global::System.Drawing.GraphicsUnit)3)", + actual: descriptor.ToString()); } } } diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1+Test.cs deleted file mode 100644 index 6905e29ec43..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1+Test.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpAnalyzerVerifier - where TAnalyzer : DiagnosticAnalyzer, new() -{ - public class Test : CSharpAnalyzerTest - { - public Test() - { - ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.WindowsForms; - - SolutionTransforms.Add((solution, projectId) => - { - CompilationOptions compilationOptions = solution.GetProject(projectId)!.CompilationOptions!; - compilationOptions = compilationOptions.WithSpecificDiagnosticOptions( - compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings)); - solution = solution.WithProjectCompilationOptions(projectId, compilationOptions); - - return solution; - }); - } - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1.cs deleted file mode 100644 index c5acd41a904..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpAnalyzerVerifier`1.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpAnalyzerVerifier - where TAnalyzer : DiagnosticAnalyzer, new() -{ - /// - public static DiagnosticResult Diagnostic() - => CSharpAnalyzerVerifier.Diagnostic(); - - /// - public static DiagnosticResult Diagnostic(string diagnosticId) - => CSharpAnalyzerVerifier.Diagnostic(diagnosticId); - - /// - public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) - => CSharpAnalyzerVerifier.Diagnostic(descriptor); - - /// - public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) - { - Test test = new() - { - TestCode = source, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2+Test.cs deleted file mode 100644 index 99626f17ae5..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2+Test.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpCodeFixVerifier - where TAnalyzer : DiagnosticAnalyzer, new() - where TCodeFix : CodeFixProvider, new() -{ - public class Test : CSharpCodeFixTest - { - public Test() - { - ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.WindowsForms; - - SolutionTransforms.Add((solution, projectId) => - { - CompilationOptions? compilationOptions = solution.GetProject(projectId)!.CompilationOptions!; - compilationOptions = compilationOptions.WithSpecificDiagnosticOptions( - compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings)); - solution = solution.WithProjectCompilationOptions(projectId, compilationOptions); - - return solution; - }); - } - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2.cs deleted file mode 100644 index 5aab6c244b8..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeFixVerifier`2.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpCodeFixVerifier - where TAnalyzer : DiagnosticAnalyzer, new() - where TCodeFix : CodeFixProvider, new() -{ - /// - public static DiagnosticResult Diagnostic() - => CSharpCodeFixVerifier.Diagnostic(); - - /// - public static DiagnosticResult Diagnostic(string diagnosticId) - => CSharpCodeFixVerifier.Diagnostic(diagnosticId); - - /// - public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) - => CSharpCodeFixVerifier.Diagnostic(descriptor); - - /// - public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) - { - Test test = new() - { - TestCode = source, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } - - /// - public static async Task VerifyCodeFixAsync(string source, string fixedSource) - => await VerifyCodeFixAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource); - - /// - public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource) - => await VerifyCodeFixAsync(source, [expected], fixedSource); - - /// - public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource) - { - Test test = new() - { - TestCode = source, - FixedCode = fixedSource, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1+Test.cs deleted file mode 100644 index 0922d3fcc2c..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1+Test.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpCodeRefactoringVerifier - where TCodeRefactoring : CodeRefactoringProvider, new() -{ - public class Test : CSharpCodeRefactoringTest - { - public Test() - { - ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.WindowsForms; - - SolutionTransforms.Add((solution, projectId) => - { - CompilationOptions compilationOptions = solution.GetProject(projectId)!.CompilationOptions!; - compilationOptions = compilationOptions.WithSpecificDiagnosticOptions( - compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings)); - solution = solution.WithProjectCompilationOptions(projectId, compilationOptions); - - return solution; - }); - } - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1.cs deleted file mode 100644 index 871082e2705..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/CSharpCodeRefactoringVerifier`1.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class CSharpCodeRefactoringVerifier - where TCodeRefactoring : CodeRefactoringProvider, new() -{ - /// - public static async Task VerifyRefactoringAsync(string source, string fixedSource) - { - await VerifyRefactoringAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource); - } - - /// - public static async Task VerifyRefactoringAsync(string source, DiagnosticResult expected, string fixedSource) - { - await VerifyRefactoringAsync(source, [expected], fixedSource); - } - - /// - public static async Task VerifyRefactoringAsync(string source, DiagnosticResult[] expected, string fixedSource) - { - Test test = new() - { - TestCode = source, - FixedCode = fixedSource, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1+Test.cs deleted file mode 100644 index d4afd5bc2b7..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1+Test.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; -using Microsoft.CodeAnalysis.VisualBasic.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicAnalyzerVerifier - where TAnalyzer : DiagnosticAnalyzer, new() -{ - public class Test : VisualBasicAnalyzerTest - { - public Test() - { - ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.WindowsForms; - } - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1.cs deleted file mode 100644 index 7b710d40804..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicAnalyzerVerifier`1.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; -using Microsoft.CodeAnalysis.VisualBasic.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicAnalyzerVerifier - where TAnalyzer : DiagnosticAnalyzer, new() -{ - /// - public static DiagnosticResult Diagnostic() - => VisualBasicAnalyzerVerifier.Diagnostic(); - - /// - public static DiagnosticResult Diagnostic(string diagnosticId) - => VisualBasicAnalyzerVerifier.Diagnostic(diagnosticId); - - /// - public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) - => VisualBasicAnalyzerVerifier.Diagnostic(descriptor); - - /// - public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) - { - Test test = new() - { - TestCode = source, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2+Test.cs deleted file mode 100644 index 9e59d844bc6..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2+Test.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing.Verifiers; -using Microsoft.CodeAnalysis.VisualBasic.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicCodeFixVerifier - where TAnalyzer : DiagnosticAnalyzer, new() - where TCodeFix : CodeFixProvider, new() -{ - public class Test : VisualBasicCodeFixTest - { - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2.cs deleted file mode 100644 index 628fe15570c..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeFixVerifier`2.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; -using Microsoft.CodeAnalysis.VisualBasic.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicCodeFixVerifier - where TAnalyzer : DiagnosticAnalyzer, new() - where TCodeFix : CodeFixProvider, new() -{ - /// - public static DiagnosticResult Diagnostic() - => VisualBasicCodeFixVerifier.Diagnostic(); - - /// - public static DiagnosticResult Diagnostic(string diagnosticId) - => VisualBasicCodeFixVerifier.Diagnostic(diagnosticId); - - /// - public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor) - => VisualBasicCodeFixVerifier.Diagnostic(descriptor); - - /// - public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) - { - Test test = new() - { - TestCode = source, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } - - /// - public static async Task VerifyCodeFixAsync(string source, string fixedSource) - => await VerifyCodeFixAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource); - - /// - public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource) - => await VerifyCodeFixAsync(source, [expected], fixedSource); - - /// - public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource) - { - Test test = new() - { - TestCode = source, - FixedCode = fixedSource, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1+Test.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1+Test.cs deleted file mode 100644 index e4927138b71..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1+Test.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.Testing.Verifiers; -using Microsoft.CodeAnalysis.VisualBasic.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicCodeRefactoringVerifier - where TCodeRefactoring : CodeRefactoringProvider, new() -{ - public class Test : VisualBasicCodeRefactoringTest - { - } -} diff --git a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1.cs b/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1.cs deleted file mode 100644 index 183e5112075..00000000000 --- a/src/System.Windows.Forms.Analyzers/tests/UnitTests/Verifiers/VisualBasicCodeRefactoringVerifier`1.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.Testing; - -namespace System.Windows.Forms.Analyzers.Tests; - -public static partial class VisualBasicCodeRefactoringVerifier - where TCodeRefactoring : CodeRefactoringProvider, new() -{ - /// - public static async Task VerifyRefactoringAsync(string source, string fixedSource) - { - await VerifyRefactoringAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource); - } - - /// - public static async Task VerifyRefactoringAsync(string source, DiagnosticResult expected, string fixedSource) - { - await VerifyRefactoringAsync(source, [expected], fixedSource); - } - - /// - public static async Task VerifyRefactoringAsync(string source, DiagnosticResult[] expected, string fixedSource) - { - Test test = new() - { - TestCode = source, - FixedCode = fixedSource, - }; - - test.ExpectedDiagnostics.AddRange(expected); - await test.RunAsync(CancellationToken.None); - } -} diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithFontNameEditor.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithFontNameEditor.cs index bc19a4be9eb..a1cad24ff14 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithFontNameEditor.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithFontNameEditor.cs @@ -19,6 +19,7 @@ public UserControlWithFontNameEditor() [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameBold { get { return "Arial Black"; } @@ -29,6 +30,7 @@ public string FontNameBold [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameBoldItalic { get { return "Forte"; } @@ -39,6 +41,7 @@ public string FontNameBoldItalic [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameEmpty { get { return ""; } @@ -49,6 +52,7 @@ public string FontNameEmpty [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int FontNameInt { get { return -1345; } @@ -59,6 +63,7 @@ public int FontNameInt [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameInvalid { get { return "some invalid font family"; } @@ -69,6 +74,7 @@ public string FontNameInvalid [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameNull { get { return null; } @@ -79,6 +85,7 @@ public string FontNameNull [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameItalics { get { return "Lucida Handwriting"; } @@ -89,6 +96,7 @@ public string FontNameItalics [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [Category(Category)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string FontNameRegular { get { return "Arial"; } diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithObjectCollectionEditor.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithObjectCollectionEditor.cs index afd6faca6c7..de71818e490 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithObjectCollectionEditor.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/UserControls/UserControlWithObjectCollectionEditor.cs @@ -20,6 +20,7 @@ public UserControlWithObjectCollectionEditor() [EditorBrowsable(EditorBrowsableState.Always)] [Category("Accessibility")] [TypeConverter(typeof(SomeCollectionTypeConverter))] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IList AAAAAFirstCollection { get { return new List(new int[] { 1, 2, 3 }); } From af3ded918d487bf1b0a2e13ce6652a89dd923281 Mon Sep 17 00:00:00 2001 From: Loni Tra Date: Thu, 25 Jul 2024 12:17:12 -0700 Subject: [PATCH 278/342] Fix LocProject.json (#11757) fix LocProject.json --- eng/Localize/LocProject.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eng/Localize/LocProject.json b/eng/Localize/LocProject.json index 1a1ed5e0552..f215ed2e3f1 100644 --- a/eng/Localize/LocProject.json +++ b/eng/Localize/LocProject.json @@ -112,11 +112,26 @@ "CopyOption": "LangIDOnName", "OutputPath": ".\\src\\System.Windows.Forms.Analyzers\\src\\Resources\\xlf\\" }, + { + "SourceFile": ".\\src\\System.Windows.Forms.Analyzers.CodeFixes.CSharp\\Resources\\xlf\\SR.xlf", + "CopyOption": "LangIDOnName", + "OutputPath": ".\\src\\System.Windows.Forms.Analyzers.CodeFixes.CSharp\\Resources\\xlf\\" + }, + { + "SourceFile": ".\\src\\System.Windows.Forms.Analyzers.CodeFixes.VisualBasic\\Resources\\xlf\\SR.xlf", + "CopyOption": "LangIDOnName", + "OutputPath": ".\\src\\System.Windows.Forms.Analyzers.CodeFixes.VisualBasic\\Resources\\xlf\\" + }, { "SourceFile": ".\\src\\System.Windows.Forms.Analyzers.CSharp\\src\\Resources\\xlf\\SR.xlf", "CopyOption": "LangIDOnName", "OutputPath": ".\\src\\System.Windows.Forms.Analyzers.CSharp\\src\\Resources\\xlf\\" }, + { + "SourceFile": ".\\src\\System.Windows.Forms.Analyzers.VisualBasic\\src\\Resources\\xlf\\SR.xlf", + "CopyOption": "LangIDOnName", + "OutputPath": ".\\src\\System.Windows.Forms.Analyzers.VisualBasic\\src\\Resources\\xlf\\" + }, { "SourceFile": ".\\src\\System.Windows.Forms.Design\\src\\Resources\\System\\ComponentModel\\Design\\xlf\\BinaryEditor.xlf", "CopyOption": "LangIDOnName", From 6d9846bc99322a9f1e9c91c5d1d6ad7c658d34ae Mon Sep 17 00:00:00 2001 From: Leaf Shi <132890443+LeafShi1@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:04:07 +0800 Subject: [PATCH 279/342] Skip test TreeNodeIKeyboardToolTip_InvokeIsHoveredWithMouse_ReturnsExpected (#11753) --- .../Windows/Forms/TreeNode.IKeyboardToolTipTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.IKeyboardToolTipTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.IKeyboardToolTipTests.cs index 3fb3a9706b4..d578a6200db 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.IKeyboardToolTipTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.IKeyboardToolTipTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; +using System.Runtime.InteropServices; namespace System.Windows.Forms.Tests; @@ -349,6 +350,7 @@ public void TreeNodeIKeyboardToolTip_InvokeHasRtlModeEnabled_ReturnsExpected( } [WinFormsTheory] + [ActiveIssue("https://github.com/dotnet/winforms/issues/11752")] [InlineData(true, true, true)] [InlineData(true, false, false)] [InlineData(false, true, false)] @@ -358,6 +360,12 @@ public void TreeNodeIKeyboardToolTip_InvokeIsHoveredWithMouse_ReturnsExpected( bool isHovered, bool expected) { + // Skip validation on X64 due to the active issue "https://github.com/dotnet/winforms/issues/11752" + if (insideTreeView && isHovered && expected && RuntimeInformation.ProcessArchitecture == Architecture.X64) + { + return; + } + Point initialPosition = Cursor.Position; try { From 19de565cf77df54fad5498c55f4f1c3faf809af4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:42:09 +0000 Subject: [PATCH 280/342] [main] Update dependencies from dotnet/arcade (#11762) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- eng/common/cross/build-rootfs.sh | 14 +++++++------- global.json | 6 +++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 15c28835793..4f52835f7b4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -187,29 +187,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f diff --git a/eng/Versions.props b/eng/Versions.props index 1c5a132393f..6eff2d7b7b0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24374.3 - 9.0.0-beta.24374.3 - 9.0.0-beta.24374.3 + 9.0.0-beta.24375.3 + 9.0.0-beta.24375.3 + 9.0.0-beta.24375.3 17.4.0-preview-20220707-01 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 6d99d1263c0..4b5e8d7166b 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -605,18 +605,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then fi echo "Building binutils. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - fi mkdir build-binutils && cd build-binutils - ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" + ../binutils-2.42/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" make -j "$JOBS" && make install && cd .. echo "Building gcc. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + wget -O- https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + curl -SL https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - fi CFLAGS="-fPIC" CXXFLAGS="-fPIC" @@ -624,7 +624,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then CFLAGS_FOR_TARGET="-fPIC" export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET mkdir build-gcc && cd build-gcc - ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ + ../gcc-13.3.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. @@ -632,7 +632,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=https://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All" + BaseUrl="$BaseUrl/packages/SmartOS/2019Q4/${__illumosArch}/All" echo "Downloading manifest" if [[ "$__hasWget" == 1 ]]; then wget "$BaseUrl" diff --git a/global.json b/global.json index cf6d875ace4..1540499ac01 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24374.3", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24374.3", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24374.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24375.3", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24374.13" }, From bacb9f8821506abd78f18c7f65bcf8d5416064be Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:44:44 +0000 Subject: [PATCH 281/342] [main] Update dependencies from dotnet/runtime (#11763) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4f52835f7b4..5ae24cda617 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 - + https://github.com/dotnet/runtime - 4072e7377aa84559e725e450ddf1bf10d6fdf00a + 8e3896b44de039ca716c70c8ed57da576be44749 diff --git a/eng/Versions.props b/eng/Versions.props index 6eff2d7b7b0..2bfe4504252 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 6.0.0 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 - 9.0.0-rc.1.24374.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24375.13 diff --git a/global.json b/global.json index 1540499ac01..34b5a97a4ed 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24374.13" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24375.13" }, "native-tools": { "cmake": "latest" From 1d2a2b8847cd6e6781c9c78dc2bfbdbf6ac749be Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:41:00 -0700 Subject: [PATCH 282/342] [main] Update dependencies from dotnet/runtime (#11765) * Update dependencies from https://github.com/dotnet/runtime build 20240726.16 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24375.13 -> To Version 9.0.0-rc.1.24376.16 * Update dependencies from https://github.com/dotnet/runtime build 20240727.4 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24375.13 -> To Version 9.0.0-rc.1.24377.4 * Update dependencies from https://github.com/dotnet/runtime build 20240728.5 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24375.13 -> To Version 9.0.0-rc.1.24378.5 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5ae24cda617..ac809b08a6b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 - + https://github.com/dotnet/runtime - 8e3896b44de039ca716c70c8ed57da576be44749 + 0912e94a6c81f4743946831137ba6c3ec3f1a179 diff --git a/eng/Versions.props b/eng/Versions.props index 2bfe4504252..1d59b8794d2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 6.0.0 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 - 9.0.0-rc.1.24375.13 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24378.5 diff --git a/global.json b/global.json index 34b5a97a4ed..0ffa42b9a36 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24375.13" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24378.5" }, "native-tools": { "cmake": "latest" From 8e25f5a2307efb44339360bcb310a968c4fa93c0 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:52:33 +0000 Subject: [PATCH 283/342] [main] Update dependencies from dotnet/runtime (#11771) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ac809b08a6b..92156b2d1cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd - + https://github.com/dotnet/runtime - 0912e94a6c81f4743946831137ba6c3ec3f1a179 + 28c4dce2c6a9a3619faa612095ed2125d03fbecd diff --git a/eng/Versions.props b/eng/Versions.props index 1d59b8794d2..e2066c74dc5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 6.0.0 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 - 9.0.0-rc.1.24378.5 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24379.3 diff --git a/global.json b/global.json index 0ffa42b9a36..4239063576c 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24378.5" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24379.3" }, "native-tools": { "cmake": "latest" From 00b8d566610cf2383763d576c1bdad51cae4d882 Mon Sep 17 00:00:00 2001 From: Epica3055 <135201996+Epica3055@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:28:34 +0800 Subject: [PATCH 284/342] fix issue 11450 Color contrast ratio of focus indicator over 'toolStripSplitButton1' is 1.247:1 which is less than 3:1: A11y_.NET CoreWinforms_StripControls_Toolstripwithmenuitem_NonTextContrast (#11502) * fix issue 11450 Color contrast ratio of focus indicator over 'toolStripSplitButton1' is 1.247:1 which is less than 3:1: A11y_.NET CoreWinforms_StripControls_Toolstripwithmenuitem_NonTextContrast * fix unit tests * fix unit tests --- .../Forms/Controls/ToolStrips/StatusStrip.cs | 12 ------------ .../System/Windows/Forms/StatusStripTests.cs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs index 4af6c352791..339498e34ed 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs @@ -29,7 +29,6 @@ public StatusStrip() SuspendLayout(); CanOverflow = false; LayoutStyle = ToolStripLayoutStyle.Table; - RenderMode = ToolStripRenderMode.System; GripStyle = ToolStripGripStyle.Hidden; SetStyle(ControlStyles.ResizeRedraw, true); @@ -428,17 +427,6 @@ protected override void SetDisplayedItems() base.SetDisplayedItems(); } - internal override void ResetRenderMode() - { - RenderMode = ToolStripRenderMode.System; - } - - internal override bool ShouldSerializeRenderMode() - { - // We should NEVER serialize custom. - return (RenderMode is not ToolStripRenderMode.System and not ToolStripRenderMode.Custom); - } - /// /// Override this function if you want to do custom table layouts for the /// StatusStrip. The default layoutstyle is tablelayout, and we need to play diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs index 375900906f9..10c0c1e7618 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs @@ -121,8 +121,8 @@ public void StatusStrip_Ctor_Default() Assert.Null(control.Region); Assert.NotNull(control.Renderer); Assert.Same(control.Renderer, control.Renderer); - Assert.IsType(control.Renderer); - Assert.Equal(ToolStripRenderMode.System, control.RenderMode); + Assert.IsType(control.Renderer); + Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); Assert.True(control.ResizeRedraw); Assert.Equal(200, control.Right); Assert.Equal(RightToLeft.No, control.RightToLeft); @@ -554,7 +554,7 @@ public void StatusStrip_RenderMode_ResetValue_Success() control.RenderMode = ToolStripRenderMode.System; Assert.Equal(ToolStripRenderMode.System, control.RenderMode); - Assert.False(property.CanResetValue(control)); + Assert.True(property.CanResetValue(control)); control.Renderer = new SubToolStripRenderer(); Assert.Equal(ToolStripRenderMode.Custom, control.RenderMode); @@ -562,10 +562,10 @@ public void StatusStrip_RenderMode_ResetValue_Success() control.RenderMode = ToolStripRenderMode.ManagerRenderMode; Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); - Assert.True(property.CanResetValue(control)); + Assert.False(property.CanResetValue(control)); property.ResetValue(control); - Assert.Equal(ToolStripRenderMode.System, control.RenderMode); + Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); Assert.False(property.CanResetValue(control)); } @@ -582,7 +582,7 @@ public void StatusStrip_RenderMode_ShouldSerializeValue_Success() control.RenderMode = ToolStripRenderMode.System; Assert.Equal(ToolStripRenderMode.System, control.RenderMode); - Assert.False(property.ShouldSerializeValue(control)); + Assert.True(property.ShouldSerializeValue(control)); control.Renderer = new SubToolStripRenderer(); Assert.Equal(ToolStripRenderMode.Custom, control.RenderMode); @@ -590,10 +590,10 @@ public void StatusStrip_RenderMode_ShouldSerializeValue_Success() control.RenderMode = ToolStripRenderMode.ManagerRenderMode; Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); - Assert.True(property.ShouldSerializeValue(control)); + Assert.False(property.ShouldSerializeValue(control)); property.ResetValue(control); - Assert.Equal(ToolStripRenderMode.System, control.RenderMode); + Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); Assert.False(property.ShouldSerializeValue(control)); } From 7f3a0d4663aac564933d08d0da41192cb24fac2d Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 30 Jul 2024 09:38:27 -0700 Subject: [PATCH 285/342] Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2505217 (#11772) * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2505103 * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2505103 --- .../src/Resources/xlf/SR.cs.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.de.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.es.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.fr.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.it.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.ja.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.ko.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.pl.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.pt-BR.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.ru.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.tr.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.zh-Hans.xlf | 18 +++++++++--------- .../src/Resources/xlf/SR.zh-Hant.xlf | 18 +++++++++--------- .../Resources/xlf/SR.cs.xlf | 2 +- .../Resources/xlf/SR.de.xlf | 2 +- .../Resources/xlf/SR.es.xlf | 2 +- .../Resources/xlf/SR.fr.xlf | 2 +- .../Resources/xlf/SR.it.xlf | 2 +- .../Resources/xlf/SR.ja.xlf | 2 +- .../Resources/xlf/SR.ko.xlf | 2 +- .../Resources/xlf/SR.pl.xlf | 2 +- .../Resources/xlf/SR.pt-BR.xlf | 2 +- .../Resources/xlf/SR.ru.xlf | 2 +- .../Resources/xlf/SR.tr.xlf | 2 +- .../Resources/xlf/SR.zh-Hans.xlf | 2 +- .../Resources/xlf/SR.cs.xlf | 2 +- .../Resources/xlf/SR.de.xlf | 2 +- .../Resources/xlf/SR.es.xlf | 2 +- .../Resources/xlf/SR.fr.xlf | 2 +- .../Resources/xlf/SR.it.xlf | 2 +- .../Resources/xlf/SR.ja.xlf | 2 +- .../Resources/xlf/SR.ko.xlf | 2 +- .../Resources/xlf/SR.pl.xlf | 2 +- .../Resources/xlf/SR.pt-BR.xlf | 2 +- .../Resources/xlf/SR.ru.xlf | 2 +- .../Resources/xlf/SR.tr.xlf | 2 +- .../Resources/xlf/SR.zh-Hans.xlf | 2 +- .../src/Resources/xlf/SR.cs.xlf | 6 +++--- .../src/Resources/xlf/SR.de.xlf | 6 +++--- .../src/Resources/xlf/SR.es.xlf | 6 +++--- .../src/Resources/xlf/SR.fr.xlf | 6 +++--- .../src/Resources/xlf/SR.it.xlf | 6 +++--- .../src/Resources/xlf/SR.ja.xlf | 6 +++--- .../src/Resources/xlf/SR.ko.xlf | 6 +++--- .../src/Resources/xlf/SR.pl.xlf | 6 +++--- .../src/Resources/xlf/SR.pt-BR.xlf | 6 +++--- .../src/Resources/xlf/SR.ru.xlf | 6 +++--- .../src/Resources/xlf/SR.tr.xlf | 6 +++--- .../src/Resources/xlf/SR.zh-Hans.xlf | 6 +++--- .../src/Resources/xlf/SR.zh-Hant.xlf | 6 +++--- .../src/Resources/xlf/SR.cs.xlf | 6 +++--- .../src/Resources/xlf/SR.de.xlf | 6 +++--- .../src/Resources/xlf/SR.es.xlf | 6 +++--- .../src/Resources/xlf/SR.fr.xlf | 6 +++--- .../src/Resources/xlf/SR.it.xlf | 6 +++--- .../src/Resources/xlf/SR.ja.xlf | 6 +++--- .../src/Resources/xlf/SR.ko.xlf | 6 +++--- .../src/Resources/xlf/SR.pl.xlf | 6 +++--- .../src/Resources/xlf/SR.pt-BR.xlf | 6 +++--- .../src/Resources/xlf/SR.ru.xlf | 6 +++--- .../src/Resources/xlf/SR.tr.xlf | 6 +++--- .../src/Resources/xlf/SR.zh-Hans.xlf | 6 +++--- .../src/Resources/xlf/SR.zh-Hant.xlf | 6 +++--- 63 files changed, 219 insertions(+), 219 deletions(-) diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf index b7da4fa74d4..748f03398e0 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.cs.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Přidat DesignerSerializationVisibilityAttribute do vlastnosti @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Podporované jsou jen projekty, kde OutputType={0}. Unsupported project type - Unsupported project type + Nepodporovaný typ projektu ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: Vlastnost projektu {0} nemůžete nastavit na {1}. ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Vlastnost projektu {0} nemůžete nastavit na {1}. Důvod: {2}. Unsupported property value - Unsupported property value + Nepodporovaná hodnota vlastnosti A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Vlastnost by měla určit serializaci obsahu vlastnosti pomocí metody DesignerSerializationVisibilityAttribute, DefaultValueAttribute nebo ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Vlastnost {0} nekonfiguruje serializaci kódu pro obsah vlastnosti. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Chybí konfigurace serializace kódu pro obsah vlastnosti diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf index 2fc05fab64e..d4de38ebfe7 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.de.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Hinzufügen von DesignerSerializationVisibilityAttribute zur Eigenschaft @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Nur Projekte mit "OutputType={0}" werden unterstützt. Unsupported project type - Unsupported project type + Nicht unterstützter Projekttyp ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: Die Projekteigenschaft "{0}" kann nicht auf "{1}" festgelegt werden. ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: Die Projekteigenschaft "{0}" kann nicht auf "{1}" festgelegt werden. Grund: {2}. Unsupported property value - Unsupported property value + Nicht unterstützter Eigenschaftswert A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Eine Eigenschaft sollte ihre Eigenschafteninhaltsserialisierung mit der DesignerSerializationVisibilityAttribute-, DefaultValueAttribute- oder ShouldSerializeProperty-Methode bestimmen. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Die Eigenschaft "{0}" konfiguriert die Codeserialisierung für ihren Eigenschafteninhalt nicht. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Fehlende Codeserialisierungskonfiguration für Eigenschafteninhalt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf index b35d9e057e6..ec2c660fbce 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.es.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Agregar DesignerSerializationVisibilityAttribute a la propiedad @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Solo se admiten proyectos con "OutputType={0}". Unsupported project type - Unsupported project type + No se admite el tipo de proyecto ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: la propiedad de proyecto '{0}' no se puede establecer en '{1}' ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: la propiedad de proyecto "{0}" no se puede establecer en "{1}". Razón: {2}. Unsupported property value - Unsupported property value + No se admite el valor de la propiedad A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Una propiedad debe determinar su serialización de contenido de propiedad con el método DesignerSerializationVisibilityAttribute, DefaultValueAttribute o ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La propiedad "{0}" no configura la serialización de código para su contenido de propiedad Missing code serialization configuration for property content - Missing code serialization configuration for property content + Falta la configuración de serialización de código para el contenido de la propiedad diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf index 24dcdcf1ad0..aa282fc4831 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.fr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Ajouter DesignerSerializationVisibilityAttribute à une propriété @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Seuls les projets avec «OutputType={0}» pris en charge Unsupported project type - Unsupported project type + Type de projet non pris en charge ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException : la propriété de projet «{0}» ne peut pas être définie sur «{1}» ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException : la propriété de projet « {0} » ne peut pas être définie sur « {1} ». Raison : {2}. Unsupported property value - Unsupported property value + Valeur de propriété non prise en charge A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Une propriété doit déterminer la sérialisation du contenu de sa propriété avec la méthode DesignerSerializationVisibilityAttribute, DefaultValueAttribute ou ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La propriété « {0} » ne configure pas la sérialisation du code pour son contenu de propriété Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configuration de sérialisation de code manquante pour le contenu de la propriété diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf index 7d50d6648d8..aa29097ed88 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.it.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Aggiungi DesignerSerializationVisibilityAttribute alla proprietà @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Sono supportati solo i progetti con 'OutputType={0}' Unsupported project type - Unsupported project type + Tipo di progetto non supportato ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: la proprietà di progetto '{0}' non può essere impostata su '{1}' ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: la proprietà di progetto '{0}' non può essere impostata su '{1}'. Motivo: {2}. Unsupported property value - Unsupported property value + Valore di proprietà non supportato A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Una proprietà deve determinare la serializzazione del proprio contenuto con il metodo DesignerSerializationVisibilityAttribute, DefaultValueAttribute o ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La proprietà '{0}' non configura la serializzazione del codice per il relativo contenuto della proprietà Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configurazione di serializzazione del codice mancante per il contenuto della proprietà diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf index 8a882ad8d6c..72c0e22704d 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ja.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute をプロパティに追加する @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + 'OutputType ={0}' のプロジェクトのみがサポートされています Unsupported project type - Unsupported project type + サポートされていないプロジェクトの種類 ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: プロジェクト プロパティ '{0}' を '{1}' に設定することはできません ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: プロジェクト プロパティ '{0}' を '{1}' に設定することはできません。理由: {2}。 Unsupported property value - Unsupported property value + サポートされていないプロパティの値 A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + プロパティは、DesignerSerializationVisibilityAttribute メソッド、DefaultValueAttribute メソッド、または ShouldSerializeProperty メソッドを使用してプロパティ コンテンツのシリアル化を決定する必要があります。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + プロパティ '{0}' は、プロパティ コンテンツのコード シリアル化を構成しません Missing code serialization configuration for property content - Missing code serialization configuration for property content + プロパティ コンテンツのコード シリアル化構成がありません diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf index a5565e3958d..9a03b436177 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ko.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute를 속성에 추가 @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + 'OutputType={0}'인 프로젝트만 지원됨 Unsupported project type - Unsupported project type + 지원되지 않는 프로젝트 유형 ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: 프로젝트 속성 '{0}'을(를) '{1}'(으)로 설정할 수 없음 ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: 프로젝트 속성 '{0}'을(를) '{1}'(으)로 설정할 수 없습니다. 이유: {2}. Unsupported property value - Unsupported property value + 지원되지 않는 속성 값 A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 속성은 DesignerSerializationVisibilityAttribute, DefaultValueAttribute 또는 ShouldSerializeProperty 메서드를 사용하여 속성 콘텐츠 직렬화를 결정해야 합니다. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + '{0}'속성은 해당 속성 콘텐츠에 대한 코드 직렬화를 구성하지 않습니다. Missing code serialization configuration for property content - Missing code serialization configuration for property content + 속성 콘텐츠에 대한 코드 직렬화 구성이 없습니다. diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf index 6329a26a159..65b99b8e6de 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pl.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Dodaj element DesignerSerializationVisibilityAttribute do właściwości @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Obsługiwane są tylko projekty z parametrem „OutputType={0}” Unsupported project type - Unsupported project type + Nieobsługiwany typ projektu ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: Właściwość projektu „{0}” nie może mieć wartości „{1}” ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: właściwość projektu „{0}” nie może mieć wartości „{1}”. Przyczyna: {2}. Unsupported property value - Unsupported property value + Nieobsługiwana wartość właściwości A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Właściwość powinna określać serializację zawartości właściwości za pomocą metody DesignerSerializationVisibilityAttribute, DefaultValueAttribute lub ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Właściwość „{0}” nie konfiguruje serializacji kodu dla jej zawartości właściwości Missing code serialization configuration for property content - Missing code serialization configuration for property content + Brak konfiguracji serializacji kodu dla zawartości właściwości diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf index 0e7c307b8b0..5b9bf78c7a7 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.pt-BR.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Adicionar o DesignerSerializationVisibilityAttribute à propriedade @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Apenas projetos com 'OutputType={0}' suportados Unsupported project type - Unsupported project type + Tipo de projeto não suportado ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: A propriedade do projeto '{0}' não pode ser definida como '{1}' ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: A propriedade de projeto '{0}' não pode ser definida como '{1}'. Motivo: {2}. Unsupported property value - Unsupported property value + Valor de propriedade não suportado A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Uma propriedade deve determinar a serialização do conteúdo da sua propriedade com o DesignerSerializationVisibilityAttribute, DefaultValueAttribute ou o método ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + A propriedade '{0}' não configura a serialização de código para seu conteúdo de propriedade Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configuração de serialização de código ausente para o conteúdo da propriedade diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf index c018b1f9397..74762892dfb 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.ru.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Добавьте DesignerSerializationVisibilityAttribute в свойство @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Поддерживаются только проекты с "OutputType ={0}" Unsupported project type - Unsupported project type + Тип проекта не поддерживается ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: свойство проекта "{0}" не может иметь значение "{1}" ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: для свойства проекта "{0}" невозможно задать значение "{1}". Причина: {2}. Unsupported property value - Unsupported property value + Значение свойства не поддерживается A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Свойство должно определять сериализацию содержимого своего свойства с помощью свойства DesignerSerializationVisibilityAttribute, DefaultValueAttribute или метода ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Свойство "{0}" не настраивает сериализацию кода для содержимого его свойства Missing code serialization configuration for property content - Missing code serialization configuration for property content + Отсутствует конфигурация сериализации кода для содержимого свойства diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf index fa738d9bc45..27dd6def001 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.tr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Özelliğe DesignerSerializationVisibilityAttribute ekleyin @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + Yalnızca 'OutputType={0}' çıkış türüne sahip projeler destekleniyor Unsupported project type - Unsupported project type + Desteklenmeyen proje türü ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: '{0}' proje özelliği '{1}' olarak ayarlanamıyor ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: '{0}' proje özelliği '{1}' olarak ayarlanamıyor. Neden: {2}. Unsupported property value - Unsupported property value + Desteklenmeyen özellik değeri A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Bir özelliğin DesignerSerializationVisibilityAttribute, DefaultValueAttribute veya ShouldSerializeProperty yöntemiyle özellik içeriği serileştirme işlemini belirlemesi gerekir. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + '{0}' özelliği, özellik içeriği için kod serileştirme işlemini yapılandırmıyor. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Özellik içeriği için kod serileştirme yapılandırması eksik diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf index 012f5c98de4..18f3847a2d4 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hans.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 将 DesignerSerializationVisibilityAttribute 添加到属性 @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + 仅支持“OutputType={0}”的项目 Unsupported project type - Unsupported project type + 不支持的项目类型 ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: 无法将项目属性“{0}”设置为“{1}” ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: 无法将项目属性“{0}”设置为“{1}”。原因: {2}。 Unsupported property value - Unsupported property value + 不支持的属性值 A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 属性应使用 DesignerSerializationVisibilityAttribute、DefaultValueAttribute 或 ShouldSerializeProperty 方法确定其属性内容序列化。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + 属性"{0}"没有为其属性内容配置代码序列化 Missing code serialization configuration for property content - Missing code serialization configuration for property content + 缺少属性内容的代码序列化配置 diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf index 30f6ca73680..5de41b5acde 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/Resources/xlf/SR.zh-Hant.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 將 DesignerSerializationVisibilityAttribute 新增至屬性 @@ -29,42 +29,42 @@ Only projects with 'OutputType={0}' supported - Only projects with 'OutputType={0}' supported + 只支援 'OutputType={0}' 的專案 Unsupported project type - Unsupported project type + 不支援的專案類型 ArgumentException: Project property '{0}' cannot be set to '{1}' - ArgumentException: Project property '{0}' cannot be set to '{1}' + ArgumentException: 專案屬性 '{0}' 不能設定為 '{1}' ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. - ArgumentException: Project property '{0}' cannot be set to '{1}'. Reason: {2}. + ArgumentException: 專案屬性 '{0}' 不能設定為 '{1}'。原因: {2}。 Unsupported property value - Unsupported property value + 不支援的屬性值 A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 屬性應使用 DesignerSerializationVisibilityAttribute、DefaultValueAttribute 或 ShouldSerializeProperty 方法判斷其屬性內容序列化。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + 屬性 '{0}' 未設定其屬性內容的程式碼序列化 Missing code serialization configuration for property content - Missing code serialization configuration for property content + 遺失屬性內容的程式碼序列化設定 diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf index a83842a2112..4ac0fc56a0b 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.cs.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Přidat DesignerSerializationVisibilityAttribute do vlastnosti diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf index 49c8b221cfa..7abe76df012 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.de.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Hinzufügen von DesignerSerializationVisibilityAttribute zur Eigenschaft diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf index 7380b5cd7bc..8d5878f6c44 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.es.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Agregar DesignerSerializationVisibilityAttribute a la propiedad diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf index b7cf14b2a10..41aa1ba31b0 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.fr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Ajouter DesignerSerializationVisibilityAttribute à la propriété diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf index c0af323b86a..0dde25829e9 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.it.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Aggiungi DesignerSerializationVisibilityAttribute alla proprietà diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf index 338d0fd1fc7..ad39fab7ed6 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ja.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute をプロパティに追加する diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf index e1690c6d59d..3b4ba0a4683 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ko.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute를 속성에 추가 diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf index dad0b68d4ab..1e6d6d6bdad 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pl.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Dodaj element DesignerSerializationVisibilityAttribute do właściwości diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf index 6f3842c4160..0bf12612310 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.pt-BR.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Adicionar o DesignerSerializationVisibilityAttribute à propriedade diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf index 90ca9eedf16..9863901b624 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.ru.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Добавить DesignerSerializationVisibilityAttribute в свойство diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf index 9dbbad8001d..2a6a0de1c2e 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.tr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Özelliğe DesignerSerializationVisibilityAttribute ekleyin diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf index f599260bdec..c75c64389b6 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hans.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 将 DesignerSerializationVisibilityAttribute 添加到属性 diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf index a83842a2112..4ac0fc56a0b 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.cs.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Přidat DesignerSerializationVisibilityAttribute do vlastnosti diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf index 49c8b221cfa..7abe76df012 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.de.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Hinzufügen von DesignerSerializationVisibilityAttribute zur Eigenschaft diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf index 7380b5cd7bc..8d5878f6c44 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.es.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Agregar DesignerSerializationVisibilityAttribute a la propiedad diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf index b7cf14b2a10..41aa1ba31b0 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.fr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Ajouter DesignerSerializationVisibilityAttribute à la propriété diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf index c0af323b86a..0dde25829e9 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.it.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Aggiungi DesignerSerializationVisibilityAttribute alla proprietà diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf index 338d0fd1fc7..ad39fab7ed6 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ja.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute をプロパティに追加する diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf index e1690c6d59d..3b4ba0a4683 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ko.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + DesignerSerializationVisibilityAttribute를 속성에 추가 diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf index dad0b68d4ab..1e6d6d6bdad 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pl.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Dodaj element DesignerSerializationVisibilityAttribute do właściwości diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf index 6f3842c4160..0bf12612310 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.pt-BR.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Adicionar o DesignerSerializationVisibilityAttribute à propriedade diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf index 90ca9eedf16..9863901b624 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.ru.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Добавить DesignerSerializationVisibilityAttribute в свойство diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf index 9dbbad8001d..2a6a0de1c2e 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.tr.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + Özelliğe DesignerSerializationVisibilityAttribute ekleyin diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf index f599260bdec..c75c64389b6 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hans.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 将 DesignerSerializationVisibilityAttribute 添加到属性 diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf index 524e3bded45..0134692fcb3 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.cs.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Vlastnost by měla určit serializaci obsahu vlastnosti pomocí metody DesignerSerializationVisibilityAttribute, DefaultValueAttribute nebo ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Vlastnost {0} nekonfiguruje serializaci kódu pro obsah vlastnosti. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Chybí konfigurace serializace kódu pro obsah vlastnosti diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf index be4cdfec4ab..eb042f467ca 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.de.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Eine Eigenschaft sollte ihre Eigenschafteninhaltsserialisierung mit der DesignerSerializationVisibilityAttribute-, DefaultValueAttribute- oder ShouldSerializeProperty-Methode bestimmen. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Die Eigenschaft "{0}" konfiguriert die Codeserialisierung für ihren Eigenschafteninhalt nicht. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Fehlende Codeserialisierungskonfiguration für Eigenschafteninhalt diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf index dcfd72f230a..db8dc66d33d 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.es.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Una propiedad debe determinar su serialización de contenido de propiedad con el método DesignerSerializationVisibilityAttribute, DefaultValueAttribute o ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La propiedad "{0}" no configura la serialización de código para su contenido de propiedad Missing code serialization configuration for property content - Missing code serialization configuration for property content + Falta la configuración de serialización de código para el contenido de la propiedad diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf index 99eac544e11..d46010ee426 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.fr.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Une propriété doit déterminer la sérialisation du contenu de sa propriété avec la méthode DesignerSerializationVisibilityAttribute, DefaultValueAttribute ou ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La propriété « {0} » ne configure pas la sérialisation du code pour son contenu de propriété Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configuration de sérialisation de code manquante pour le contenu de la propriété diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf index b64798e47a7..8534e1d64b7 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.it.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Una proprietà deve determinare la serializzazione del proprio contenuto con il metodo DesignerSerializationVisibilityAttribute, DefaultValueAttribute o ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + La proprietà '{0}' non configura la serializzazione del codice per il relativo contenuto della proprietà Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configurazione di serializzazione del codice mancante per il contenuto della proprietà diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf index 7c5de5cff90..b4dfb280d36 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ja.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + プロパティは、DesignerSerializationVisibilityAttribute メソッド、DefaultValueAttribute メソッド、または ShouldSerializeProperty メソッドを使用してプロパティ コンテンツのシリアル化を決定する必要があります。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + プロパティ '{0}' は、プロパティ コンテンツのコード シリアル化を構成しません Missing code serialization configuration for property content - Missing code serialization configuration for property content + プロパティ コンテンツのコード シリアル化構成がありません diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf index 71349ef0c2a..bca31adf788 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ko.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 속성은 DesignerSerializationVisibilityAttribute, DefaultValueAttribute 또는 ShouldSerializeProperty 메서드를 사용하여 속성 콘텐츠 직렬화를 결정해야 합니다. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + '{0}'속성은 해당 속성 콘텐츠에 대한 코드 직렬화를 구성하지 않습니다. Missing code serialization configuration for property content - Missing code serialization configuration for property content + 속성 콘텐츠에 대한 코드 직렬화 구성이 없습니다. diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf index dd2eb4d6a38..9f1d02111d9 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pl.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Właściwość powinna określać serializację zawartości właściwości za pomocą metody DesignerSerializationVisibilityAttribute, DefaultValueAttribute lub ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Właściwość „{0}” nie konfiguruje serializacji kodu dla jej zawartości właściwości Missing code serialization configuration for property content - Missing code serialization configuration for property content + Brak konfiguracji serializacji kodu dla zawartości właściwości diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf index a8ec4b7736a..7ee4da2d575 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.pt-BR.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Uma propriedade deve determinar a serialização do conteúdo da propriedade com o método DesignerSerializationVisibilityAttribute, DefaultValueAttribute ou ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + A propriedade '{0}' não configura a serialização de código para seu conteúdo de propriedade Missing code serialization configuration for property content - Missing code serialization configuration for property content + Configuração de serialização de código ausente para o conteúdo da propriedade diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf index e096b18db92..432896de694 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.ru.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Свойство должно определять сериализацию содержимого своего свойства с помощью свойства DesignerSerializationVisibilityAttribute, DefaultValueAttribute или метода ShouldSerializeProperty. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + Свойство "{0}" не настраивает сериализацию кода для содержимого его свойства Missing code serialization configuration for property content - Missing code serialization configuration for property content + Отсутствует конфигурация сериализации кода для содержимого свойства diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf index 629ce04899e..981fb62bb67 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.tr.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + Bir özelliğin DesignerSerializationVisibilityAttribute, DefaultValueAttribute veya ShouldSerializeProperty yöntemiyle özellik içeriği serileştirme işlemini belirlemesi gerekir. Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + '{0}' özelliği, özellik içeriği için kod serileştirme işlemini yapılandırmıyor. Missing code serialization configuration for property content - Missing code serialization configuration for property content + Özellik içeriği için kod serileştirme yapılandırması eksik diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf index 5d73d81a966..9055c3ad7cd 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hans.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 属性应使用 DesignerSerializationVisibilityAttribute、DefaultValueAttribute 或 ShouldSerializeProperty 方法确定其属性内容序列化。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + 属性"{0}"没有为其属性内容配置代码序列化 Missing code serialization configuration for property content - Missing code serialization configuration for property content + 缺少属性内容的代码序列化配置 diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf index ebee57c24ac..03038e20315 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Resources/xlf/SR.zh-Hant.xlf @@ -4,17 +4,17 @@ A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. - A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method. + 屬性應使用 DesignerSerializationVisibilityAttribute、DefaultValueAttribute 或 ShouldSerializeProperty 方法判斷其屬性內容序列化。 Property '{0}' does not configure the code serialization for its property content - Property '{0}' does not configure the code serialization for its property content + 屬性 '{0}' 未設定其屬性內容的程式碼序列化 Missing code serialization configuration for property content - Missing code serialization configuration for property content + 遺失屬性內容的程式碼序列化設定 diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf index 53504c96e5a..11c65058d54 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.cs.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Odeberte z {0} nastavení vysokého rozlišení DPI a použijte ke konfiguraci rozhraní API Application.SetHighDpiMode nebo vlastnost projektu {1}. Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Odeberte z {0} nastavení vysokého rozlišení DPI a použijte ke konfiguraci vlastnost {1} v aplikačním frameworku. Unsupported high DPI configuration - Unsupported high DPI configuration + Nepodporovaná konfigurace vysokého rozlišení DPI diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf index e00efde08ce..0aa9d6532c6 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.de.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Entfernen Sie Einstellungen mit hohem DPI-Wert aus {0} und konfigurieren Sie sie über die Application.SetHighDpiMode-API oder die Projekteigenschaft "{1}". Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Entfernen Sie Einstellungen mit hohem DPI-Wert aus {0} und konfigurieren Sie sie über die Eigenschaft "{1}" in Application Framework. Unsupported high DPI configuration - Unsupported high DPI configuration + Nicht unterstützte Konfiguration mit hohem DPI-Wert diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf index 6dfdb4380d9..e05d003807e 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.es.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Quitar la configuración con valores altos de PPP de {0} y configurar a través de la aplicación API SetHighDpiMode o a través de la propiedad del proyecto '{1}'. Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Quitar la configuración con valores altos de PPP de {0} y configurar a través de la propiedad '{1}' en el marco de trabajo de la aplicación Unsupported high DPI configuration - Unsupported high DPI configuration + Configuración de PPP alta no admitida diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf index 1c0851279af..dda71699cef 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.fr.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Supprimez les paramètres haute résolution de {0} et configurez-les via l’API Application.SetHighDpiMode ou la propriété de projet «{1}» Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Supprimer les paramètres haute résolution de {0} et configurer via la propriété «{1}» dans Application Framework Unsupported high DPI configuration - Unsupported high DPI configuration + Configuration haute résolution non prise en charge diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf index 6555d0e84fd..7e39109e643 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.it.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Rimuovere le impostazioni della risoluzione elevata da {0} e configurare tramite l'API Application.SetHighDpiMode o la proprietà di progetto '{1}' Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Rimuovere le impostazioni della risoluzione elevata da {0} e configurare tramite la proprietà '{1}' in Framework applicazione Unsupported high DPI configuration - Unsupported high DPI configuration + Configurazione per risoluzione elevata non supportata diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf index fc2364f2d5c..74c62c6a959 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ja.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + 高 DPI 設定を {0} から削除し、Application.SetHighDpiMode API または '{1}' プロジェクト プロパティを使用して構成します Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + 高 DPI 設定を {0} から削除し、アプリケーション フレームワークの '{1}' プロパティを使用して構成します Unsupported high DPI configuration - Unsupported high DPI configuration + サポートされていない高 DPI 構成 diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf index 35064e57ee1..86c4cded946 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ko.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + {0}에서 높은 DPI 설정을 제거하고 Application.SetHighDpiMode API 또는 '{1}' 프로젝트 속성을 통해 구성 Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + {0}에서 높은 DPI 설정을 제거하고 Application Framework의 '{1}' 속성을 통해 구성 Unsupported high DPI configuration - Unsupported high DPI configuration + 지원되지 않는 높은 DPI 구성 diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf index 68e4f9ab65f..4039a92c63e 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pl.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Usuń ustawienia wysokiej rozdzielczości DPI z {0}i skonfiguruj za pomocą interfejsu API Application.SetHighDpiMode lub właściwości projektu „{1}” Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Usuń ustawienia wysokiej rozdzielczości DPI z {0}and skonfiguruj za pomocą właściwości „{1}” w programie Application Framework Unsupported high DPI configuration - Unsupported high DPI configuration + Nieobsługiwana konfiguracja wysokiej rozdzielczości DPI diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf index 285c0002c2e..443b82cc531 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.pt-BR.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Remova as configurações de DPI alto de {0} e configure por meio da API Application.SetHighDpiMode ou da propriedade do projeto '{1}' Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Remova as configurações de DPI alto de {0} e configure por meio da propriedade '{1}' no Application Framework Unsupported high DPI configuration - Unsupported high DPI configuration + Configuração de alta DPI não suportada diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf index 2a1b5f2fd2f..8c31c777cda 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.ru.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Удалить параметры высокого DPI из "{0}" и настроить через API приложения Application.SetHighDpiMode или свойство проекта "{1}" Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Удалить параметры высокого DPI из {0} и настроить через свойство "{1}" в исполняющей среде Unsupported high DPI configuration - Unsupported high DPI configuration + Неподдерживаемая конфигурация высокого DPI diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf index 2a8b4a55f7e..10b9f094449 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.tr.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + Yüksek DPI ayarlarını {0} bileşeninden kaldırın ve Application.SetHighDpiMode API’si veya '{1}' proje özelliği aracılığıyla yapılandırın Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + Yüksek DPI ayarlarını {0} bileşeninden kaldırın ve Uygulama Çerçevesi’ndeki '{1}' özelliği aracılığıyla yapılandırın Unsupported high DPI configuration - Unsupported high DPI configuration + Desteklenmeyen yüksek DPI yapılandırması diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf index ae612122627..61531e262e3 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hans.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + 从 {0} 中删除高 DPI 设置,并通过 Application.SetHighDpiMode API 或“{1}”项目属性进行配置 Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + 从 {0} 中删除高 DPI 设置,并通过应用程序框架中的“{1}”属性进行配置 Unsupported high DPI configuration - Unsupported high DPI configuration + 不支持的高 DPI 配置 diff --git a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf index fd34c52dba4..f318db92b99 100644 --- a/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers/src/Resources/xlf/SR.zh-Hant.xlf @@ -4,17 +4,17 @@ Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property - Remove high DPI settings from {0} and configure via Application.SetHighDpiMode API or '{1}' project property + 從 {0} 移除高 DPI 設定,並透過Application.SetHighDpiMode API 或 '{1}' 專案屬性進行設定 Remove high DPI settings from {0} and configure via '{1}' property in Application Framework - Remove high DPI settings from {0} and configure via '{1}' property in Application Framework + 從 {0} 移除高 DPI 設定,並透過應用程式架構中的 '{1}' 屬性進行設定 Unsupported high DPI configuration - Unsupported high DPI configuration + 不支援的高 DPI 設定 From 6476dfac01f7954918fa65b3797109545baf861d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:29:41 +0000 Subject: [PATCH 286/342] [main] Update dependencies from dotnet/runtime (#11777) * Update dependencies from https://github.com/dotnet/runtime build 20240729.9 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24379.3 -> To Version 9.0.0-rc.1.24379.9 * Update dependencies from https://github.com/dotnet/runtime build 20240730.2 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24379.3 -> To Version 9.0.0-rc.1.24380.2 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 92156b2d1cf..9e4e0ef3e42 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a - + https://github.com/dotnet/runtime - 28c4dce2c6a9a3619faa612095ed2125d03fbecd + 7ed15a215d19e7391406e676191bf44c7a44281a diff --git a/eng/Versions.props b/eng/Versions.props index e2066c74dc5..3a1bcf8d963 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 6.0.0 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 - 9.0.0-rc.1.24379.3 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.2 diff --git a/global.json b/global.json index 4239063576c..7d8629f9d8f 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24379.3" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24380.2" }, "native-tools": { "cmake": "latest" From 2b1da781241f66f3fd30450bc0135c6ae2ce792e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:42:35 +0000 Subject: [PATCH 287/342] [main] Update dependencies from dotnet/runtime (#11786) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9e4e0ef3e42..59eadf78c68 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 - + https://github.com/dotnet/runtime - 7ed15a215d19e7391406e676191bf44c7a44281a + c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 diff --git a/eng/Versions.props b/eng/Versions.props index 3a1bcf8d963..60d121baec0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 6.0.0 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 - 9.0.0-rc.1.24380.2 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24380.7 diff --git a/global.json b/global.json index 7d8629f9d8f..27abc4dc48c 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24380.2" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24380.7" }, "native-tools": { "cmake": "latest" From 51100a54e3073906294aae74ba0597988fe7b67a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:43:09 +0000 Subject: [PATCH 288/342] [main] Update dependencies from dotnet/arcade (#11776) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- global.json | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 59eadf78c68..3812bc6027a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -187,29 +187,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 diff --git a/eng/Versions.props b/eng/Versions.props index 60d121baec0..084f9822ed0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24375.3 - 9.0.0-beta.24375.3 - 9.0.0-beta.24375.3 + 9.0.0-beta.24379.1 + 9.0.0-beta.24379.1 + 9.0.0-beta.24379.1 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 27abc4dc48c..f8ae9c660e4 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24375.3", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24375.3", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24375.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.1", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24379.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24379.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24380.7" }, From 3c7de215b5df6558edc8a39b36367b9140fe1d2b Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 31 Jul 2024 09:57:07 -0700 Subject: [PATCH 289/342] Defer GDI+ initialization to first PInvoke access (#11781) Initializing GDI+ on module load left GDI+ with a stale DPI setting. It has to come after the call to Application.SetHighDpiMode. Fixes 11608 There is one case where we can call a GDI+ PInvoke in Core before we call any in System.Drawing (creating a Graphics object from HWND). I've moved the initialization down and explicitly validated initialization in this case and in one other possible location in Core where we might use GDI+ before we've ever called something in System.Drawing's interop. --- .../src/ModuleInitializer.cs | 19 ------------ .../src/NativeMethods.txt | 2 -- .../src/System/Drawing/Gdiplus.cs | 31 +++++-------------- .../src/System/Drawing/Graphics.cs | 5 +++ .../System/Drawing/ToolboxBitmapAttribute.cs | 3 -- .../src/Windows/Win32/PInvoke.cs | 17 ++++++++++ .../src/NativeMethods.txt | 2 ++ .../System/Drawing/ImageCodecInfoHelper.cs | 2 ++ .../Graphics/GdiPlus/GdiPlusInitialization.cs | 27 ++++++++++++++++ .../Graphics/GdiPlus/GdiplusStartupInputEx.cs | 0 10 files changed, 60 insertions(+), 48 deletions(-) delete mode 100644 src/System.Drawing.Common/src/ModuleInitializer.cs create mode 100644 src/System.Drawing.Common/src/Windows/Win32/PInvoke.cs create mode 100644 src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiPlusInitialization.cs rename src/{System.Drawing.Common => System.Private.Windows.Core}/src/Windows/Win32/Graphics/GdiPlus/GdiplusStartupInputEx.cs (100%) diff --git a/src/System.Drawing.Common/src/ModuleInitializer.cs b/src/System.Drawing.Common/src/ModuleInitializer.cs deleted file mode 100644 index e3ae64d339f..00000000000 --- a/src/System.Drawing.Common/src/ModuleInitializer.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace System.Drawing; - -internal static class ModuleInitializer -{ -#pragma warning disable CA2255 // The 'ModuleInitializer' attribute should not be used in libraries - [ModuleInitializer] -#pragma warning restore CA2255 - public static void InitializeModule() - { - // Ensure GDI+ is initialized with the module. - bool initialized = Gdip.Initialized; - Debug.Assert(initialized); - } -} diff --git a/src/System.Drawing.Common/src/NativeMethods.txt b/src/System.Drawing.Common/src/NativeMethods.txt index 544adc231a7..ac7e0fad4d8 100644 --- a/src/System.Drawing.Common/src/NativeMethods.txt +++ b/src/System.Drawing.Common/src/NativeMethods.txt @@ -376,8 +376,6 @@ GdipLoadImageFromFile GdipLoadImageFromFileICM GdipLoadImageFromStream GdipLoadImageFromStreamICM -GdiplusStartup -GdiplusStartupInputEx GdipMeasureCharacterRanges GdipMeasureString GdipMultiplyLineTransform diff --git a/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs b/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs index 9ebc83ed2cf..84615dbfa17 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs @@ -8,12 +8,12 @@ namespace System.Drawing; internal static partial class Gdip { - private static readonly nuint s_initToken = Init(); + private static readonly bool s_initialized = Init(); [ThreadStatic] private static IDictionary? t_threadData; - private static unsafe nuint Init() + private static unsafe bool Init() { if (!OperatingSystem.IsWindows()) { @@ -21,35 +21,18 @@ private static unsafe nuint Init() throw new PlatformNotSupportedException(SR.PlatformNotSupported_Unix)); } - Debug.Assert(s_initToken == 0, "GdiplusInitialization: Initialize should not be called more than once in the same domain!"); - - // GDI+ ref counts multiple calls to Startup in the same process, so calls from multiple - // domains are ok, just make sure to pair each w/GdiplusShutdown - - nuint token; - GdiplusStartupInputEx startup = GdiplusStartupInputEx.GetDefault(); - Status status = PInvoke.GdiplusStartup(&token, (GdiplusStartupInput*)&startup, null); - CheckStatus(status); - return token; + return GdiPlusInitialization.EnsureInitialized(); } - /// - /// Returns true if GDI+ has been started, but not shut down - /// - internal static bool Initialized => s_initToken != 0; + internal static bool Initialized => s_initialized; /// - /// This property will give us back a dictionary we can use to store all of our static brushes and pens on - /// a per-thread basis. This way we can avoid 'object in use' crashes when different threads are - /// referencing the same drawing object. + /// This property will give us back a dictionary we can use to store all of our static brushes and pens on + /// a per-thread basis. This way we can avoid 'object in use' crashes when different threads are + /// referencing the same drawing object. /// internal static IDictionary ThreadData => t_threadData ??= new Dictionary(); - // Used to ensure static constructor has run. - internal static void DummyFunction() - { - } - internal static void CheckStatus(Status status) => status.ThrowIfFailed(); internal static Exception StatusException(Status status) => status.GetException(); diff --git a/src/System.Drawing.Common/src/System/Drawing/Graphics.cs b/src/System.Drawing.Common/src/System/Drawing/Graphics.cs index 3d4fed66f4a..e5f16e4be0b 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Graphics.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Graphics.cs @@ -114,6 +114,11 @@ public static Graphics FromHdc(IntPtr hdc, IntPtr hdevice) public static Graphics FromHwndInternal(IntPtr hwnd) { GpGraphics* nativeGraphics; + + // This is one of the few places we need to manually ensure GDI+ is initialized. Other calls to PInvoke will do + // this automatically, PInvokeCore cannot and as such needs to be manually initialized if we've never called + // another PInvoke method. + GdiPlusInitialization.EnsureInitialized(); Gdip.CheckStatus(PInvokeCore.GdipCreateFromHWND((HWND)hwnd, &nativeGraphics)); return new Graphics(nativeGraphics); } diff --git a/src/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.cs b/src/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.cs index f2eee019640..57aca30c32a 100644 --- a/src/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.cs +++ b/src/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.cs @@ -311,9 +311,6 @@ private static void MakeBackgroundAlphaZero(Bitmap img) #pragma warning disable CA1810 // DummyFunction apparently needs to be invoked prior to the rest of the initialization static ToolboxBitmapAttribute() { - // When we call Gdip.DummyFunction, JIT will make sure Gdip..cctor will be called. - Gdip.DummyFunction(); - Stream? stream = BitmapSelector.GetResourceStream(typeof(ToolboxBitmapAttribute), "DefaultComponent.bmp"); Debug.Assert(stream is not null, "DefaultComponent.bmp must be present as an embedded resource."); diff --git a/src/System.Drawing.Common/src/Windows/Win32/PInvoke.cs b/src/System.Drawing.Common/src/Windows/Win32/PInvoke.cs new file mode 100644 index 00000000000..edd40371aec --- /dev/null +++ b/src/System.Drawing.Common/src/Windows/Win32/PInvoke.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Drawing; + +namespace Windows.Win32; + +internal static partial class PInvoke +{ + static PInvoke() + { + // Ensure GDI+ is initialized before the first PInvoke call. Note that this has to happen after + // the DPI awareness context is set for scaling to occur correctly. + bool initialized = Gdip.Initialized; + Debug.Assert(initialized); + } +} diff --git a/src/System.Private.Windows.Core/src/NativeMethods.txt b/src/System.Private.Windows.Core/src/NativeMethods.txt index d8c2ca6a07a..d40fdf2e645 100644 --- a/src/System.Private.Windows.Core/src/NativeMethods.txt +++ b/src/System.Private.Windows.Core/src/NativeMethods.txt @@ -73,6 +73,8 @@ GdipGetImagePixelFormat GdipGetImageRawFormat GdipGetRegionHRgn GdipIsInfiniteRegion +GdiplusStartup +GdiplusStartupInputEx GdipSaveImageToStream GetClientRect GetClipRgn diff --git a/src/System.Private.Windows.Core/src/System/Drawing/ImageCodecInfoHelper.cs b/src/System.Private.Windows.Core/src/System/Drawing/ImageCodecInfoHelper.cs index 0cf37485c1f..4e33755bcff 100644 --- a/src/System.Private.Windows.Core/src/System/Drawing/ImageCodecInfoHelper.cs +++ b/src/System.Private.Windows.Core/src/System/Drawing/ImageCodecInfoHelper.cs @@ -36,6 +36,8 @@ private static unsafe (Guid Format, Guid Encoder)[] Encoders { if (s_encoders is null) { + GdiPlusInitialization.EnsureInitialized(); + uint numEncoders; uint size; diff --git a/src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiPlusInitialization.cs b/src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiPlusInitialization.cs new file mode 100644 index 00000000000..f5dc769a4ee --- /dev/null +++ b/src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiPlusInitialization.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Windows.Win32.Graphics.GdiPlus; + +internal static partial class GdiPlusInitialization +{ + private static readonly nuint s_initToken = Init(); + + private static unsafe nuint Init() + { + Debug.Assert(s_initToken == 0, "GdiplusInitialization: Initialize should not be called more than once!"); + + // GDI+ ref counts multiple calls to Startup in the same process, so calls from multiple + // domains are ok, just make sure to pair each w/GdiplusShutdown + + nuint token; + GdiplusStartupInputEx startup = GdiplusStartupInputEx.GetDefault(); + PInvokeCore.GdiplusStartup(&token, (GdiplusStartupInput*)&startup, null).ThrowIfFailed(); + return token; + } + + /// + /// Returns true if GDI+ has been started. + /// + internal static bool EnsureInitialized() => s_initToken != 0; +} diff --git a/src/System.Drawing.Common/src/Windows/Win32/Graphics/GdiPlus/GdiplusStartupInputEx.cs b/src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiplusStartupInputEx.cs similarity index 100% rename from src/System.Drawing.Common/src/Windows/Win32/Graphics/GdiPlus/GdiplusStartupInputEx.cs rename to src/System.Private.Windows.Core/src/Windows/Win32/Graphics/GdiPlus/GdiplusStartupInputEx.cs From 52b89d61f6bc09ecc886af0ce7550324d2da49a4 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 31 Jul 2024 16:04:33 -0700 Subject: [PATCH 290/342] Handle null PropertyDescriptor in PropertyGrid value set event (#11787) It is possible to not have a PropertyDescriptor, we should handle that case. Fixes #11768 --- .../Forms/Controls/PropertyGrid/PropertyGrid.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs index 0a458fe6f86..b760fd4b26f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs @@ -2941,20 +2941,16 @@ internal void OnPropertyValueSet(GridItem changedItem, object? oldValue) return; } - // Announce the property value change like standalone combobox control do: "[something] selected". + // Announce the property value change like standalone combobox control does: "[something] selected". bool dropDown = false; - Type propertyType = changedItem.PropertyDescriptor!.PropertyType; - var editor = (UITypeEditor?)TypeDescriptor.GetEditor(propertyType, typeof(UITypeEditor)); - if (editor is not null) + if (changedItem.PropertyDescriptor?.PropertyType is { } propertyType + && TypeDescriptor.GetEditor(propertyType, typeof(UITypeEditor)) is UITypeEditor editor) { dropDown = editor.GetEditStyle() == UITypeEditorEditStyle.DropDown; } - else + else if (changedItem is GridEntry gridEntry && gridEntry.Enumerable) { - if (changedItem is GridEntry gridEntry && gridEntry.Enumerable) - { - dropDown = true; - } + dropDown = true; } if (IsAccessibilityObjectCreated && dropDown && !_gridView.DropDownVisible) From f67b7e51533bf877a54465f10dac978e83cfad0c Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 31 Jul 2024 16:25:24 -0700 Subject: [PATCH 291/342] Put back AddStatement call in CodeDomSerializer (#11788) Overlooked in the code review when removing the tracing. I've done a full review twice. Two other small tweaks to WriteResource to remove the TraceScope name. --- .../Serialization/CodeDomSerializerBase.cs | 5 ++++- .../Serialization/ResourceCodeDomSerializer.cs | 17 +++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomSerializerBase.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomSerializerBase.cs index d069e776911..398af088d54 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomSerializerBase.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomSerializerBase.cs @@ -2601,6 +2601,8 @@ internal static void FillStatementTable(IDesignerSerializationManager manager, I } else if (statement is CodeVariableDeclarationStatement variableDecl) { + AddStatement(table, variableDecl.Name, variableDecl); + if (names is not null && variableDecl.Type is not null && !string.IsNullOrEmpty(variableDecl.Type.BaseType)) { names[variableDecl.Name] = GetTypeNameFromCodeTypeReference(manager, variableDecl.Type); @@ -2611,7 +2613,8 @@ internal static void FillStatementTable(IDesignerSerializationManager manager, I if (expression is not null) { - // Simplify the expression as much as we can, looking for our target object in the process. If we find an expression that refers to our target object, we're done and can move on to the next statement. + // Simplify the expression as much as we can, looking for our target object in the process. If we find an + // expression that refers to our target object, we're done and can move on to the next statement. while (true) { if (expression is CodeCastExpression castEx) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.cs index ca0643bb468..4d871f7c71b 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.cs @@ -351,26 +351,23 @@ public static void SerializeMetadata(IDesignerSerializationManager manager, stri } /// - /// Serializes the given resource value into the resource set. This does not effect the code dom values. The resource is written into the current culture. + /// Serializes the given resource value into the resource set. This does not effect the code dom values. + /// The resource is written into the current culture. /// public static void WriteResource(IDesignerSerializationManager manager, string name, object? value) { - SetValueUsingCommonTraceScope(manager, name, value, false, false, true, false); + SerializationResourceManager sm = GetResourceManager(manager); + sm.SetValue(manager, name, value, forceInvariant: false, shouldSerializeInvariant: false, ensureInvariant: true, applyingCachedResources: false); } /// - /// Serializes the given resource value into the resource set. This does not effect the code dom values. The resource is written into the invariant culture. + /// Serializes the given resource value into the resource set. This does not effect the code dom values. + /// The resource is written into the invariant culture. /// public static void WriteResourceInvariant(IDesignerSerializationManager manager, string name, object? value) - { - SetValueUsingCommonTraceScope(manager, name, value, true, true, true, false); - } - - private static void SetValueUsingCommonTraceScope(IDesignerSerializationManager manager, string name, object? value, - bool forceInvariant, bool shouldSerializeInvariant, bool ensureInvariant, bool applyingCachedResources) { SerializationResourceManager sm = GetResourceManager(manager); - sm.SetValue(manager, name, value, forceInvariant, shouldSerializeInvariant, ensureInvariant, applyingCachedResources); + sm.SetValue(manager, name, value, forceInvariant: true, shouldSerializeInvariant: true, ensureInvariant: true, applyingCachedResources: false); } /// From bb6335df3fb5a1f5fede177f89f32fd334ff8ded Mon Sep 17 00:00:00 2001 From: Leaf Shi <132890443+LeafShi1@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:39:43 +0800 Subject: [PATCH 292/342] Issue 11760 fix tool strip combo box display (#11761) * Render narrow drop down button for ToolStripComboBox --- .../Controls/ComboBox/ComboBox.FlatComboAdapter.cs | 13 +++++++++++-- .../Windows/Forms/Controls/ComboBox/ComboBox.cs | 2 +- ...oBoxControl.ToolStripComboBoxFlatComboAdapter.cs | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.FlatComboAdapter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.FlatComboAdapter.cs index 46bc2020571..75d96c937e5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.FlatComboAdapter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.FlatComboAdapter.cs @@ -23,7 +23,9 @@ internal class FlatComboAdapter private const int OFFSET_2PIXELS = 2; protected static int s_offsetPixels = OFFSET_2PIXELS; - public FlatComboAdapter(ComboBox comboBox, bool smallButton) + private bool ShouldRedrawAsSmallButton { get; } + + public FlatComboAdapter(ComboBox comboBox, bool shouldRedrawAsSmallButton) { // adapter is re-created when combobox is resized, see IsValid method, thus we don't need to handle DPI changed explicitly s_offsetPixels = comboBox.LogicalToDeviceUnits(OFFSET_2PIXELS); @@ -35,8 +37,10 @@ public FlatComboAdapter(ComboBox comboBox, bool smallButton) _innerInnerBorder = new Rectangle(_innerBorder.X + 1, _innerBorder.Y + 1, _innerBorder.Width - 2, _innerBorder.Height - 2); _dropDownRect = new Rectangle(_innerBorder.Right + 1, _innerBorder.Y, dropDownButtonWidth, _innerBorder.Height + 1); + ShouldRedrawAsSmallButton = shouldRedrawAsSmallButton; + // fill in several pixels of the dropdown rect with white so that it looks like the combo button is thinner. - if (smallButton) + if (shouldRedrawAsSmallButton) { _whiteFillRect = _dropDownRect; _whiteFillRect.Width = WhiteFillRectWidth; @@ -67,6 +71,11 @@ public virtual void DrawPopUpCombo(ComboBox comboBox, Graphics g) return; } + if (ShouldRedrawAsSmallButton) + { + DrawFlatCombo(comboBox, g); + } + bool rightToLeft = comboBox.RightToLeft == RightToLeft.Yes; // Draw a dark border around everything if we're in popup mode diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs index c9baff3b0bf..02533f34e1d 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs @@ -3976,5 +3976,5 @@ private FlatComboAdapter FlatComboBoxAdapter } internal virtual FlatComboAdapter CreateFlatComboAdapterInstance() - => new(this, smallButton: false); + => new(this, shouldRedrawAsSmallButton: false); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs index 155717838db..da96be6fc91 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs @@ -12,7 +12,7 @@ internal partial class ToolStripComboBoxControl : ComboBox { internal class ToolStripComboBoxFlatComboAdapter : FlatComboAdapter { - public ToolStripComboBoxFlatComboAdapter(ComboBox comboBox) : base(comboBox, smallButton: true) + public ToolStripComboBoxFlatComboAdapter(ComboBox comboBox) : base(comboBox, shouldRedrawAsSmallButton: true) { } From 42f465f9753b00fee80f58c9d74686776a50861f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:28:14 +0000 Subject: [PATCH 293/342] [main] Update dependencies from dotnet/runtime (#11798) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3812bc6027a..8ef059c990e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca - + https://github.com/dotnet/runtime - c86bcbb7a573bb09fcb1f4fcd7bc24323e9d6f44 + 7f2b222f92d323b7ca522a06c7116f1ec25d12ca diff --git a/eng/Versions.props b/eng/Versions.props index 084f9822ed0..22888382505 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 6.0.0 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 - 9.0.0-rc.1.24380.7 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24381.5 diff --git a/global.json b/global.json index f8ae9c660e4..8ecc09e2a5c 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24379.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24379.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24380.7" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24381.5" }, "native-tools": { "cmake": "latest" From e2ec84cb8bb93ff24cf227c974ae57852eaabb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20L=C3=B6ffelmann?= <9663150+KlausLoeffelmann@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:17:14 -0700 Subject: [PATCH 294/342] Update Analyzer docs and number groups. (#11791) * Update Analyzer docs and number groups. * Address review feedback. --- .../analyzers}/AppManifestAnalyzer.Help.md | 2 +- .../ApplicationConfigurationGenerator.Help.md | 4 +- docs/analyzers/Experimental.Help.md | 10 +++++ .../analyzers/WinFormsCSharpAnalyzers.Help.md | 39 +++++++++++++++++++ .../WinFormsVisualBasicAnalyzers.Help.md | 39 +++++++++++++++++++ docs/analyzers/akams.txt | 7 ++++ .../src/AnalyzerReleases.Unshipped.md | 4 +- ...stem.Windows.Forms.Analyzers.CSharp.csproj | 3 +- ...Windows.Forms.Analyzers.VisualBasic.vbproj | 4 ++ .../src/System.Windows.Forms.Analyzers.csproj | 7 +++- .../Analyzers/Diagnostics/DiagnosticIDs.cs | 9 +++-- 11 files changed, 117 insertions(+), 11 deletions(-) rename {src/System.Windows.Forms.Analyzers => docs/analyzers}/AppManifestAnalyzer.Help.md (92%) rename {src/System.Windows.Forms.Analyzers.CSharp => docs/analyzers}/ApplicationConfigurationGenerator.Help.md (91%) create mode 100644 docs/analyzers/Experimental.Help.md create mode 100644 docs/analyzers/WinFormsCSharpAnalyzers.Help.md create mode 100644 docs/analyzers/WinFormsVisualBasicAnalyzers.Help.md create mode 100644 docs/analyzers/akams.txt diff --git a/src/System.Windows.Forms.Analyzers/AppManifestAnalyzer.Help.md b/docs/analyzers/AppManifestAnalyzer.Help.md similarity index 92% rename from src/System.Windows.Forms.Analyzers/AppManifestAnalyzer.Help.md rename to docs/analyzers/AppManifestAnalyzer.Help.md index e051c99b6ff..411c30f47c9 100644 --- a/src/System.Windows.Forms.Analyzers/AppManifestAnalyzer.Help.md +++ b/docs/analyzers/AppManifestAnalyzer.Help.md @@ -7,7 +7,7 @@ are automatically referenced for Window Forms .NET applications. `AppManifestAnalyzer` is automatically invoked when a Windows Forms application (`OutputType=Exe` or `OutputType=WinExe`) has a custom app.manifest. -## [WFAC010](https://aka.ms/winforms-warnings/WFAC010): Unsupported high DPI configuration. +## [WFO0003](https://aka.ms/winforms-warnings/WFAC010): Unsupported high DPI configuration. Windows Forms applications should specify application DPI-awareness via the [application configuration](https://aka.ms/applicationconfiguration) or [`Application.SetHighDpiMode` API](https://docs.microsoft.com/dotnet/api/system.windows.forms.application.sethighdpimode). diff --git a/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md b/docs/analyzers/ApplicationConfigurationGenerator.Help.md similarity index 91% rename from src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md rename to docs/analyzers/ApplicationConfigurationGenerator.Help.md index 235896d2ed6..8e16f0043a5 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md +++ b/docs/analyzers/ApplicationConfigurationGenerator.Help.md @@ -19,7 +19,7 @@ public static void Initialize() For more information on application configuration refer to https://aka.ms/applicationconfiguration. -## [WFAC001](https://aka.ms/winforms-warnings/WFAC001): Unsupported project type. +## [WFO0001](https://aka.ms/winforms-warnings/WFAC001): Unsupported project type. Only projects with `OutputType` set to "Exe" or "WinExe" are supported, because only applications projects define an application entry point, where the application bootstrap code must reside. @@ -33,7 +33,7 @@ where the application bootstrap code must reside. --- -## [WFAC002](https://aka.ms/winforms-warnings/WFAC002): Unsupported property value. +## [WFO0002](https://aka.ms/winforms-warnings/WFAC002): Unsupported property value. The specified project property cannot be set to the given value. diff --git a/docs/analyzers/Experimental.Help.md b/docs/analyzers/Experimental.Help.md new file mode 100644 index 00000000000..1dbf6979773 --- /dev/null +++ b/docs/analyzers/Experimental.Help.md @@ -0,0 +1,10 @@ +# List of WinForms Experimental Function Areas + +System.Windows.Forms.Analyzers analyzers and source generators are shipped inbox with Windows Desktop .NET SDK, and +are automatically referenced for Window Forms .NET applications. + +| Diagnostic ID | Description | +| :------------- | :---------- | +| __`WFO5000`__ | Functionality around Visual Styling is experimental in .NET 9. | +| __`WFO5001`__ | Functionality around Dark Mode Colors is experimental in .NET 9. | +| __`WFO5002`__ | New ASync APIs for e.g. consuming Windows projected APIs, WebView2 or AI/LLM Libs are experimental in .NET 9. | diff --git a/docs/analyzers/WinFormsCSharpAnalyzers.Help.md b/docs/analyzers/WinFormsCSharpAnalyzers.Help.md new file mode 100644 index 00000000000..db768d58a6b --- /dev/null +++ b/docs/analyzers/WinFormsCSharpAnalyzers.Help.md @@ -0,0 +1,39 @@ +# How to use System.Windows.Forms.Analyzers + +System.Windows.Forms.Analyzers analyzers and source generators are shipped inbox with Windows Desktop .NET SDK, and +are automatically referenced for Window Forms .NET applications. + +## `AppManifestAnalyzer` + +`AppManifestAnalyzer` is automatically invoked when a Windows Forms application (`OutputType=Exe` or `OutputType=WinExe`) has a custom app.manifest. + +### [WFO0003](https://aka.ms/winforms-warnings/WFAC010): Unsupported high DPI configuration. + +Windows Forms applications should specify application DPI-awareness via the [application configuration](https://aka.ms/applicationconfiguration) or +[`Application.SetHighDpiMode` API](https://docs.microsoft.com/dotnet/api/system.windows.forms.application.sethighdpimode). + +|Item|Value| +|-|-| +| Category | ApplicationConfiguration | +| Enabled | True | +| Severity | Warning | +| CodeFix | False | +--- + +## `MissingPropertySerializationConfiguration` + +`MissingPropertySerializationConfiguration` checks for missing `DesignerSerializationVisibilityAttribute` on properties of classes which are +derived from `Control` and could potentially serialize design-time data by the designer without the user being aware of it. + +### [WFO1000](https://aka.ms/winforms-warnings/WFO1000): Missing property serialization configuration. + +Properties of classes derived from `Control` should have `DesignerSerializationVisibilityAttribute` +set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibility.Visible`. + +|Item|Value| +|-|-| +| Category | ApplicationConfiguration | +| Enabled | True | +| Severity | Warning | +| CodeFix | False | +--- diff --git a/docs/analyzers/WinFormsVisualBasicAnalyzers.Help.md b/docs/analyzers/WinFormsVisualBasicAnalyzers.Help.md new file mode 100644 index 00000000000..db768d58a6b --- /dev/null +++ b/docs/analyzers/WinFormsVisualBasicAnalyzers.Help.md @@ -0,0 +1,39 @@ +# How to use System.Windows.Forms.Analyzers + +System.Windows.Forms.Analyzers analyzers and source generators are shipped inbox with Windows Desktop .NET SDK, and +are automatically referenced for Window Forms .NET applications. + +## `AppManifestAnalyzer` + +`AppManifestAnalyzer` is automatically invoked when a Windows Forms application (`OutputType=Exe` or `OutputType=WinExe`) has a custom app.manifest. + +### [WFO0003](https://aka.ms/winforms-warnings/WFAC010): Unsupported high DPI configuration. + +Windows Forms applications should specify application DPI-awareness via the [application configuration](https://aka.ms/applicationconfiguration) or +[`Application.SetHighDpiMode` API](https://docs.microsoft.com/dotnet/api/system.windows.forms.application.sethighdpimode). + +|Item|Value| +|-|-| +| Category | ApplicationConfiguration | +| Enabled | True | +| Severity | Warning | +| CodeFix | False | +--- + +## `MissingPropertySerializationConfiguration` + +`MissingPropertySerializationConfiguration` checks for missing `DesignerSerializationVisibilityAttribute` on properties of classes which are +derived from `Control` and could potentially serialize design-time data by the designer without the user being aware of it. + +### [WFO1000](https://aka.ms/winforms-warnings/WFO1000): Missing property serialization configuration. + +Properties of classes derived from `Control` should have `DesignerSerializationVisibilityAttribute` +set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibility.Visible`. + +|Item|Value| +|-|-| +| Category | ApplicationConfiguration | +| Enabled | True | +| Severity | Warning | +| CodeFix | False | +--- diff --git a/docs/analyzers/akams.txt b/docs/analyzers/akams.txt new file mode 100644 index 00000000000..8fd1d7856cd --- /dev/null +++ b/docs/analyzers/akams.txt @@ -0,0 +1,7 @@ +https://aka.ms/WfoGenManifest https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers/AppManifestAnalyzer.Help.md +https://aka.ms/WfoExperimental https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers/Experimental.Help.md + +https://aka.ms/WfoCsAppConfig https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md +https://aka.ms/WfoCsAnalyzers https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/WinFormsCSharpAnalyzers.Help.md + +https://aka.ms/WfoVbAnalyzers https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.VisualBasic/WinFormsVisualBasicAnalyzers.Help.md diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md index 25f28635322..d6bf986bc83 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/AnalyzerReleases.Unshipped.md @@ -5,8 +5,8 @@ Rule ID | Category | Severity | Notes --------|----------|----------|------- -WFO0001 | Application Configuration | Error | CSharpDiagnosticDescriptors -WFO0002 | Application Configuration | Error | CSharpDiagnosticDescriptors +WFO0001 | Application Configuration | Error | ApplicationConfigurationGenerator, [Documentation](https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md) +WFO0002 | Application Configuration | Error | ApplicationConfigurationGenerator, [Documentation](https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Analyzers.CSharp/ApplicationConfigurationGenerator.Help.md) WFO1000 | WinForms Security | Error | CSharpDiagnosticDescriptors ### Removed Rules diff --git a/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj b/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj index f697a6c7b9c..7161b642740 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj +++ b/src/System.Windows.Forms.Analyzers.CSharp/src/System.Windows.Forms.Analyzers.CSharp.csproj @@ -9,8 +9,9 @@ + + - diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj index 6aedac3dbcf..781b23f2008 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/src/System.Windows.Forms.Analyzers.VisualBasic.vbproj @@ -20,6 +20,10 @@ + + + + diff --git a/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj b/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj index 8fcd7ea3fa2..6cd403f5c43 100644 --- a/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj +++ b/src/System.Windows.Forms.Analyzers/src/System.Windows.Forms.Analyzers.csproj @@ -9,8 +9,9 @@ + + - @@ -21,6 +22,10 @@ + + + + true diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs index 10381e1b716..b8a930fc736 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs @@ -13,10 +13,11 @@ internal static class DiagnosticIDs // Security, number group 1000+ public const string MissingPropertySerializationConfiguration = "WFO1000"; - // WinForms best practize, number group 2000+ + // WinForms best practice, number group 2000+ public const string DisposeModalDialog = "WFO2000"; - // Experimental, number group 9000+ - public const string ExperimentalVisualStyles = "WFO9000"; - public const string ExperimentalDarkMode = "WFO9001"; + // Experimental, number group 5000+ + public const string ExperimentalVisualStyles = "WFO5000"; + public const string ExperimentalDarkMode = "WFO5001"; + public const string ExperimentalAsync = "WFO5002"; } From a2c18a7fd3afffb66bac6d80f048a70fb9b16af0 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 1 Aug 2024 12:29:20 -0700 Subject: [PATCH 295/342] Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2506992 (#11799) * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2506961 * Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2506961 --- .../Resources/xlf/SR.zh-Hant.xlf | 2 +- .../Resources/xlf/SR.zh-Hant.xlf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf index 8cf4f2161cb..1c34538cc65 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 將 DesignerSerializationVisibilityAttribute 新增至屬性 diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf index 8cf4f2161cb..1c34538cc65 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf @@ -4,7 +4,7 @@ Add DesignerSerializationVisibilityAttribute to property - Add DesignerSerializationVisibilityAttribute to property + 將 DesignerSerializationVisibilityAttribute 新增至屬性 From 6194fcc4bd5b23a47be4298f4cdc15ed78da8e0f Mon Sep 17 00:00:00 2001 From: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com> Date: Fri, 2 Aug 2024 03:50:27 +0800 Subject: [PATCH 296/342] Do not crash when an invalid VirtualMode==true ListView is destroyed (#11679) * Add VirtualMode check in the ReleaseUiaProvider method * Restore changes in ListView, and update the property description. * update resource files * Adding Exception about ListView failed to retrieval items * Update exception message * Optimization Code * Adjust codes * Add a new accessor method without throw no exception * Modifying Exception Information * Undo test item modifications * Optimized code * Remove useless codes * Modify the code as suggested * Add test case for new internal api * Add test case * Adjusting code styles * fix comment * fix comment * 1 avoid the private reflection because we have public property that can be used instead (AccessibilityObject) 2. invoke ReleaseUiaProviders in the same way as it is invoked in applications, by calling Control.ReleaseUiaProveders method. 3. validate that control handle had not been created. * catch the specific expected exception --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) Co-authored-by: Epica3055 Co-authored-by: Tanya Solyanik --- .../src/Resources/SR.resx | 2 +- .../src/Resources/xlf/SR.cs.xlf | 4 +- .../src/Resources/xlf/SR.de.xlf | 4 +- .../src/Resources/xlf/SR.es.xlf | 4 +- .../src/Resources/xlf/SR.fr.xlf | 4 +- .../src/Resources/xlf/SR.it.xlf | 4 +- .../src/Resources/xlf/SR.ja.xlf | 4 +- .../src/Resources/xlf/SR.ko.xlf | 4 +- .../src/Resources/xlf/SR.pl.xlf | 4 +- .../src/Resources/xlf/SR.pt-BR.xlf | 4 +- .../src/Resources/xlf/SR.ru.xlf | 4 +- .../src/Resources/xlf/SR.tr.xlf | 4 +- .../src/Resources/xlf/SR.zh-Hans.xlf | 4 +- .../src/Resources/xlf/SR.zh-Hant.xlf | 4 +- ...tView.ListViewItemCollection.IInnerList.cs | 14 ++++ .../ListView.ListViewItemCollection.cs | 8 +++ .../ListView.ListViewNativeItemCollection.cs | 68 +++++++++++-------- .../Forms/Controls/ListView/ListView.cs | 2 +- .../System/Windows/Forms/ListViewTests.cs | 60 ++++++++++++++++ 19 files changed, 149 insertions(+), 57 deletions(-) diff --git a/src/System.Windows.Forms/src/Resources/SR.resx b/src/System.Windows.Forms/src/Resources/SR.resx index d77b3cfc975..f3529e2b26b 100644 --- a/src/System.Windows.Forms/src/Resources/SR.resx +++ b/src/System.Windows.Forms/src/Resources/SR.resx @@ -4018,7 +4018,7 @@ Stack trace where the illegal operation occurred was: Occurs whenever the state of a virtual item is changed. - Sets the count of the item collection when the ListView is in virtual mode. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. Value of '{1}' is not valid for '{0}'. {0} should be greater than or equal to 0. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index 4f97a54feb9..5e4255d7774 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -6855,8 +6855,8 @@ Trasování zásobníku, kde došlo k neplatné operaci: - Sets the count of the item collection when the ListView is in virtual mode. - Nastaví počet pro kolekci položek v případě, že je vlastnost ListView ve virtuálním režimu. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Nastaví počet pro kolekci položek v případě, že je vlastnost ListView ve virtuálním režimu. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index 8087afad687..8aae9969a91 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -6855,8 +6855,8 @@ Stapelüberwachung, in der der unzulässige Vorgang auftrat: - Sets the count of the item collection when the ListView is in virtual mode. - Legt die Anzahl der Elemente für die Elementesammlung fest, wenn sich die ListView im virtuellen Modus befindet. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Legt die Anzahl der Elemente für die Elementesammlung fest, wenn sich die ListView im virtuellen Modus befindet. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index 0371065311e..b59f7acbed5 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -6855,8 +6855,8 @@ El seguimiento de la pila donde tuvo lugar la operación no válida fue: - Sets the count of the item collection when the ListView is in virtual mode. - Establece el recuento de la colección de elementos cuando ListView está en modo virtual. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Establece el recuento de la colección de elementos cuando ListView está en modo virtual. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index 3b1771b16d8..aeeb58b943c 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -6855,8 +6855,8 @@ Cette opération non conforme s'est produite sur la trace de la pile : - Sets the count of the item collection when the ListView is in virtual mode. - Définit le nombre de la collection d'éléments lorsque le ListView est en mode virtuel. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Définit le nombre de la collection d'éléments lorsque le ListView est en mode virtuel. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index ef0690ba0aa..0b86f273b26 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -6855,8 +6855,8 @@ Traccia dello stack da cui si è verificata l'operazione non valida: - Sets the count of the item collection when the ListView is in virtual mode. - Imposta il numero di elementi nella raccolta quando il controllo ListView è in modalità virtuale. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Imposta il numero di elementi nella raccolta quando il controllo ListView è in modalità virtuale. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index d2d1d7cf835..ca1a70768d0 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -6855,8 +6855,8 @@ Stack trace where the illegal operation occurred was: - Sets the count of the item collection when the ListView is in virtual mode. - ListView が仮想モードであるときに、項目コレクションの数を設定します。 + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + ListView が仮想モードであるときに、項目コレクションの数を設定します。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index 57fddd139db..378a8b1073f 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -6855,8 +6855,8 @@ Stack trace where the illegal operation occurred was: - Sets the count of the item collection when the ListView is in virtual mode. - ListView가 가상 모드에 있는 경우 항목 컬렉션의 개수를 설정합니다. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + ListView가 가상 모드에 있는 경우 항목 컬렉션의 개수를 설정합니다. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index aefe67576f7..9ff9fc7c5ef 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -6855,8 +6855,8 @@ Stos śledzenia, w którym wystąpiła zabroniona operacja: - Sets the count of the item collection when the ListView is in virtual mode. - Ustawia liczbę kolekcji elementów, gdy formant ListView jest w trybie wirtualnym. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Ustawia liczbę kolekcji elementów, gdy formant ListView jest w trybie wirtualnym. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index 35ed4d3d1cf..2fe6afe0003 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -6855,8 +6855,8 @@ Rastreamento de pilha em que a operação ilegal ocorreu: - Sets the count of the item collection when the ListView is in virtual mode. - Define a contagem de coleção de itens quando ListView está no modo virtual. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Define a contagem de coleção de itens quando ListView está no modo virtual. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index 89bf91f5453..93c17d57579 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -6856,8 +6856,8 @@ Stack trace where the illegal operation occurred was: - Sets the count of the item collection when the ListView is in virtual mode. - Устанавливает счетчик коллекции элементов, когда ListView находится в виртуальном режиме. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + Устанавливает счетчик коллекции элементов, когда ListView находится в виртуальном режиме. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 1ccb6b8cc93..8cf583187e5 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -6855,8 +6855,8 @@ Geçersiz işlemin gerçekleştiği yığın izi: - Sets the count of the item collection when the ListView is in virtual mode. - ListView sanal moddayken öğe koleksiyonu sayısını ayarlar. + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + ListView sanal moddayken öğe koleksiyonu sayısını ayarlar. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index 759ada01525..b29c1028198 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -6855,8 +6855,8 @@ Stack trace where the illegal operation occurred was: - Sets the count of the item collection when the ListView is in virtual mode. - 当 ListView 处于虚拟模式时,设置项集合的计数。 + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + 当 ListView 处于虚拟模式时,设置项集合的计数。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index 2ada131f238..e5344649fc9 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -6855,8 +6855,8 @@ Stack trace where the illegal operation occurred was: - Sets the count of the item collection when the ListView is in virtual mode. - 設定 ListView 處於虛擬模式時項目集合的計數。 + Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. + 設定 ListView 處於虛擬模式時項目集合的計數。 diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.IInnerList.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.IInnerList.cs index a41c43a54ae..1b99554316d 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.IInnerList.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.IInnerList.cs @@ -26,6 +26,20 @@ internal interface IInnerList ListViewItem Insert(int index, ListViewItem item); void Remove(ListViewItem item); void RemoveAt(int index); + ListViewItem? GetItemByIndex(int index) + { + ArgumentOutOfRangeException.ThrowIfNegative(index); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count); + + try + { + return this[index]; + } + catch (InvalidOperationException) + { + return null; + } + } } } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs index 1a4e21fbdca..dc4328e25cb 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs @@ -73,6 +73,14 @@ public virtual ListViewItem this[int index] } } + internal ListViewItem? GetItemByIndex(int index) + { + ArgumentOutOfRangeException.ThrowIfNegative(index); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, InnerList.Count); + + return InnerList.GetItemByIndex(index); + } + object? IList.this[int index] { get diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewNativeItemCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewNativeItemCollection.cs index 6addbc83686..0d3e08a17b2 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewNativeItemCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewNativeItemCollection.cs @@ -34,35 +34,7 @@ public int Count public ListViewItem this[int displayIndex] { - get - { - _owner.ApplyUpdateCachedItems(); - - if (_owner.VirtualMode) - { - // if we are showing virtual items, we need to get the item from the user - RetrieveVirtualItemEventArgs rVI = new(displayIndex); - _owner.OnRetrieveVirtualItem(rVI); - rVI.Item!.SetItemIndex(_owner, displayIndex); - return rVI.Item; - } - else - { - ArgumentOutOfRangeException.ThrowIfNegative(displayIndex); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(displayIndex, _owner._itemCount); - - if (_owner.IsHandleCreated && !_owner.ListViewHandleDestroyed) - { - _owner._listItemsTable.TryGetValue(DisplayIndexToID(displayIndex), out ListViewItem? item); - return item!; - } - else - { - Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); - return _owner._listViewItems[displayIndex]; - } - } - } + get => GetItemByIndexInternal(displayIndex, throwInVirtualMode: true)!; set { _owner.ApplyUpdateCachedItems(); @@ -84,6 +56,44 @@ public ListViewItem this[int displayIndex] } } + public ListViewItem? GetItemByIndex(int index) => + GetItemByIndexInternal(index, throwInVirtualMode: false); + + private ListViewItem? GetItemByIndexInternal(int index, [NotNullWhen(true)] bool throwInVirtualMode) + { + _owner.ApplyUpdateCachedItems(); + + if (_owner.VirtualMode) + { + // If we are showing virtual items, we need to get the item from the user. + RetrieveVirtualItemEventArgs rVI = new(index); + _owner.OnRetrieveVirtualItem(rVI); + if (rVI.Item is null) + { + return !throwInVirtualMode ? null : throw new InvalidOperationException(SR.ListViewVirtualItemRequired); + } + + rVI.Item.SetItemIndex(_owner, index); + return rVI.Item; + } + else + { + ArgumentOutOfRangeException.ThrowIfNegative(index); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _owner._itemCount); + + if (_owner.IsHandleCreated && !_owner.ListViewHandleDestroyed) + { + _owner._listItemsTable.TryGetValue(DisplayIndexToID(index), out ListViewItem? item); + return item!; + } + else + { + Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); + return _owner._listViewItems[index]; + } + } + } + public ListViewItem Add(ListViewItem value) { if (_owner.VirtualMode) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs index 444d60a1917..d260e1c2903 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs @@ -5117,7 +5117,7 @@ internal override void ReleaseUiaProvider(HWND handle) for (int i = 0; i < Items.Count; i++) { - Items[i].ReleaseUiaProvider(); + Items.GetItemByIndex(i)?.ReleaseUiaProvider(); } if (_defaultGroup is not null) diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs index bf1a2951d33..5bfd1fc4718 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs @@ -5203,6 +5203,66 @@ public void ListView_AnnounceColumnHeader_WorksCorrectly(int x, int y, string ex Assert.True(listView.IsHandleCreated); } + public static TheoryData GetListViewItemTheoryData() => new() + { + { new("Item 1") }, + { null } + }; + + [WinFormsTheory] + [MemberData(nameof(GetListViewItemTheoryData))] + // Regression test for https://github.com/dotnet/winforms/issues/11663. + public void ListView_VirtualMode_ReleaseUiaProvider_Success(ListViewItem listItem) + { + using ListView listView = new() + { + VirtualMode = true, + VirtualListSize = 1 + }; + + listView.RetrieveVirtualItem += (s, e) => + { + e.Item = e.ItemIndex switch + { + 0 => listItem, + _ => throw new NotImplementedException() + }; + }; + + listView.AccessibilityObject.Should().NotBeNull(); + + Action action = () => listView.ReleaseUiaProvider(listView.InternalHandle); + action.Should().NotThrow(); + listView.IsAccessibilityObjectCreated.Should().BeFalse(); + listView.IsHandleCreated.Should().BeFalse(); + } + + [WinFormsFact] + public void ListView_VirtualMode_GetListViewItemAsExpected() + { + using ListView listView = new() + { + VirtualMode = true, + VirtualListSize = 2 + }; + + ListViewItem listItem1 = new("Item 1"); + ListViewItem listItem2 = null; + listView.RetrieveVirtualItem += (s, e) => + { + e.Item = e.ItemIndex switch + { + 0 => listItem1, + 1 => listItem2, + _ => throw new NotImplementedException() + }; + }; + listView.Items.GetItemByIndex(0).Should().Be(listView.Items[0]); + listView.Items.GetItemByIndex(1).Should().BeNull(); + Action action = () => listView.Items[1].ToString(); + action.Should().Throw(SR.ListViewVirtualItemRequired); + } + private class SubListViewAccessibleObject : ListView.ListViewAccessibleObject { internal string AnnouncedColumn { get; private set; } From 3b51f55af97fc77e19f20dd4bf00d94e0c393e52 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:42:11 +0000 Subject: [PATCH 297/342] [main] Update dependencies from dotnet/arcade (#11808) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- eng/common/native/init-compiler.sh | 4 ++-- global.json | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8ef059c990e..e6d1a40881a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -187,29 +187,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc diff --git a/eng/Versions.props b/eng/Versions.props index 22888382505..fef4815c8ee 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24379.1 - 9.0.0-beta.24379.1 - 9.0.0-beta.24379.1 + 9.0.0-beta.24401.1 + 9.0.0-beta.24401.1 + 9.0.0-beta.24401.1 17.4.0-preview-20220707-01 diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 14175343cc6..9a0e1f2b456 100755 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -21,7 +21,7 @@ case "$compiler" in majorVersion="${version%%.*}" # LLVM based on v18 released in early 2024, with two releases per year - maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))" + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))" compiler=clang ;; @@ -31,7 +31,7 @@ case "$compiler" in majorVersion="${version%%.*}" # GCC based on v14 released in early 2024, with one release per year - maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))" + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))" compiler=gcc ;; esac diff --git a/global.json b/global.json index 8ecc09e2a5c..e3c20f1363c 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.1", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24379.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24379.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24401.1", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24381.5" }, From d4bdea7843100d088401c274301c7bfe6803be99 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:42:27 +0000 Subject: [PATCH 298/342] [main] Update dependencies from dotnet/runtime (#11809) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e6d1a40881a..6757bbb6b03 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 - + https://github.com/dotnet/runtime - 7f2b222f92d323b7ca522a06c7116f1ec25d12ca + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 diff --git a/eng/Versions.props b/eng/Versions.props index fef4815c8ee..6042901f0d8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 6.0.0 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 - 9.0.0-rc.1.24381.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24401.5 diff --git a/global.json b/global.json index e3c20f1363c..e0217f16575 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24381.5" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24401.5" }, "native-tools": { "cmake": "latest" From 506c97b3a8d80a1895388a0ce98b335cad8ba9b4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 2 Aug 2024 22:56:25 -0700 Subject: [PATCH 299/342] Change NetworkDownloadTests to use Fluent Assurations --- .../Windows/Forms/NetworkDownloadTests.vb | 969 ++++++++++-------- 1 file changed, 523 insertions(+), 446 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index 57201c0f577..b6e488736e5 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -3,7 +3,10 @@ Imports System.IO Imports System.Net +Imports FluentAssertions +Imports FluentAssertions.Specialized Imports Microsoft.VisualBasic.FileIO +Imports Microsoft.VisualStudio.TestPlatform.ObjectModel Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -26,11 +29,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' Private Shared Function ValidateDownload(destinationFileName As String) As Long Dim fileInfo As New FileInfo(destinationFileName) - + fileInfo.Exists.Should.BeTrue() + Directory.Exists(fileInfo.DirectoryName).Should.BeTrue() ' This directory should not be systems Temp Directory because it must be created - Assert.NotEqual(Path.GetTempPath, fileInfo.DirectoryName) - Assert.True(Directory.Exists(fileInfo.DirectoryName)) - Assert.True(fileInfo.Exists) + Path.GetTempPath.Should.NotBe(fileInfo.DirectoryName) Return fileInfo.Length End Function @@ -40,7 +42,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests listener.Stop() listener.Close() If Not String.IsNullOrWhiteSpace(testDirectory) Then - Assert.True(testDirectory.StartsWith(Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase)) + testDirectory.Should.StartWith(Path.GetTempPath) Directory.Delete(testDirectory, recursive:=True) End If End Sub @@ -53,22 +55,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName:=testDirectory, ' This is a Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=testDirectory, ' This is a Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + testCode.Should() _ + .Throw(Of InvalidOperationException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -84,23 +86,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - $"{destinationFileName}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.IO_FilePathException, ex.Message) - Assert.Contains(NameOf(destinationFileName), ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=$"{destinationFileName}{separator}", + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should() _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -116,23 +118,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.IO_FilePathException, ex.Message) - Assert.Contains(NameOf(destinationFileName), ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should() _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -148,22 +150,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should() _ + .Throw(Of InvalidOperationException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -177,11 +180,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName) - - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(uriString:=webListener.Address), + destinationFileName) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try @@ -195,21 +203,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - userName:="", - password:="", - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) - - End Sub) - - Assert.StartsWith(SR.Network_BadConnectionTimeout, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) + End Sub + + testCode.Should() _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_BadConnectionTimeout)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -223,21 +232,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, Uri), - destinationFileName, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile( + address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -251,22 +262,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, Uri), - destinationFileName, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -280,22 +291,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(address:=CType(Nothing, Uri), - destinationFileName, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile( + address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -308,18 +320,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) CleanUp(listener, testDirectory) End Sub @@ -331,17 +347,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) CleanUp(listener, testDirectory) End Sub @@ -354,19 +374,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As New NetworkCredential(DefaultUserName, DefaultPassword) - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - networkCredentials, - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) - Finally - CleanUp(listener, testDirectory) - End Try + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + networkCredentials, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) + + CleanUp(listener, testDirectory) End Sub @@ -376,18 +399,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Directory.Delete(testDirectory, recursive:=True) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) CleanUp(listener, testDirectory) End Sub @@ -399,20 +426,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=True) - - Assert.Equal(DownloadLargeFileSize, ValidateDownload(destinationFileName)) - Finally - CleanUp(listener, testDirectory) - End Try + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadLargeFileSize) + + CleanUp(listener, testDirectory) End Sub @@ -422,15 +452,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName) + End Sub - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) - Finally - CleanUp(listener, testDirectory) - End Try + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) + + CleanUp(listener, testDirectory) End Sub @@ -440,17 +473,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - Try - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), - destinationFileName, - DefaultUserName, - DefaultPassword) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=DefaultUserName, + password:=DefaultPassword) + End Sub - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) - Finally - CleanUp(listener, testDirectory) - End Try + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) + + CleanUp(listener, testDirectory) End Sub @@ -463,18 +499,20 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(New Uri(webListener.Address), + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), destinationFileName, - DefaultUserName, + userName:=DefaultUserName, password) + End Sub - End Sub) + testCode.Should _ + .Throw(Of WebException)() _ + .WithMessage(SR.net_webstatus_Unauthorized) + File.Exists(destinationFileName).Should.BeFalse() - Assert.Equal(SR.net_webstatus_Unauthorized, ex.Message) - Assert.False(File.Exists(destinationFileName)) Finally CleanUp(listener, testDirectory) End Try @@ -488,22 +526,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=testDirectory, ' This is a Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=testDirectory, ' This is a Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub + + testCode.Should _ + .Throw(Of InvalidOperationException)() _ + .WithMessage(SR.Network_DownloadNeedsFilename) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -519,23 +559,25 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - $"{destinationFileName}{separator}", - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.IO_FilePathException, ex.Message) - Assert.Contains(NameOf(destinationFileName), ex.Message) - Assert.False(File.Exists(destinationFileName)) + + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=$"{destinationFileName}{separator}", + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + + End Sub + + testCode.Should _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -551,23 +593,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.IO_FilePathException, ex.Message) - Assert.Contains(NameOf(destinationFileName), ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -583,22 +625,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of InvalidOperationException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub) - - Assert.Equal(SR.Network_DownloadNeedsFilename, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should _ + .Throw(Of InvalidOperationException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -612,11 +655,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName) + + End Sub - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try @@ -632,16 +681,17 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(address, - destinationFileName) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile( + address, + destinationFileName) + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -656,16 +706,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName) - End Sub) + End Sub - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) - Assert.False(File.Exists(destinationFileName)) + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -679,20 +731,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=Nothing, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener) End Try @@ -706,21 +760,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName:=Nothing, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False, - UICancelOption.DoNothing) - - End Sub) - - Assert.StartsWith(SR.General_ArgumentNullException, ex.Message) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=Nothing, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should _ + .Throw(Of ArgumentNullException)() _ + .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener) End Try @@ -732,23 +788,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - - Dim ex As Exception = Assert.Throws(Of IOException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.Equal(SR.IO_FileExists_Path.Replace("{0}", destinationFileName), ex.Message) - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(ValidateDownload(destinationFileName), 1) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub + + + testCode.Should _ + .Throw(Of IOException)() _ + .Where(Function(e) e.Message.Equals(SR.IO_FileExists_Path.Replace("{0}", destinationFileName))) + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(1) CleanUp(listener, testDirectory) End Sub @@ -761,21 +818,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"), ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile( + address:=InvalidUrlAddress, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub + + testCode.Should _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"))) + + Directory.Exists(testDirectory).Should.BeTrue() + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -789,21 +849,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(InvalidUrlAddress, - destinationFileName, - userName:="", - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - End Sub) - - Assert.StartsWith(SR.Network_InvalidUriString.Replace("{0}", InvalidUrlAddress), ex.Message) - Assert.False(File.Exists(destinationFileName)) + My.Computer.Network.DownloadFile( + address:=InvalidUrlAddress, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + + + End Sub + + testCode.Should() _ + .Throw(Of ArgumentException)() _ + .Where(Function(e) e.Message.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"))) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -817,16 +880,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - userName:=Nothing, - password:="", - showUI:=True, - TestingConnectionTimeout, - overwrite:=False) - - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=Nothing, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try @@ -839,19 +902,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) CleanUp(listener, testDirectory) End Sub @@ -863,17 +929,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - userName:="", - password:="", - showUI:=False, - TestingConnectionTimeout, - overwrite:=True) - - Assert.True(Directory.Exists(testDirectory)) - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True) + End Sub + + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try @@ -887,13 +957,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - DefaultUserName, - DefaultPassword) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=DefaultUserName, + password:=DefaultPassword) + End Sub - Assert.Equal(DownloadSmallFileSize, ValidateDownload(destinationFileName)) + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) Finally CleanUp(listener, testDirectory) End Try @@ -907,21 +982,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of WebException)( - Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - userName:="", - password:="", - showUI:=False, - connectionTimeout:=1, - overwrite:=True) - - End Sub) - - Assert.Equal(SR.net_webstatus_Timeout, ex.Message) - Assert.False(File.Exists(destinationFileName)) + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=1, + overwrite:=True) + End Sub + + testCode.Should _ + .Throw(Of WebException)() _ + .WithMessage(SR.net_webstatus_Timeout) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try @@ -933,22 +1009,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWithWrongPassword_Throw(password As String) Dim testDirectory As String = CreateTempDirectory() Dim destinationFileName As String = GetDestinationFileName(testDirectory) - Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, "") + Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, String.Empty) Dim listener As HttpListener = webListener.ProcessRequests() Try - Dim ex As Exception = Assert.Throws(Of WebException)( + Dim testCode As Action = Sub() - My.Computer.Network _ - .DownloadFile(webListener.Address, - destinationFileName, - DefaultUserName, - password) - - End Sub) + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=DefaultUserName, + password) + End Sub - Assert.Equal(SR.net_webstatus_Unauthorized, ex.Message) - Assert.False(File.Exists(destinationFileName)) + testCode.Should _ + .Throw(Of WebException)() _ + .WithMessage(SR.net_webstatus_Unauthorized) + File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) End Try From 04f21db71b1092fef11ee4ee56668e3b27b3c66c Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 3 Aug 2024 01:33:54 -0700 Subject: [PATCH 300/342] Use FluentAssertions where possibleMove TestUtitilies to subdirectory --- .../AssemblyPublicKeyIsAsExpectedTest.vb | 6 +- .../Windows/Forms/ClipboardProxyTests.vb | 35 ++--- .../System/Windows/Forms/ControlTests.vb | 29 ++-- .../System/Windows/Forms/FileIoProxyTests.vb | 126 +++++++++--------- .../Windows/Forms/NetworkDownloadTests.vb | 2 - .../Forms/SingleInstanceHelpersTests.vb | 19 +-- .../System/Windows/Forms/TimeTests.vb | 12 +- .../System/Windows/Forms/UserTests.vb | 25 ++-- .../GetUntiqueUtilities.vb} | 2 +- .../TempDirectoryFileFunctions.vb | 0 .../{Forms => TestUtilities}/WebListener.vb | 0 .../MyServices/ClipboardProxyTests.cs | 1 + 12 files changed, 140 insertions(+), 117 deletions(-) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/{Forms/TestUtilities.vb => TestUtilities/GetUntiqueUtilities.vb} (94%) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/{Forms => TestUtilities}/TempDirectoryFileFunctions.vb (100%) rename src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/{Forms => TestUtilities}/WebListener.vb (100%) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb index 421eaa6e0ff..ca79c88066a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Text +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -18,10 +19,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim sb As New StringBuilder For Each [byte] As Byte In publicKey sb.AppendFormat("{0:x2}", [byte]) - Next [byte] + Next - ' Set breakpoint here to find out what's in sb - Assert.Equal(AssemblyPK, sb.ToString()) + AssemblyPK.Should.Be(sb.ToString()) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index c55ae82c194..6fb18574bd4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -4,6 +4,7 @@ Imports System.Collections.Specialized Imports System.IO Imports System.Windows.Forms +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -20,13 +21,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim clipboardProxy As New MyServices.ClipboardProxy Dim text As String = GetUniqueText() clipboardProxy.SetText(text) - Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText) - Assert.Equal(Clipboard.ContainsText, clipboardProxy.ContainsText(TextDataFormat.Text)) - Assert.Equal(Clipboard.ContainsData(DataFormats.Text), clipboardProxy.ContainsData(DataFormats.Text)) - Assert.Equal(text, clipboardProxy.GetText()) + Clipboard.ContainsText.Should.Be(clipboardProxy.ContainsText) + Clipboard.ContainsText.Should.Be(clipboardProxy.ContainsText(TextDataFormat.Text)) + Clipboard.ContainsData(DataFormats.Text).Should.Be(clipboardProxy.ContainsData(DataFormats.Text)) + clipboardProxy.GetText().Should.Be(text) text = GetUniqueText() clipboardProxy.SetText(text, TextDataFormat.Text) - Assert.Equal(text, clipboardProxy.GetText(TextDataFormat.Text)) + clipboardProxy.GetText(TextDataFormat.Text).Should.Be(text) End Sub @@ -35,7 +36,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim audioBytes As Byte() = {1, 2, 3} clipboardProxy.SetAudio(audioBytes) Dim result As Stream = clipboardProxy.GetAudioStream() - Assert.Equal(result.Length, clipboardProxy.GetAudioStream().Length) + clipboardProxy.GetAudioStream().Length.Should.Be(result.Length) End Sub @@ -43,10 +44,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim clipboardProxy As New MyServices.ClipboardProxy Dim audioBytes As Byte() = {1, 2, 3} clipboardProxy.SetAudio(audioBytes) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(Assert.IsType(Of MemoryStream)(CType(clipboardProxy.GetAudioStream(), MemoryStream))).Length) - Assert.Equal(audioBytes.Length, CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length) + clipboardProxy.ContainsAudio().Should.BeTrue() + clipboardProxy.ContainsData(DataFormats.WaveAudio).Should.BeTrue() + CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length.Should.Be(audioBytes.Length) + + Dim audioStream As MemoryStream = CType(clipboardProxy.GetAudioStream(), MemoryStream) + audioStream.Should.NotBeNull() + audioBytes.Length.Should.Be(CInt(audioStream.Length)) End Sub @@ -56,9 +60,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using audioStream As New MemoryStream(audioBytes) clipboardProxy.SetAudio(audioStream) Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetData(DataFormats.WaveAudio)).ToArray().Length) - Assert.True(clipboardProxy.ContainsAudio()) - Assert.True(clipboardProxy.ContainsData(DataFormats.WaveAudio)) + Dim waveAudio As MemoryStream = CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream) + waveAudio.ToArray.Length.Should.Be(audioBytes.Length) + clipboardProxy.ContainsAudio().Should.BeTrue() + clipboardProxy.ContainsData(DataFormats.WaveAudio).Should.BeTrue() End Using End Sub @@ -68,8 +73,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim filePaths As New StringCollection From {"filePath", "filePath2"} clipboardProxy.SetFileDropList(filePaths) - Assert.True(clipboardProxy.ContainsFileDropList()) - Assert.Equal(filePaths, clipboardProxy.GetFileDropList()) + clipboardProxy.ContainsFileDropList().Should.BeTrue() + clipboardProxy.GetFileDropList().Equals(filePaths) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index 6b17c00d00b..f714d1be1e7 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -22,8 +23,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As Action = AddressOf FaultingMethod - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(invoker) + End Sub + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -39,8 +43,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Action method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Action method) ") End Using End Sub @@ -50,8 +54,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As New MethodInvoker(AddressOf FaultingMethod) - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(invoker) + End Sub + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -78,10 +85,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests _control.CreateControl() Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( + Dim testCode As Action = Sub() Dim result As Integer = _control.Invoke(Function() invoker(19)) - End Sub) + End Sub + + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -95,8 +104,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__4-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 111 ' at Xunit.Assert.RecordException(Action testCode) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\Record.cs:line 27 - Assert.Contains(NameOf(FaultingFunc), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingFunc)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ") End Using End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 64bf1f904f8..70ddefd18c3 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -3,6 +3,7 @@ Imports System.Collections.ObjectModel Imports System.Text +Imports FluentAssertions Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.FileIO Imports Microsoft.VisualBasic.MyServices @@ -31,9 +32,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) - Assert.True(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + IO.Directory.Exists(testDirectory).Should.BeTrue() + IO.Directory.Exists(destinationDirectory).Should.BeTrue() + IO.Directory.EnumerateFiles(testDirectory).Count.Should.Be(IO.Directory.EnumerateFiles(destinationDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -47,9 +48,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) - Assert.True(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(IO.Directory.EnumerateFiles(testDirectory).Count, IO.Directory.EnumerateFiles(destinationDirectory).Count) + IO.Directory.Exists(testDirectory).Should.BeTrue() + IO.Directory.Exists(destinationDirectory).Should.BeTrue() + IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(IO.Directory.EnumerateFiles(testDirectory).Count) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -64,8 +65,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) _fileSystem.CopyFile(file1, file2) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -79,8 +80,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2), size:=1) _fileSystem.CopyFile(file1, file2, overwrite:=True) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -94,8 +95,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) _fileSystem.CopyFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -109,8 +110,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) _fileSystem.CopyFile(file1, file2, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -120,10 +121,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeTrue() _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) - Assert.False(IO.Directory.Exists(testDirectory)) + IO.Directory.Exists(testDirectory).Should.BeFalse() End Sub @@ -132,10 +133,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeTrue() _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) - Assert.False(IO.Directory.Exists(testDirectory)) + IO.Directory.Exists(testDirectory).Should.BeFalse() End Sub @@ -144,10 +145,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeTrue() _fileSystem.DeleteFile(file1) - Assert.False(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeFalse() _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -158,10 +159,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeTrue() _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) - Assert.False(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeFalse() _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -172,35 +173,39 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1), size:=1) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) - Assert.True(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeTrue() _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) - Assert.False(IO.File.Exists(file1)) + IO.File.Exists(file1).Should.BeFalse() _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub Public Sub DriveProxyTest() - Assert.Equal(_fileSystem.Drives.Count, FileIO.FileSystem.Drives.Count) + FileIO.FileSystem.Drives.Count.Should.Be(_fileSystem.Drives.Count) End Sub Public Sub FileNormalizePathEmptyStringTest_Fail() - Dim ex As Exception = Assert.Throws(Of ArgumentException)( + Dim testCode As Action = Sub() FileSystemUtils.NormalizePath("") - End Sub) - Assert.Equal("The path is empty. (Parameter 'path')", ex.Message) + End Sub + + Dim ex As Exception = Assert.Throws(Of ArgumentException)(testCode) + ex.Message.Should.Be("The path is empty. (Parameter 'path')") End Sub Public Sub FileNormalizePathNullTest_Fail() - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)( + Dim testCode As Action = Sub() FileSystemUtils.NormalizePath(Nothing) - End Sub) - Assert.Equal("Value cannot be null. (Parameter 'path')", ex.Message) + End Sub + + Dim ex As Exception = Assert.Throws(Of ArgumentNullException)(testCode) + ex.Message.Should.Be("Value cannot be null. (Parameter 'path')") End Sub @@ -217,10 +222,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim fileC As String = CreateTempFile(testDirectory, NameOf(fileC)) _fileSystem.WriteAllText(fileC, "C", append:=False) Dim filenames As ReadOnlyCollection(Of String) = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly) - Assert.Equal(filenames.Count, 1) - Assert.Equal(filenames(0), _fileSystem.CombinePath(testDirectory, NameOf(fileA))) + filenames.Count.Should.Be(1) + _fileSystem.CombinePath(testDirectory, NameOf(fileA)).Should.Be(filenames(0)) filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") - Assert.Equal(filenames.Count, 0) + filenames.Count.Should.Be(0) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -233,9 +238,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) - Assert.False(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + IO.Directory.Exists(testDirectory).Should.BeFalse() + IO.Directory.Exists(destinationDirectory).Should.BeTrue() + IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(1) _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -248,9 +253,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) _fileSystem.MoveDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs) - Assert.False(IO.Directory.Exists(testDirectory)) - Assert.True(IO.Directory.Exists(destinationDirectory)) - Assert.Equal(1, IO.Directory.EnumerateFiles(destinationDirectory).Count) + IO.Directory.Exists(testDirectory).Should.BeFalse() + IO.Directory.Exists(destinationDirectory).Should.BeTrue() + IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(1) _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -264,10 +269,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.False(IO.File.Exists(file1)) - Assert.True(IO.File.Exists(file2)) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + IO.File.Exists(file1).Should.BeFalse() + IO.File.Exists(file2).Should.BeTrue() + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -281,10 +286,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim file2 As String = CreateTempFile(testDirectory, NameOf(file2)) _fileSystem.MoveFile(file1, file2, showUI:=UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) - Assert.False(IO.File.Exists(file1)) - Assert.True(IO.File.Exists(file2)) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + IO.File.Exists(file1).Should.BeFalse() + IO.File.Exists(file2).Should.BeTrue() + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -298,7 +303,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Using Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") + text.Should.Be("A") End Using _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) @@ -329,9 +334,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests For Each currentField In currentRow totalFields += 1 Next - Assert.Equal(7, totalFields) + totalFields.Should.Be(7) End While - Assert.Equal(2, totalRows) + totalRows.Should.Be(2) + reader.Close() _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -346,7 +352,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Using Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA, Encoding.ASCII) Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") + text.Should.Be("A") End Using _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) @@ -367,14 +373,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim totalFields As Integer = 0 For Each currentField In currentRow If totalRows = 1 Then - Assert.Equal(splitData(totalFields), currentField.TrimEnd(";"c)) + splitData(totalFields).Should.Be(currentField.TrimEnd(";"c)) End If totalFields += 1 Next - Assert.Equal(6, totalFields) + totalFields.Should.Be(6) totalRows += 1 End While - Assert.Equal(2, totalRows) + totalRows.Should.Be(2) reader.Close() _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -386,7 +392,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.WriteAllText(fileA, "A", append:=False) Using fileReader As IO.StreamReader = _fileSystem.OpenTextFileReader(fileA) Dim text As String = fileReader.ReadLine() - Assert.Equal(text, "A") + text.Should.Be("A") End Using _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) @@ -400,8 +406,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.WriteAllBytes(fileA, byteArray, append:=False) Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) - Assert.Equal(bytes.Length, 1) - Assert.Equal(bytes(0), 4) + bytes.Length.Should.Be(1) + bytes(0).Should.Be(4) _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -411,7 +417,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) _fileSystem.WriteAllText(fileA, "A", append:=False) Dim text As String = _fileSystem.ReadAllText(fileA) - Assert.Equal(text, "A") + text.Should.Be("A") _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub @@ -421,7 +427,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim fileA As String = CreateTempFile(testDirectory, NameOf(fileA)) _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) - Assert.Equal(text, "A") + text.Should.Be("A") _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index b6e488736e5..c64de9a2772 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -4,9 +4,7 @@ Imports System.IO Imports System.Net Imports FluentAssertions -Imports FluentAssertions.Specialized Imports Microsoft.VisualBasic.FileIO -Imports Microsoft.VisualStudio.TestPlatform.ObjectModel Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb index 5eb7060e355..8546ce0b3c8 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb @@ -4,6 +4,7 @@ Imports System.IO.Pipes Imports System.Runtime.CompilerServices Imports System.Threading +Imports FluentAssertions Imports Microsoft.VisualBasic.ApplicationServices Imports Xunit @@ -23,11 +24,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub TryCreatePipeServerTests() Dim pipeName As String = GetUniqueText() Dim pipeServer As NamedPipeServerStream = Nothing - Assert.True(TryCreatePipeServer(pipeName, pipeServer)) - Assert.True(pipeServer.CanRead) - Assert.False(pipeServer.CanSeek) - Assert.False(pipeServer.CanWrite) - Assert.Equal(PipeTransmissionMode.Byte, pipeServer.TransmissionMode) + TryCreatePipeServer(pipeName, pipeServer).Should.BeTrue() + pipeServer.CanRead.Should.BeTrue() + pipeServer.CanSeek.Should.BeFalse() + pipeServer.CanWrite.Should.BeFalse() + pipeServer.TransmissionMode.Should.Be(PipeTransmissionMode.Byte) pipeServer.Close() pipeServer.Dispose() End Sub @@ -36,10 +37,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub TryCreatePipeServerTwiceTests_Fail() Dim pipeName As String = GetUniqueText() Dim pipeServer As NamedPipeServerStream = Nothing - Assert.True(TryCreatePipeServer(pipeName, pipeServer)) + TryCreatePipeServer(pipeName, pipeServer).Should.BeTrue() Dim pipeServer1 As NamedPipeServerStream = Nothing - Assert.False(TryCreatePipeServer(pipeName, pipeServer1)) - Assert.Null(pipeServer1) + TryCreatePipeServer(pipeName, pipeServer1).Should.BeFalse() + pipeServer1.Should.BeNull() pipeServer.Close() pipeServer.Dispose() End Sub @@ -64,7 +65,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Do Await Task.Delay(5) Loop Until _resultArgs IsNot Nothing - Assert.Equal("Hello", _resultArgs(0)) + _resultArgs(0).Should.Be("Hello") Await tokenSource.CancelAsync() End Using End If diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index e13e5bec731..31ded914b0f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests @@ -15,27 +16,28 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub SystemTimeNotNew() - Assert.True(Date.Now > New Date) + Date.Now.Should.BeAfter(New Date) End Sub Public Sub VbGmtTimeCloseToDateUtcNow() - Assert.True(timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit)) + timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbLocalTimeCloseToDateNow() - Assert.True(timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit)) + timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbTickCountCloseToEnvironmentTickCount() - Assert.True(Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit) + Dim condition As Boolean = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit + condition.Should.BeTrue() End Sub Public Sub VbTimeNotNew() - Assert.True(My.Computer.Clock.LocalTime > New Date) + My.Computer.Clock.LocalTime.Should.BeAfter(New Date) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb index 9ffd37723aa..ad47141d4d0 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports FluentAssertions Imports Microsoft.VisualBasic.ApplicationServices Imports Xunit @@ -11,16 +12,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub UserBaseTest() Dim testUser As New User - Assert.Null(testUser.CurrentPrincipal) + testUser.CurrentPrincipal.Should.BeNull() Dim userPrincipal As New UserPrincipal( - authenticationType:="Basic", - name:="Test", - isAuthenticated:=True, - role:="Guest") + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") testUser.CurrentPrincipal = userPrincipal - Assert.NotNull(testUser.CurrentPrincipal) - Assert.Equal(userPrincipal, testUser.CurrentPrincipal) - Assert.Equal("Basic", userPrincipal.Identity.AuthenticationType) + testUser.CurrentPrincipal.Should.NotBeNull() + testUser.CurrentPrincipal.Should.Be(userPrincipal) + userPrincipal.Identity.AuthenticationType.Should.Be("Basic") End Sub @@ -32,7 +33,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests isAuthenticated:=True, role:="Guest") } - Assert.Equal("Test", testUser.Name) + testUser.Name.Should.Be("Test") End Sub @@ -44,7 +45,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests isAuthenticated:=True, role:="Guest") } - Assert.Equal(True, testUser.IsAuthenticated) + testUser.IsAuthenticated.Should.BeTrue() End Sub @@ -56,8 +57,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests isAuthenticated:=True, role:="Guest") } - Assert.True(testUser.IsInRole("Guest")) - Assert.False(testUser.IsInRole("Basic")) + testUser.IsInRole("Guest").Should.BeTrue() + testUser.IsInRole("Basic").Should.BeFalse() End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUntiqueUtilities.vb similarity index 94% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUntiqueUtilities.vb index 8fc64d6bb12..58361538c20 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TestUtilities.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUntiqueUtilities.vb @@ -2,7 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Namespace Microsoft.VisualBasic.Forms.Tests - Friend Module TestUtilities + Friend Module GetUniqueUtilities Friend Function GetUniqueInteger(positiveOnly As Boolean) As Integer If positiveOnly Then diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TempDirectoryFileFunctions.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb similarity index 100% rename from src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/WebListener.vb rename to src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 63af4b299f5..c2d8014c513 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -19,6 +19,7 @@ public void Audio() { var clipboard = (new Computer()).Clipboard; Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); + // Not tested: // Public Function GetAudioStream() As Stream // Public Sub SetAudio(audioBytes As Byte()) From aa0047aed7108107d78c9ad6c7c0620dfa4a6130 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 3 Aug 2024 02:01:21 -0700 Subject: [PATCH 301/342] Update HostServicesTest to use FluentAssertions --- .../System/Windows/Forms/HostServicesTests.vb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb index f98ac773aab..1fe8d05981f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/HostServicesTests.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms +Imports FluentAssertions Imports Microsoft.VisualBasic.CompilerServices Imports Xunit @@ -13,8 +14,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetUniqueIntegerTests_Success() - Assert.True(GetUniqueInteger(positiveOnly:=True) >= 0) - Assert.NotEqual(GetUniqueInteger(positiveOnly:=False), GetUniqueInteger(positiveOnly:=False)) + Dim condition As Boolean = GetUniqueInteger(positiveOnly:=True) >= 0 + condition.Should.BeTrue() + GetUniqueInteger(positiveOnly:=False).Should.NotBe(GetUniqueInteger(positiveOnly:=False)) End Sub @@ -27,16 +29,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim parentWindow As IWin32Window = Nothing Dim vbHost As IVbHost = HostServices.VBHost Dim inputHandler As New InputBoxHandler(prompt, title, defaultResponse, xPos, yPos, parentWindow) - Assert.Equal(Nothing, vbHost) - Assert.Equal(Nothing, inputHandler.Exception) - Assert.Equal(Nothing, inputHandler.Result) + vbHost.Should.BeNull() + inputHandler.Exception.Should.BeNull() + inputHandler.Result.Should.BeNull() End Sub Public Sub VbHostTests_Success() Dim vbHost As IVbHost = New TestVbHost - Assert.Equal(s_control, vbHost.GetParentWindow) - Assert.Equal(s_title, vbHost.GetWindowTitle) + CType(vbHost.GetParentWindow, Control).Should.Be(s_control) + vbHost.GetWindowTitle.Should.Be(s_title) End Sub Private NotInheritable Class TestVbHost From bc5246772415fca6856516735916dc9b25cf2419 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 12:41:02 +0000 Subject: [PATCH 302/342] [main] Update dependencies from dotnet/runtime (#11812) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 176 ++++++++++++++++++++-------------------- eng/Versions.props | 56 ++++++------- global.json | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6757bbb6b03..1df9d0ae983 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,182 +7,182 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + a4fe68fcb3233b8b229444557d38c7565938de05 diff --git a/eng/Versions.props b/eng/Versions.props index 6042901f0d8..52427cfacb4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 9.0.0-preview.7.24373.8 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 6.0.0 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 - 9.0.0-rc.1.24401.5 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24402.7 diff --git a/global.json b/global.json index e0217f16575..599a5b4e7e9 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24401.5" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24402.7" }, "native-tools": { "cmake": "latest" From ff2acdf41abfdc9d6557c545cb61906158fe9976 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Sat, 3 Aug 2024 13:33:23 -0700 Subject: [PATCH 303/342] Fix dependency flow for Nrbf package (#11810) Co-authored-by: Jeremy Kuhne --- eng/Version.Details.xml | 4 ++++ eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1df9d0ae983..41ff3a87432 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -120,6 +120,10 @@ Note: if the Uri is a new place, you will need to add a subscription from that p https://github.com/dotnet/runtime a4fe68fcb3233b8b229444557d38c7565938de05 + + https://github.com/dotnet/runtime + ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + https://github.com/dotnet/runtime a4fe68fcb3233b8b229444557d38c7565938de05 diff --git a/eng/Versions.props b/eng/Versions.props index 52427cfacb4..4f926455257 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,7 +16,7 @@ 9.0.0-rc.1.24402.7 9.0.0-rc.1.24402.7 9.0.0-rc.1.24402.7 - 9.0.0-preview.7.24373.8 + 9.0.0-rc.1.24402.7 9.0.0-rc.1.24402.7 9.0.0-rc.1.24402.7 9.0.0-rc.1.24402.7 From 85edaef221a578e326b57e265ee9803d2e8bd47e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 3 Aug 2024 15:47:36 -0700 Subject: [PATCH 304/342] Update remainder of tests to use FluentAssurations --- .../Windows/Forms/ClipboardProxyTests.vb | 4 +- .../Forms/ComputerInfoDebugViewTests.vb | 15 ++++---- .../System/Windows/Forms/ControlTests.vb | 14 +++---- .../System/Windows/Forms/ExceptionTests.vb | 35 ++++++++++-------- .../Windows/Forms/ExceptionUtilsTests.vb | 37 +++++++++---------- .../System/Windows/Forms/FileIoProxyTests.vb | 6 +-- 6 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 6fb18574bd4..74f69c10416 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -59,7 +59,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim audioBytes() As Byte = {1, 2, 3} Using audioStream As New MemoryStream(audioBytes) clipboardProxy.SetAudio(audioStream) - Assert.Equal(audioBytes.Length, Assert.IsType(Of MemoryStream)(clipboardProxy.GetAudioStream()).ToArray().Length) + audioStream.Should.BeOfType(Of MemoryStream)() + Dim length As Integer = DirectCast(clipboardProxy.GetAudioStream(), MemoryStream).ToArray().Length + audioBytes.Length.Should.Be(length) Dim waveAudio As MemoryStream = CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream) waveAudio.ToArray.Length.Should.Be(audioBytes.Length) clipboardProxy.ContainsAudio().Should.BeTrue() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb index 37d2497ebb0..ab55d91ee95 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ComputerInfoDebugViewTests.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports FluentAssertions Imports Microsoft.VisualBasic.Devices Imports Microsoft.VisualBasic.Devices.ComputerInfo Imports Xunit @@ -13,19 +14,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub Memory() Dim info As New ComputerInfoDebugView(New ComputerInfo) If PlatformDetection.IsWindows Then - Assert.NotEqual(0UI, info.AvailablePhysicalMemory) - Assert.NotEqual(0UI, info.AvailableVirtualMemory) - Assert.NotEqual(0UI, info.TotalPhysicalMemory) - Assert.NotEqual(0UI, info.TotalVirtualMemory) + info.AvailablePhysicalMemory.Should.NotBe(0UI) + info.AvailableVirtualMemory.Should.NotBe(0UI) + info.TotalPhysicalMemory.Should.NotBe(0UI) + info.TotalVirtualMemory.Should.NotBe(0UI) End If End Sub Public Sub Properties() Dim info As New ComputerInfoDebugView(New ComputerInfo) - Assert.Equal(Globalization.CultureInfo.InstalledUICulture, info.InstalledUICulture) - Assert.Equal(Environment.OSVersion.Platform.ToString(), info.OSPlatform) - Assert.Equal(Environment.OSVersion.Version.ToString(), info.OSVersion) + info.InstalledUICulture.Should.Be(Globalization.CultureInfo.InstalledUICulture) + info.OSPlatform.Should.Be(Environment.OSVersion.Platform.ToString()) + info.OSVersion.Should.Be(Environment.OSVersion.Version.ToString()) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index f714d1be1e7..dbfa2f3f6e4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -22,11 +22,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Action = AddressOf FaultingMethod Dim testCode As Action = Sub() - _control.Invoke(invoker) + _control.Invoke(AddressOf FaultingMethod) End Sub + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. @@ -53,10 +53,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As New MethodInvoker(AddressOf FaultingMethod) Dim testCode As Action = Sub() - _control.Invoke(invoker) + _control.Invoke(New MethodInvoker(AddressOf FaultingMethod)) End Sub Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) @@ -74,8 +73,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Delegate method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Delegate method) ") End Using End Sub @@ -84,10 +83,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc Dim testCode As Action = Sub() - Dim result As Integer = _control.Invoke(Function() invoker(19)) + Dim result As Integer = _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) End Sub Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb index 6be52ebfdfe..65c7884295b 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionTests.vb @@ -2,6 +2,7 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.IO +Imports FluentAssertions Imports Microsoft.VisualBasic.ApplicationServices Imports Xunit @@ -14,31 +15,33 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub CantStartSingleInstanceExceptionTest() Dim ex As Exception = New CantStartSingleInstanceException() - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Dim expected As String = ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect) - Assert.Equal(expected, ex.Message) + ex.Should.BeOfType(Of CantStartSingleInstanceException)() + ex.Message.Should.Be(ExUtils.GetResourceString(SR.AppModel_SingleInstanceCantConnect)) + ex = New CantStartSingleInstanceException("Test") - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Assert.Equal("Test", ex.Message) + ex.Should.BeOfType(Of CantStartSingleInstanceException)() + ex.Message.Should.Be("Test") + ex = New CantStartSingleInstanceException("Test1", New DirectoryNotFoundException) - Assert.IsType(Of CantStartSingleInstanceException)(ex) - Assert.Equal("Test1", ex.Message) - Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + ex.Should.BeOfType(Of CantStartSingleInstanceException)() + ex.Message.Should.Be("Test1") + ex.InnerException.Should.BeOfType(Of DirectoryNotFoundException)() End Sub Public Sub NoStartupFormExceptionTest() Dim ex As Exception = New NoStartupFormException() - Assert.IsType(Of NoStartupFormException)(ex) - Dim expected As String = ExUtils.GetResourceString(SR.AppModel_NoStartupForm) - Assert.Equal(expected, ex.Message) + ex.Should.BeOfType(Of NoStartupFormException)() + ex.Message.Should.Be(ExUtils.GetResourceString(SR.AppModel_NoStartupForm)) + ex = New NoStartupFormException("Test") - Assert.IsType(Of NoStartupFormException)(ex) - Assert.Equal("Test", ex.Message) + ex.Should.BeOfType(Of NoStartupFormException)() + ex.Message.Should.Be("Test") + ex = New NoStartupFormException("Test1", New DirectoryNotFoundException) - Assert.IsType(Of NoStartupFormException)(ex) - Assert.Equal("Test1", ex.Message) - Assert.IsType(Of DirectoryNotFoundException)(ex.InnerException) + ex.Should.BeOfType(Of NoStartupFormException)() + ex.Message.Should.Be("Test1") + ex.InnerException.Should.BeOfType(Of DirectoryNotFoundException)() End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 5dea00d249f..d8657f7f839 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -1,6 +1,7 @@ ' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. +Imports FluentAssertions Imports Microsoft.VisualBasic.CompilerServices Imports Xunit @@ -15,54 +16,54 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetArgumentNullExceptionTest_Succeed() - Dim ex As Exception = ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") - Assert.IsType(Of ArgumentNullException)(ex) - Assert.Equal($"Property MainForm cannot be set to Nothing. (Parameter 'MainForm')", ex.Message) - Assert.Equal("MainForm", CType(ex, ArgumentNullException).ParamName) + Const ArgumentName As String = "MainForm" + Dim ex As Exception = ExUtils.GetArgumentNullException(ArgumentName, SR.General_PropertyNothing, ArgumentName) + ex.Should.BeOfType(Of ArgumentNullException)() + ex.Message.Should.Be($"Property MainForm cannot be set to Nothing. (Parameter '{ArgumentName}')") + CType(ex, ArgumentNullException).ParamName.Should.Be(ArgumentName) End Sub Public Sub GetDirectoryNotFoundExceptionTest_Succeed() Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) - Assert.IsType(Of IO.DirectoryNotFoundException)(ex) - Assert.Equal("File not found.", ex.Message) + ex.Should.BeOfType(Of IO.DirectoryNotFoundException)() + ex.Message.Should.Be("File not found.") End Sub Public Sub GetFileNotFoundExceptionTest_Succeed() Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) - Assert.IsType(Of IO.FileNotFoundException)(ex) - Assert.Equal("File not found.", ex.Message) - Assert.Equal("Test", CType(ex, IO.FileNotFoundException).FileName) + ex.Should.BeOfType(Of IO.FileNotFoundException)() + ex.Message.Should.Be("File not found.") + CType(ex, IO.FileNotFoundException).FileName.Should.Be("Test") End Sub Public Sub GetInvalidOperationExceptionTest_Succeed() - Dim ex As Exception = ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent) - Assert.IsType(Of InvalidOperationException)(ex) + ExUtils.GetInvalidOperationException(SR.Mouse_NoMouseIsPresent).Should.BeOfType(Of InvalidOperationException)() End Sub Public Sub GetIOExceptionTest_Succeed() Dim ex As Exception = ExUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) - Assert.IsType(Of IO.IOException)(ex) - Assert.Equal($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.", ex.Message) + ex.Should.BeOfType(Of IO.IOException)() + ex.Message.Should.Be($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.") End Sub Public Sub GetWin32ExceptionTest_Succeed() Dim ex As Exception = ExUtils.GetWin32Exception(SR.DiagnosticInfo_Memory) - Assert.IsType(Of ComponentModel.Win32Exception)(ex) + ex.Should.BeOfType(Of ComponentModel.Win32Exception)() End Sub Public Sub VbMakeExceptionInvalidValuesTest_Succeed(BadResourceId As Integer) - Dim id As String = $"ID{CStr(BadResourceId)}" - Assert.Equal($"{SR.GetResourceString(id, id)}", ExUtils.VbMakeException(BadResourceId).Message) + Dim id As String = $"ID{BadResourceId}" + VbMakeException(BadResourceId).Message.Should.Be($"{SR.GetResourceString(id, id)}") End Sub @@ -70,9 +71,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer, expected As String) - Dim id As String = $"ID{CStr(errorCode)}" - Dim message As String = ExUtils.VbMakeException(errorCode).Message - Assert.Equal(expected, message) + ExUtils.VbMakeException(errorCode).Message.Should.Be(expected) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 70ddefd18c3..f98af6216d2 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -193,8 +193,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests FileSystemUtils.NormalizePath("") End Sub - Dim ex As Exception = Assert.Throws(Of ArgumentException)(testCode) - ex.Message.Should.Be("The path is empty. (Parameter 'path')") + testCode.Should.Throw(Of ArgumentException).WithMessage("The path is empty. (Parameter 'path')") End Sub @@ -204,8 +203,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests FileSystemUtils.NormalizePath(Nothing) End Sub - Dim ex As Exception = Assert.Throws(Of ArgumentNullException)(testCode) - ex.Message.Should.Be("Value cannot be null. (Parameter 'path')") + testCode.Should.Throw(Of ArgumentNullException).WithMessage("Value cannot be null. (Parameter 'path')") End Sub From a215418f3b9c484d9438a568cd2e38d93a6064d6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 4 Aug 2024 12:41:04 +0000 Subject: [PATCH 305/342] [main] Update dependencies from dotnet/runtime (#11813) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 41ff3a87432..ebcdb150f9e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - ae30cbaf993d757eec8bfc3420b152e1a7bc4af0 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 - + https://github.com/dotnet/runtime - a4fe68fcb3233b8b229444557d38c7565938de05 + 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 diff --git a/eng/Versions.props b/eng/Versions.props index 4f926455257..80bc842ca4e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 6.0.0 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 - 9.0.0-rc.1.24402.7 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24403.1 diff --git a/global.json b/global.json index 599a5b4e7e9..4269dcdf7cf 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24402.7" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24403.1" }, "native-tools": { "cmake": "latest" From bda7e86b5c0a662ec1f0e4f32374472442af032f Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Aug 2024 18:45:40 -0700 Subject: [PATCH 306/342] Remove unneeded Enable Warning --- .../VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb index f24698cc2d7..2504a96f7b6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeTypes.SECURITY_ATTRIBUTES.vb @@ -9,7 +9,6 @@ Namespace Microsoft.VisualBasic.CompilerServices Friend NotInheritable Class SECURITY_ATTRIBUTES -#Enable Warning CA1812 Implements IDisposable Friend Sub New() From f3566848e74ba4a1243a123036653deea074f759 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 4 Aug 2024 18:47:48 -0700 Subject: [PATCH 307/342] Add NativeTypeTests --- .../System/Windows/Forms/NativeTypesTests.vb | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb new file mode 100644 index 00000000000..9d077a2d821 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb @@ -0,0 +1,53 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Runtime.InteropServices +Imports FluentAssertions +Imports Microsoft.VisualBasic.CompilerServices.NativeTypes +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class NativeTypesTests + + + Public Sub SECURITY_ATTRIBUTES_New_Test_Success() + Dim testCode As Action = + Sub() + Dim att As New SECURITY_ATTRIBUTES + att.nLength.Should.Be(Marshal.SizeOf(GetType(SECURITY_ATTRIBUTES))) + att.Dispose() + End Sub + testCode.Should.NotThrow() + End Sub + + + Public Sub STARTUPINFO_New_Test_Success() + Dim startupInfo As New STARTUPINFO + With startupInfo + .dwY.Should.Be(0) + .cb.Should.Be(0) + .lpReserved.Should.Be(IntPtr.Zero) + .lpDesktop.Should.Be(IntPtr.Zero) + .lpTitle.Should.Be(IntPtr.Zero) + .dwX.Should.Be(0) + .dwY.Should.Be(0) + .dwXSize.Should.Be(0) + .dwYSize.Should.Be(0) + .dwXCountChars.Should.Be(0) + .dwYCountChars.Should.Be(0) + .dwFillAttribute.Should.Be(0) + .dwFlags.Should.Be(0) + .wShowWindow.Should.Be(0) + .cbReserved2.Should.Be(0) + .lpReserved2.Should.Be(IntPtr.Zero) + .hStdInput.Should.Be(IntPtr.Zero) + .hStdOutput.Should.Be(IntPtr.Zero) + .hStdError.Should.Be(IntPtr.Zero) + + End With + + End Sub + + End Class +End Namespace From 2798a8145c9b625ca60e6105dc171e2cd6f772c7 Mon Sep 17 00:00:00 2001 From: kirsan31 <17767561+kirsan31@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:07:33 +0300 Subject: [PATCH 308/342] Default font scaling corrections and optimizations. Fix #11037. (#11206) * Small default font scaling corrections and optimizations. Fix #11037. * Outdated SetDefaultFont test removed. New tests added. * Suggestions implemented. * Fluent assertions. --- .../Windows/Forms/Internals/ScaleHelper.cs | 21 +---- .../src/System/Windows/Forms/Application.cs | 54 ++++++++--- .../src/System/Windows/Forms/Control.cs | 29 +++++- .../System/Windows/Forms/ApplicationTests.cs | 90 ++++++++++++++++--- 4 files changed, 149 insertions(+), 45 deletions(-) diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.cs index 45f774531af..59e9e3f66c8 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.cs @@ -215,33 +215,16 @@ internal static Bitmap ScaleToDpi(Bitmap logicalBitmap, int dpi, bool disposeBit internal static bool IsScalingRequired => InitialSystemDpi != OneHundredPercentLogicalDpi; /// - /// Creates a scaled version of the given to the Windows Accessibility Text Size setting (also + /// Creates a scaled version of the given non system to the Windows Accessibility Text Size setting (also /// known as Text Scaling) if needed, otherwise returns . /// internal static Font? ScaleToSystemTextSize(Font? font) { - if (!OsVersion.IsWindows10_1507OrGreater() || font is null || font.IsSystemFont) + if (font is null || font.IsSystemFont || !OsVersion.IsWindows10_1507OrGreater()) { return null; } - if (font.IsSystemFont) - { - // Recreating the SystemFont will have it scaled to the right size for the current setting. This could be - // done more efficiently by querying the OS to see if this is necessary for the specific font. - // - // This should never return null. - Font newSystemFont = SystemFonts.GetFontByName(font.SystemFontName)!; - if (newSystemFont.Size == font.Size) - { - // No point in keeping an identical one, free the resource. - newSystemFont.Dispose(); - return null; - } - - return newSystemFont; - } - // The default(100) and max(225) text scale factor is value what Settings display text scale // applies and also clamps the text scale factor value between 100 and 225 value. // See https://docs.microsoft.com/windows/uwp/design/input/text-scaling. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index bbcb3a3f87a..7db4f080db3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -25,6 +25,9 @@ public sealed partial class Application /// private static EventHandlerList? s_eventHandlers; private static Font? s_defaultFont; + /// + /// Scaled version of non system . + /// private static Font? s_defaultFontScaled; private static string? s_startupPath; private static string? s_executablePath; @@ -1204,23 +1207,52 @@ public static void SetDefaultFont(Font font) if (NativeWindow.AnyHandleCreated) throw new InvalidOperationException(string.Format(SR.Win32WindowAlreadyCreated, nameof(SetDefaultFont))); - // If user made a prior call to this API with a different custom fonts, we want to clean it up. - if (s_defaultFont is not null && !ReferenceEquals(s_defaultFont, font)) - { - s_defaultFont.Dispose(); - } - s_defaultFont = font; ScaleDefaultFont(); } + /// + /// Scale or if needed. + /// internal static void ScaleDefaultFont() { - // It is possible the existing scaled font will be identical after scaling the default font again. Figuring - // that out requires additional complexity that doesn't appear to be strictly necessary. - s_defaultFontScaled?.Dispose(); - s_defaultFontScaled = null; - s_defaultFontScaled = ScaleHelper.ScaleToSystemTextSize(s_defaultFont); + if (s_defaultFont is null) + { + return; + } + + if (s_defaultFont.IsSystemFont) + { + s_defaultFontScaled?.Dispose(); + s_defaultFontScaled = null; + // Recreating the SystemFont will have it scaled to the right size for the current setting. This could be + // done more efficiently by querying the OS to see if this is necessary for the specific font. + // + // This should never return null. + Font newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!; + if (s_defaultFont.Equals(newSystemFont)) + { + // No point in keeping an identical one, free the resource. + newSystemFont.Dispose(); + } + else + { + s_defaultFont = newSystemFont; + } + } + else // non system Font + { + Font? font = ScaleHelper.ScaleToSystemTextSize(s_defaultFont); + if (font is null || !font.Equals(s_defaultFontScaled)) // change s_defaultFontScaled only if needed + { + s_defaultFontScaled?.Dispose(); + s_defaultFontScaled = font; + } + else + { + font.Dispose(); + } + } } /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index d6354e76d7c..25c7eea141c 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -12785,11 +12785,34 @@ protected virtual void WndProc(ref Message m) // SPI_SETICONTITLELOGFONT. Waiting for SPI_SETICONTITLELOGFONT has some sort of timing issue // where layout doesn't always update correctly. // - // Historically we reset the font on WM_SYSCOLORCHANGE, which does come through before any + // Historically we reset the font (s_defaultFont) on WM_SYSCOLORCHANGE, which does come through before any // of the WM_SETTINGCHANGE messages. SPI_SETNONCLIENTMETRICS seems more correct. + // + // We don't want reset font if scaling not actually changed: https://github.com/dotnet/winforms/issues/11037 + // Most (if not all) of these problems was solved with moving this code to SPI_SETNONCLIENTMETRICS! + // s_defaultFont = Application.DefaultFont ?? SystemFonts.MessageBoxFont; + // So we need to check both variants - manually set font (Application.DefaultFont is not null) and auto system font - s_defaultFont = null; - Application.ScaleDefaultFont(); + if (Application.DefaultFont is null) // auto system font + { + if (s_defaultFont is not null) // we need to check only if s_defaultFont already set + { + Font font = SystemFonts.MessageBoxFont!; + if (!s_defaultFont.Equals(font)) // the font has changed + { + s_defaultFont = font; + } + else + { + font.Dispose(); + } + } + } + else // manually set font + { + Application.ScaleDefaultFont(); // will update Application.s_defaultFont or Application.s_defaultFontScaled only if needed + s_defaultFont = Application.DefaultFont; // Application.s_defaultFontScaled ?? Application.s_defaultFont + } } } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ApplicationTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ApplicationTests.cs index 2dc706bf385..5d39868002e 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ApplicationTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ApplicationTests.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.Windows.Forms.VisualStyles; using Microsoft.DotNet.RemoteExecutor; +using Microsoft.Win32; namespace System.Windows.Forms.Tests; @@ -219,36 +220,101 @@ public void Application_SetDefaultFont_AfterHandleCreated_InvalidOperationExcept } [WinFormsFact] - public void Application_SetDefaultFont_MustNotCloneSystemFont() + public void Application_SetDefaultFont_SystemFont() { var applicationTestAccessor = typeof(Application).TestAccessor().Dynamic; - Assert.Null(applicationTestAccessor.s_defaultFont); - Assert.Null(applicationTestAccessor.s_defaultFontScaled); - - Font systemCaptionFont = SystemFonts.CaptionFont; - Assert.True(systemCaptionFont.IsSystemFont); + Font font = applicationTestAccessor.s_defaultFont; + font.Should().BeNull(); + font = applicationTestAccessor.s_defaultFontScaled; + font.Should().BeNull(); // This a unholy, but generally at this stage NativeWindow.AnyHandleCreated=true, // And we won't be able to set the font, unless we flip the bit var nativeWindowTestAccessor = typeof(NativeWindow).TestAccessor().Dynamic; bool currentAnyHandleCreated = nativeWindowTestAccessor.t_anyHandleCreated; + try + { + nativeWindowTestAccessor.t_anyHandleCreated = false; + using Font sysFont = SystemFonts.CaptionFont; + sysFont.IsSystemFont.Should().BeTrue(); + Application.SetDefaultFont(sysFont); + font = applicationTestAccessor.s_defaultFontScaled; + font.Should().BeNull(); + // Because we set default font to system font, then in this test it must not be changed, + // unless, of course, after calling SystemFonts.CaptionFont and this check + // HKCU\Software\Microsoft\Accessibility\TextScaleFactor is not changed + Application.DefaultFont.Should().BeSameAs(sysFont); + + // create fake system font + using Font fakeSysFont = sysFont.WithSize(sysFont.Size * 1.25f); + // set IsSystemFont flag + fakeSysFont.TestAccessor().Dynamic.SetSystemFontName(sysFont.SystemFontName); + fakeSysFont.IsSystemFont.Should().BeTrue(); + Application.SetDefaultFont(fakeSysFont); + font = applicationTestAccessor.s_defaultFontScaled; + font.Should().BeNull(); + Application.DefaultFont.Should().NotBe(fakeSysFont, "Because we got a new real system font."); + Application.DefaultFont.Should().NotBeSameAs(sysFont, "Because we got a new system font."); + Application.DefaultFont.Should().Be(sysFont, "Because the new system font is the same as our original system font."); + } + finally + { + // Flip the bit back + nativeWindowTestAccessor.t_anyHandleCreated = currentAnyHandleCreated; + applicationTestAccessor.s_defaultFont?.Dispose(); + applicationTestAccessor.s_defaultFont = null; + } + } + [WinFormsFact] + public void Application_SetDefaultFont_NonSystemFont() + { + var applicationTestAccessor = typeof(Application).TestAccessor().Dynamic; + Font font = applicationTestAccessor.s_defaultFont; + font.Should().BeNull(); + font = applicationTestAccessor.s_defaultFontScaled; + font.Should().BeNull(); + + using Font customFont = new(new FontFamily("Arial"), 12f); + customFont.IsSystemFont.Should().BeFalse(); + + // This a unholy, but generally at this stage NativeWindow.AnyHandleCreated=true, + // And we won't be able to set the font, unless we flip the bit + var nativeWindowTestAccessor = typeof(NativeWindow).TestAccessor().Dynamic; + bool currentAnyHandleCreated = nativeWindowTestAccessor.t_anyHandleCreated; try { nativeWindowTestAccessor.t_anyHandleCreated = false; - Application.SetDefaultFont(systemCaptionFont); + Application.SetDefaultFont(customFont); + font = applicationTestAccessor.s_defaultFontScaled; + if (!OsVersion.IsWindows10_1507OrGreater()) + { + font.Should().BeNull(); + Application.DefaultFont.Should().BeSameAs(customFont); + return; + } - // We now handle the system font case within the ScaleHelper so we have no need to clone it. - Assert.True(applicationTestAccessor.s_defaultFont.IsSystemFont); + // Retrieve the text scale factor, which is set via Settings > Display > Make Text Bigger. + using RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Accessibility"); + int textScale = (int)(key?.GetValue("TextScaleFactor", 100) ?? 100); + if (textScale == 100) // Application.DefaultFont must be the same + { + font.Should().BeNull("Because TextScaleFactor == 100."); + Application.DefaultFont.Should().BeSameAs(customFont, "Because TextScaleFactor == 100."); + } + else // Application.DefaultFont must be a new scaled font + { + font.Should().NotBeNull("Because TextScaleFactor != 100."); + Application.DefaultFont.Should().NotBe(customFont, "Because textScaleFactor != 100 and we got a new scaled font."); + } } finally { // Flip the bit back nativeWindowTestAccessor.t_anyHandleCreated = currentAnyHandleCreated; - - applicationTestAccessor.s_defaultFont.Dispose(); - applicationTestAccessor.s_defaultFontScaled?.Dispose(); + applicationTestAccessor.s_defaultFont?.Dispose(); applicationTestAccessor.s_defaultFont = null; + applicationTestAccessor.s_defaultFontScaled?.Dispose(); applicationTestAccessor.s_defaultFontScaled = null; } } From b84a0724e7e7bb7eed720ebcc056f1f86d6d0c79 Mon Sep 17 00:00:00 2001 From: Ricardo Bossan Date: Mon, 5 Aug 2024 13:20:52 -0300 Subject: [PATCH 309/342] Suppress CodeQL for BinaryFormatter deserialization in several files (#11805) Suppress CodeQL for BinaryFormatter deserialization for several files Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) --- ...ComponentSerializationService.CodeDomSerializationStore.cs | 2 +- .../src/System/Windows/Forms/Design/CommandSet.cs | 2 +- .../Forms/Design/OleDragDropHandler.ComponentDataObject.cs | 4 ++-- src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs | 3 ++- .../src/System/Resources/ResXSerializationBinder.cs | 3 ++- .../System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs | 2 +- .../src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs | 2 +- .../OLE/DataObject.Composition.NativeToWinFormsAdapter.cs | 3 ++- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs index 9625a6b8583..908ed298b22 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs @@ -225,7 +225,7 @@ private void Deserialize(IServiceProvider? provider, IContainer? container, bool { _resourceStream.Seek(0, SeekOrigin.Begin); #pragma warning disable SYSLIB0011 // Type or member is obsolete - Hashtable? resources = new BinaryFormatter().Deserialize(_resourceStream) as Hashtable; + Hashtable? resources = new BinaryFormatter().Deserialize(_resourceStream) as Hashtable; // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter #pragma warning restore SYSLIB0011 // Type or member is obsolete _resources = new LocalResourceManager(resources); } diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/CommandSet.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/CommandSet.cs index 2462bced8dc..1f6ac15a8bc 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/CommandSet.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/CommandSet.cs @@ -1865,7 +1865,7 @@ protected void OnMenuPaste(object? sender, EventArgs e) { s.Seek(0, SeekOrigin.Begin); #pragma warning disable SYSLIB0011 // Type or member is obsolete - object serializationData = new BinaryFormatter().Deserialize(s); + object serializationData = new BinaryFormatter().Deserialize(s); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter #pragma warning restore SYSLIB0011 // Type or member is obsolete using (ScaleHelper.EnterDpiAwarenessScope(DPI_AWARENESS_CONTEXT.DPI_AWARENESS_CONTEXT_SYSTEM_AWARE)) { diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/OleDragDropHandler.ComponentDataObject.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/OleDragDropHandler.ComponentDataObject.cs index be90f6ad3f4..23c851548f5 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/OleDragDropHandler.ComponentDataObject.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/OleDragDropHandler.ComponentDataObject.cs @@ -139,7 +139,7 @@ private static void GetAssociatedComponents(IComponent component, IDesignerHost { SerializationStream!.Seek(0, SeekOrigin.Begin); #pragma warning disable SYSLIB0011 // Type or member is obsolete - return new BinaryFormatter().Deserialize(SerializationStream); + return new BinaryFormatter().Deserialize(SerializationStream); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter #pragma warning restore SYSLIB0011 // Type or member is obsolete } else if (format.Equals(NestedToolboxItemFormat)) @@ -211,7 +211,7 @@ public void Deserialize(IServiceProvider? serviceProvider, bool removeCurrentCom try { #pragma warning disable SYSLIB0011 // Type or member is obsolete - _serializationData ??= new BinaryFormatter().Deserialize(SerializationStream!); + _serializationData ??= new BinaryFormatter().Deserialize(SerializationStream!); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter #pragma warning restore SYSLIB0011 // Type or member is obsolete if (removeCurrentComponents && _components is not null) diff --git a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs index 127a7d9ba9e..90b04726d70 100644 --- a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs +++ b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs @@ -447,7 +447,8 @@ Type ResolveTypeName(string typeName) Binder = new ResXSerializationBinder(typeResolver) }; - object? result = _binaryFormatter.Deserialize(stream); + // cs/dangerous-binary-deserialization + object? result = _binaryFormatter.Deserialize(stream); // CodeQL[SM03722] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior if (result is ResXNullRef) { result = null; diff --git a/src/System.Windows.Forms/src/System/Resources/ResXSerializationBinder.cs b/src/System.Windows.Forms/src/System/Resources/ResXSerializationBinder.cs index c82af06f7b0..471a5ec5c63 100644 --- a/src/System.Windows.Forms/src/System/Resources/ResXSerializationBinder.cs +++ b/src/System.Windows.Forms/src/System/Resources/ResXSerializationBinder.cs @@ -66,7 +66,8 @@ internal class ResXSerializationBinder : SerializationBinder type ??= _typeResolver.GetType(parsed.FullName); // Hand back what we found or null to let the default loader take over. - return type; + // cs/deserialization/nullbindtotype + return type; // CodeQL[SM04225] : This binder isn't intended as a security facility; it's allowable for us to return null. } public override void BindToName(Type serializedType, out string? assemblyName, out string? typeName) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs index 8f0e9360fd4..e4223188daa 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs @@ -43,7 +43,7 @@ internal PropertyBagStream(Stream stream) { stream.Position = position; #pragma warning disable SYSLIB0011 // Type or member is obsolete - _bag = (Hashtable)new BinaryFormatter().Deserialize(stream); + _bag = (Hashtable)new BinaryFormatter().Deserialize(stream); // CodeQL[SM03722, SM04191] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior" } catch (Exception inner) when (!inner.IsCriticalException()) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs index bbb34638ee9..110eda25ec3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs @@ -1157,7 +1157,7 @@ bool SetValue(PropertyDescriptor currentProperty, object data) } stream.Position = 0; - deserialized = new BinaryFormatter().Deserialize(stream); + deserialized = new BinaryFormatter().Deserialize(stream); // CodeQL[SM03722, SM04191] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior } #pragma warning restore diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs index bda6d4149e9..3b430ccda64 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.NativeToWinFormsAdapter.cs @@ -204,11 +204,12 @@ static object ReadObjectFromHandleDeserializer(Stream stream, bool restrictDeser #pragma warning disable SYSLIB0011 // Type or member is obsolete #pragma warning disable SYSLIB0050 // Type or member is obsolete + // cs/dangerous-binary-deserialization return new BinaryFormatter() { Binder = restrictDeserialization ? new BitmapBinder() : null, AssemblyFormat = FormatterAssemblyStyle.Simple - }.Deserialize(stream); + }.Deserialize(stream); // CodeQL[SM03722] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior #pragma warning restore SYSLIB0050 #pragma warning restore SYSLIB0011 } From aef1eaca434a40b51743c2b1ac41ed3a2ea3387c Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 5 Aug 2024 10:41:42 -0700 Subject: [PATCH 310/342] Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 2507042 (#11801) --- src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf | 2 +- src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index 5e4255d7774..bfa7ac7208c 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -6856,7 +6856,7 @@ Trasování zásobníku, kde došlo k neplatné operaci: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Nastaví počet pro kolekci položek v případě, že je vlastnost ListView ve virtuálním režimu. + Nastaví počet pro kolekci položek v případě, že je vlastnost ListView ve virtuálním režimu. Pokud je vlastnost VirtualMode nastavena na hodnotu true a vlastnost VirtualListSize je větší než 0, je nutné zpracovat událost RetrieveVirtualItem tak, že poskytnete platné položky. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index 8aae9969a91..04575ad5174 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -6856,7 +6856,7 @@ Stapelüberwachung, in der der unzulässige Vorgang auftrat: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Legt die Anzahl der Elemente für die Elementesammlung fest, wenn sich die ListView im virtuellen Modus befindet. + Legt die Anzahl der Elemente für die Elementesammlung fest, wenn sich die ListView im virtuellen Modus befindet. Wenn VirtualMode auf TRUE festgelegt ist und die VirtualListSize-Eigenschaft größer als 0 ist, müssen Sie das RetrieveVirtualItem-Ereignis behandeln, das gültige Elemente bereitstellt. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index b59f7acbed5..22a22d4a708 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -6856,7 +6856,7 @@ El seguimiento de la pila donde tuvo lugar la operación no válida fue: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Establece el recuento de la colección de elementos cuando ListView está en modo virtual. + Establece el recuento de la colección de elementos cuando ListView está en modo virtual. Si VirtualMode se establece en true y la propiedad VirtualListSize es mayor que 0, debe controlar el evento RetrieveVirtualItem que proporciona elementos válidos. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index aeeb58b943c..cc479cf72c2 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -6856,7 +6856,7 @@ Cette opération non conforme s'est produite sur la trace de la pile : Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Définit le nombre de la collection d'éléments lorsque le ListView est en mode virtuel. + Définit le nombre de la collection d’éléments lorsque le ListView est en mode virtuel. Si VirtualMode a la valeur true et que la propriété VirtualListSize est supérieure à 0, vous devez gérer l’événement RetrieveVirtualItem en fournissant des éléments valides. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index 0b86f273b26..d8ade0271fd 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -6856,7 +6856,7 @@ Traccia dello stack da cui si è verificata l'operazione non valida: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Imposta il numero di elementi nella raccolta quando il controllo ListView è in modalità virtuale. + Imposta il numero di elementi nella raccolta quando il controllo ListView è in modalità virtuale. Se VirtualMode è impostato su true e la proprietà VirtualListSize è maggiore di 0, è necessario gestire l'evento RetrieveVirtualItem che fornisce elementi validi. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index ca1a70768d0..cfc4e7c11c0 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -6856,7 +6856,7 @@ Stack trace where the illegal operation occurred was: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - ListView が仮想モードであるときに、項目コレクションの数を設定します。 + ListView が仮想モードであるときに、項目コレクションの数を設定します。VirtualMode が true に設定されていて、VirtualListSize プロパティが 0 より大きい場合は、有効な項目を供給して RetrieveVirtualItem イベントを処理する必要があります。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index 378a8b1073f..1cc6095d9e8 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -6856,7 +6856,7 @@ Stack trace where the illegal operation occurred was: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - ListView가 가상 모드에 있는 경우 항목 컬렉션의 개수를 설정합니다. + ListView가 가상 모드에 있는 경우 항목 컬렉션의 개수를 설정합니다. VirtualMode가 true로 설정되어 있고 VirtualListSize 속성이 0보다 큰 경우 유효한 항목을 제공하는 RetrieveVirtualItem 이벤트를 처리해야 합니다. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index 9ff9fc7c5ef..72c5816c9e9 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -6856,7 +6856,7 @@ Stos śledzenia, w którym wystąpiła zabroniona operacja: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Ustawia liczbę kolekcji elementów, gdy formant ListView jest w trybie wirtualnym. + Ustawia liczbę kolekcji elementów, gdy formant ListView jest w trybie wirtualnym. Jeśli VirtualMode ma wartość true, a właściwość VirtualListSize jest większa niż 0, należy obsłużyć zdarzenie RetrieveVirtualItem, podając prawidłowe elementy. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index 2fe6afe0003..a39d846544c 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -6856,7 +6856,7 @@ Rastreamento de pilha em que a operação ilegal ocorreu: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Define a contagem de coleção de itens quando ListView está no modo virtual. + Define a contagem de coleção de itens quando ListView está no modo virtual. Se VirtualMode estiver definido como true e a propriedade VirtualListSize for maior que 0, você deverá manipular o evento RetrieveVirtualItem fornecendo itens válidos. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index 93c17d57579..f6afcc784e1 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -6857,7 +6857,7 @@ Stack trace where the illegal operation occurred was: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - Устанавливает счетчик коллекции элементов, когда ListView находится в виртуальном режиме. + Устанавливает счетчик коллекции элементов, когда ListView находится в виртуальном режиме. Если для VirtualMode настроено значение true, а значение свойства VirtualListSize больше 0, необходимо обработать событие RetrieveVirtualItem, указав допустимые элементы. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 8cf583187e5..03b61e88211 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -6856,7 +6856,7 @@ Geçersiz işlemin gerçekleştiği yığın izi: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - ListView sanal moddayken öğe koleksiyonu sayısını ayarlar. + ListView sanal moddayken öğe koleksiyonu sayısını ayarlar. VirtualMode true olarak ayarlanmışsa ve VirtualListSize özelliği 0'dan büyükse, RetrieveVirtualItem olayını geçerli öğeler sağlayarak işlemeniz gerekir. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index b29c1028198..04031c8a418 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -6856,7 +6856,7 @@ Stack trace where the illegal operation occurred was: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - 当 ListView 处于虚拟模式时,设置项集合的计数。 + 当 ListView 处于虚拟模式时,设置项集合的计数。如果 VirtualMode 设置为 true,且 VirtualListSize 属性大于 0,则必须处理提供有效项的 RetrieveVirtualItem 事件。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index e5344649fc9..eef29ce9bb1 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -6856,7 +6856,7 @@ Stack trace where the illegal operation occurred was: Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items. - 設定 ListView 處於虛擬模式時項目集合的計數。 + 設定 ListView 處於虛擬模式時項目集合的計數。如果 VirtualMode 設定為 true,並且 VirtualListSize 屬性大於 0,則必須處理提供有效項目的 RetrieveVirtualItem 事件。 From c62451f7871030bb938ca49e72cf5c017d64bc9a Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 16:18:27 -0700 Subject: [PATCH 311/342] These are just tests that require no changes to any existing code and changes ControlTests to use FluentAssertions. --- .../Microsoft.VisualBasic.Forms.Tests.vbproj | 10 ++- .../AssemblyPublicKeyIsAsExpectedTest.vb | 28 +++++++ .../System/Windows/Forms/ControlTests.vb | 40 +++++---- .../System/Windows/Forms/TimeTests.vb | 44 ++++++++++ .../Windows/Forms/UserTests.UserIdentity.vb | 42 ++++++++++ .../Windows/Forms/UserTests.UserPrincipal.vb | 34 ++++++++ .../System/Windows/Forms/UserTests.vb | 65 ++++++++++++++ .../TestUtilities/GetUniqueUtilities.vb | 19 +++++ .../TempDirectoryFileFunctions.vb | 62 ++++++++++++++ .../Windows/TestUtilities/WebListener.vb | 84 +++++++++++++++++++ 10 files changed, 410 insertions(+), 18 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index e711e903745..1781f140963 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -4,11 +4,17 @@ $(TargetFramework) $(TargetFramework)-windows7.0 true - Microsoft.VisualBasic.Forms.Tests + latest true + On + Off + On + WindowsFormsWithCustomSubMain + True + Library - + diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb new file mode 100644 index 00000000000..ca79c88066a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -0,0 +1,28 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Text +Imports FluentAssertions +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class AssemblyPublicKeyIsAsExpectedTest + Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" + + ''' + ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. + ''' + + Public Sub AssemblyPublicKeyIsAsExpected() + Dim publicKey() As Byte = GetType(ControlTests).Assembly.GetName().GetPublicKey() + Dim sb As New StringBuilder + For Each [byte] As Byte In publicKey + sb.AppendFormat("{0:x2}", [byte]) + Next + + AssemblyPK.Should.Be(sb.ToString()) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index 4a044fa8114..dbfa2f3f6e4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -2,9 +2,11 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests + Partial Public Class ControlTests Public Shared Function FaultingFunc(a As Integer) As Integer @@ -20,9 +22,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Action = AddressOf FaultingMethod - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(AddressOf FaultingMethod) + End Sub + + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -38,8 +43,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Action method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Action method) ") End Using End Sub @@ -48,9 +53,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As New MethodInvoker(AddressOf FaultingMethod) - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(New MethodInvoker(AddressOf FaultingMethod)) + End Sub + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -66,8 +73,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Delegate method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Delegate method) ") End Using End Sub @@ -76,11 +83,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( + Dim testCode As Action = Sub() - Dim result As Integer = _control.Invoke(Function() invoker(19)) - End Sub) + Dim result As Integer = _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) + End Sub + + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -94,8 +102,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__4-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 111 ' at Xunit.Assert.RecordException(Action testCode) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\Record.cs:line 27 - Assert.Contains(NameOf(FaultingFunc), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingFunc)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ") End Using End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb new file mode 100644 index 00000000000..31ded914b0f --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -0,0 +1,44 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports FluentAssertions +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class TimeTests + Private Const PrecisionTickLimit As Integer = 1000 + + Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean + Dim diff As TimeSpan = systemLocalTime - vbLocalTime + Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks + End Function + + + Public Sub SystemTimeNotNew() + Date.Now.Should.BeAfter(New Date) + End Sub + + + Public Sub VbGmtTimeCloseToDateUtcNow() + timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit).Should.BeTrue() + End Sub + + + Public Sub VbLocalTimeCloseToDateNow() + timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit).Should.BeTrue() + End Sub + + + Public Sub VbTickCountCloseToEnvironmentTickCount() + Dim condition As Boolean = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit + condition.Should.BeTrue() + End Sub + + + Public Sub VbTimeNotNew() + My.Computer.Clock.LocalTime.Should.BeAfter(New Date) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb new file mode 100644 index 00000000000..a086c0709d1 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb @@ -0,0 +1,42 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Public Class UserIdentity + Implements IIdentity + + Private ReadOnly _authenticationType As String + Private ReadOnly _name As String + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean) + _authenticationType = authenticationType + _name = name + End Sub + + Public ReadOnly Property AuthenticationType As String Implements IIdentity.AuthenticationType + Get + Return _authenticationType + End Get + End Property + + Public ReadOnly Property IsAuthenticated As Boolean Implements IIdentity.IsAuthenticated + Get + Return True + End Get + End Property + + Public ReadOnly Property Name As String Implements IIdentity.Name + Get + Return _name + End Get + End Property + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb new file mode 100644 index 00000000000..c38fa0e7363 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb @@ -0,0 +1,34 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Private NotInheritable Class UserPrincipal + Implements IPrincipal + + Private _role As String + Private _userIdentity As IIdentity + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) + _userIdentity = New UserIdentity(authenticationType, name, isAuthenticated) + _role = role + End Sub + + Public ReadOnly Property Identity As IIdentity Implements IPrincipal.Identity + Get + Return _userIdentity + End Get + End Property + + Public Function IsInRole(role As String) As Boolean Implements IPrincipal.IsInRole + Return role = _role + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb new file mode 100644 index 00000000000..8967888036a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -0,0 +1,65 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports FluentAssertions +Imports Microsoft.VisualBasic.ApplicationServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + + Public Sub UserBaseTest() + Dim testUser As New User + testUser.CurrentPrincipal.Should.BeNull() + Dim userPrincipal As New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + testUser.CurrentPrincipal = userPrincipal + testUser.CurrentPrincipal.Should.NotBeNull() + testUser.CurrentPrincipal.Should.Be(userPrincipal) + userPrincipal.Identity.AuthenticationType.Should.Be("Basic") + End Sub + + + Public Sub UserGetNameTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.Name.Should.Be("Test") + End Sub + + + Public Sub UserIsAuthenticatedTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.IsAuthenticated.Should.BeTrue() + End Sub + + + Public Sub UserIsInRoleTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.IsInRole("Guest").Should.BeTrue() + testUser.IsInRole("Basic").Should.BeFalse() + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb new file mode 100644 index 00000000000..58361538c20 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb @@ -0,0 +1,19 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Namespace Microsoft.VisualBasic.Forms.Tests + Friend Module GetUniqueUtilities + + Friend Function GetUniqueInteger(positiveOnly As Boolean) As Integer + If positiveOnly Then + Return Math.Abs(Guid.NewGuid().GetHashCode()) + End If + Return Guid.NewGuid().GetHashCode() + End Function + + Friend Function GetUniqueText() As String + Return Guid.NewGuid().ToString("D") + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb new file mode 100644 index 00000000000..67944cf4a68 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb @@ -0,0 +1,62 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Runtime.CompilerServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Module TempDirectoryFileFunctions + + ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName + Friend ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") + + ''' + ''' Creates or returns a directory based on the name of the function that + ''' call it. The base directory is described above. + ''' Even if directory exists this call will success and just return it. + ''' + ''' + ''' If >1 use line number as part of name. + ''' The name of a directory that is safe to write to and is verified to exist. + Friend Function CreateTempDirectory( Optional memberName As String = Nothing, Optional lineNumber As Integer = -1) As String + Dim folder As String + If lineNumber > 1 Then + folder = Path.Combine(s_baseTempPath, $"{memberName}{lineNumber}") + Else + folder = Path.Combine(s_baseTempPath, memberName) + End If + + Directory.CreateDirectory(folder) + Return folder + End Function + + ''' + ''' If size >= 0 then create the file with size length. + ''' + ''' Full path to working directory. + ''' + ''' Size in bytes of the file to be created. + ''' + ''' The full path and file name of the created file. + ''' If size = -1 no file is create but the full path is returned. + ''' + Friend Function CreateTempFile(tmpFilePath As String, Optional optionalFilename As String = "Testing.Text", Optional size As Integer = -1) As String + Dim filename As String = GetDestinationFileName(tmpFilePath, optionalFilename) + + If size >= 0 Then + Using destinationStream As FileStream = File.Create(filename) + destinationStream.Write(New Byte(size - 1) {}) + destinationStream.Flush() + destinationStream.Close() + End Using + End If + Return filename + End Function + + Friend Function GetDestinationFileName(tmpFilePath As String, Optional filename As String = "testing.txt") As String + Return Path.Combine(tmpFilePath, filename) + End Function + + End Module +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb new file mode 100644 index 00000000000..cd35c68bc46 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb @@ -0,0 +1,84 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.IO +Imports System.Net +Imports System.Runtime.CompilerServices + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class WebListener + Private ReadOnly _downloadFileUrlPrefix As String + Private ReadOnly _fileSize As Integer + + Private _password As String + Private _userName As String + + ''' + ''' The name of the function that creates the server is uses to establish the file to be downloaded. + ''' + ''' Is used to create the file name and the size of download. + ''' Used to establish the file path to be downloaded. + Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) + _fileSize = fileSize + _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" + Address = $"{_downloadFileUrlPrefix}T{fileSize}" + End Sub + + ''' + ''' Used for authenticated download. + ''' + ''' Passed to Me.New. + ''' Name to match for authorization. + ''' Password to match for authorization. + ''' Passed to Me.New. + Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) + Me.New(fileSize, memberName) + _userName = userName + _password = password + End Sub + + Public ReadOnly Property Address As String + + Friend Function ProcessRequests() As HttpListener + ' Create a listener and add the prefixes. + Dim listener As New HttpListener() + + listener.Prefixes.Add(_downloadFileUrlPrefix) + If _userName IsNot Nothing OrElse _password IsNot Nothing Then + listener.AuthenticationSchemes = AuthenticationSchemes.Basic + End If + listener.Start() + Task.Run( + Sub() + ' Start the listener to begin listening for requests. + Dim response As HttpListenerResponse = Nothing + + Try + ' Note: GetContext blocks while waiting for a request. + Dim context As HttpListenerContext = listener.GetContext() + ' Create the response. + response = context.Response + Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) + If context.User?.Identity.IsAuthenticated Then + If String.IsNullOrWhiteSpace(identity.Name) OrElse identity.Name <> _userName OrElse String.IsNullOrWhiteSpace(identity.Password) OrElse identity.Password <> _password Then + response.StatusCode = HttpStatusCode.Unauthorized + Exit Try + End If + End If + Dim responseString As String = Strings.StrDup(_fileSize, "A") + ' Simulate network traffic + Threading.Thread.Sleep(20) + Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) + response.ContentLength64 = buffer.Length + Dim output As Stream = response.OutputStream + output.Write(buffer, 0, buffer.Length) + Finally + response?.Close() + End Try + End Sub) + Return listener + End Function + + End Class +End Namespace From 6fd03c03b1b72590ac4397969baf5b988a83b35e Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 16:42:21 -0700 Subject: [PATCH 312/342] Clean up formatting and convert ClipboardProzyTests to use FluentAssertions --- .../System/Windows/Forms/UserTests.vb | 38 +++++++++---------- .../MyServices/ClipboardProxyTests.cs | 21 +++++----- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb index ad47141d4d0..8967888036a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -14,10 +14,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim testUser As New User testUser.CurrentPrincipal.Should.BeNull() Dim userPrincipal As New UserPrincipal( - authenticationType:="Basic", - name:="Test", - isAuthenticated:=True, - role:="Guest") + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") testUser.CurrentPrincipal = userPrincipal testUser.CurrentPrincipal.Should.NotBeNull() testUser.CurrentPrincipal.Should.Be(userPrincipal) @@ -27,11 +27,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub UserGetNameTest() Dim testUser As New User With { - .CurrentPrincipal = New UserPrincipal( - authenticationType:="Basic", - name:="Test", - isAuthenticated:=True, - role:="Guest") + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") } testUser.Name.Should.Be("Test") End Sub @@ -39,11 +39,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub UserIsAuthenticatedTest() Dim testUser As New User With { - .CurrentPrincipal = New UserPrincipal( - authenticationType:="Basic", - name:="Test", - isAuthenticated:=True, - role:="Guest") + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") } testUser.IsAuthenticated.Should.BeTrue() End Sub @@ -51,11 +51,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub UserIsInRoleTest() Dim testUser As New User With { - .CurrentPrincipal = New UserPrincipal( - authenticationType:="Basic", - name:="Test", - isAuthenticated:=True, - role:="Guest") + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") } testUser.IsInRole("Guest").Should.BeTrue() testUser.IsInRole("Basic").Should.BeFalse() diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index c2d8014c513..646645f5b9e 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; +using FluentAssertions; using Microsoft.VisualBasic.Devices; using DataFormats = System.Windows.Forms.DataFormats; using TextDataFormat = System.Windows.Forms.TextDataFormat; @@ -18,7 +19,7 @@ public class ClipboardProxyTests public void Audio() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); + clipboard.ContainsAudio().Should().Be(System.Windows.Forms.Clipboard.ContainsAudio()); // Not tested: // Public Function GetAudioStream() As Stream @@ -32,9 +33,9 @@ public void Clear() var clipboard = (new Computer()).Clipboard; string text = GetUniqueText(); clipboard.SetText(text); - Assert.True(System.Windows.Forms.Clipboard.ContainsText()); + System.Windows.Forms.Clipboard.ContainsText().Should().BeTrue(); clipboard.Clear(); - Assert.False(System.Windows.Forms.Clipboard.ContainsText()); + System.Windows.Forms.Clipboard.ContainsText().Should().BeFalse(); } [WinFormsFact] @@ -60,7 +61,7 @@ public void DataObject() public void FileDropList() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsFileDropList(), clipboard.ContainsFileDropList()); + System.Windows.Forms.Clipboard.ContainsFileDropList().Should().Be(clipboard.ContainsFileDropList()); // Not tested: // Public Function GetFileDropList() As StringCollection // Public Sub SetFileDropList(filePaths As StringCollection) @@ -71,8 +72,8 @@ public void Image() { var clipboard = (new Computer()).Clipboard; Bitmap image = new(2, 2); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsImage(), clipboard.ContainsImage()); - Assert.Equal(System.Windows.Forms.Clipboard.GetImage(), clipboard.GetImage()); + System.Windows.Forms.Clipboard.ContainsImage().Should().Be(clipboard.ContainsImage()); + System.Windows.Forms.Clipboard.GetImage().Should().Be(clipboard.GetImage()); clipboard.SetImage(image); } @@ -82,9 +83,9 @@ public void Text() var clipboard = (new Computer()).Clipboard; string text = GetUniqueText(); clipboard.SetText(text, TextDataFormat.UnicodeText); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); - Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); + System.Windows.Forms.Clipboard.ContainsText().Should().Be(clipboard.ContainsText()); + System.Windows.Forms.Clipboard.GetText().Should().Be(clipboard.GetText()); + System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(text); } } From 5521a4a38d1b3278685e5cad32ce64bb95629167 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 16:44:19 -0700 Subject: [PATCH 313/342] Improve Clipboard Proxy Tests --- .../MyServices/ClipboardProxyTests.cs | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 9977d6ec803..646645f5b9e 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; +using FluentAssertions; using Microsoft.VisualBasic.Devices; using DataFormats = System.Windows.Forms.DataFormats; using TextDataFormat = System.Windows.Forms.TextDataFormat; @@ -12,78 +13,79 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [CollectionDefinition("Sequential", DisableParallelization = true)] public class ClipboardProxyTests { + private static string GetUniqueText() => Guid.NewGuid().ToString("D"); + [WinFormsFact] - public void Clear() + public void Audio() { var clipboard = (new Computer()).Clipboard; - string text = GetUniqueText(); - clipboard.SetText(text); - Assert.True(System.Windows.Forms.Clipboard.ContainsText()); - clipboard.Clear(); - Assert.False(System.Windows.Forms.Clipboard.ContainsText()); + clipboard.ContainsAudio().Should().Be(System.Windows.Forms.Clipboard.ContainsAudio()); + + // Not tested: + // Public Function GetAudioStream() As Stream + // Public Sub SetAudio(audioBytes As Byte()) + // Public Sub SetAudio(audioStream As Stream) } [WinFormsFact] - public void Text() + public void Clear() { var clipboard = (new Computer()).Clipboard; string text = GetUniqueText(); - clipboard.SetText(text, TextDataFormat.UnicodeText); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); - Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.SetText(text); + System.Windows.Forms.Clipboard.ContainsText().Should().BeTrue(); + clipboard.Clear(); + System.Windows.Forms.Clipboard.ContainsText().Should().BeFalse(); } [WinFormsFact] - public void Image() + public void Data() { var clipboard = (new Computer()).Clipboard; - Bitmap image = new(2, 2); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsImage(), clipboard.ContainsImage()); - Assert.Equal(System.Windows.Forms.Clipboard.GetImage(), clipboard.GetImage()); - clipboard.SetImage(image); + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); + Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); + clipboard.SetData(DataFormats.UnicodeText, data); } [WinFormsFact] - public void Audio() + public void DataObject() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); - // Not tested: - // Public Function GetAudioStream() As Stream - // Public Sub SetAudio(audioBytes As Byte()) - // Public Sub SetAudio(audioStream As Stream) + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); + clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); } [WinFormsFact] public void FileDropList() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsFileDropList(), clipboard.ContainsFileDropList()); + System.Windows.Forms.Clipboard.ContainsFileDropList().Should().Be(clipboard.ContainsFileDropList()); // Not tested: // Public Function GetFileDropList() As StringCollection // Public Sub SetFileDropList(filePaths As StringCollection) } [WinFormsFact] - public void Data() + public void Image() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); - Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); - clipboard.SetData(DataFormats.UnicodeText, data); + Bitmap image = new(2, 2); + System.Windows.Forms.Clipboard.ContainsImage().Should().Be(clipboard.ContainsImage()); + System.Windows.Forms.Clipboard.GetImage().Should().Be(clipboard.GetImage()); + clipboard.SetImage(image); } [WinFormsFact] - public void DataObject() + public void Text() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); - clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); + string text = GetUniqueText(); + clipboard.SetText(text, TextDataFormat.UnicodeText); + System.Windows.Forms.Clipboard.ContainsText().Should().Be(clipboard.ContainsText()); + System.Windows.Forms.Clipboard.GetText().Should().Be(clipboard.GetText()); + System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(text); } - - private static string GetUniqueText() => Guid.NewGuid().ToString("D"); } From 9929bd035408f6c7d6038135fc642789f4a0fda7 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 17:38:15 -0700 Subject: [PATCH 314/342] Remove code note neede now --- .../TestUtilities/GetUniqueUtilities.vb | 19 ----- .../TempDirectoryFileFunctions.vb | 62 -------------- .../Windows/TestUtilities/WebListener.vb | 84 ------------------- 3 files changed, 165 deletions(-) delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb delete mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb deleted file mode 100644 index 58361538c20..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/GetUniqueUtilities.vb +++ /dev/null @@ -1,19 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Namespace Microsoft.VisualBasic.Forms.Tests - Friend Module GetUniqueUtilities - - Friend Function GetUniqueInteger(positiveOnly As Boolean) As Integer - If positiveOnly Then - Return Math.Abs(Guid.NewGuid().GetHashCode()) - End If - Return Guid.NewGuid().GetHashCode() - End Function - - Friend Function GetUniqueText() As String - Return Guid.NewGuid().ToString("D") - End Function - - End Module -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb deleted file mode 100644 index 67944cf4a68..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb +++ /dev/null @@ -1,62 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.IO -Imports System.Runtime.CompilerServices - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Module TempDirectoryFileFunctions - - ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName - Friend ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") - - ''' - ''' Creates or returns a directory based on the name of the function that - ''' call it. The base directory is described above. - ''' Even if directory exists this call will success and just return it. - ''' - ''' - ''' If >1 use line number as part of name. - ''' The name of a directory that is safe to write to and is verified to exist. - Friend Function CreateTempDirectory( Optional memberName As String = Nothing, Optional lineNumber As Integer = -1) As String - Dim folder As String - If lineNumber > 1 Then - folder = Path.Combine(s_baseTempPath, $"{memberName}{lineNumber}") - Else - folder = Path.Combine(s_baseTempPath, memberName) - End If - - Directory.CreateDirectory(folder) - Return folder - End Function - - ''' - ''' If size >= 0 then create the file with size length. - ''' - ''' Full path to working directory. - ''' - ''' Size in bytes of the file to be created. - ''' - ''' The full path and file name of the created file. - ''' If size = -1 no file is create but the full path is returned. - ''' - Friend Function CreateTempFile(tmpFilePath As String, Optional optionalFilename As String = "Testing.Text", Optional size As Integer = -1) As String - Dim filename As String = GetDestinationFileName(tmpFilePath, optionalFilename) - - If size >= 0 Then - Using destinationStream As FileStream = File.Create(filename) - destinationStream.Write(New Byte(size - 1) {}) - destinationStream.Flush() - destinationStream.Close() - End Using - End If - Return filename - End Function - - Friend Function GetDestinationFileName(tmpFilePath As String, Optional filename As String = "testing.txt") As String - Return Path.Combine(tmpFilePath, filename) - End Function - - End Module -End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb deleted file mode 100644 index cd35c68bc46..00000000000 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb +++ /dev/null @@ -1,84 +0,0 @@ -' Licensed to the .NET Foundation under one or more agreements. -' The .NET Foundation licenses this file to you under the MIT license. - -Imports System.IO -Imports System.Net -Imports System.Runtime.CompilerServices - -Namespace Microsoft.VisualBasic.Forms.Tests - - Public Class WebListener - Private ReadOnly _downloadFileUrlPrefix As String - Private ReadOnly _fileSize As Integer - - Private _password As String - Private _userName As String - - ''' - ''' The name of the function that creates the server is uses to establish the file to be downloaded. - ''' - ''' Is used to create the file name and the size of download. - ''' Used to establish the file path to be downloaded. - Public Sub New(fileSize As Integer, Optional memberName As String = Nothing) - _fileSize = fileSize - _downloadFileUrlPrefix = $"http://127.0.0.1:8080/{memberName}/" - Address = $"{_downloadFileUrlPrefix}T{fileSize}" - End Sub - - ''' - ''' Used for authenticated download. - ''' - ''' Passed to Me.New. - ''' Name to match for authorization. - ''' Password to match for authorization. - ''' Passed to Me.New. - Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) - Me.New(fileSize, memberName) - _userName = userName - _password = password - End Sub - - Public ReadOnly Property Address As String - - Friend Function ProcessRequests() As HttpListener - ' Create a listener and add the prefixes. - Dim listener As New HttpListener() - - listener.Prefixes.Add(_downloadFileUrlPrefix) - If _userName IsNot Nothing OrElse _password IsNot Nothing Then - listener.AuthenticationSchemes = AuthenticationSchemes.Basic - End If - listener.Start() - Task.Run( - Sub() - ' Start the listener to begin listening for requests. - Dim response As HttpListenerResponse = Nothing - - Try - ' Note: GetContext blocks while waiting for a request. - Dim context As HttpListenerContext = listener.GetContext() - ' Create the response. - response = context.Response - Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) - If context.User?.Identity.IsAuthenticated Then - If String.IsNullOrWhiteSpace(identity.Name) OrElse identity.Name <> _userName OrElse String.IsNullOrWhiteSpace(identity.Password) OrElse identity.Password <> _password Then - response.StatusCode = HttpStatusCode.Unauthorized - Exit Try - End If - End If - Dim responseString As String = Strings.StrDup(_fileSize, "A") - ' Simulate network traffic - Threading.Thread.Sleep(20) - Dim buffer() As Byte = Text.Encoding.UTF8.GetBytes(responseString) - response.ContentLength64 = buffer.Length - Dim output As Stream = response.OutputStream - output.Write(buffer, 0, buffer.Length) - Finally - response?.Close() - End Try - End Sub) - Return listener - End Function - - End Class -End Namespace From 6059ae09fb9e468e5fc53e097548bca2b0b94a06 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 18:36:38 -0700 Subject: [PATCH 315/342] Improve audio tests and make FluentAssertions --- .../VisualBasic/Devices/AudioTests.cs | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs index 60d544d8960..3ee404bc0ac 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs @@ -1,16 +1,43 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.ComponentModel; +using FluentAssertions; + namespace Microsoft.VisualBasic.Devices.Tests; public class AudioTests { + private static string GetUniqueName() => Guid.NewGuid().ToString("D"); + [Fact] public void Play() { string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); Audio audio = new(); - Assert.Throws(() => audio.Play(location)); + Action testCode = () => audio.Play(location); + testCode.Should().Throw(); + } + + [Fact] + public void PlayInvalidMode_Throws() + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, (AudioPlayMode)(-1)); + testCode.Should().Throw(); + } + + [Theory] + [InlineData(AudioPlayMode.Background)] + [InlineData(AudioPlayMode.BackgroundLoop)] + [InlineData(AudioPlayMode.WaitToComplete)] + public void PlayAllModes_Throws(AudioPlayMode mode) + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, mode); + testCode.Should().Throw(); } // Not tested: @@ -22,6 +49,4 @@ public void Stop() Audio audio = new(); audio.Stop(); } - - private static string GetUniqueName() => Guid.NewGuid().ToString("D"); } From 3d5461ce2bfff44431fadb48baa9acea173935cf Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 5 Aug 2024 18:37:51 -0700 Subject: [PATCH 316/342] Improve Audio Tests and use FluentAssertions --- .../VisualBasic/Devices/AudioTests.cs | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs index 60d544d8960..3ee404bc0ac 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs @@ -1,16 +1,43 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.ComponentModel; +using FluentAssertions; + namespace Microsoft.VisualBasic.Devices.Tests; public class AudioTests { + private static string GetUniqueName() => Guid.NewGuid().ToString("D"); + [Fact] public void Play() { string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); Audio audio = new(); - Assert.Throws(() => audio.Play(location)); + Action testCode = () => audio.Play(location); + testCode.Should().Throw(); + } + + [Fact] + public void PlayInvalidMode_Throws() + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, (AudioPlayMode)(-1)); + testCode.Should().Throw(); + } + + [Theory] + [InlineData(AudioPlayMode.Background)] + [InlineData(AudioPlayMode.BackgroundLoop)] + [InlineData(AudioPlayMode.WaitToComplete)] + public void PlayAllModes_Throws(AudioPlayMode mode) + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, mode); + testCode.Should().Throw(); } // Not tested: @@ -22,6 +49,4 @@ public void Stop() Audio audio = new(); audio.Stop(); } - - private static string GetUniqueName() => Guid.NewGuid().ToString("D"); } From ab9eb71f903d7771849887a15ab5ff3f37ba4c00 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:36:20 +0000 Subject: [PATCH 317/342] [main] Update dependencies from dotnet/runtime (#11823) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ebcdb150f9e..f466499270b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 - + https://github.com/dotnet/runtime - 1cc0186c3e120ee4ed0494cf74fef0a3ef0118d6 + af5a23cea6cf99842187d028946d2be2f62b7001 diff --git a/eng/Versions.props b/eng/Versions.props index 80bc842ca4e..249a7f3546c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 6.0.0 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 - 9.0.0-rc.1.24403.1 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24405.9 diff --git a/global.json b/global.json index 4269dcdf7cf..21aa9bfeb4e 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24403.1" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24405.9" }, "native-tools": { "cmake": "latest" From 013bff2fac2f9baf2c43083536189c96094f88b5 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Tue, 6 Aug 2024 19:04:06 -0700 Subject: [PATCH 318/342] Remove extra blank line. --- .../src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb index 113c5f38082..849e129edbc 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Logging/FileLogTraceListener.vb @@ -36,7 +36,6 @@ Namespace Microsoft.VisualBasic.Logging ' Changes to this enum must be reflected in ValidateLogfileLocationEnumValue() TempDirectory - LocalUserApplicationDirectory CommonApplicationDirectory ExecutableDirectory From 4c0d8511e4453c87335605b395e522301fb69119 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:17:02 -0700 Subject: [PATCH 319/342] [main] Update dependencies from dotnet/runtime (#11834) Update dependencies from https://github.com/dotnet/runtime build 20240806.14 Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.Formats.Nrbf , System.IO.Hashing , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Runtime.Serialization.Formatters , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.9.0 From Version 9.0.0-rc.1.24405.9 -> To Version 9.0.0-rc.1.24406.14 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f466499270b..6891ac5aeaf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 - + https://github.com/dotnet/runtime - af5a23cea6cf99842187d028946d2be2f62b7001 + 4985021ebfff545de02caa3386e3dd4b21784b95 diff --git a/eng/Versions.props b/eng/Versions.props index 249a7f3546c..708bff69bb8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 6.0.0 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 - 9.0.0-rc.1.24405.9 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24406.14 diff --git a/global.json b/global.json index 21aa9bfeb4e..84831c27210 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24405.9" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24406.14" }, "native-tools": { "cmake": "latest" From 4c8f625f78edb05882389f2bb9e8e1ce395f2495 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:17:26 -0700 Subject: [PATCH 320/342] [main] Update dependencies from dotnet/arcade (#11833) Update dependencies from https://github.com/dotnet/arcade build 20240805.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.CMake.Sdk , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.24401.1 -> To Version 9.0.0-beta.24405.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- global.json | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6891ac5aeaf..041089dcde5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -191,29 +191,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 diff --git a/eng/Versions.props b/eng/Versions.props index 708bff69bb8..68dc8052350 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24401.1 - 9.0.0-beta.24401.1 - 9.0.0-beta.24401.1 + 9.0.0-beta.24405.1 + 9.0.0-beta.24405.1 + 9.0.0-beta.24405.1 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 84831c27210..a0656146c3d 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24401.1", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24401.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24401.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24405.1", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24405.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24405.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24406.14" }, From 7006c1c2c5515bc4b648e5b3c2ea6a604867e0b9 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 7 Aug 2024 18:07:17 -0700 Subject: [PATCH 321/342] Ensure source paths leave 40 characters for root (#11835) The default path for VS is in the user directory, which ends up being something like `C:\Users\jkuhne\source\repos\winforms`. Recent paths make the repo impossible to sync. I've added a test that reserves 40 characters for the repro root path and moved files out of subdirectories that violated that. A longer follow up is to see if we can pick some type names that aren't so long. Additionally we should try to up this check to 50 characters- which would require more renaming. --- ...ertySerializationDiagnosticAnalyzerTest.cs | 0 ...SharpIncrementalSourceGeneratorVerifier.cs | 0 .../Verifiers/CSharpSourceGeneratorTest`1.cs | 0 .../Verifiers/CSharpVerifierHelper.cs | 0 .../ApplicationConfigurationGeneratorTests.cs | 2 +- ...tialize_DefaultFont=SansSerif.verified.txt | 0 ...Initialize_DefaultFont=Tahoma.verified.txt | 0 ...nitialize_DefaultFont=default.verified.txt | 0 ...teInitialize_DefaultFont=null.verified.txt | 0 ...lize_EnableVisualStyles=false.verified.txt | 0 ...alize_EnableVisualStyles=true.verified.txt | 0 ...ze_UseCompTextRendering=false.verified.txt | 0 ...ize_UseCompTextRendering=true.verified.txt | 0 ...tionConfigurationInitializeBuilderTests.cs | 2 +- ....GenerateInitialize_default_boilerplate.cs | 0 ...ts.GenerateInitialize_default_top_level.cs | 0 ...ateInitialize_user_settings_boilerplate.cs | 0 ...Tests.GenerateInitialize_user_top_level.cs | 0 ...tializeBuilderTests.default_boilerplate.cs | 0 ...nitializeBuilderTests.default_top_level.cs | 0 .../ProjectFileReaderTests.FontConverter.cs | 0 .../Generators/ProjectFileReaderTests.cs | 0 ...indows.Forms.Analyzers.CSharp.Tests.csproj | 4 +- ...rSerializationVisibilityCodeFixProvider.vb | 0 ...lizationConfigurationDiagnosticAnalyzer.vb | 0 .../VisualBasicDiagnosticDescriptors.vb | 0 ...ySerializationConfigurationAnalyzerTest.vb | 0 ...s.Forms.Analyzers.VisualBasic.Tests.vbproj | 6 --- .../TestUtilities.Tests/PathLengthTests.cs | 40 +++++++++++++++++++ 29 files changed, 44 insertions(+), 10 deletions(-) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Analyzers/Verifiers/CSharpVerifierHelper.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationGeneratorTests.cs (98%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=SansSerif.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=Tahoma.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=default.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=null.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=false.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=true.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=false.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=true.verified.txt (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ApplicationConfigurationInitializeBuilderTests.cs (97%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_boilerplate.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_top_level.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_settings_boilerplate.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_top_level.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_boilerplate.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_top_level.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ProjectFileReaderTests.FontConverter.cs (100%) rename src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/{System/Windows/Forms => }/Generators/ProjectFileReaderTests.cs (100%) rename src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/{System/Windows/Forms/VisualBasic/CodeFixes => }/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb (100%) rename src/System.Windows.Forms.Analyzers.VisualBasic/src/{System/Windows/Forms/VisualBasic => }/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (100%) rename src/System.Windows.Forms.Analyzers.VisualBasic/src/{System/Windows/Forms/VisualBasic => }/Diagnostic/VisualBasicDiagnosticDescriptors.vb (100%) rename src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/{System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration => }/MissingPropertySerializationConfigurationAnalyzerTest.vb (100%) create mode 100644 src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/MissingPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpIncrementalSourceGeneratorVerifier.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpSourceGeneratorTest`1.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpVerifierHelper.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpVerifierHelper.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/Verifiers/CSharpVerifierHelper.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Analyzers/Verifiers/CSharpVerifierHelper.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationGeneratorTests.cs similarity index 98% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationGeneratorTests.cs index 064935b03e2..2a10b26f3cc 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationGeneratorTests.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationGeneratorTests.cs @@ -220,6 +220,6 @@ public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_user_s private SourceText LoadFileContent(string testName) => SourceText.From( - File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{testName}.cs"), + File.ReadAllText($@"Generators\MockData\{GetType().Name}.{testName}.cs"), Encoding.UTF8); } diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=SansSerif.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=SansSerif.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=SansSerif.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=SansSerif.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=Tahoma.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=Tahoma.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=Tahoma.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=Tahoma.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=default.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=default.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=default.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=default.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=null.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=null.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=null.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_DefaultFont=null.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=false.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=false.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=false.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=false.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=true.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=true.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=true.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_EnableVisualStyles=true.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=false.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=false.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=false.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=false.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=true.verified.txt b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=true.verified.txt similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=true.verified.txt rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.GenerateInitialize_UseCompTextRendering=true.verified.txt diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.cs similarity index 97% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.cs index ff3595863ee..3f7d373eef6 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ApplicationConfigurationInitializeBuilderTests.cs +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ApplicationConfigurationInitializeBuilderTests.cs @@ -30,7 +30,7 @@ public partial class ApplicationConfigurationInitializeBuilderTests [InlineData("MyProject", "default_boilerplate")] public void ApplicationConfigurationInitializeBuilder_GenerateInitialize_can_handle_namespace(string? ns, string expectedFileName) { - string expected = File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{expectedFileName}.cs"); + string expected = File.ReadAllText($@"Generators\MockData\{GetType().Name}.{expectedFileName}.cs"); string output = ApplicationConfigurationInitializeBuilder.GenerateInitialize(ns, new ApplicationConfig( diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_boilerplate.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_boilerplate.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_boilerplate.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_boilerplate.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_top_level.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_top_level.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_top_level.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_default_top_level.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_settings_boilerplate.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_settings_boilerplate.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_settings_boilerplate.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_settings_boilerplate.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_top_level.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_top_level.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_top_level.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationGeneratorTests.GenerateInitialize_user_top_level.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_boilerplate.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_boilerplate.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_boilerplate.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_boilerplate.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_top_level.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_top_level.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_top_level.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/MockData/ApplicationConfigurationInitializeBuilderTests.default_top_level.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ProjectFileReaderTests.FontConverter.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.FontConverter.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ProjectFileReaderTests.FontConverter.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ProjectFileReaderTests.cs similarity index 100% rename from src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Generators/ProjectFileReaderTests.cs rename to src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/Generators/ProjectFileReaderTests.cs diff --git a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj index 103ea05e9d6..f694dc32083 100644 --- a/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj +++ b/src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System.Windows.Forms.Analyzers.CSharp.Tests.csproj @@ -28,8 +28,8 @@ - - + + PreserveNewest diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb b/src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb similarity index 100% rename from src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/System/Windows/Forms/VisualBasic/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb rename to src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.vb diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb similarity index 100% rename from src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb rename to src/System.Windows.Forms.Analyzers.VisualBasic/src/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/src/Diagnostic/VisualBasicDiagnosticDescriptors.vb similarity index 100% rename from src/System.Windows.Forms.Analyzers.VisualBasic/src/System/Windows/Forms/VisualBasic/Diagnostic/VisualBasicDiagnosticDescriptors.vb rename to src/System.Windows.Forms.Analyzers.VisualBasic/src/Diagnostic/VisualBasicDiagnosticDescriptors.vb diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/MissingPropertySerializationConfigurationAnalyzerTest.vb similarity index 100% rename from src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System/Windows/Forms/Analyzers/MissingPropertySerializationConfiguration/MissingPropertySerializationConfigurationAnalyzerTest.vb rename to src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/MissingPropertySerializationConfigurationAnalyzerTest.vb diff --git a/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj index c59dd663ee6..083c68dac3c 100644 --- a/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj +++ b/src/System.Windows.Forms.Analyzers.VisualBasic/tests/UnitTests/System.Windows.Forms.Analyzers.VisualBasic.Tests/System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj @@ -28,10 +28,4 @@ - - - PreserveNewest - - - diff --git a/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs b/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs new file mode 100644 index 00000000000..e8b3fe470fc --- /dev/null +++ b/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs @@ -0,0 +1,40 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using FluentAssertions; +using System.IO.Enumeration; + +namespace System.Tests; + +public class PathLengthTests +{ + [Fact] + public void RepoPathsLeaveRoomForRoot() + { + string currentPath = typeof(PathLengthTests).Assembly.Location; + currentPath = Path.GetFullPath(@"..\..\..\..\..\..\src", currentPath); + Directory.Exists(currentPath).Should().BeTrue(); + + // Current path will be something like C:\Users\jkuhne\source\repos\winforms\src (41 chars, 38 without src). + // We want to reserve 40 characters of the path length for everything past src. + int currentRootLength = currentPath.Length - "src".Length; + + const int MaxRootLength = 40; + + int maxLength = 260 - (currentRootLength > MaxRootLength + ? MaxRootLength + : MaxRootLength + (MaxRootLength - currentRootLength)); + + FileSystemEnumerable enumerable = new( + currentPath, + (ref FileSystemEntry entry) => entry.ToFullPath(), + new EnumerationOptions() { RecurseSubdirectories = true }) + { + ShouldIncludePredicate = (ref FileSystemEntry entry) => + // Directory doesn't contain a trailing slash + entry.Directory.Length + entry.FileName.Length > maxLength + }; + + enumerable.Should().BeEmpty(); + } +} From 64e4b37132d992ae4298e19be883b225d535eb4b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:42:26 +0000 Subject: [PATCH 322/342] [main] Update dependencies from dotnet/runtime (#11839) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 041089dcde5..fe959855d46 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 - + https://github.com/dotnet/runtime - 4985021ebfff545de02caa3386e3dd4b21784b95 + a562a9fe5582dabf601884392d5ce987484ea706 diff --git a/eng/Versions.props b/eng/Versions.props index 68dc8052350..79e98660bf7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 6.0.0 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 - 9.0.0-rc.1.24406.14 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24407.9 diff --git a/global.json b/global.json index a0656146c3d..623ea9267f8 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24405.1", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24405.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24406.14" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24407.9" }, "native-tools": { "cmake": "latest" From 7aeab490a5dfa8c9429da4164a1d3b4e97ba6780 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:58:52 +0000 Subject: [PATCH 323/342] [main] Update dependencies from dotnet/arcade (#11838) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- global.json | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fe959855d46..25e5b789f9b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -191,29 +191,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c diff --git a/eng/Versions.props b/eng/Versions.props index 79e98660bf7..3f0c4c1ae1c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24405.1 - 9.0.0-beta.24405.1 - 9.0.0-beta.24405.1 + 9.0.0-beta.24408.1 + 9.0.0-beta.24408.1 + 9.0.0-beta.24408.1 17.4.0-preview-20220707-01 diff --git a/global.json b/global.json index 623ea9267f8..8cf01fe1675 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24405.1", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24405.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24405.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.1", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.1", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24407.9" }, From 4467b6816d86e3f104bca0e57c780c2ba3160849 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 8 Aug 2024 17:03:00 -0700 Subject: [PATCH 324/342] Shorten long Lines --- .../System/Windows/Forms/ControlTests.vb | 3 ++- .../System/Windows/Forms/TimeTests.vb | 20 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index dbfa2f3f6e4..21eaa9a503f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -85,7 +85,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim testCode As Action = Sub() - Dim result As Integer = _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) + Dim result As Integer = + _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) End Sub Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index 31ded914b0f..5a3d4f4d04f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -9,7 +9,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Class TimeTests Private Const PrecisionTickLimit As Integer = 1000 - Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean + Private Function timesEqual( + systemLocalTime As Date, + vbLocalTime As Date, + acceptableDifferenceInTicks As Long) As Boolean + Dim diff As TimeSpan = systemLocalTime - vbLocalTime Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks End Function @@ -21,18 +25,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub VbGmtTimeCloseToDateUtcNow() - timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit).Should.BeTrue() + timesEqual( + systemLocalTime:=My.Computer.Clock.GmtTime, + vbLocalTime:=Date.UtcNow, + acceptableDifferenceInTicks:=PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbLocalTimeCloseToDateNow() - timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit).Should.BeTrue() + timesEqual( + systemLocalTime:=My.Computer.Clock.LocalTime, + vbLocalTime:=Date.Now, + acceptableDifferenceInTicks:=PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbTickCountCloseToEnvironmentTickCount() - Dim condition As Boolean = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit - condition.Should.BeTrue() + Dim tickCount As Integer = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) + Call (tickCount < PrecisionTickLimit).Should.BeTrue() End Sub From 00c3b617d7dc5f00582f87c144f4fc9e69754387 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 8 Aug 2024 19:20:04 -0700 Subject: [PATCH 325/342] Shorten long lines Cleanup CliboardProxyTests --- .../Windows/Forms/ClipboardProxyTests.vb | 9 +- .../System/Windows/Forms/ControlTests.vb | 3 +- .../Windows/Forms/ExceptionUtilsTests.vb | 10 +- .../System/Windows/Forms/FileIoProxyTests.vb | 108 ++- .../System/Windows/Forms/NativeTypesTests.vb | 2 - .../Windows/Forms/NetworkDownloadTests.vb | 645 ++++++++---------- .../Forms/SingleInstanceHelpersTests.vb | 1 - .../System/Windows/Forms/TimeTests.vb | 20 +- .../TempDirectoryFileFunctions.vb | 2 +- .../Windows/TestUtilities/WebListener.vb | 13 +- 10 files changed, 419 insertions(+), 394 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb index 74f69c10416..f7f936142cc 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ClipboardProxyTests.vb @@ -23,7 +23,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests clipboardProxy.SetText(text) Clipboard.ContainsText.Should.Be(clipboardProxy.ContainsText) Clipboard.ContainsText.Should.Be(clipboardProxy.ContainsText(TextDataFormat.Text)) - Clipboard.ContainsData(DataFormats.Text).Should.Be(clipboardProxy.ContainsData(DataFormats.Text)) + + Dim expected As Boolean = clipboardProxy.ContainsData(DataFormats.Text) + Clipboard.ContainsData(DataFormats.Text).Should.Be(expected) + clipboardProxy.GetText().Should.Be(text) text = GetUniqueText() clipboardProxy.SetText(text, TextDataFormat.Text) @@ -46,7 +49,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests clipboardProxy.SetAudio(audioBytes) clipboardProxy.ContainsAudio().Should.BeTrue() clipboardProxy.ContainsData(DataFormats.WaveAudio).Should.BeTrue() - CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream).Length.Should.Be(audioBytes.Length) + + Dim memoryStream As MemoryStream = CType(clipboardProxy.GetData(DataFormats.WaveAudio), MemoryStream) + memoryStream.Length.Should.Be(audioBytes.Length) Dim audioStream As MemoryStream = CType(clipboardProxy.GetAudioStream(), MemoryStream) audioStream.Should.NotBeNull() diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index dbfa2f3f6e4..21eaa9a503f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -85,7 +85,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim testCode As Action = Sub() - Dim result As Integer = _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) + Dim result As Integer = + _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) End Sub Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index d8657f7f839..9a2cdb03db5 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -17,10 +17,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetArgumentNullExceptionTest_Succeed() Const ArgumentName As String = "MainForm" - Dim ex As Exception = ExUtils.GetArgumentNullException(ArgumentName, SR.General_PropertyNothing, ArgumentName) + Dim ex As Exception = ExUtils.GetArgumentNullException( + ArgumentName, + resourceID:=SR.General_PropertyNothing, + ArgumentName) ex.Should.BeOfType(Of ArgumentNullException)() - ex.Message.Should.Be($"Property MainForm cannot be set to Nothing. (Parameter '{ArgumentName}')") CType(ex, ArgumentNullException).ParamName.Should.Be(ArgumentName) + ex.Message.Should.Be($"Property MainForm cannot be set to Nothing. (Parameter '{ArgumentName}')") End Sub @@ -49,7 +52,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetIOExceptionTest_Succeed() Dim ex As Exception = ExUtils.GetIOException(SR.IO_FileExists_Path, IO.Path.GetTempPath) ex.Should.BeOfType(Of IO.IOException)() - ex.Message.Should.Be($"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.") + ex.Message.Should.Be( + $"Could not complete operation since a file already exists in this path '{IO.Path.GetTempPath}'.") End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index f98af6216d2..c72044f322c 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -23,20 +23,44 @@ Namespace Microsoft.VisualBasic.Forms.Tests "IndexFirstLastCompanyCityCountry 4321;1234;321;654321;123;1234567" + Private Sub CleanupDirectories(testDirectory As String, Optional destinationDirectory As String = Nothing) + If String.IsNullOrEmpty(testDirectory) Then + Throw New ArgumentException($"'{NameOf(testDirectory)}' cannot be null or empty.", NameOf(testDirectory)) + End If + If testDirectory = IO.Path.GetTempPath Then + Throw New ArgumentException($"'{NameOf(testDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(testDirectory)) + End If + + _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + If destinationDirectory IsNot Nothing Then + If destinationDirectory = IO.Path.GetTempPath Then + Throw New ArgumentException($"'{NameOf(destinationDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(testDirectory)) + End If + _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + End If + End Sub + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) - Dim file1 As String = CreateTempFile(testDirectory, NameOf(file1)) + Dim file1 As String = CreateTempFile(tmpFilePath:=testDirectory, optionalFilename:=NameOf(file1)) Dim byteArray As Byte() = {4} _fileSystem.WriteAllBytes(file1, byteArray, append:=False) Dim destinationDirectory As String = CreateTempDirectory(lineNumber:=2) - _fileSystem.CopyDirectory(testDirectory, destinationDirectory, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing) + _fileSystem.CopyDirectory( + sourceDirectoryName:=testDirectory, + destinationDirectory, + showUI:=UIOption.OnlyErrorDialogs, + onUserCancel:=UICancelOption.DoNothing) IO.Directory.Exists(testDirectory).Should.BeTrue() IO.Directory.Exists(destinationDirectory).Should.BeTrue() - IO.Directory.EnumerateFiles(testDirectory).Count.Should.Be(IO.Directory.EnumerateFiles(destinationDirectory).Count) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + + Dim count As Integer = IO.Directory.EnumerateFiles(destinationDirectory).Count + IO.Directory.EnumerateFiles(testDirectory).Count.Should.Be(count) + + CleanupDirectories(testDirectory, destinationDirectory) End Sub @@ -51,8 +75,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests IO.Directory.Exists(testDirectory).Should.BeTrue() IO.Directory.Exists(destinationDirectory).Should.BeTrue() IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(IO.Directory.EnumerateFiles(testDirectory).Count) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory, destinationDirectory) End Sub @@ -67,7 +91,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -82,7 +107,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -97,7 +123,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -112,7 +139,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim bytes As Byte() = _fileSystem.ReadAllBytes(file2) bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -135,7 +163,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.WriteAllBytes(file1, byteArray, append:=False) IO.File.Exists(file1).Should.BeTrue() - _fileSystem.DeleteDirectory(testDirectory, showUI:=UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) + _fileSystem.DeleteDirectory( + directory:=testDirectory, + showUI:=UIOption.OnlyErrorDialogs, + recycle:=RecycleOption.DeletePermanently) IO.Directory.Exists(testDirectory).Should.BeFalse() End Sub @@ -150,7 +181,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteFile(file1) IO.File.Exists(file1).Should.BeFalse() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory( + directory:=testDirectory, + onDirectoryNotEmpty:=DeleteDirectoryOption.DeleteAllContents) End Sub @@ -164,7 +197,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently) IO.File.Exists(file1).Should.BeFalse() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory( + directory:=testDirectory, + onDirectoryNotEmpty:=DeleteDirectoryOption.DeleteAllContents) End Sub @@ -178,7 +213,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.DeleteFile(file1, UIOption.OnlyErrorDialogs, RecycleOption.DeletePermanently, UICancelOption.DoNothing) IO.File.Exists(file1).Should.BeFalse() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + CleanupDirectories(testDirectory) End Sub @@ -193,7 +228,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests FileSystemUtils.NormalizePath("") End Sub - testCode.Should.Throw(Of ArgumentException).WithMessage("The path is empty. (Parameter 'path')") + testCode.Should.Throw(Of ArgumentException).WithMessage( + expectedWildcardPattern:="The path is empty. (Parameter 'path')") End Sub @@ -203,7 +239,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests FileSystemUtils.NormalizePath(Nothing) End Sub - testCode.Should.Throw(Of ArgumentNullException).WithMessage("Value cannot be null. (Parameter 'path')") + testCode.Should.Throw(Of ArgumentNullException).WithMessage( + expectedWildcardPattern:="Value cannot be null. (Parameter 'path')") End Sub @@ -224,7 +261,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.CombinePath(testDirectory, NameOf(fileA)).Should.Be(filenames(0)) filenames = _fileSystem.FindInFiles(testDirectory, containsText:="A", ignoreCase:=True, SearchOption.SearchTopLevelOnly, "*C") filenames.Count.Should.Be(0) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -239,7 +277,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests IO.Directory.Exists(testDirectory).Should.BeFalse() IO.Directory.Exists(destinationDirectory).Should.BeTrue() IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(1) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(destinationDirectory) End Sub @@ -254,7 +293,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests IO.Directory.Exists(testDirectory).Should.BeFalse() IO.Directory.Exists(destinationDirectory).Should.BeTrue() IO.Directory.EnumerateFiles(destinationDirectory).Count.Should.Be(1) - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(destinationDirectory) End Sub @@ -271,7 +311,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests IO.File.Exists(file2).Should.BeTrue() bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -288,7 +329,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests IO.File.Exists(file2).Should.BeTrue() bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -304,7 +346,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests text.Should.Be("A") End Using - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + CleanupDirectories(testDirectory) End Sub @@ -335,9 +377,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests totalFields.Should.Be(7) End While totalRows.Should.Be(2) - reader.Close() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -353,7 +395,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests text.Should.Be("A") End Using - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + CleanupDirectories(testDirectory) End Sub @@ -380,7 +422,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests End While totalRows.Should.Be(2) reader.Close() - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -393,7 +436,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests text.Should.Be("A") End Using - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + CleanupDirectories(testDirectory) End Sub @@ -406,7 +449,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim bytes As Byte() = _fileSystem.ReadAllBytes(fileA) bytes.Length.Should.Be(1) bytes(0).Should.Be(4) - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -416,7 +460,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.WriteAllText(fileA, "A", append:=False) Dim text As String = _fileSystem.ReadAllText(fileA) text.Should.Be("A") - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub @@ -426,7 +471,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests _fileSystem.WriteAllText(fileA, "A", append:=False, Encoding.UTF8) Dim text As String = _fileSystem.ReadAllText(fileA, Encoding.UTF8) text.Should.Be("A") - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + + CleanupDirectories(testDirectory) End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb index 9d077a2d821..4e40adfea28 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NativeTypesTests.vb @@ -44,9 +44,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests .hStdInput.Should.Be(IntPtr.Zero) .hStdOutput.Should.Be(IntPtr.Zero) .hStdError.Should.Be(IntPtr.Zero) - End With - End Sub End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index c64de9a2772..ede037ce19c 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -17,6 +17,16 @@ Namespace Microsoft.VisualBasic.Forms.Tests Private Const InvalidUrlAddress As String = "invalidURL" Private Const TestingConnectionTimeout As Integer = 100000 + Private Shared Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) + Debug.Assert(Path.GetTempPath <> testDirectory) + listener.Stop() + listener.Close() + If Not String.IsNullOrWhiteSpace(testDirectory) Then + testDirectory.Should.StartWith(Path.GetTempPath) + Directory.Delete(testDirectory, recursive:=True) + End If + End Sub + ''' ''' Verify that testDirectory exists, that destinationFileName exist and what its length is. ''' @@ -35,25 +45,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Return fileInfo.Length End Function - Private Sub CleanUp(listener As HttpListener, Optional testDirectory As String = Nothing) - Debug.Assert(Path.GetTempPath <> testDirectory) - listener.Stop() - listener.Close() - If Not String.IsNullOrWhiteSpace(testDirectory) Then - testDirectory.Should.StartWith(Path.GetTempPath) - Directory.Delete(testDirectory, recursive:=True) - End If - End Sub - Public Sub DownloadFile_UriCheckDestinationIsDirectory_Throws() Dim testDirectory As String = CreateTempDirectory() Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - - Try - Dim testCode As Action = + Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( address:=New Uri(webListener.Address), @@ -65,6 +63,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True, onUserCancel:=UICancelOption.DoNothing) End Sub + Try testCode.Should() _ .Throw(Of InvalidOperationException)() _ .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) @@ -82,27 +81,28 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=$"{destinationFileName}{separator}", + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + Dim exceptionExpression As Expressions.Expression(Of Func(Of ArgumentException, Boolean)) = + Function(e) e.Message.StartsWith(SR.IO_FilePathException) _ + AndAlso e.Message.Contains(NameOf(destinationFileName)) Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName:=$"{destinationFileName}{separator}", - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should() _ - .Throw(Of ArgumentException)() _ - .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + .Throw(Of ArgumentException)() _ + .Where(exceptionExpression) File.Exists(destinationFileName).Should.BeFalse() Finally - CleanUp(listener, testDirectory) + CleanUp(listener, testDirectory) End Try End Sub @@ -114,24 +114,25 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + Dim exceptionExpression As Expressions.Expression(Of Func(Of ArgumentException, Boolean)) = + Function(e) e.Message.StartsWith(SR.IO_FilePathException) _ + AndAlso e.Message.Contains(NameOf(destinationFileName)) Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should() _ - .Throw(Of ArgumentException)() _ - .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + .Throw(Of ArgumentException)() _ + .Where(exceptionExpression) File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) @@ -146,21 +147,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName:=root, ' This is a Root Directory! - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should() _ .Throw(Of InvalidOperationException)() _ .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) @@ -176,15 +175,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(uriString:=webListener.Address), + destinationFileName) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(uriString:=webListener.Address), - destinationFileName) - End Sub - testCode.Should.NotThrow() Directory.Exists(testDirectory).Should.BeTrue() ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) @@ -199,20 +196,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=-1, + overwrite:=False) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=-1, - overwrite:=False) - End Sub - testCode.Should() _ .Throw(Of ArgumentException)() _ .Where(Function(e) e.Message.StartsWith(SR.Network_BadConnectionTimeout)) @@ -228,21 +223,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=CType(Nothing, Uri), - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False) - - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -258,20 +251,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile(address:=CType(Nothing, Uri), - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -287,21 +278,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=CType(Nothing, Uri), + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=CType(Nothing, Uri), - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -317,7 +306,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( @@ -344,7 +332,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( @@ -371,7 +358,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() Dim networkCredentials As New NetworkCredential(DefaultUserName, DefaultPassword) - Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( @@ -423,7 +409,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( @@ -449,13 +434,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName) - End Sub + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName) + End Sub testCode.Should.NotThrow() Directory.Exists(testDirectory).Should.BeTrue() @@ -470,7 +454,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = Sub() My.Computer.Network.DownloadFile( @@ -495,17 +478,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=New Uri(webListener.Address), + destinationFileName, + userName:=DefaultUserName, + password) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=New Uri(webListener.Address), - destinationFileName, - userName:=DefaultUserName, - password) - End Sub - testCode.Should _ .Throw(Of WebException)() _ .WithMessage(SR.net_webstatus_Unauthorized) @@ -522,22 +503,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=testDirectory, ' This is a Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName:=testDirectory, ' This is a Directory! - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - - End Sub - testCode.Should _ .Throw(Of InvalidOperationException)() _ .WithMessage(SR.Network_DownloadNeedsFilename) @@ -555,12 +533,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - - Try - - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( address:=webListener.Address, destinationFileName:=$"{destinationFileName}{separator}", userName:=String.Empty, @@ -569,12 +544,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests connectionTimeout:=TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - - End Sub - + End Sub + Dim exceptionExpression As Expressions.Expression(Of Func(Of ArgumentException, Boolean)) = + Function(e) e.Message.StartsWith(SR.IO_FilePathException) _ + AndAlso e.Message.Contains(NameOf(destinationFileName)) + Try testCode.Should _ .Throw(Of ArgumentException)() _ - .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + .Where(exceptionExpression) File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) @@ -589,24 +566,25 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub + Dim exceptionExpression As Expressions.Expression(Of Func(Of ArgumentException, Boolean)) = + Function(e) e.Message.StartsWith(SR.IO_FilePathException) _ + AndAlso e.Message.Contains(NameOf(destinationFileName)) Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should _ .Throw(Of ArgumentException)() _ - .Where(Function(e) e.Message.StartsWith(SR.IO_FilePathException) AndAlso e.Message.Contains(NameOf(destinationFileName))) + .Where(exceptionExpression) File.Exists(destinationFileName).Should.BeFalse() Finally CleanUp(listener, testDirectory) @@ -621,21 +599,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=root, ' This is a Root Directory! + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName:=root, ' This is a Root Directory! - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should _ .Throw(Of InvalidOperationException)() _ .Where(Function(e) e.Message.StartsWith(SR.Network_DownloadNeedsFilename)) @@ -651,16 +627,14 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName) - - End Sub - testCode.Should.NotThrow() Directory.Exists(testDirectory).Should.BeTrue() ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) @@ -677,15 +651,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address, + destinationFileName) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address, - destinationFileName) - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -702,16 +674,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim testDirectory As String = CreateTempDirectory() Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName) - - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -727,20 +696,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidOverwrite_Throws(destinationFileName As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=Nothing, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName:=Nothing, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False) - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -756,21 +723,19 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DownloadFile_UrlWhereDestinationFileNameInvalidWithOnUerCancel_Throws(destinationFileName As String) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName:=Nothing, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False, + onUserCancel:=UICancelOption.DoNothing) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName:=Nothing, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False, - onUserCancel:=UICancelOption.DoNothing) - End Sub - testCode.Should _ .Throw(Of ArgumentNullException)() _ .Where(Function(e) e.Message.StartsWith(SR.General_ArgumentNullException)) @@ -798,10 +763,10 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=False) End Sub - + Dim value As String = SR.IO_FileExists_Path.Replace("{0}", destinationFileName) testCode.Should _ - .Throw(Of IOException)() _ - .Where(Function(e) e.Message.Equals(SR.IO_FileExists_Path.Replace("{0}", destinationFileName))) + .Throw(Of IOException)() _ + .Where(Function(e) e.Message.Equals(value)) Directory.Exists(testDirectory).Should.BeTrue() ValidateDownload(destinationFileName).Should.Be(1) @@ -814,23 +779,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=InvalidUrlAddress, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=InvalidUrlAddress, - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False) - End Sub - + Dim value As String = SR.Network_InvalidUriString.Replace("{0}", "invalidURL") testCode.Should _ .Throw(Of ArgumentException)() _ - .Where(Function(e) e.Message.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"))) + .Where(Function(e) e.Message.StartsWith(value)) Directory.Exists(testDirectory).Should.BeTrue() File.Exists(destinationFileName).Should.BeFalse() @@ -845,22 +809,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=InvalidUrlAddress, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=InvalidUrlAddress, - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False) - - - End Sub - testCode.Should() _ .Throw(Of ArgumentException)() _ .Where(Function(e) e.Message.StartsWith(SR.Network_InvalidUriString.Replace("{0}", "invalidURL"))) @@ -876,21 +836,22 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=Nothing, + password:=String.Empty, + showUI:=True, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=False) + End Sub - Try - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName, - userName:=Nothing, - password:=String.Empty, - showUI:=True, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=False) + testCode.Should.NotThrow() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) - ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub @@ -899,10 +860,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( + Sub() + My.Computer.Network.DownloadFile( address:=webListener.Address, destinationFileName, userName:=String.Empty, @@ -911,7 +871,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests connectionTimeout:=TestingConnectionTimeout, overwrite:=True, onUserCancel:=UICancelOption.DoNothing) - End Sub + End Sub testCode.Should.NotThrow() Directory.Exists(testDirectory).Should.BeTrue() @@ -925,26 +885,23 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = CreateTempFile(testDirectory, size:=1) Dim webListener As New WebListener(DownloadSmallFileSize) Dim listener As HttpListener = webListener.ProcessRequests() + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=TestingConnectionTimeout, + overwrite:=True) + End Sub - Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=TestingConnectionTimeout, - overwrite:=True) - End Sub + testCode.Should.NotThrow() + Directory.Exists(testDirectory).Should.BeTrue() + ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) - testCode.Should.NotThrow() - Directory.Exists(testDirectory).Should.BeTrue() - ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) - Finally - CleanUp(listener, testDirectory) - End Try + CleanUp(listener, testDirectory) End Sub @@ -953,17 +910,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, DefaultPassword) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=DefaultUserName, + password:=DefaultPassword) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName, - userName:=DefaultUserName, - password:=DefaultPassword) - End Sub - testCode.Should.NotThrow() Directory.Exists(testDirectory).Should.BeTrue() ValidateDownload(destinationFileName).Should.Be(DownloadSmallFileSize) @@ -978,19 +933,18 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadLargeFileSize) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=String.Empty, + password:=String.Empty, + showUI:=False, + connectionTimeout:=1, + overwrite:=True) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName, - userName:=String.Empty, - password:=String.Empty, - showUI:=False, - connectionTimeout:=1, - overwrite:=True) - End Sub testCode.Should _ .Throw(Of WebException)() _ @@ -1009,16 +963,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Dim destinationFileName As String = GetDestinationFileName(testDirectory) Dim webListener As New WebListener(DownloadSmallFileSize, DefaultUserName, String.Empty) Dim listener As HttpListener = webListener.ProcessRequests() - + Dim testCode As Action = + Sub() + My.Computer.Network.DownloadFile( + address:=webListener.Address, + destinationFileName, + userName:=DefaultUserName, + password) + End Sub Try - Dim testCode As Action = - Sub() - My.Computer.Network.DownloadFile( - address:=webListener.Address, - destinationFileName, - userName:=DefaultUserName, - password) - End Sub testCode.Should _ .Throw(Of WebException)() _ diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb index 8546ce0b3c8..3066667e0f1 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/SingleInstanceHelpersTests.vb @@ -69,7 +69,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests Await tokenSource.CancelAsync() End Using End If - End Function End Class diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb index 31ded914b0f..5a3d4f4d04f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -9,7 +9,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Class TimeTests Private Const PrecisionTickLimit As Integer = 1000 - Private Function timesEqual(systemLocalTime As Date, vbLocalTime As Date, acceptableDifferenceInTicks As Long) As Boolean + Private Function timesEqual( + systemLocalTime As Date, + vbLocalTime As Date, + acceptableDifferenceInTicks As Long) As Boolean + Dim diff As TimeSpan = systemLocalTime - vbLocalTime Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks End Function @@ -21,18 +25,24 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub VbGmtTimeCloseToDateUtcNow() - timesEqual(My.Computer.Clock.GmtTime, Date.UtcNow, PrecisionTickLimit).Should.BeTrue() + timesEqual( + systemLocalTime:=My.Computer.Clock.GmtTime, + vbLocalTime:=Date.UtcNow, + acceptableDifferenceInTicks:=PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbLocalTimeCloseToDateNow() - timesEqual(My.Computer.Clock.LocalTime, Date.Now, PrecisionTickLimit).Should.BeTrue() + timesEqual( + systemLocalTime:=My.Computer.Clock.LocalTime, + vbLocalTime:=Date.Now, + acceptableDifferenceInTicks:=PrecisionTickLimit).Should.BeTrue() End Sub Public Sub VbTickCountCloseToEnvironmentTickCount() - Dim condition As Boolean = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) < PrecisionTickLimit - condition.Should.BeTrue() + Dim tickCount As Integer = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) + Call (tickCount < PrecisionTickLimit).Should.BeTrue() End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb index 67944cf4a68..18fa07d34bc 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/TempDirectoryFileFunctions.vb @@ -8,7 +8,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Module TempDirectoryFileFunctions - ' The base path is system temp directory/a guaranteed unique directory based on a GUID/A temp directory bases on TestName + ' The base path is system temp directory / a guaranteed unique directory based on a GUID / a temp directory based on TestName Friend ReadOnly s_baseTempPath As String = Path.Combine(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") ''' diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb index cd35c68bc46..df56930c667 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/TestUtilities/WebListener.vb @@ -32,7 +32,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests ''' Name to match for authorization. ''' Password to match for authorization. ''' Passed to Me.New. - Public Sub New(fileSize As Integer, userName As String, password As String, Optional memberName As String = Nothing) + Public Sub New( + fileSize As Integer, + userName As String, + password As String, + Optional memberName As String = Nothing) + Me.New(fileSize, memberName) _userName = userName _password = password @@ -61,7 +66,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests response = context.Response Dim identity As HttpListenerBasicIdentity = CType(context.User?.Identity, HttpListenerBasicIdentity) If context.User?.Identity.IsAuthenticated Then - If String.IsNullOrWhiteSpace(identity.Name) OrElse identity.Name <> _userName OrElse String.IsNullOrWhiteSpace(identity.Password) OrElse identity.Password <> _password Then + If String.IsNullOrWhiteSpace(identity.Name) _ + OrElse identity.Name <> _userName _ + OrElse String.IsNullOrWhiteSpace(identity.Password) _ + OrElse identity.Password <> _password Then + response.StatusCode = HttpStatusCode.Unauthorized Exit Try End If From d1f0a5d8b03bb93879909473ccf4b865b3985ee9 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 8 Aug 2024 19:32:03 -0700 Subject: [PATCH 326/342] Remove some extra blank lines --- .../UnitTests/System/Windows/Forms/NetworkDownloadTests.vb | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb index ede037ce19c..620a8cf8cf4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/NetworkDownloadTests.vb @@ -491,7 +491,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests .Throw(Of WebException)() _ .WithMessage(SR.net_webstatus_Unauthorized) File.Exists(destinationFileName).Should.BeFalse() - Finally CleanUp(listener, testDirectory) End Try @@ -945,7 +944,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests overwrite:=True) End Sub Try - testCode.Should _ .Throw(Of WebException)() _ .WithMessage(SR.net_webstatus_Timeout) @@ -972,7 +970,6 @@ Namespace Microsoft.VisualBasic.Forms.Tests password) End Sub Try - testCode.Should _ .Throw(Of WebException)() _ .WithMessage(SR.net_webstatus_Unauthorized) From 6be89f84141a5ead1e744ba58447e94936783209 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 9 Aug 2024 00:33:36 -0700 Subject: [PATCH 327/342] Add testing for CleanupDirectories --- .../System/Windows/Forms/FileIoProxyTests.vb | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index c72044f322c..5781215367a 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -30,17 +30,51 @@ Namespace Microsoft.VisualBasic.Forms.Tests If testDirectory = IO.Path.GetTempPath Then Throw New ArgumentException($"'{NameOf(testDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(testDirectory)) End If + If Not testDirectory.StartsWith(IO.Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase) Then + Throw New ArgumentException($"'{NameOf(testDirectory)}' must start with {IO.Path.GetTempPath}.", NameOf(testDirectory)) + End If _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) If destinationDirectory IsNot Nothing Then If destinationDirectory = IO.Path.GetTempPath Then - Throw New ArgumentException($"'{NameOf(destinationDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(testDirectory)) + Throw New ArgumentException($"'{NameOf(destinationDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(destinationDirectory)) + End If + If Not destinationDirectory.StartsWith(IO.Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase) Then + Throw New ArgumentException($"'{NameOf(testDirectory)}' must start with {IO.Path.GetTempPath}.", NameOf(destinationDirectory)) End If _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) End If End Sub + + Public Sub CleanupDirectoriesTests() + Dim testCode As Action = + Sub() + CleanupDirectories(Nothing) + End Sub + testCode.Should.Throw(Of ArgumentException)() + testCode = + Sub() + CleanupDirectories(String.Empty) + End Sub + + testCode.Should.Throw(Of ArgumentException)() + testCode = + Sub() + CleanupDirectories(IO.Path.GetTempPath) + End Sub + + testCode.Should.Throw(Of ArgumentException)() + + testCode = + Sub() + Dim testDirectory As String = CreateTempDirectory() + CleanupDirectories(testDirectory, String.Empty) + End Sub + testCode.Should.Throw(Of ArgumentException)() + End Sub + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) From bb1247e75f76ed25eafcfce5055741c41dfb4767 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:42:07 +0000 Subject: [PATCH 328/342] [main] Update dependencies from dotnet/arcade (#11850) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 6 +++--- eng/common/darc-init.ps1 | 2 +- eng/common/darc-init.sh | 2 +- global.json | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 25e5b789f9b..c58c445ded3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -191,29 +191,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 diff --git a/eng/Versions.props b/eng/Versions.props index 3f0c4c1ae1c..f3ba2e82ec8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,9 @@ - 9.0.0-beta.24408.1 - 9.0.0-beta.24408.1 - 9.0.0-beta.24408.1 + 9.0.0-beta.24408.2 + 9.0.0-beta.24408.2 + 9.0.0-beta.24408.2 17.4.0-preview-20220707-01 diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index 8fda30bdce2..e3374310563 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -1,6 +1,6 @@ param ( $darcVersion = $null, - $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16', + $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20', $verbosity = 'minimal', $toolpath = $null ) diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index c305ae6bd77..36dbd45e1ce 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -2,7 +2,7 @@ source="${BASH_SOURCE[0]}" darcVersion='' -versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16' +versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20' verbosity='minimal' while [[ $# > 0 ]]; do diff --git a/global.json b/global.json index 8cf01fe1675..25bf5cd4651 100644 --- a/global.json +++ b/global.json @@ -14,9 +14,9 @@ "version": "9.0.100-preview.5.24307.3" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.1", - "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.2", + "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.2", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.2", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24407.9" }, From d7c8152edde558c99c31fc13663c2141b53e5fdb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:42:27 +0000 Subject: [PATCH 329/342] [main] Update dependencies from dotnet/runtime (#11851) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c58c445ded3..6600f59f3fa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 - + https://github.com/dotnet/runtime - a562a9fe5582dabf601884392d5ce987484ea706 + 48aa31535f0e5f318f061eb6f8ad4f25611e6133 diff --git a/eng/Versions.props b/eng/Versions.props index f3ba2e82ec8..8444496b6bf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 6.0.0 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 - 9.0.0-rc.1.24407.9 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24408.13 diff --git a/global.json b/global.json index 25bf5cd4651..31d2e091559 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.2", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.2", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24407.9" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24408.13" }, "native-tools": { "cmake": "latest" From 3983d447c60fb64f0dac8a6cecad65411f02a5bd Mon Sep 17 00:00:00 2001 From: Loni Tra Date: Fri, 9 Aug 2024 17:17:01 -0700 Subject: [PATCH 330/342] Fix Cursor Display Incorrectly On Drag (#11853) Re-add condition to check drag image --- .../src/System/Windows/Forms/OLE/DropSource.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DropSource.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DropSource.cs index d3b14590d23..5d082e84f53 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DropSource.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DropSource.cs @@ -68,7 +68,7 @@ public HRESULT GiveFeedback(DROPEFFECT dwEffect) _peer.OnGiveFeedback(gfbEvent); - if (IsDropTargetWindowInCurrentThread() && !gfbEvent.Equals(_lastGiveFeedbackEventArgs)) + if (IsDropTargetWindowInCurrentThread() && gfbEvent.DragImage is not null && !gfbEvent.Equals(_lastGiveFeedbackEventArgs)) { _lastGiveFeedbackEventArgs = gfbEvent.Clone(); UpdateDragImage(_lastGiveFeedbackEventArgs, _dataObject, _lastHwndTarget); @@ -106,7 +106,7 @@ public unsafe HRESULT DragEnterTarget(HWND hwndTarget) public HRESULT DragLeaveTarget() { - if (IsDropTargetWindowInCurrentThread()) + if (IsDropTargetWindowInCurrentThread() && _lastGiveFeedbackEventArgs?.DragImage is not null) { DragDropHelper.DragLeave(); } From 9ce2d6f4dda4744435b19a60cf2b01d05d3c33df Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Fri, 9 Aug 2024 22:35:08 -0700 Subject: [PATCH 331/342] Test CleanupDirectories --- .../System/Windows/Forms/FileIoProxyTests.vb | 60 +++++++++++-------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index 5781215367a..bb45a6dc1ea 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -12,6 +12,21 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Public Class FileIoProxyTests + Protected Friend Class PathTestData + Implements IEnumerable(Of Object()) + + Public Iterator Function GetEnumerator() As IEnumerator(Of Object()) Implements IEnumerable(Of Object()).GetEnumerator + Yield {Nothing} + Yield {String.Empty} + Yield {" "} + Yield {IO.Path.GetPathRoot(IO.Path.GetTempPath)} + Yield {IO.Path.GetTempPath} + End Function + + Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator + Throw New NotImplementedException() + End Function + End Class Private ReadOnly _csvSampleData As String = "Index,Customer Id,First Name,Last Name,Company,City,Country @@ -23,7 +38,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests "IndexFirstLastCompanyCityCountry 4321;1234;321;654321;123;1234567" - Private Sub CleanupDirectories(testDirectory As String, Optional destinationDirectory As String = Nothing) + Private Sub CleanupDirectories(testDirectory As String, Optional destinationDirectory As String = Nothing, Optional onDirectoryNotEmpty As DeleteDirectoryOption = DeleteDirectoryOption.DeleteAllContents) If String.IsNullOrEmpty(testDirectory) Then Throw New ArgumentException($"'{NameOf(testDirectory)}' cannot be null or empty.", NameOf(testDirectory)) End If @@ -34,45 +49,40 @@ Namespace Microsoft.VisualBasic.Forms.Tests Throw New ArgumentException($"'{NameOf(testDirectory)}' must start with {IO.Path.GetTempPath}.", NameOf(testDirectory)) End If - _fileSystem.DeleteDirectory(testDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(testDirectory, onDirectoryNotEmpty) If destinationDirectory IsNot Nothing Then If destinationDirectory = IO.Path.GetTempPath Then Throw New ArgumentException($"'{NameOf(destinationDirectory)}' cannot be {IO.Path.GetTempPath}.", NameOf(destinationDirectory)) End If If Not destinationDirectory.StartsWith(IO.Path.GetTempPath, StringComparison.InvariantCultureIgnoreCase) Then - Throw New ArgumentException($"'{NameOf(testDirectory)}' must start with {IO.Path.GetTempPath}.", NameOf(destinationDirectory)) + Throw New ArgumentException($"'{NameOf(destinationDirectory)}' must start with {IO.Path.GetTempPath}.", NameOf(destinationDirectory)) End If - _fileSystem.DeleteDirectory(destinationDirectory, DeleteDirectoryOption.DeleteAllContents) + _fileSystem.DeleteDirectory(destinationDirectory, onDirectoryNotEmpty) End If End Sub - - Public Sub CleanupDirectoriesTests() + + + Public Sub CleanupDirectoriesTests(testDirectory As String) Dim testCode As Action = Sub() - CleanupDirectories(Nothing) - End Sub - testCode.Should.Throw(Of ArgumentException)() - testCode = - Sub() - CleanupDirectories(String.Empty) - End Sub - - testCode.Should.Throw(Of ArgumentException)() - testCode = - Sub() - CleanupDirectories(IO.Path.GetTempPath) + CleanupDirectories(testDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) End Sub - testCode.Should.Throw(Of ArgumentException)() + End Sub - testCode = - Sub() - Dim testDirectory As String = CreateTempDirectory() - CleanupDirectories(testDirectory, String.Empty) - End Sub - testCode.Should.Throw(Of ArgumentException)() + + + Public Sub CleanupDirectoriesWithDestinationDirectoryTests(destinationDirectory As String) + Dim testCode As Action = + Sub() + Dim testDirectory As String = CreateTempDirectory() + CleanupDirectories(testDirectory, destinationDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) + End Sub + If destinationDirectory IsNot Nothing Then + testCode.Should.Throw(Of ArgumentException)() + End If End Sub From 69fb20a71e0c76bfc8bf2f61f72a2fd7291d25e1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 12:41:00 +0000 Subject: [PATCH 332/342] [main] Update dependencies from dotnet/runtime (#11855) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6600f59f3fa..917318baec6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 - + https://github.com/dotnet/runtime - 48aa31535f0e5f318f061eb6f8ad4f25611e6133 + 0953757c1edd732b0cdbd6e67839965218de52b1 diff --git a/eng/Versions.props b/eng/Versions.props index 8444496b6bf..2b857181a98 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 6.0.0 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 - 9.0.0-rc.1.24408.13 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24409.6 diff --git a/global.json b/global.json index 31d2e091559..91ed6d3b66e 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.2", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.2", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24408.13" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24409.6" }, "native-tools": { "cmake": "latest" From 530bd8fc2712a9d9628068990e5a434a5d20ede4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 10 Aug 2024 15:03:09 -0700 Subject: [PATCH 333/342] Add a test for IEnumerable_GetEnumerator Sort File --- .../System/Windows/Forms/FileIoProxyTests.vb | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index bb45a6dc1ea..d3f1fbb7c5e 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -12,21 +12,6 @@ Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests Public Class FileIoProxyTests - Protected Friend Class PathTestData - Implements IEnumerable(Of Object()) - - Public Iterator Function GetEnumerator() As IEnumerator(Of Object()) Implements IEnumerable(Of Object()).GetEnumerator - Yield {Nothing} - Yield {String.Empty} - Yield {" "} - Yield {IO.Path.GetPathRoot(IO.Path.GetTempPath)} - Yield {IO.Path.GetTempPath} - End Function - - Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator - Throw New NotImplementedException() - End Function - End Class Private ReadOnly _csvSampleData As String = "Index,Customer Id,First Name,Last Name,Company,City,Country @@ -85,6 +70,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests End If End Sub + + Public Sub CleanupDirectoryPathTestDataIteratorTests() + Dim testClass As New PathTestData + testClass.IEnumerable_GetEnumerator.Should.NotBeNull() + End Sub + Public Sub CopyDirectoryWithShowUICancelOptionsProxyTest() Dim testDirectory As String = CreateTempDirectory(lineNumber:=1) @@ -519,5 +510,21 @@ Namespace Microsoft.VisualBasic.Forms.Tests CleanupDirectories(testDirectory) End Sub + Protected Friend Class PathTestData + Implements IEnumerable(Of Object()) + + Public Iterator Function GetEnumerator() As IEnumerator(Of Object()) Implements IEnumerable(Of Object()).GetEnumerator + Yield {Nothing} + Yield {String.Empty} + Yield {" "} + Yield {IO.Path.GetPathRoot(IO.Path.GetTempPath)} + Yield {IO.Path.GetTempPath} + End Function + + Public Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator + Return GetEnumerator() + End Function + + End Class End Class End Namespace From 0b0042f2ac21cb32b421be41e7f409b4bbdce950 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sat, 10 Aug 2024 23:31:19 -0700 Subject: [PATCH 334/342] Cleanupformatting of FileIoProxyTests Correct logic in DriveProxyTest and FileNormalizePathTest_Success --- .../System/Windows/Forms/FileIoProxyTests.vb | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb index d3f1fbb7c5e..01d4dfb5687 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/FileIoProxyTests.vb @@ -50,21 +50,15 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub CleanupDirectoriesTests(testDirectory As String) - Dim testCode As Action = - Sub() - CleanupDirectories(testDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) - End Sub + Dim testCode As Action = Sub() CleanupDirectories(testDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) testCode.Should.Throw(Of ArgumentException)() End Sub Public Sub CleanupDirectoriesWithDestinationDirectoryTests(destinationDirectory As String) - Dim testCode As Action = - Sub() - Dim testDirectory As String = CreateTempDirectory() - CleanupDirectories(testDirectory, destinationDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) - End Sub + Dim testDirectory As String = CreateTempDirectory() + Dim testCode As Action = Sub() CleanupDirectories(testDirectory, destinationDirectory, onDirectoryNotEmpty:=DeleteDirectoryOption.ThrowIfDirectoryNonEmpty) If destinationDirectory IsNot Nothing Then testCode.Should.Throw(Of ArgumentException)() End If @@ -253,34 +247,26 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub DriveProxyTest() - FileIO.FileSystem.Drives.Count.Should.Be(_fileSystem.Drives.Count) + _fileSystem.Drives.Count.Should.Be(FileIO.FileSystem.Drives.Count) End Sub Public Sub FileNormalizePathEmptyStringTest_Fail() - Dim testCode As Action = - Sub() - FileSystemUtils.NormalizePath("") - End Sub - + Dim testCode As Action = Sub() FileSystemUtils.NormalizePath("") testCode.Should.Throw(Of ArgumentException).WithMessage( expectedWildcardPattern:="The path is empty. (Parameter 'path')") End Sub Public Sub FileNormalizePathNullTest_Fail() - Dim testCode As Action = - Sub() - FileSystemUtils.NormalizePath(Nothing) - End Sub - + Dim testCode As Action = Sub() FileSystemUtils.NormalizePath(Nothing) testCode.Should.Throw(Of ArgumentNullException).WithMessage( expectedWildcardPattern:="Value cannot be null. (Parameter 'path')") End Sub Public Sub FileNormalizePathTest_Success() - FileSystemUtils.NormalizePath(IO.Path.GetTempPath) + FileSystemUtils.NormalizePath(IO.Path.GetTempPath).Should.Be(IO.Path.GetTempPath.TrimEnd(IO.Path.DirectorySeparatorChar)) End Sub From 36db42c7e11d83c24991b256a043576067fa9fae Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2024 12:36:00 +0000 Subject: [PATCH 335/342] [main] Update dependencies from dotnet/runtime (#11856) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 180 ++++++++++++++++++++-------------------- eng/Versions.props | 58 ++++++------- global.json | 2 +- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 917318baec6..87206d9937a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,186 +7,186 @@ Note: if the Uri is a new place, you will need to add a subscription from that p --> - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f - + https://github.com/dotnet/runtime - 0953757c1edd732b0cdbd6e67839965218de52b1 + 7cb32e193a55a95c74fc3bd56501b951b48b700f diff --git a/eng/Versions.props b/eng/Versions.props index 2b857181a98..813de89393d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,37 +13,37 @@ - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 5.0.0-preview.7.20320.5 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 6.0.0 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 - 9.0.0-rc.1.24409.6 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 + 9.0.0-rc.1.24410.5 diff --git a/global.json b/global.json index 91ed6d3b66e..e511df55142 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.2", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.2", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24409.6" + "Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24410.5" }, "native-tools": { "cmake": "latest" From 1ff332e56983388827832261543d7a48de533ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20L=C3=B6ffelmann?= <9663150+KlausLoeffelmann@users.noreply.github.com> Date: Sun, 11 Aug 2024 14:42:09 -0700 Subject: [PATCH 336/342] V2 of WinForms Async experimental APIs (#11854) * Implement Control.Async. * Introduce Form.ShowAsync. * Introduce Form.ShowDialogAsync. * Introduce TaskDialog.ShowDialogAsync. * Fix setting correct TaskCompletionSource on Closing/Disposing. * Address review feedback. --- .../Analyzers/Diagnostics/DiagnosticIDs.cs | 2 + .../System.Windows.Forms.Primitives.csproj | 1 + .../src/GlobalSuppressions.cs | 7 + .../src/PublicAPI.Unshipped.txt | 10 + .../src/Resources/SR.resx | 8 +- .../src/Resources/xlf/SR.cs.xlf | 10 + .../src/Resources/xlf/SR.de.xlf | 10 + .../src/Resources/xlf/SR.es.xlf | 10 + .../src/Resources/xlf/SR.fr.xlf | 10 + .../src/Resources/xlf/SR.it.xlf | 10 + .../src/Resources/xlf/SR.ja.xlf | 10 + .../src/Resources/xlf/SR.ko.xlf | 10 + .../src/Resources/xlf/SR.pl.xlf | 10 + .../src/Resources/xlf/SR.pt-BR.xlf | 10 + .../src/Resources/xlf/SR.ru.xlf | 10 + .../src/Resources/xlf/SR.tr.xlf | 10 + .../src/Resources/xlf/SR.zh-Hans.xlf | 10 + .../src/Resources/xlf/SR.zh-Hant.xlf | 10 + .../Forms/Control.ControlNativeWindow.cs | 5 +- .../src/System/Windows/Forms/Control.cs | 29 +- .../Windows/Forms/Control_InvokeAsync.cs | 255 +++++++++++++++ .../Forms/Dialogs/TaskDialog/TaskDialog.cs | 177 +++++++++-- .../src/System/Windows/Forms/Form.cs | 300 +++++++++++++++++- .../UIIntegrationTests/ApplicationTests.cs | 2 + .../Infra/ControlTestBase.cs | 4 + 25 files changed, 893 insertions(+), 37 deletions(-) create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs index b8a930fc736..c57f90e29ad 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs @@ -5,6 +5,8 @@ namespace System.Windows.Forms.Analyzers.Diagnostics; internal static class DiagnosticIDs { + public const string UrlFormat = "https://aka.ms/winforms-warnings/{0}"; + // Application Configuration, number group 0001+ public const string UnsupportedProjectType = "WFO0001"; public const string PropertyCantBeSetToValue = "WFO0002"; diff --git a/src/System.Windows.Forms.Primitives/src/System.Windows.Forms.Primitives.csproj b/src/System.Windows.Forms.Primitives/src/System.Windows.Forms.Primitives.csproj index 3f8e590182a..647bf2ebc2e 100644 --- a/src/System.Windows.Forms.Primitives/src/System.Windows.Forms.Primitives.csproj +++ b/src/System.Windows.Forms.Primitives/src/System.Windows.Forms.Primitives.csproj @@ -56,6 +56,7 @@ + diff --git a/src/System.Windows.Forms/src/GlobalSuppressions.cs b/src/System.Windows.Forms/src/GlobalSuppressions.cs index cbacdc46a5f..30dc6b18e0e 100644 --- a/src/System.Windows.Forms/src/GlobalSuppressions.cs +++ b/src/System.Windows.Forms/src/GlobalSuppressions.cs @@ -260,3 +260,10 @@ [assembly: SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.BindingManagerBase.onPositionChangedHandler")] [assembly: SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.CurrencyManager.listposition")] [assembly: SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.CurrencyManager.finalType")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{``0},System.Threading.CancellationToken)~System.Threading.Tasks.Task{``0}")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)~System.Threading.Tasks.Task")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{``0}},System.Threading.CancellationToken)~System.Threading.Tasks.Task{``0}")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.Control.InvokeAsync(System.Action,System.Threading.CancellationToken)~System.Threading.Tasks.Task")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.TaskDialogPage,System.Windows.Forms.TaskDialogStartupLocation)~System.Threading.Tasks.Task{System.Windows.Forms.TaskDialogButton}")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.IWin32Window,System.Windows.Forms.TaskDialogPage,System.Windows.Forms.TaskDialogStartupLocation)~System.Threading.Tasks.Task{System.Windows.Forms.TaskDialogButton}")] +[assembly: SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Analyzer wrongly complains for new APIs - known issue.", Scope = "member", Target = "~M:System.Windows.Forms.TaskDialog.ShowDialogAsync(System.IntPtr,System.Windows.Forms.TaskDialogPage,System.Windows.Forms.TaskDialogStartupLocation)~System.Threading.Tasks.Task{System.Windows.Forms.TaskDialogButton}")] diff --git a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt index e69de29bb2d..9923ae55cb6 100644 --- a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt +++ b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt @@ -0,0 +1,10 @@ +static System.Windows.Forms.TaskDialog.ShowDialogAsync(nint hwndOwner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task! +static System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.IWin32Window! owner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task! +static System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterScreen) -> System.Threading.Tasks.Task! +System.Windows.Forms.Control.InvokeAsync(System.Action! callback, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +System.Windows.Forms.Control.InvokeAsync(System.Func! callback, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +System.Windows.Forms.Control.InvokeAsync(System.Func>! callback, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +System.Windows.Forms.Control.InvokeAsync(System.Func! callback, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +System.Windows.Forms.Form.ShowAsync(System.Windows.Forms.IWin32Window? owner = null) -> System.Threading.Tasks.Task! +System.Windows.Forms.Form.ShowDialogAsync() -> System.Threading.Tasks.Task! +System.Windows.Forms.Form.ShowDialogAsync(System.Windows.Forms.IWin32Window! owner) -> System.Threading.Tasks.Task! \ No newline at end of file diff --git a/src/System.Windows.Forms/src/Resources/SR.resx b/src/System.Windows.Forms/src/Resources/SR.resx index f3529e2b26b..f0c6d889a88 100644 --- a/src/System.Windows.Forms/src/Resources/SR.resx +++ b/src/System.Windows.Forms/src/Resources/SR.resx @@ -6979,4 +6979,10 @@ Stack trace where the illegal operation occurred was: Design time features are not supported. - + + The form has already been shown asynchronously. + + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + \ No newline at end of file diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index bfa7ac7208c..bf14bfbcf63 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -5520,6 +5520,11 @@ Chcete jej nahradit? Míra průhlednosti ovládacího prvku v procentech + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Pole formulářů vlastněných tímto formulářem. @@ -5565,6 +5570,11 @@ Chcete jej nahradit? Určuje počáteční stav viditelnosti formuláře. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Určuje objekt Format, který tento ovládací prvek nyní používá k formátování hodnot. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index 04575ad5174..ecb00061f8d 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -5520,6 +5520,11 @@ Möchten Sie sie ersetzen? Der Prozentsatz der Durchlässigkeit des Steuerelements. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Das Array der Formulare, die dieses Formular besitzt. @@ -5565,6 +5570,11 @@ Möchten Sie sie ersetzen? Bestimmt den ersten visuellen Zustand des Formulars. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Zeigt das Format-Objekt an, das dieses Steuerelement zurzeit für die Formatierung seiner Werte verwendet. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index 22a22d4a708..4a8189273d4 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -5520,6 +5520,11 @@ Do you want to replace it? Porcentaje de la opacidad del control. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Matriz de formularios que pertenecen a este formulario. @@ -5565,6 +5570,11 @@ Do you want to replace it? Determina el estado visual inicial del formulario. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Indica el objeto Format que utiliza este control para dar formato a sus valores. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index cc479cf72c2..53d0208e006 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -5520,6 +5520,11 @@ Voulez-vous le remplacer ? Le pourcentage d'opacité du contrôle. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Tableau de formulaires dont ce formulaire est propriétaire. @@ -5565,6 +5570,11 @@ Voulez-vous le remplacer ? Détermine l'état visuel initial du formulaire. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Indique l'objet Format que ce contrôle utilise pour mettre en forme ses valeurs. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index d8ade0271fd..d3d3114fc82 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -5520,6 +5520,11 @@ Sostituirlo? La percentuale di opacità del controllo. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. La matrice dei form di questo form. @@ -5565,6 +5570,11 @@ Sostituirlo? Determina lo stato di visualizzazione iniziale del form. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Indica l'oggetto Format che questo controllo sta utilizzando per formattare i propri valori. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index cfc4e7c11c0..6a91f0f5204 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -5520,6 +5520,11 @@ Do you want to replace it? コントロールの不透明度の割合です。 + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. このフォームが持つ配列のフォームです。 @@ -5565,6 +5570,11 @@ Do you want to replace it? フォームの最初の表示状態を決定します。 + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. 値をフォーマットするために、このコントロールが現在使用している Format オブジェクトを示します。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index 1cc6095d9e8..130bd7446c5 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -5520,6 +5520,11 @@ Do you want to replace it? 컨트롤의 불투명도(%)입니다. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. 이 폼에서 소유하는 폼 배열입니다. @@ -5565,6 +5570,11 @@ Do you want to replace it? 폼의 초기 표시 상태를 결정합니다. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. 값 서식을 지정하기 위해 이 컨트롤에서 현재 사용 중인 Format 개체를 나타냅니다. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index 72c5816c9e9..6439e2d55b0 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -5520,6 +5520,11 @@ Czy chcesz go zamienić? Stopień nieprzezroczystości formantu. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Tablica formularzy będących własnością tego formularza. @@ -5565,6 +5570,11 @@ Czy chcesz go zamienić? Określa początkowy wizualny stan formularza. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Wskazuje obiekt Format używany aktualnie przez formant do formatowania wartości. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index a39d846544c..976969af99f 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -5520,6 +5520,11 @@ Deseja substituí-lo? A porcentagem de opacidade do controle. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Matriz de formulários de propriedade deste formulário. @@ -5565,6 +5570,11 @@ Deseja substituí-lo? Determina o estado visual inicial do formulário. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Indica o objeto Format que este controle está usando atualmente para formatar seus valores. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index f6afcc784e1..0e78b1f48ac 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -5521,6 +5521,11 @@ Do you want to replace it? Степень прозрачности элемента управления (в процентах). + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Массив форм, принадлежащих этой форме. @@ -5566,6 +5571,11 @@ Do you want to replace it? Определяет исходное видимое состояние данной формы. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Указывает объект Format, который используется в текущий момент этим элементом управления для форматирования своих значений. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 03b61e88211..2af30d01d04 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -5520,6 +5520,11 @@ Bunu değiştirmek istiyor musunuz? Formun donukluk yüzdesi. + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. Bu formun sahibi olduğu formlar dizisi. @@ -5565,6 +5570,11 @@ Bunu değiştirmek istiyor musunuz? Formun başlangıçtaki görsel durumunu belirler. + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. Bu denetimin değerleri biçimlendirmek için kullandığı geçerli Format nesnesini gösterir. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index 04031c8a418..2dbcb4f32ea 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -5520,6 +5520,11 @@ Do you want to replace it? 控件的不透明度百分比。 + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. 此窗体拥有的窗体阵列。 @@ -5565,6 +5570,11 @@ Do you want to replace it? 确定窗体的初始可视状态。 + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. 指示该控件当前用于格式化其值的 Format 对象。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index eef29ce9bb1..51dfd40dddd 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -5520,6 +5520,11 @@ Do you want to replace it? 控制項的透明度百分比。 + + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + Failed to retrieve the Synchronization Context for showing the Form asynchronously. + + Array of forms owned by this form. 此表單擁有的表單陣列。 @@ -5565,6 +5570,11 @@ Do you want to replace it? 決定表單的初始可見狀態。 + + The form has already been shown asynchronously. + The form has already been shown asynchronously. + + Indicates the Format object that this control is currently using to format its values. 表示此控制項目前用來格式化其值的 Format 物件。 diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs index 2769ffe12b4..21ab6a062a9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs @@ -54,7 +54,10 @@ internal void LockReference(bool locked) protected override void OnThreadException(Exception e) { - WndProcException(e); + if (!_control.SuppressApplicationOnThreadException(e)) + { + Application.OnThreadException(e); + } } // IWindowTarget method diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index 25c7eea141c..edea3823111 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -6712,6 +6712,26 @@ protected virtual void NotifyInvalidate(Rectangle invalidatedArea) OnInvalidated(new InvalidateEventArgs(invalidatedArea)); } + /// + /// Called by the NativeWindow callback when an exception is caught. + /// + /// true, when the exception has been handled; otherwise, false. + /// + /// + /// This will usually be rerouted to the , but in certain + /// (async) scenarios, it makes more sense to catch the exception on the control or form that caused it. + /// + /// + /// Example: When a form throws an exception inside of Form.OnLoad, and the scenario needs to be gracefully handled + /// when another form shows the erroneous form. In that case, you cannot directly catch the exception. + /// + /// + /// It gets marshalled down to , which is an extreme + /// discoverability issue and the root cause for many WinForms apps crashing unexpectedly. + /// + /// + private protected virtual bool SuppressApplicationOnThreadException(Exception ex) => false; + // Used by form to notify the control that it is validating. private bool NotifyValidating() { @@ -12863,15 +12883,6 @@ protected virtual void WndProc(ref Message m) GC.KeepAlive(this); } - /// - /// Called when an exception occurs in dispatching messages through - /// the main window procedure. - /// - private static void WndProcException(Exception e) - { - Application.OnThreadException(e); - } - ArrangedElementCollection IArrangedElement.Children { get diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs new file mode 100644 index 00000000000..cedced54dba --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs @@ -0,0 +1,255 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Windows.Forms; + +public partial class Control +{ + /// + /// Invokes the specified synchronous callback asynchronously on the thread that owns the control's handle. + /// + /// The synchronous action to execute. + /// The cancellation token. + /// A task representing the operation. + /// + /// + /// Note: When you pass a to this method, the method will return, + /// but the callback will still be executed. The callback will be running on the UI thread and will be + /// also blocking the UI thread. InvokeAsync in this case is just queuing the callback to the end of the + /// message queue and returns immediately, but as soon as the callback gets executed, it will still block + /// the UI thread for the time it is running. For this reason, it is recommended to only execute short sync running + /// operations in the callback, like updating a control's property or similar. + /// + /// + /// If you want to execute a long-running operation, consider using asynchronous callbacks instead, + /// by making sure that you use either the overload + /// or + /// . + /// + /// + public async Task InvokeAsync(Action callback, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(callback); + + if (cancellationToken.IsCancellationRequested) + { + return; + } + + TaskCompletionSource completion = new(TaskCreationOptions.RunContinuationsAsynchronously); + + using (cancellationToken.Register(() => completion.SetCanceled(), useSynchronizationContext: false)) + { + BeginInvoke(WrappedAction); + await completion.Task.ConfigureAwait(false); + } + + void WrappedAction() + { + try + { + if (cancellationToken.IsCancellationRequested) + { + completion.SetCanceled(cancellationToken); + return; + } + + callback(); + completion.TrySetResult(); + } + catch (Exception ex) + { + completion.TrySetException(ex); + } + } + } + + /// + /// Invokes the specified synchronous callback asynchronously on the thread that owns the control's handle. + /// + /// The return type of the synchronous callback. + /// The synchronous function to execute. + /// The cancellation token. + /// A task representing the operation and containing the function's result. + /// + /// + /// Note: When you pass a to this method, the method will return, + /// but the callback will still be executed. The callback will be running on the UI thread and will be + /// also blocking the UI thread. InvokeAsync in this case is just queuing the callback to the end of the + /// message queue and returns immediately, but as soon as the callback is executed, it will still block + /// the UI for the time it is running. For this reason, it is recommended to only execute short sync running + /// operations in the callback, like updating a control's property or similar. + /// + /// + /// If you want to execute a long-running operation, consider using asynchronous callbacks instead, which you use + /// with the overloads of InvokeAsync described below. + /// + /// + /// Important: Also note that if you use this overload to pass a callback which returns a + /// that this Task will NOT be awaited but return immediately and has the characteristics of an + /// "engage-and-forget". If you want the task which you pass to be awaited, make sure that you + /// use either the overload + /// or + /// . + /// + /// + public async Task InvokeAsync(Func callback, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(callback); + + if (cancellationToken.IsCancellationRequested) + { + return default!; + } + + TaskCompletionSource completion = new(TaskCreationOptions.RunContinuationsAsynchronously); + + using (cancellationToken.Register(() => completion.SetCanceled(), useSynchronizationContext: false)) + { + BeginInvoke(WrappedCallback); + return await completion.Task.ConfigureAwait(false); + } + + void WrappedCallback() + { + try + { + if (cancellationToken.IsCancellationRequested) + { + completion.TrySetCanceled(cancellationToken); + return; + } + + T result = callback(); + completion.TrySetResult(result); + } + catch (Exception ex) + { + completion.TrySetException(ex); + } + } + } + + /// + /// Executes the specified asynchronous callback on the thread that owns the control's handle asynchronously. + /// + /// + /// The asynchronous function to execute, which takes a + /// and returns a . + /// + /// The cancellation token. + /// + /// A task representing the operation. + /// + /// Thrown if the control's handle is not yet created. + /// + /// + /// Note: The callback will be marshalled to the thread that owns the control's handle, + /// and then awaited. Exceptions will be propagated back to the caller. Also note that the returned task + /// is not the task associated with the callback, but a task representing the operation of marshalling the + /// callback to the UI thread. If you need to pass a callback returning a rather than a + /// , use the ValueTask's constructor to create a new ValueTask which wraps the original + /// Task. The will be both taken into account when marshalling the callback to the + /// thread that owns the control's handle, and when executing the callback. + /// + /// + /// If you want to asynchronously execute a synchronous callback, use the overload + /// or the overload + /// . + /// + /// + public async Task InvokeAsync(Func callback, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(callback); + + if (cancellationToken.IsCancellationRequested) + { + return; + } + + TaskCompletionSource completion = new(TaskCreationOptions.RunContinuationsAsynchronously); + + using (cancellationToken.Register(() => completion.SetCanceled(), useSynchronizationContext: false)) + { + BeginInvoke(async () => await WrappedCallbackAsync().ConfigureAwait(false)); + await completion.Task.ConfigureAwait(false); + } + + async Task WrappedCallbackAsync() + { + try + { + if (cancellationToken.IsCancellationRequested) + { + completion.TrySetCanceled(cancellationToken); + return; + } + + await callback(cancellationToken).ConfigureAwait(false); + completion.TrySetResult(); + } + catch (Exception ex) + { + completion.TrySetException(ex); + } + } + } + + /// + /// Executes the specified asynchronous callback on the thread that owns the control's handle. + /// + /// The return type of the asynchronous callback. + /// + /// The asynchronous function to execute, which takes a + /// and returns a . + /// + /// The cancellation token. + /// A task representing the operation and containing the function's result of type T. + /// Thrown if the control's handle is not yet created. + /// + /// + /// Note: The callback will be marshalled to the thread that owns the control's handle, + /// and then be awaited. Exceptions will be propagated back to the caller. Also note that the returned task + /// is not the task associated with the callback, but a task representing the operation of marshalling the + /// callback to the UI thread. If you need to pass a callback returning a rather than a + /// , use the ValueTask's constructor to create a new ValueTask which wraps the original + /// Task. The will be both taken into account when marshalling the callback to the + /// thread that owns the control's handle, and when executing the callback. + /// + /// + /// If you want to asynchronously execute a synchronous callback, use the overload + /// or the overload + /// . + /// + /// + public async Task InvokeAsync(Func> callback, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(callback); + + if (cancellationToken.IsCancellationRequested) + { + return default!; + } + + TaskCompletionSource completion = new(TaskCreationOptions.RunContinuationsAsynchronously); + + using (cancellationToken.Register(() => completion.SetCanceled(), useSynchronizationContext: false)) + { + BeginInvoke(async () => await WrappedCallbackAsync().ConfigureAwait(false)); + return await completion.Task.ConfigureAwait(false); + } + + async Task WrappedCallbackAsync() + { + try + { + var returnValue = await callback(cancellationToken).ConfigureAwait(false); + completion.TrySetResult(returnValue); + } + catch (Exception ex) + { + completion.TrySetException(ex); + } + } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs index f6ded51b775..5a3e5aedda0 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Windows.Forms.Analyzers.Diagnostics; using TASKDIALOGCONFIG_FooterIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous2_e__Union; using TASKDIALOGCONFIG_MainIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous1_e__Union; namespace System.Windows.Forms; @@ -298,28 +299,160 @@ private static TaskDialogButton CreatePlaceholderButton(TaskDialogResult result) } /// - /// Shows the task dialog. + /// Shows the task dialog with the specified owner asynchronously. /// /// - /// The page instance that contains the contents which this task dialog will display. + /// The page instance that contains the contents which this task dialog will display. /// /// - /// Gets or sets the position of the task dialog when it is shown. + /// Gets or sets the position of the task dialog when it is shown. /// /// - /// - /// Showing the dialog will bind the and its controls until - /// this method returns or the dialog is navigated to a different page. - /// + /// + /// Showing the dialog will bind the and its controls until + /// this method returns or the dialog is navigated to a different page. + /// /// /// - /// The which was clicked by the user to close the dialog. + /// The which was clicked by the user to close the dialog. /// /// - /// is . + /// is . /// /// - /// The specified contains an invalid configuration. + /// The specified contains an invalid configuration. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public static Task ShowDialogAsync( + TaskDialogPage page, + TaskDialogStartupLocation startupLocation = TaskDialogStartupLocation.CenterScreen) + => ShowDialogAsync(IntPtr.Zero, page.OrThrowIfNull(), startupLocation); + + /// + /// Shows the task dialog with the specified owner asynchronously. + /// + /// + /// The page instance that contains the contents which this task dialog will display. + /// + /// + /// The owner window. + /// + /// + /// Gets or sets the position of the task dialog when it is shown. + /// + /// + /// + /// Showing the dialog will bind the and its controls until + /// this method returns or the dialog is navigated to a different page. + /// + /// + /// + /// The which was clicked by the user to close the dialog. + /// + /// + /// is . + /// + /// + /// The specified contains an invalid configuration. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public static Task ShowDialogAsync( + IWin32Window owner, + TaskDialogPage page, + TaskDialogStartupLocation startupLocation = TaskDialogStartupLocation.CenterOwner) => + ShowDialogAsync(owner.Handle, page, startupLocation); + + /// + /// Shows the task dialog with the specified owner asynchronously. + /// + /// + /// The page instance that contains the contents which this task dialog will display. + /// + /// + /// The handle of the owner window, or to show a modeless dialog. + /// + /// + /// Gets or sets the position of the task dialog when it is shown. + /// + /// + /// + /// Showing the dialog will bind the and its controls until + /// this method returns or the dialog is navigated to a different page. + /// + /// + /// + /// The which was clicked by the user to close the dialog. + /// + /// + /// is . + /// + /// + /// The specified contains an invalid configuration. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public static async Task ShowDialogAsync( + nint hwndOwner, + TaskDialogPage page, + TaskDialogStartupLocation startupLocation = TaskDialogStartupLocation.CenterOwner) + { + ArgumentNullException.ThrowIfNull(page); + + var completion = new TaskCompletionSource(); + + TaskDialog? dialog = null; + + if (SynchronizationContext.Current is null) + { + WindowsFormsSynchronizationContext.InstallIfNeeded(); + } + + var syncContext = SynchronizationContext.Current + ?? throw new InvalidOperationException(SR.FormOrTaskDialog_NoSyncContextForShowAsync); + + syncContext.Post(_ => ShowDialogProc(), null); + + TaskDialogButton result; + + result = await completion.Task.ConfigureAwait(true); + return result; + + void ShowDialogProc() + { + try + { + dialog = new(); + completion.TrySetResult(dialog.ShowDialogInternal(hwndOwner, page, startupLocation)); + } + catch (Exception ex) + { + completion.TrySetException(ex); + } + } + } + + /// + /// Shows the task dialog. + /// + /// + /// The page instance that contains the contents which this task dialog will display. + /// + /// + /// Gets or sets the position of the task dialog when it is shown. + /// + /// + /// + /// Showing the dialog will bind the and its controls until + /// this method returns or the dialog is navigated to a different page. + /// + /// + /// + /// The which was clicked by the user to close the dialog. + /// + /// + /// is . + /// + /// + /// The specified contains an invalid configuration. /// public static TaskDialogButton ShowDialog( TaskDialogPage page, @@ -327,31 +460,31 @@ public static TaskDialogButton ShowDialog( => ShowDialog(IntPtr.Zero, page.OrThrowIfNull(), startupLocation); /// - /// Shows the task dialog with the specified owner. + /// Shows the task dialog with the specified owner. /// /// - /// The page instance that contains the contents which this task dialog will display. + /// The page instance that contains the contents which this task dialog will display. /// /// The owner window, or to show a modeless dialog. /// - /// Gets or sets the position of the task dialog when it is shown. + /// Gets or sets the position of the task dialog when it is shown. /// /// - /// - /// Showing the dialog will bind the and its controls until - /// this method returns or the dialog is navigated to a different page. - /// + /// + /// Showing the dialog will bind the and its controls until + /// this method returns or the dialog is navigated to a different page. + /// /// /// - /// The which was clicked by the user to close the dialog. + /// The which was clicked by the user to close the dialog. /// /// - /// is - /// - or - - /// is . + /// is + /// - or - + /// is . /// /// - /// The specified contains an invalid configuration. + /// The specified contains an invalid configuration. /// public static TaskDialogButton ShowDialog( IWin32Window owner, diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs index 95b389b1771..2d759c387ad 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs @@ -7,6 +7,7 @@ using System.Drawing; using System.Globalization; using System.Runtime.InteropServices; +using System.Windows.Forms.Analyzers.Diagnostics; using System.Windows.Forms.Layout; using System.Windows.Forms.VisualStyles; using Windows.Win32.System.Threading; @@ -160,6 +161,10 @@ public partial class Form : ContainerControl private bool _processingDpiChanged; private bool _inRecreateHandle; + private TaskCompletionSource? _nonModalFormCompletion; + private TaskCompletionSource? _modalFormCompletion; + private readonly Lock _lock = new(); + /// /// Initializes a new instance of the class. /// @@ -3349,6 +3354,8 @@ protected override void Dispose(bool disposing) Properties.RemoveObject(s_propDummyMdiMenu); PInvoke.DestroyMenu(dummyMenu); } + + _nonModalFormCompletion?.TrySetResult(); } else { @@ -3849,7 +3856,24 @@ protected virtual void OnFormClosed(FormClosedEventArgs e) // Remove the form from Application.OpenForms (nothing happens if isn't present) Application.OpenForms.Remove(this); - ((FormClosedEventHandler?)Events[s_formClosedEvent])?.Invoke(this, e); + try + { + ((FormClosedEventHandler?)Events[s_formClosedEvent])?.Invoke(this, e); + + // This effectively ends an `await form.ShowAsync();` call. + _nonModalFormCompletion?.TrySetResult(); + } + catch (Exception ex) + { + if (_nonModalFormCompletion is not null) + { + _nonModalFormCompletion.TrySetException(ex); + } + else + { + throw; + } + } } /// @@ -5141,8 +5165,39 @@ public void SetDesktopLocation(int x, int y) } /// - /// Makes the control display by setting the visible property to true - /// + /// Displays the form by setting its property to . + /// + /// + /// The optional owner window that implements . + /// + /// + /// Thrown if: + /// + /// The form is already visible. + /// The form is disabled. + /// The form is not a top-level form. + /// The form is trying to set itself as its own owner. + /// The operating system is in a non-interactive mode. + /// + /// + /// + /// Thrown if the owner window is trying to set itself as its own owner. + /// + /// + /// + /// This method makes the form visible by setting the property to . + /// + /// + /// If the owner window is provided, it ensures that the owner is topmost and sets the owner for the form. + /// + /// + /// This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, + /// attempting to display the form when it is not a top-level window, or setting the form as its own owner. + /// + /// + /// If the operating system is in a non-interactive mode, this method will throw an . + /// + /// public void Show(IWin32Window? owner) { if (owner == this) @@ -5203,10 +5258,136 @@ public void Show(IWin32Window? owner) Visible = true; } + /// + /// Displays the form asynchronously, by setting its property to . + /// + /// + /// The optional owner window that implements . + /// + /// + /// A that completes when the form is closed or disposed. + /// + /// + /// + /// This method makes the form visible by setting the property to . + /// + /// + /// This method immediately returns, even if the form is large and takes a long time to be set up. + /// + /// + /// The task will complete when the form is closed or disposed. + /// + /// + /// If the owner window is provided, it ensures that the owner is topmost and sets the owner for the form. + /// + /// + /// This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, + /// attempting to display the form when it is not a top-level window, or setting the form as its own owner. + /// + /// + /// If the operating system is in a non-interactive mode, this method will throw an . + /// + /// + /// If the form is already displayed asynchronously, an will be thrown. + /// + /// + /// An will also occur if no + /// could be retrieved or installed. + /// + /// + /// There is no need to marshal the call to the UI thread manually if the call + /// originates from a different thread than the UI-Thread. This is handled automatically. + /// + /// + /// + /// Thrown if: + /// + /// The form is already visible. + /// The form is disabled. + /// The form is not a top-level form. + /// The form is trying to set itself as its own owner. + /// + /// Thrown if the form is already displayed asynchronously or if no + /// could be retrieved or installed. + /// + /// The operating system is in a non-interactive mode. + /// + /// + /// + /// Thrown if the owner window is trying to set itself as its own owner. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public async Task ShowAsync(IWin32Window? owner = null) + { + // We lock the access to the task completion source to prevent + // multiple calls to ShowAsync from interfering with each other. + lock (_lock) + { + if (_nonModalFormCompletion is not null || _modalFormCompletion is not null) + { + throw new InvalidOperationException(SR.Form_HasAlreadyBeenShownAsync); + } + + _nonModalFormCompletion = new(TaskCreationOptions.RunContinuationsAsynchronously); + } + + if (SynchronizationContext.Current is null) + { + WindowsFormsSynchronizationContext.InstallIfNeeded(); + } + + var syncContext = SynchronizationContext.Current + ?? throw new InvalidOperationException(SR.FormOrTaskDialog_NoSyncContextForShowAsync); + + syncContext.Post((state) => ShowFormInternally(owner), null); + + // Wait until the form is closed or disposed. + try + { + await _nonModalFormCompletion.Task.ConfigureAwait(true); + } + catch (Exception ex) + { + // We need to rethrow the exception on the caller's context. + Application.OnThreadException(ex); + } + finally + { + _nonModalFormCompletion = null; + } + + void ShowFormInternally(IWin32Window? owner) + { + try + { + // Show the form with an optional owner. + Show(owner); + } + catch (Exception ex) + { + _nonModalFormCompletion.TrySetException(ex); + } + } + } + + private protected override bool SuppressApplicationOnThreadException(Exception ex) + { + lock (_lock) + { + if (_nonModalFormCompletion is not TaskCompletionSource completion) + { + return false; + } + + completion.TrySetException(ex); + return true; + } + } + /// /// Displays this form as a modal dialog box with no owner window. /// - public DialogResult ShowDialog() => ShowDialog(null); + public DialogResult ShowDialog() => ShowDialog(owner: null); /// /// Shows this form as a modal dialog with the specified owner. @@ -5371,6 +5552,117 @@ public DialogResult ShowDialog(IWin32Window? owner) return DialogResult; } + /// + /// Shows the form as a modal dialog box asynchronously. + /// + /// + /// A representing the outcome of the dialog. The task completes when the form is closed or disposed. + /// + /// + /// + /// The task will complete when the form is closed or disposed. + /// + /// + /// This method immediately returns, even if the form is large and takes a long time to be set up. + /// + /// + /// If the form is already displayed asynchronously by , an will be thrown. + /// + /// + /// An will also occur if no could be retrieved or installed. + /// + /// + /// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically. + /// + /// + /// Any exceptions that occur will be automatically propagated to the calling thread. + /// + /// + /// + /// Thrown if the form is already displayed asynchronously or if no could be retrieved or installed. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public Task ShowDialogAsync() => ShowDialogAsyncInternal(owner: null); + + /// + /// Shows the form as a modal dialog box with the specified owner asynchronously. + /// + /// + /// Any object that implements that represents the top-level window that will own the modal dialog box. + /// + /// + /// A representing the outcome of the dialog. The task completes when the form is closed or disposed. + /// + /// + /// + /// The task will complete when the form is closed or disposed. + /// + /// + /// This method immediately returns, even if the form is large and takes a long time to be set up. + /// + /// + /// If the form is already displayed asynchronously by , an will be thrown. + /// + /// + /// An will also occur if no could be retrieved or installed. + /// + /// + /// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically. + /// + /// + /// Any exceptions that occur will be automatically propagated to the calling thread. + /// + /// + /// + /// Thrown if the form is already displayed asynchronously or if no could be retrieved or installed. + /// + [Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = DiagnosticIDs.UrlFormat)] + public Task ShowDialogAsync(IWin32Window owner) => ShowDialogAsyncInternal(owner); + + private Task ShowDialogAsyncInternal(IWin32Window? owner) + { + lock (_lock) + { + if (_nonModalFormCompletion is not null || _modalFormCompletion is not null) + { + throw new InvalidOperationException(SR.Form_HasAlreadyBeenShownAsync); + } + + _modalFormCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + } + + if (SynchronizationContext.Current is null) + { + WindowsFormsSynchronizationContext.InstallIfNeeded(); + } + + var syncContext = SynchronizationContext.Current + ?? throw new InvalidOperationException(SR.FormOrTaskDialog_NoSyncContextForShowAsync); + + syncContext.Post((state) => ShowDialogProc( + modalFormCompletion: ref _modalFormCompletion, owner: owner), + state: null); + + return _modalFormCompletion.Task; + + void ShowDialogProc(ref TaskCompletionSource modalFormCompletion, IWin32Window? owner = default) + { + try + { + DialogResult result = ShowDialog(owner); + modalFormCompletion.SetResult(result); + } + catch (Exception ex) + { + modalFormCompletion.SetException(ex); + } + finally + { + modalFormCompletion = null!; + } + } + } + /// /// Indicates whether the property should be /// persisted. diff --git a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/ApplicationTests.cs b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/ApplicationTests.cs index e99dddf67da..ac221312d8d 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/ApplicationTests.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/ApplicationTests.cs @@ -20,7 +20,9 @@ await RunTestAsync(form => { form.Show(); using Form child = new() { RightToLeft = RightToLeft.No }; +#pragma warning disable VSTHRD103 // Call async methods when in an async method child.Show(form); +#pragma warning restore VSTHRD103 // Call async methods when in an async method const int expectedFormCount = 2; Assert.Equal(expectedFormCount, Application.OpenForms.Count); diff --git a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs index c88825b4662..63c076510de 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs @@ -334,7 +334,9 @@ protected async Task RunFormAsync(Func<(Form dialog, T control)> createDialog Assert.NotNull(control); dialog.Activated += (sender, e) => gate.TrySetResult(default); +#pragma warning disable VSTHRD103 // Call async methods when in an async method dialog.ShowDialog(); +#pragma warning restore VSTHRD103 // Call async methods when in an async method await test.JoinAsync(); } @@ -375,7 +377,9 @@ protected async Task RunFormWithoutControlAsync(Func createForm, F Assert.NotNull(dialog); dialog.Activated += (sender, e) => gate.TrySetResult(default); +#pragma warning disable VSTHRD103 // Call async methods when in an async method dialog.ShowDialog(); +#pragma warning restore VSTHRD103 // Call async methods when in an async method await test.JoinAsync(); } From b238485ba67308251d71a2da184f691899e584bb Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Sat, 10 Aug 2024 16:17:45 -0700 Subject: [PATCH 337/342] Experimental dark mode support Pulled from https://github.com/dotnet/winforms/pull/10985/files. Styling features and non-critical changes were stripped out to make this the smallest change possible. --- .../src/Microsoft.VisualBasic.Forms.vbproj | 1 - .../ApplyApplicationDefaultsEventArgs.vb | 21 +- .../WindowsFormsApplicationBase.vb | 84 +++-- .../src/Microsoft/VisualBasic/Interaction.vb | 1 + .../src/PublicAPI.Unshipped.txt | 4 + .../src/System/Drawing/SystemBrushes.cs | 20 +- .../src/System/Drawing/SystemPens.cs | 21 +- .../Resources/SR.resx | 2 +- .../src/NativeMethods.txt | 4 + .../src/Properties/AssemblyInfo.cs | 2 + .../Windows/Forms/DeviceContextExtensions.cs | 17 +- .../src/Windows/Win32/CreateBrushScope.cs | 5 +- .../src/PublicAPI.Unshipped.txt | 31 ++ .../src/Resources/SR.resx | 32 +- .../src/Resources/xlf/SR.cs.xlf | 50 +++ .../src/Resources/xlf/SR.de.xlf | 50 +++ .../src/Resources/xlf/SR.es.xlf | 50 +++ .../src/Resources/xlf/SR.fr.xlf | 50 +++ .../src/Resources/xlf/SR.it.xlf | 50 +++ .../src/Resources/xlf/SR.ja.xlf | 50 +++ .../src/Resources/xlf/SR.ko.xlf | 50 +++ .../src/Resources/xlf/SR.pl.xlf | 50 +++ .../src/Resources/xlf/SR.pt-BR.xlf | 50 +++ .../src/Resources/xlf/SR.ru.xlf | 50 +++ .../src/Resources/xlf/SR.tr.xlf | 50 +++ .../src/Resources/xlf/SR.zh-Hans.xlf | 50 +++ .../src/Resources/xlf/SR.zh-Hant.xlf | 50 +++ .../src/System/Windows/Forms/Application.cs | 119 ++++++- .../src/System/Windows/Forms/Control.cs | 41 ++- .../src/System/Windows/Forms/ControlStyles.cs | 11 + .../Forms/Controls/Buttons/ButtonBase.cs | 5 + .../Forms/Controls/ComboBox/ComboBox.cs | 16 +- .../Controls/DataGridView/DataGridView.cs | 4 + .../Controls/DateTimePicker/DateTimePicker.cs | 8 +- .../Forms/Controls/GroupBox/GroupBox.cs | 9 +- .../Windows/Forms/Controls/Labels/Label.cs | 4 + .../Forms/Controls/ListBoxes/ListBox.cs | 4 + .../Forms/Controls/ListView/ListView.cs | 45 ++- .../Controls/MonthCalendar/MonthCalendar.cs | 11 +- .../Forms/Controls/PictureBox/PictureBox.cs | 4 + .../Forms/Controls/ProgressBar/ProgressBar.cs | 21 ++ .../Controls/PropertyGrid/PropertyGrid.cs | 7 + .../Forms/Controls/Splitter/Splitter.cs | 4 + .../Forms/Controls/TabControl/TabControl.cs | 3 + .../Forms/Controls/TabControl/TabPage.cs | 36 ++- .../Forms/Controls/TextBox/TextBoxBase.cs | 4 + .../Forms/Controls/ToolStrips/StatusStrip.cs | 4 + .../Controls/ToolStrips/ToolStripManager.cs | 24 +- .../Controls/ToolStrips/ToolStripMenuItem.cs | 13 +- .../Forms/Controls/TrackBar/TrackBar.cs | 4 + .../Forms/Controls/TreeView/TreeView.cs | 19 +- .../UpDown/UpDownBase.UpDownButtons.cs | 4 + .../Forms/Controls/UpDown/UpDownBase.cs | 4 + .../Windows/Forms/DarkProfessionalColors.cs | 52 +++ .../src/System/Windows/Forms/Form.cs | 296 +++++++++++++++++- .../Windows/Forms/FormCornerPreference.cs | 35 +++ .../src/System/Windows/Forms/MDI/MDIClient.cs | 6 + .../src/System/Windows/Forms/Panels/Panel.cs | 4 + .../Windows/Forms/Rendering/TextRenderer.cs | 12 +- .../Windows/Forms/Scrolling/ScrollBar.cs | 4 + .../Forms/Scrolling/ScrollableControl.cs | 6 +- .../System/Windows/Forms/SystemColorMode.cs | 25 ++ .../System/Windows/Forms/StatusStripTests.cs | 7 +- 63 files changed, 1690 insertions(+), 80 deletions(-) create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/DarkProfessionalColors.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index 45cc087bd34..0357326ed70 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -9,7 +9,6 @@ Microsoft.VisualBasic.Forms true On - Off On Latest diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 0033ac0ad62..f12c6d2f1b0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -2,9 +2,11 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.ComponentModel +Imports System.Diagnostics.CodeAnalysis Imports System.Drawing Imports System.Runtime.InteropServices Imports System.Windows.Forms +Imports System.Windows.Forms.Analyzers.Diagnostics Namespace Microsoft.VisualBasic.ApplicationServices @@ -15,12 +17,20 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Class ApplyApplicationDefaultsEventArgs Inherits EventArgs +#Disable Warning WFO5001 + Friend Sub New(minimumSplashScreenDisplayTime As Integer, - highDpiMode As HighDpiMode) + highDpiMode As HighDpiMode, + colorMode As SystemColorMode) + Me.MinimumSplashScreenDisplayTime = minimumSplashScreenDisplayTime Me.HighDpiMode = highDpiMode + Me.ColorMode = colorMode End Sub +#Enable Warning WFO5000 +#Enable Warning WFO5001 + ''' ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. ''' @@ -34,7 +44,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. ''' Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MINIMUM_SPLASH_EXPOSURE_DEFAULT + WindowsFormsApplicationBase.MinimumSplashExposureDefault ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. @@ -44,5 +54,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property HighDpiMode As HighDpiMode + ''' + ''' Setting this property inside the event handler determines the for the application. + ''' + + Public Property ColorMode As SystemColorMode + End Class +#Disable Warning WFO5001 End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 8de33f6b462..4882984446e 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -3,6 +3,7 @@ Imports System.Collections.ObjectModel Imports System.ComponentModel +Imports System.Diagnostics.CodeAnalysis Imports System.IO.Pipes Imports System.Reflection Imports System.Runtime.CompilerServices @@ -10,6 +11,7 @@ Imports System.Runtime.InteropServices Imports System.Security Imports System.Threading Imports System.Windows.Forms +Imports System.Windows.Forms.Analyzers.Diagnostics Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils @@ -88,9 +90,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private Delegate Sub DisposeDelegate() ' How long a subsequent instance will wait for the original instance to get on its feet. - Private Const SECOND_INSTANCE_TIMEOUT As Integer = 2500 ' milliseconds. + Private Const SecondInstanceTimeOut As Integer = 2500 ' milliseconds. - Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. + Friend Const MinimumSplashExposureDefault As Integer = 2000 ' milliseconds. + Friend Const WinFormsExperimentalUrl As String = "https://aka.ms/winforms-experimental/{0}" Private ReadOnly _splashLock As New Object Private ReadOnly _appContext As WinFormsAppContext @@ -131,15 +134,20 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private _splashScreen As Form ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. - Private _minimumSplashExposure As Integer = MINIMUM_SPLASH_EXPOSURE_DEFAULT + Private _minimumSplashExposure As Integer = MinimumSplashExposureDefault Private _splashTimer As Timers.Timer Private _appSynchronizationContext As SynchronizationContext ' Informs My.Settings whether to save the settings on exit or not. Private _saveMySettingsOnExit As Boolean - ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. + ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyApplicationsDefault event. Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware +#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. + ' The ColorMode (Classic/Light, System, Dark) the user assigned to the ApplyApplicationsDefault event. + ' Note: We aim to expose this to the App Designer in later runtime/VS versions. + Private _colorMode As SystemColorMode = SystemColorMode.Classic +#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. ''' ''' Occurs when the network availability changes. @@ -249,15 +257,15 @@ Namespace Microsoft.VisualBasic.ApplicationServices RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) If _unhandledExceptionHandlers IsNot Nothing Then - ' In the case that we throw from the handler, we don't want to - ' run the handler again. + ' In the case that we throw from the UnhandledException handler, we don't want to + ' run the UnhandledException handler again. _processingUnhandledExceptionEvent = True For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers handler?.Invoke(sender, e) Next - ' Now that we are out of the handler, treat exceptions normally again. + ' Now that we are out of the UnhandledException handler, treat exceptions normally again. _processingUnhandledExceptionEvent = False End If End RaiseEvent @@ -291,8 +299,8 @@ Namespace Microsoft.VisualBasic.ApplicationServices If authenticationMode = AuthenticationMode.Windows Then Try ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) - ' Will only check THIS caller so you'll always get TRUE. - ' What is needed is a way to get to the value of this on a demand basis. + ' Will only check the THIS caller so you'll always get TRUE. + ' What we need is a way to get to the value of this on a demand basis. ' So I try/catch instead for now but would rather be able to IF my way around this block. Thread.CurrentPrincipal = New Principal.WindowsPrincipal(Principal.WindowsIdentity.GetCurrent) Catch ex As SecurityException @@ -347,9 +355,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' --- We are launching a subsequent instance. Dim tokenSource As New CancellationTokenSource() - tokenSource.CancelAfter(SECOND_INSTANCE_TIMEOUT) + tokenSource.CancelAfter(SecondInstanceTimeOut) Try - Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync(applicationInstanceID, commandLine, cancellationToken:=tokenSource.Token).ConfigureAwait(False) + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync( + pipeName:=applicationInstanceID, + args:=commandLine, + cancellationToken:=tokenSource.Token).ConfigureAwait(False) + awaitable.GetAwaiter().GetResult() Catch ex As Exception Throw New CantStartSingleInstanceException() @@ -492,20 +504,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents ' where it could be modified (again). So event wins over Override over default value (2 seconds). - ' b) We feed the default HighDpiMode (SystemAware) to the EventArgs. With the introduction of - ' the HighDpiMode property, we give Project System the chance to reflect the HighDpiMode - ' in the App Designer UI and have it code-generated based on a modified Application.myapp, which - ' would result it to be set in the derived constructor. (See the hidden file in the Solution Explorer - ' "My Project\Application.myapp\Application.Designer.vb for how those UI-set values get applied.) + ' b) We feed the defaults for HighDpiMode, ColorMode, VisualStylesMode to the EventArgs. + ' With the introduction of the HighDpiMode property, we changed Project System the chance to reflect + ' those default values in the App Designer UI and have it code-generated based on a modified + ' Application.myapp, which would result it to be set in the derived constructor. + ' (See the hidden file in the Solution Explorer "My Project\Application.myapp\Application.Designer.vb + ' for how those UI-set values get applied.) ' Once all this is done, we give the User another chance to change the value by code through ' the ApplyDefaults event. - ' Overriding MinimumSplashScreenDisplayTime needs still to keep working! + ' Note: Overriding MinimumSplashScreenDisplayTime needs still to keep working! +#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. Dim applicationDefaultsEventArgs As New ApplyApplicationDefaultsEventArgs( MinimumSplashScreenDisplayTime, - HighDpiMode) With + HighDpiMode, + ColorMode) With { .MinimumSplashScreenDisplayTime = MinimumSplashScreenDisplayTime } +#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. RaiseEvent ApplyApplicationDefaults(Me, applicationDefaultsEventArgs) @@ -521,17 +537,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices _highDpiMode = applicationDefaultsEventArgs.HighDpiMode +#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. + + _colorMode = applicationDefaultsEventArgs.ColorMode + ' Then, it's applying what we got back as HighDpiMode. Dim dpiSetResult As Boolean = Application.SetHighDpiMode(_highDpiMode) + If dpiSetResult Then _highDpiMode = Application.HighDpiMode End If Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") - ' And finally we take care of EnableVisualStyles. - If _enableVisualStyles Then - Application.EnableVisualStyles() - End If + ' Now, let's set VisualStyles and ColorMode: + Application.SetColorMode(_colorMode) + +#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. ' We'll handle "/nosplash" for you. If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then @@ -559,7 +580,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' It is important not to create the network object until the ExecutionContext has everything on it. ' By now the principal will be on the thread so we can create the network object. ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' the network changed event to the main thread. The asyncOperationsManager does a CreateOperation() ' which makes a copy of the executionContext. That execution context shows up on your thread during ' the callback so I delay creating the network object (and consequently the capturing of the execution context) ' until the principal has been set on the thread. This avoids the problem where My.User isn't set @@ -796,6 +817,23 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property + ''' + ''' Gets or sets the ColorMode for the Application. + ''' + ''' + ''' The that the application is running in. + ''' + + + Protected Property ColorMode As SystemColorMode + Get + Return _colorMode + End Get + Set(value As SystemColorMode) + _colorMode = value + End Set + End Property + Protected Property IsSingleInstance() As Boolean Get diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 6aa828c617b..d3e371f8aa8 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -10,6 +10,7 @@ Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils +Imports NativeMethods = Microsoft.VisualBasic.CompilerServices.NativeMethods Namespace Microsoft.VisualBasic diff --git a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt index e69de29bb2d..131dfdfa7bd 100644 --- a/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt +++ b/src/Microsoft.VisualBasic.Forms/src/PublicAPI.Unshipped.txt @@ -0,0 +1,4 @@ +Microsoft.VisualBasic.ApplicationServices.ApplyApplicationDefaultsEventArgs.ColorMode() -> System.Windows.Forms.SystemColorMode +Microsoft.VisualBasic.ApplicationServices.ApplyApplicationDefaultsEventArgs.ColorMode(AutoPropertyValue As System.Windows.Forms.SystemColorMode) -> Void +Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.ColorMode() -> System.Windows.Forms.SystemColorMode +Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.ColorMode(value As System.Windows.Forms.SystemColorMode) -> Void diff --git a/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs b/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs index a2fd62f88e1..518b019f8c3 100644 --- a/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs +++ b/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs @@ -5,6 +5,11 @@ namespace System.Drawing; public static class SystemBrushes { +#if NET9_0_OR_GREATER +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + private static bool s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. +#endif private static readonly object s_systemBrushesKey = new(); public static Brush ActiveBorder => FromSystemColor(SystemColors.ActiveBorder); @@ -57,7 +62,20 @@ public static Brush FromSystemColor(Color c) throw new ArgumentException(SR.Format(SR.ColorNotSystemColor, c.ToString())); } - if (!Gdip.ThreadData.TryGetValue(s_systemBrushesKey, out object? tempSystemBrushes) || tempSystemBrushes is not Brush[] systemBrushes) +#if NET9_0_OR_GREATER +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (s_colorSetOnLastAccess != SystemColors.UseAlternativeColorSet) + { + s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; + + // We need to clear the SystemBrushes cache, when the ColorMode had changed. + Gdip.ThreadData.Remove(s_systemBrushesKey); + } +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. +#endif + + if (!Gdip.ThreadData.TryGetValue(s_systemBrushesKey, out object? tempSystemBrushes) + || tempSystemBrushes is not Brush[] systemBrushes) { systemBrushes = new Brush[(int)KnownColor.WindowText + (int)KnownColor.MenuHighlight - (int)KnownColor.YellowGreen]; Gdip.ThreadData[s_systemBrushesKey] = systemBrushes; diff --git a/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs b/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs index 8e1786d5fac..a104c452b12 100644 --- a/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs +++ b/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs @@ -5,6 +5,12 @@ namespace System.Drawing; public static class SystemPens { +#if NET9_0_OR_GREATER +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + private static bool s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. +#endif + private static readonly object s_systemPensKey = new(); public static Pen ActiveBorder => FromSystemColor(SystemColors.ActiveBorder); @@ -58,7 +64,20 @@ public static Pen FromSystemColor(Color c) throw new ArgumentException(SR.Format(SR.ColorNotSystemColor, c.ToString())); } - if (!Gdip.ThreadData.TryGetValue(s_systemPensKey, out object? tempSystemPens) || tempSystemPens is not Pen[] systemPens) +#if NET9_0_OR_GREATER +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (s_colorSetOnLastAccess != SystemColors.UseAlternativeColorSet) + { + s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; + + // We need to clear the SystemBrushes cache, when the ColorMode had changed. + Gdip.ThreadData.Remove(s_systemPensKey); + } +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. +#endif + + if (!Gdip.ThreadData.TryGetValue(s_systemPensKey, out object? tempSystemPens) + || tempSystemPens is not Pen[] systemPens) { systemPens = new Pen[(int)KnownColor.WindowText + (int)KnownColor.MenuHighlight - (int)KnownColor.YellowGreen]; Gdip.ThreadData[s_systemPensKey] = systemPens; diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx index cf5f0ae9db7..6c0e0125a53 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx @@ -120,4 +120,4 @@ Add DesignerSerializationVisibilityAttribute to property - + \ No newline at end of file diff --git a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt index 6dc088f67e9..20d4e5497ec 100644 --- a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt +++ b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt @@ -108,6 +108,9 @@ DSH_FLAGS DTM_* DTN_* DTS_* +DwmGetWindowAttribute +DwmSetWindowAttribute +DWM_WINDOW_CORNER_PREFERENCE DuplicateHandle EC_* ECO_* @@ -164,6 +167,7 @@ GetClipboardFormatName GetClipBox GetClipCursor GetClipRgn +GetComboBoxInfo GetCurrentActCtx GetCurrentObject GetCurrentProcess diff --git a/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs b/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs index 335a005fd97..beb5c608c30 100644 --- a/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs +++ b/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs @@ -5,6 +5,8 @@ [assembly: System.Runtime.InteropServices.ComVisible(false)] +[assembly: InternalsVisibleTo("Microsoft.VisualBasic.Forms, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] + [assembly: InternalsVisibleTo("System.Windows.Forms, PublicKey=00000000000000000400000000000000")] [assembly: InternalsVisibleTo("System.Windows.Forms.Design, PublicKey=00000000000000000400000000000000")] [assembly: InternalsVisibleTo("System.Windows.Forms.Design.Editors, PublicKey=00000000000000000400000000000000")] diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs index 5e8d271c476..8db0598de8e 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs @@ -116,7 +116,22 @@ internal static unsafe void DrawLines(this HDC hdc, HPEN hpen, ReadOnlySpan /// internal static Color FindNearestColor(this HDC hdc, Color color) { - Color newColor = ColorTranslator.FromWin32((int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value); +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (color.IsSystemColor && SystemColors.UseAlternativeColorSet) + { + // We need to "un-system" the color for nearest color to work correctly in dark mode, + // since GetNearestColor doesn't understand dark mode system colors and internally works + // with the light mode colors. + color = Color.FromArgb(color.ToArgb()); + Debug.Assert(!color.IsSystemColor, "Color should not be a system color."); + } +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + + Color newColor = ColorTranslator.FromWin32( + (int)PInvoke.GetNearestColor( + hdc: hdc, + color: (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value); + return newColor.ToArgb() == color.ToArgb() ? color : newColor; } diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs index cd09e6fc84c..2988ae0c6ee 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs @@ -28,9 +28,12 @@ internal readonly ref struct CreateBrushScope /// public CreateBrushScope(Color color) { - HBRUSH = color.IsSystemColor +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + HBRUSH = color.IsSystemColor && !SystemColors.UseAlternativeColorSet ? PInvoke.GetSysColorBrush(color) : PInvoke.CreateSolidBrush(color); +#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + ValidateBrushHandle(); } diff --git a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt index 9923ae55cb6..4d90b128a8a 100644 --- a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt +++ b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt @@ -1,3 +1,34 @@ +override System.Windows.Forms.ProgressBar.OnCreateControl() -> void +static System.Windows.Forms.Application.ColorMode.get -> System.Windows.Forms.SystemColorMode +static System.Windows.Forms.Application.IsDarkModeEnabled.get -> bool +static System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode systemColorMode) -> void +static System.Windows.Forms.Application.SystemColorMode.get -> System.Windows.Forms.SystemColorMode +System.Windows.Forms.ControlStyles.ApplyThemingImplicitly = 524288 -> System.Windows.Forms.ControlStyles +System.Windows.Forms.Form.FormBorderColor.get -> System.Drawing.Color +System.Windows.Forms.Form.FormBorderColor.set -> void +System.Windows.Forms.Form.FormBorderColorChanged -> System.EventHandler? +System.Windows.Forms.Form.FormCaptionBackColor.get -> System.Drawing.Color +System.Windows.Forms.Form.FormCaptionBackColor.set -> void +System.Windows.Forms.Form.FormCaptionBackColorChanged -> System.EventHandler? +System.Windows.Forms.Form.FormCaptionTextColor.get -> System.Drawing.Color +System.Windows.Forms.Form.FormCaptionTextColor.set -> void +System.Windows.Forms.Form.FormCaptionTextColorChanged -> System.EventHandler? +System.Windows.Forms.Form.FormCornerPreference.get -> System.Windows.Forms.FormCornerPreference +System.Windows.Forms.Form.FormCornerPreference.set -> void +System.Windows.Forms.Form.FormCornerPreferenceChanged -> System.EventHandler? +System.Windows.Forms.FormCornerPreference +System.Windows.Forms.FormCornerPreference.Default = 0 -> System.Windows.Forms.FormCornerPreference +System.Windows.Forms.FormCornerPreference.DoNotRound = 1 -> System.Windows.Forms.FormCornerPreference +System.Windows.Forms.FormCornerPreference.Round = 2 -> System.Windows.Forms.FormCornerPreference +System.Windows.Forms.FormCornerPreference.RoundSmall = 3 -> System.Windows.Forms.FormCornerPreference +System.Windows.Forms.SystemColorMode +System.Windows.Forms.SystemColorMode.Classic = 0 -> System.Windows.Forms.SystemColorMode +System.Windows.Forms.SystemColorMode.Dark = 2 -> System.Windows.Forms.SystemColorMode +System.Windows.Forms.SystemColorMode.System = 1 -> System.Windows.Forms.SystemColorMode +virtual System.Windows.Forms.Form.OnFormBorderColorChanged(System.EventArgs! e) -> void +virtual System.Windows.Forms.Form.OnFormCaptionBackColorChanged(System.EventArgs! e) -> void +virtual System.Windows.Forms.Form.OnFormCaptionTextColorChanged(System.EventArgs! e) -> void +virtual System.Windows.Forms.Form.OnFormCornerPreferenceChanged(System.EventArgs! e) -> void static System.Windows.Forms.TaskDialog.ShowDialogAsync(nint hwndOwner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task! static System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.IWin32Window! owner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task! static System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterScreen) -> System.Threading.Tasks.Task! diff --git a/src/System.Windows.Forms/src/Resources/SR.resx b/src/System.Windows.Forms/src/Resources/SR.resx index f0c6d889a88..a456df22368 100644 --- a/src/System.Windows.Forms/src/Resources/SR.resx +++ b/src/System.Windows.Forms/src/Resources/SR.resx @@ -6979,10 +6979,40 @@ Stack trace where the illegal operation occurred was: Design time features are not supported. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + + Occurs whenever the FormBorderColor property is changed. + + + Occurs whenever the FormCaptionBackColor property is changed. + + + Occurs whenever the FormCaptionTextColor property is changed. + + + Occurs whenever the FormCornerPreference property is changed. + + + The rounding style of the Form's border. + + + The color of the Form's border. + + + The back color of the Form's caption (title bar). + + + The color of the Form's text caption (title bar text). + The form has already been shown asynchronously. Failed to retrieve the Synchronization Context for showing the Form asynchronously. - \ No newline at end of file + diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index bf14bfbcf63..def511334cd 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -1527,6 +1527,11 @@ Ukazatel myši, který se zobrazí, pokud jej přesunete přes ovládací prvek. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Vyvolá se při změně hodnoty vlastnosti DataContext. @@ -2182,6 +2187,11 @@ Ukazatele zásobníku nelze serializovat. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. Funkce AddNew není pro vazby mezi vlastnostmi podporována. @@ -5305,6 +5315,16 @@ Chcete jej nahradit? Aktuální pozice posuvníku automatického posouvání. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Určuje vzhled a chování ohraničení a záhlaví formuláře. @@ -5315,11 +5335,41 @@ Chcete jej nahradit? Stornovací tlačítko formuláře. Je-li tato vlastnost nastavena, dojde k aktivaci tohoto tlačítka vždy, když uživatel stiskne klávesu Esc. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Určuje, zda má formulář systémovou a řídicí nabídku. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Okraje tohoto formuláře v souřadnicích plochy. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index ecb00061f8d..0730517b619 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -1527,6 +1527,11 @@ Der angezeigte Cursor, wenn der Zeiger über das Steuerelement bewegt wird. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Tritt auf, wenn sich der Wert der DataSource-Eigenschaft ändert. @@ -2182,6 +2187,11 @@ Vordefinierte Cursor können nicht serialisiert werden. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew wird für die Eigenschaftenbindung nicht unterstützt. @@ -5305,6 +5315,16 @@ Möchten Sie sie ersetzen? Die aktuelle Position der automatischen Schiebeleiste. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Gibt die Darstellung und das Verhalten des Rahmens und der Titelleiste des Formulars an. @@ -5315,11 +5335,41 @@ Möchten Sie sie ersetzen? Die Schaltfläche "Abbrechen" des Formulars. Wenn diese Eigenschaft festgelegt ist, wird auf die Schaltfläche "geklickt", wenn der Benutzer die ESC-Taste drückt. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Bestimmt, ob ein Formular ein Steuerelement/System-Menüfeld hat. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Die Begrenzungen dieses Formulars in Desktopkoordinaten. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index 4a8189273d4..b12f0ba4eef 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -1527,6 +1527,11 @@ Cursor que aparece al pasar el puntero por el control. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Se produce cuando cambia el valor de la propiedad DataContext. @@ -2182,6 +2187,11 @@ Los cursores estándar no se pueden serializar. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. No se admite AddNew para el enlace propiedad a propiedad. @@ -5305,6 +5315,16 @@ Do you want to replace it? Posición actual de la barra de desplazamiento automático. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Indica la apariencia y el comportamiento del borde y de la barra de título del formulario. @@ -5315,11 +5335,41 @@ Do you want to replace it? Botón Cancelar del formulario. Si esta propiedad está establecida, se 'hace clic' en el botón cuando el usuario presiona la tecla 'ESC'. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Determina si el formulario tiene un cuadro de menú Control o Sistema. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Límites de este formulario en coordenadas del escritorio. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index 53d0208e006..f873a0bc12d 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -1527,6 +1527,11 @@ Le curseur qui s'affiche lorsque le pointeur passe sur le contrôle. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Se produit lorsque la valeur de la propriété DataContext change. @@ -2182,6 +2187,11 @@ Les curseurs de stock ne peuvent pas être sérialisés. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew n'est pas pris en charge pour la liaison de propriété à propriété. @@ -5305,6 +5315,16 @@ Voulez-vous le remplacer ? La position actuelle de la barre de défilement automatique. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Indique l'apparence et le comportement de la bordure et de la barre de titre du formulaire. @@ -5315,11 +5335,41 @@ Voulez-vous le remplacer ? Le bouton d'annulation de ce formulaire. Si cette propriété est définie, le bouton est "cliqué" lorsque l'utilisateur appuie sur la touche "ÉCHAP". + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Détermine si un formulaire a un menu Système. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Les limites de ce formulaire en coordonnées du bureau. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index d3d3114fc82..d4486a14a07 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -1527,6 +1527,11 @@ Il cursore che viene visualizzato quando il puntatore del mouse viene spostato sul controllo. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Generato quando il valore della proprietà DataSource cambia. @@ -2182,6 +2187,11 @@ I cursori predefiniti non possono essere serializzati. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew non è supportato per l'associazione da proprietà a proprietà. @@ -5305,6 +5315,16 @@ Sostituirlo? La posizione corrente della barra di scorrimento automatico. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Indica l'aspetto e il comportamento del bordo e della barra del titolo del form. @@ -5315,11 +5335,41 @@ Sostituirlo? Il pulsante di annullamento del form. Se la proprietà viene impostata, il pulsante verrà scelto ogni volta che l'utente premerà ESC. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Determina se un form dispone di una casella del menu di sistema/controllo. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. I limiti di questo form in coordinate desktop. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index 6a91f0f5204..5e43a401cae 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -1527,6 +1527,11 @@ ポインターがコントロールに移動したときに表示されるカーソルです。 + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. DataContext プロパティの値が変更されたときに発生します。 @@ -2182,6 +2187,11 @@ ストック カーソルをシリアル化できません。 + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew は、プロパティからプロパティへの バインドに対してサポートされていません。 @@ -5305,6 +5315,16 @@ Do you want to replace it? 自動スクロール機能のスクロール バーの現在の位置です。 + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. フォームの境界線およびタイトル バーの、外観および動作を示します。 @@ -5315,11 +5335,41 @@ Do you want to replace it? フォームの [キャンセル] ボタンです。このプロパティを設定すると、ユーザーが Esc キーを押すたびに、ボタンがクリックされます。 + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. フォームにコントロール/システム メニュー ボックスを加えるかどうかを決定します。 + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. デスクトップ座標でのこのフォームの境界線です。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index 130bd7446c5..8bf0a027e3a 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -1527,6 +1527,11 @@ 포인터가 컨트롤 위로 이동할 때 나타나는 커서입니다. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. DataContext 속성의 값이 변경되면 발생합니다. @@ -2182,6 +2187,11 @@ 스톡 커서를 serialize할 수 없습니다. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew는 속성에 대하여 속성 바인딩을 지원하지 않습니다. @@ -5305,6 +5315,16 @@ Do you want to replace it? 자동으로 스크롤되는 스크롤 막대의 현재 위치입니다. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. 폼의 테두리 및 제목 표시줄의 모양과 동작을 나타냅니다. @@ -5315,11 +5335,41 @@ Do you want to replace it? 폼의 취소 단추입니다. 이 속성을 설정하면 <Esc> 키를 누를 때마다 단추가 '클릭'됩니다. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. 폼에 컨트롤/시스템 메뉴 상자를 포함할지 여부를 결정합니다. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. 데스크톱 좌표로 표시한 이 폼의 범위입니다. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index 6439e2d55b0..96f153e2378 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -1527,6 +1527,11 @@ Wygląd kursora, gdy wskaźnik myszy przesuwa się nad formantem. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Występuje, gdy wartość właściwości DataContext zostanie zmieniona. @@ -2182,6 +2187,11 @@ Typowe kursory nie mogą być serializowane. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. Element AddNew nie jest obsługiwany dla powiązań właściwości z właściwością. @@ -5305,6 +5315,16 @@ Czy chcesz go zamienić? Bieżąca pozycja paska przewijania automatycznego. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Wskazuje wygląd i zachowanie obramowania i paska tytułu formularza. @@ -5315,11 +5335,41 @@ Czy chcesz go zamienić? Przycisk anulowania formularza. Gdy ta właściwość jest ustawiona, to przycisk jest „kliknięty” przy każdym naciśnięciu klawisza ESC. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Określa, czy w formularzu znajduje się pole menu systemowego/sterowania. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Granice formularza we współrzędnych pulpitu. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index 976969af99f..f26cfd1b80a 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -1527,6 +1527,11 @@ O cursor exibido quando o ponteiro se move sobre o controle. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Ocorre quando o valor da propriedade DataContext é alterado. @@ -2182,6 +2187,11 @@ Os cursores padrão não podem ser serializados. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. AddNew não oferece suporte para associação de propriedade a propriedade. @@ -5305,6 +5315,16 @@ Deseja substituí-lo? A posição atual da barra de rolagem automática. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Indica a aparência e o comportamento da borda e da barra de títulos do formulário. @@ -5315,11 +5335,41 @@ Deseja substituí-lo? O botão para cancelar do formulário. Se esta propriedade estiver definida, o botão será 'clicado' sempre que o usuário pressionar a tecla 'ESC'. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Determina se um formulário tem uma caixa de menu Controle/Sistema. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Os limites deste formulário nas coordenadas da área de trabalho. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index 0e78b1f48ac..775b41bde9a 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -1527,6 +1527,11 @@ Курсор, отображаемый при наведении указателя мыши на данный элемент управления. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. Возникает при изменении значения свойства DataContext. @@ -2182,6 +2187,11 @@ Невозможно сериализовать Stock курсоры. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. Метод AddNew не поддерживается для привязки свойства к другому свойству. @@ -5306,6 +5316,16 @@ Do you want to replace it? Текущее положение автоматической полосы прокрутки. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Определяет внешний вид и поведение границы и строки заголовка данной формы. @@ -5316,11 +5336,41 @@ Do you want to replace it? Кнопка отмены для данной формы. Если это свойство задано, можно сделать нажатие клавиши ESC эквивалентным нажатию этой кнопки. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Определяет, содержит ли форма значок меню окна/системного меню. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Привязки данной формы в координатах рабочего стола. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 2af30d01d04..94b4ee81b31 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -1527,6 +1527,11 @@ İşaretçi denetimin üzerine geldiğinde görünen imleç. + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. DataContext özelliğinin değeri değiştiğinde gerçekleşir. @@ -2182,6 +2187,11 @@ Hazır imleçler seri hale getirilemez. + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. Özellikler arası bağlamada AddNew özelliği desteklenmiyor. @@ -5305,6 +5315,16 @@ Bunu değiştirmek istiyor musunuz? Otomatik kayan kaydırma çubuğunun geçerli konumu. + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. Formun kenarlığının ve başlık çubuğunun görünümünü ve davranışını gösterir. @@ -5315,11 +5335,41 @@ Bunu değiştirmek istiyor musunuz? Formun iptal düğmesi. Bu özellik ayarlıysa, kullanıcı 'ESC' tuşuna her bastığında düğme 'tıklatılır'. + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. Formun Denetim/Sistem menüsü kutusu olup olmadığını belirler. + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. Bu formun sınırları (masaüstü koordinatlarında). diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index 2dbcb4f32ea..3c74c5a0f16 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -1527,6 +1527,11 @@ 指针移过该控件时显示的光标。 + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. 当 DataContext 属性的值发生更改时发生。 @@ -2182,6 +2187,11 @@ 常用光标无法序列化。 + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. 属性到属性的绑定不支持 AddNew。 @@ -5305,6 +5315,16 @@ Do you want to replace it? 自动滚动的滚动条的当前位置。 + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. 指示窗体的边框和标题栏的外观和行为。 @@ -5315,11 +5335,41 @@ Do you want to replace it? 窗体的“取消”按钮。如果设置该属性,每次用户按“Esc”键都相当于“单击”了该按钮。 + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. 确定窗体是否有“控件/系统”菜单框。 + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. 此窗体在桌面坐标中的边界。 diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index 51dfd40dddd..9b9516a2818 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -1527,6 +1527,11 @@ 當指標移到控制項時所顯示的游標。 + + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + Determines the dark mode setting for the control. This ambient property inherits its value from its parent control or from the Application class. + + Occurs when the value of the DataContext property changes. DataCoNtext 屬性的值變更時發生。 @@ -2182,6 +2187,11 @@ 無法序列化內建游標。 + + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + Dark mode cannot be activated, either because of an activated High-Contrast mode or because the underlying OS does not support it. + + AddNew is not supported for property to property binding. 屬性間的繫結不支援 AddNew。 @@ -5305,6 +5315,16 @@ Do you want to replace it? 自動捲動捲軸目前的位置。 + + Occurs whenever the FormBorderColor property is changed. + Occurs whenever the FormBorderColor property is changed. + + + + The color of the Form's border. + The color of the Form's border. + + Indicates the appearance and behavior of the border and title bar of the form. 表示表單框線和標題列的外觀和行為。 @@ -5315,11 +5335,41 @@ Do you want to replace it? 表單的取消按鈕。如果設定此屬性,當使用者按下 'ESC' 鍵時就代表「已按下」該按鈕。 + + Occurs whenever the FormCaptionBackColor property is changed. + Occurs whenever the FormCaptionBackColor property is changed. + + + + The back color of the Form's caption (title bar). + The back color of the Form's caption (title bar). + + + + Occurs whenever the FormCaptionTextColor property is changed. + Occurs whenever the FormCaptionTextColor property is changed. + + + + The color of the Form's text caption (title bar text). + The color of the Form's text caption (title bar text). + + Determines whether a form has a Control/System menu box. 決定表單是否有系統控制功能表方塊。 + + Occurs whenever the FormCornerPreference property is changed. + Occurs whenever the FormCornerPreference property is changed. + + + + The rounding style of the Form's border. + The rounding style of the Form's border. + + The bounds of this form in desktop coordinates. 此表單在桌面座標中的界限。 diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index 7db4f080db3..fbe9124ffa7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.Reflection; using System.Text; +using System.Windows.Forms.Analyzers.Diagnostics; using System.Windows.Forms.VisualStyles; using Microsoft.Office; using Microsoft.Win32; @@ -40,9 +41,19 @@ public sealed partial class Application private static bool s_comCtlSupportsVisualStylesInitialized; private static bool s_comCtlSupportsVisualStyles; private static FormCollection? s_forms; - private static readonly object s_internalSyncObject = new(); + private static readonly Lock s_internalSyncObject = new(); private static bool s_useWaitCursor; +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + private static SystemColorMode? s_systemColorMode; +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + + internal const string WinFormsExperimentalUrl = "https://aka.ms/winforms-experimental/{0}"; + + private const string DarkModeKeyPath = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; + private const string DarkModeKey = "AppsUseLightTheme"; + private const int DarkModeNotAvailable = -1; + /// /// Events the user can hook into /// @@ -237,7 +248,111 @@ public static InputLanguage CurrentInputLanguage internal static bool CustomThreadExceptionHandlerAttached => ThreadContext.FromCurrent().CustomThreadExceptionHandlerAttached; - internal static Font? DefaultFont => s_defaultFontScaled ?? s_defaultFont; + /// + /// Gets the default dark mode for the application. This is the SystemColorMode which either has been set + /// by or its default value . + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + public static SystemColorMode ColorMode => + !s_systemColorMode.HasValue + ? SystemColorMode.Classic + : s_systemColorMode.Value == SystemColorMode.System + ? SystemColorMode + : s_systemColorMode.Value; + + /// + /// Sets the default dark mode for the application. + /// + /// The default dark mode to set. + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + public static void SetColorMode(SystemColorMode systemColorMode) + { + try + { + // Can't use the Generator here, since it cannot deal with experimentals. + _ = systemColorMode switch + { + SystemColorMode.Classic => systemColorMode, + SystemColorMode.System => systemColorMode, + SystemColorMode.Dark => systemColorMode, + _ => throw new ArgumentOutOfRangeException(nameof(systemColorMode)) + }; + + if (GetSystemColorModeInternal() > -1) + { + s_systemColorMode = systemColorMode; + return; + } + + s_systemColorMode = SystemColorMode.Classic; + } + finally + { + SystemColors.UseAlternativeColorSet = IsDarkModeEnabled; + } + } + + internal static Font DefaultFont => s_defaultFontScaled ?? s_defaultFont!; + + /// + /// Gets the system color mode setting of the OS system environment. + /// + /// + /// + /// The color setting is determined based on the operating system version and its system settings. + /// It returns if the dark mode is enabled in the system settings, + /// if the color mode equals the light, standard color setting. + /// + /// + /// SystemColorMode is supported on Windows 11 or later versions. + /// + /// + /// SystemColorModes is not supported, if the Windows OS High Contrast Mode has been enabled in the system settings. + /// + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + public static SystemColorMode SystemColorMode => + GetSystemColorModeInternal() == 0 + ? SystemColorMode.Dark + : SystemColorMode.Classic; + + // Returns 0 if dark mode is available, otherwise -1 (DarkModeNotAvailable) + private static int GetSystemColorModeInternal() + { + if (SystemInformation.HighContrast) + { + return DarkModeNotAvailable; + } + + int systemColorMode = DarkModeNotAvailable; + + // Dark mode is supported when we are >= W11/22000 + // Technically, we could go earlier, but then the APIs we're using weren't officially public. + if (OsVersion.IsWindows11_OrGreater()) + { + try + { + systemColorMode = (Registry.GetValue( + keyName: DarkModeKeyPath, + valueName: DarkModeKey, + defaultValue: DarkModeNotAvailable) as int?) ?? systemColorMode; + } + catch (Exception ex) when (!ex.IsCriticalException()) + { + } + } + + return systemColorMode; + } + + /// + /// Gets a value indicating whether the application is running in a dark system color context. + /// Note: In a high contrast mode, this will always return . + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + public static bool IsDarkModeEnabled => + !SystemInformation.HighContrast + && (ColorMode == SystemColorMode.Dark); /// /// Gets the path for the executable file that started the application. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index edea3823111..6aa7d6c9ac1 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -14,6 +14,7 @@ using Windows.Win32.System.Ole; using Windows.Win32.UI.Accessibility; using Windows.Win32.UI.Input.KeyboardAndMouse; +using Windows.Win32.Graphics.Dwm; using Com = Windows.Win32.System.Com; using ComTypes = System.Runtime.InteropServices.ComTypes; using Encoding = System.Text.Encoding; @@ -142,6 +143,7 @@ public unsafe partial class Control : private static readonly object s_causesValidationEvent = new(); private static readonly object s_regionChangedEvent = new(); private static readonly object s_marginChangedEvent = new(); + // This needs to be internal for derived controls to access it. private protected static readonly object s_paddingChangedEvent = new(); private static readonly object s_previewKeyDownEvent = new(); private static readonly object s_dataContextEvent = new(); @@ -157,6 +159,11 @@ public unsafe partial class Control : private static FontHandleWrapper? s_defaultFontHandleWrapper; + internal const string DarkModeIdentifier = "DarkMode"; + internal const string ExplorerThemeIdentifier = "Explorer"; + internal const string ItemsViewThemeIdentifier = "ItemsView"; + internal const string ComboBoxButtonThemeIdentifier = "CFD"; + private const short PaintLayerBackground = 1; private const short PaintLayerForeground = 2; @@ -709,7 +716,8 @@ internal HBRUSH BackColorBrush Color color = BackColor; HBRUSH backBrush; - if (color.IsSystemColor) +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (color.IsSystemColor && !Application.IsDarkModeEnabled) { backBrush = PInvoke.GetSysColorBrush(color); SetState(States.OwnCtlBrush, false); @@ -719,6 +727,7 @@ internal HBRUSH BackColorBrush backBrush = PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); SetState(States.OwnCtlBrush, true); } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle"); Properties.SetObject(s_backBrushProperty, backBrush); @@ -7542,6 +7551,16 @@ protected virtual void OnHandleCreated(EventArgs e) PInvoke.SetWindowText(this, _text); } +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. + if (Application.IsDarkModeEnabled && GetStyle(ControlStyles.ApplyThemingImplicitly)) + { + _ = PInvoke.SetWindowTheme( + hwnd: HWND, + pszSubAppName: $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", + pszSubIdList: null); + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. + if (this is not ScrollableControl && !IsMirrored && GetExtendedState(ExtendedStates.SetScrollPosition) @@ -10594,15 +10613,22 @@ protected virtual void SetVisibleCore(bool value) bool fireChange = false; +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. if (GetTopLevel()) { // The processing of WmShowWindow will set the visibility // bit and call CreateControl() if (IsHandleCreated || value) { - PInvoke.ShowWindow(this, value ? ShowParams : SHOW_WINDOW_CMD.SW_HIDE); + if (value) + { + PrepareDarkMode(HWND, Application.IsDarkModeEnabled); + } + + PInvoke.ShowWindow(HWND, value ? ShowParams : SHOW_WINDOW_CMD.SW_HIDE); } } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. else if (IsHandleCreated || (value && _parent?.Created == true)) { // We want to mark the control as visible so that CreateControl @@ -10690,6 +10716,17 @@ protected virtual void SetVisibleCore(bool value) | (value ? SET_WINDOW_POS_FLAGS.SWP_SHOWWINDOW : SET_WINDOW_POS_FLAGS.SWP_HIDEWINDOW)); } } + + static unsafe void PrepareDarkMode(HWND hwnd, bool darkModeEnabled) + { + BOOL value = darkModeEnabled; + + PInvoke.DwmSetWindowAttribute( + hwnd, + DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE, + &value, + (uint)sizeof(BOOL)).AssertSuccess(); + } } /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs index 9a41f738ec5..b9401a2b66a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; +using System.Windows.Forms.Analyzers.Diagnostics; namespace System.Windows.Forms; @@ -135,4 +136,14 @@ public enum ControlStyles /// not be used by Active Accessibility. /// UseTextForAccessibility = 0x00040000, + + /// + /// For certain UI-related color modes (Dark Mode/Light Mode), controls + /// can opt-in to automatically apply the appropriate theming. Especially + /// controls which are utilizing system-managed scrollbars can benefit + /// from this setting. Note that using this settings will cause some + /// win32 control theming renderers to become inactive for a specific theme. + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + ApplyThemingImplicitly = 0x00080000 } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/ButtonBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/ButtonBase.cs index 6ceb9b5a715..df4bb0b6a67 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/ButtonBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/ButtonBase.cs @@ -77,6 +77,11 @@ protected ButtonBase() SetExtendedState(ExtendedStates.UserPreferredSizeCache, true); SetStyle(ControlStyles.UserMouse | ControlStyles.UserPaint, OwnerDraw); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetFlag(FlagUseMnemonic, true); SetFlag(FlagShowToolTip, false); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs index 02533f34e1d..bf9b6dc33d3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs @@ -2377,7 +2377,7 @@ protected override void CreateHandle() /// Inheriting classes should not forget to call /// base.OnHandleCreated() /// - protected override void OnHandleCreated(EventArgs e) + protected override unsafe void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); @@ -2449,6 +2449,20 @@ protected override void OnHandleCreated(EventArgs e) _fromHandleCreate = false; } +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled) + { + // Style the ComboBox Open-Button: + PInvoke.SetWindowTheme(HWND, $"{DarkModeIdentifier}_{ComboBoxButtonThemeIdentifier}", null); + COMBOBOXINFO cInfo = default; + cInfo.cbSize = (uint)sizeof(COMBOBOXINFO); + + // Style the ComboBox drop-down (including its ScrollBar(s)): + _ = PInvoke.GetComboBoxInfo(HWND, ref cInfo); + PInvoke.SetWindowTheme(cInfo.hwndList, $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", null); + } +#pragma warning restore WFO5001 + if (_itemsCollection is not null) { foreach (object item in _itemsCollection) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs index 7cc6e1cde49..78b1dd092b7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.cs @@ -387,6 +387,10 @@ public DataGridView() SetStyle(ControlStyles.SupportsTransparentBackColor, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // this class overrides GetPreferredSizeCore, let Control automatically cache the result SetExtendedState(ExtendedStates.UserPreferredSizeCache, true); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DateTimePicker/DateTimePicker.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DateTimePicker/DateTimePicker.cs index 61f1acb7e13..836441bcca5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DateTimePicker/DateTimePicker.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DateTimePicker/DateTimePicker.cs @@ -488,7 +488,13 @@ public LeftRightAlignment DropDownAlign [EditorBrowsable(EditorBrowsableState.Never)] public override Color ForeColor { - get => ShouldSerializeForeColor() ? base.ForeColor : SystemColors.WindowText; +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. + get => ShouldSerializeForeColor() + || Application.IsDarkModeEnabled + ? base.ForeColor + : SystemColors.WindowText; +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. + set => base.ForeColor = value; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/GroupBox/GroupBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/GroupBox/GroupBox.cs index e571f240124..50e1cb7351b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/GroupBox/GroupBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/GroupBox/GroupBox.cs @@ -424,15 +424,17 @@ protected override void OnPaint(PaintEventArgs e) // We only pass in the text color if it is explicitly set, else we let the renderer use the color // specified by the theme. This is a temporary workaround till we find a good solution for the // "default theme color" issue. - if (ShouldSerializeForeColor() || !Enabled) +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (ShouldSerializeForeColor() || Application.IsDarkModeEnabled || !Enabled) { - Color textcolor = Enabled ? ForeColor : TextRenderer.DisabledTextColor(BackColor); + Color textColor = Enabled ? ForeColor : TextRenderer.DisabledTextColor(BackColor); + GroupBoxRenderer.DrawGroupBox( e, new Rectangle(0, 0, Width, Height), Text, Font, - textcolor, + textColor, textFlags, gbState); } @@ -446,6 +448,7 @@ protected override void OnPaint(PaintEventArgs e) textFlags, gbState); } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } base.OnPaint(e); // raise paint event diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Labels/Label.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Labels/Label.cs index ab4c404459f..74b33f4eb32 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Labels/Label.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Labels/Label.cs @@ -74,6 +74,10 @@ public Label() : base() SetStyle(ControlStyles.ResizeRedraw, true); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + CommonProperties.SetSelfAutoSizeInDefaultLayout(this, true); _labelState[s_stateFlatStyle] = (int)FlatStyle.Standard; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/ListBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/ListBox.cs index 45c8743a214..2f656362654 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/ListBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/ListBox.cs @@ -120,6 +120,10 @@ public ListBox() : base() { SetStyle(ControlStyles.UserPaint | ControlStyles.StandardClick | ControlStyles.UseTextForAccessibility, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // This class overrides GetPreferredSizeCore, let Control automatically cache the result. SetExtendedState(ExtendedStates.UserPreferredSizeCache, true); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs index d260e1c2903..04a3d0f3912 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs @@ -4613,6 +4613,17 @@ protected override void OnHandleCreated(EventArgs e) PInvoke.SendMessage(this, PInvoke.CCM_SETVERSION, (WPARAM)5); } +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled) + { + _ = PInvoke.SetWindowTheme(HWND, $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", null); + + // Get the ListView's ColumnHeader handle: + HWND columnHeaderHandle = (HWND)PInvoke.SendMessage(this, PInvoke.LVM_GETHEADER, (WPARAM)0, (LPARAM)0); + PInvoke.SetWindowTheme(columnHeaderHandle, $"{DarkModeIdentifier}_{ItemsViewThemeIdentifier}", null); + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + UpdateExtendedStyles(); RealizeProperties(); PInvoke.SendMessage(this, PInvoke.LVM_SETBKCOLOR, (WPARAM)0, (LPARAM)BackColor); @@ -5008,16 +5019,19 @@ protected void RealizeProperties() Color c; c = BackColor; - if (c != SystemColors.Window) +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (c != SystemColors.Window || Application.IsDarkModeEnabled) { PInvoke.SendMessage(this, PInvoke.LVM_SETBKCOLOR, (WPARAM)0, (LPARAM)c); } c = ForeColor; - if (c != SystemColors.WindowText) + + if (c != SystemColors.WindowText || Application.IsDarkModeEnabled) { PInvoke.SendMessage(this, PInvoke.LVM_SETTEXTCOLOR, (WPARAM)0, (LPARAM)c); } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. if (_imageListLarge is not null) { @@ -6007,6 +6021,33 @@ private unsafe bool WmNotify(ref Message m) { NMHDR* nmhdr = (NMHDR*)(nint)m.LParamInternal; + // We need to set the text color when we are in dark mode, + // so that the themed headers are actually readable. +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled + && !OwnerDraw + && nmhdr->code == PInvoke.NM_CUSTOMDRAW) + { + NMLVCUSTOMDRAW* nmlvcd = (NMLVCUSTOMDRAW*)(nint)m.LParamInternal; + + if (nmlvcd->nmcd.dwDrawStage == NMCUSTOMDRAW_DRAW_STAGE.CDDS_PREPAINT) + { + // We request the notification for the items to be drawn. + m.ResultInternal = (LRESULT)(nint)PInvoke.CDRF_NOTIFYITEMDRAW; + return true; + } + else if (nmlvcd->nmcd.dwDrawStage == NMCUSTOMDRAW_DRAW_STAGE.CDDS_ITEMPREPAINT) + { + // Setting the current ForeColor to the text color. + PInvoke.SetTextColor(nmlvcd->nmcd.hdc, ForeColor); + + // and the rest remains the same. + m.ResultInternal = (LRESULT)(nint)PInvoke.CDRF_DODEFAULT; + return false; + } + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (nmhdr->code == PInvoke.NM_CUSTOMDRAW && PInvoke.UiaClientsAreListening()) { // Checking that mouse buttons are not pressed is necessary to avoid diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.cs index 57e02247556..cfdd0b8a84f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.cs @@ -137,6 +137,9 @@ public MonthCalendar() : base() _focusedDate = _todaysDate; SetStyle(ControlStyles.UserPaint, false); SetStyle(ControlStyles.StandardClick, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. TabStop = true; } @@ -188,12 +191,13 @@ public DateTime[] AnnuallyBoldedDates } } +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [SRDescription(nameof(SR.MonthCalendarMonthBackColorDescr))] public override Color BackColor { get { - if (ShouldSerializeBackColor()) + if (ShouldSerializeBackColor() || Application.IsDarkModeEnabled) { return base.BackColor; } @@ -202,6 +206,7 @@ public override Color BackColor } set => base.BackColor = value; } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] @@ -402,12 +407,13 @@ public Day FirstDayOfWeek } } +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [SRDescription(nameof(SR.MonthCalendarForeColorDescr))] public override Color ForeColor { get { - if (ShouldSerializeForeColor()) + if (ShouldSerializeForeColor() || Application.IsDarkModeEnabled) { return base.ForeColor; } @@ -416,6 +422,7 @@ public override Color ForeColor } set => base.ForeColor = value; } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PictureBox/PictureBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PictureBox/PictureBox.cs index 2855cb0b6f8..4adb3e99327 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PictureBox/PictureBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PictureBox/PictureBox.cs @@ -111,6 +111,10 @@ public PictureBox() SetStyle(ControlStyles.Opaque | ControlStyles.Selectable, false); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + TabStop = false; _savedSize = Size; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ProgressBar/ProgressBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ProgressBar/ProgressBar.cs index 747186dc107..a7d7815aebf 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ProgressBar/ProgressBar.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ProgressBar/ProgressBar.cs @@ -38,6 +38,10 @@ public partial class ProgressBar : Control public ProgressBar() : base() { SetStyle(ControlStyles.UserPaint | ControlStyles.UseTextForAccessibility | ControlStyles.Selectable, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + ForeColor = s_defaultForeColor; } @@ -60,6 +64,7 @@ protected override CreateParams CreateParams { // We want to turn on mirroring for Form explicitly. cp.ExStyle |= (int)WINDOW_EX_STYLE.WS_EX_LAYOUTRTL; + // Don't need these styles when mirroring is turned on. cp.ExStyle &= ~(int)(WINDOW_EX_STYLE.WS_EX_RTLREADING | WINDOW_EX_STYLE.WS_EX_RIGHT | WINDOW_EX_STYLE.WS_EX_LEFTSCROLLBAR); } @@ -68,6 +73,22 @@ protected override CreateParams CreateParams } } + protected override void OnCreateControl() + { + base.OnCreateControl(); + + // If SystemColorMode is enabled, we need to disable the Visual Styles + // so Windows allows setting Fore- and Background color. + // There are more ideal ways imaginable, but this does the trick for now. +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled) + { + // Disables Visual Styles for the ProgressBar. + PInvoke.SetWindowTheme(HWND, " ", " "); + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + } + [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public override bool AllowDrop diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs index b760fd4b26f..c9e14a1cc60 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs @@ -2537,6 +2537,13 @@ protected override void OnFontChanged(EventArgs e) protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); + + // Making sure, the _toolBar BackColor gets updated when the + // default BackColor is not the typical light-theme one. +#pragma warning disable CA2245 // Do not assign a property to itself + BackColor = BackColor; +#pragma warning restore CA2245 + OnLayoutInternal(dividerOnly: false); TypeDescriptor.Refreshed += OnTypeDescriptorRefreshed; if (_selectedObjects is not null && _selectedObjects.Length > 0) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Splitter/Splitter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Splitter/Splitter.cs index ddc1031d4fb..9c25630aa16 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Splitter/Splitter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Splitter/Splitter.cs @@ -47,6 +47,10 @@ public partial class Splitter : Control public Splitter() : base() { SetStyle(ControlStyles.Selectable, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + TabStop = false; _minSize = 25; _minExtra = 25; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabControl.cs index d02511cad3b..b079664aacd 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabControl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabControl.cs @@ -83,6 +83,9 @@ public TabControl() _tabCollection = new TabPageCollection(this); SetStyle(ControlStyles.UserPaint, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabPage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabPage.cs index 0374f8fd402..3fcd81249af 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabPage.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TabControl/TabPage.cs @@ -35,6 +35,9 @@ public partial class TabPage : Panel public TabPage() : base() { SetStyle(ControlStyles.CacheText, true); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. Text = null; } @@ -97,14 +100,19 @@ public override Color BackColor get { Color color = base.BackColor; +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. if (color != DefaultBackColor) { return color; } - else if (Application.RenderWithVisualStyles && UseVisualStyleBackColor && (ParentInternal is TabControl parent && parent.Appearance == TabAppearance.Normal)) + else if (!Application.IsDarkModeEnabled + && Application.RenderWithVisualStyles + && UseVisualStyleBackColor + && (ParentInternal is TabControl parent && parent.Appearance == TabAppearance.Normal)) { return Color.Transparent; } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. return color; } @@ -590,15 +598,26 @@ protected override void OnPaintBackground(PaintEventArgs e) // Utilize the UseVisualStyleBackColor property to determine whether or not the themed // background should be utilized. - if (Application.RenderWithVisualStyles && UseVisualStyleBackColor && (ParentInternal is TabControl parent && parent.Appearance == TabAppearance.Normal)) + if (Application.RenderWithVisualStyles + && UseVisualStyleBackColor + && (ParentInternal is TabControl parent && parent.Appearance == TabAppearance.Normal)) { - Color bkcolor = UseVisualStyleBackColor ? Color.Transparent : BackColor; +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + Color bkColor = (UseVisualStyleBackColor && !Application.IsDarkModeEnabled) + ? Color.Transparent + : BackColor; +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + Rectangle inflateRect = LayoutUtils.InflateRect(DisplayRectangle, Padding); // To ensure that the TabPage draws correctly (the border will get clipped and // and gradient fill will match correctly with the tabcontrol). Unfortunately, // there is no good way to determine the padding used on the TabPage. - Rectangle rectWithBorder = new(inflateRect.X - 4, inflateRect.Y - 2, inflateRect.Width + 8, inflateRect.Height + 6); + Rectangle rectWithBorder = new( + inflateRect.X - 4, + inflateRect.Y - 2, + inflateRect.Width + 8, + inflateRect.Height + 6); TabRenderer.DrawTabPage(e, rectWithBorder); @@ -606,7 +625,14 @@ protected override void OnPaintBackground(PaintEventArgs e) // draw it ourselves. if (BackgroundImage is not null) { - ControlPaint.DrawBackgroundImage(e.Graphics, BackgroundImage, bkcolor, BackgroundImageLayout, inflateRect, inflateRect, DisplayRectangle.Location); + ControlPaint.DrawBackgroundImage( + e.Graphics, + BackgroundImage, + bkColor, + BackgroundImageLayout, + inflateRect, + inflateRect, + DisplayRectangle.Location); } } else diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs index 36b068ac121..84948cbf191 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs @@ -98,6 +98,10 @@ internal TextBoxBase() : base() | ControlStyles.UseTextForAccessibility | ControlStyles.UserPaint, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 + // cache requestedHeight. Note: Control calls DefaultSize (overridable) in the constructor // to set the control's cached height that is returned when calling Height, so we just // need to get the cached height here. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs index 339498e34ed..3d7c133c41b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs @@ -29,6 +29,10 @@ public StatusStrip() SuspendLayout(); CanOverflow = false; LayoutStyle = ToolStripLayoutStyle.Table; + + // Default changed for SystemColorMode from System to ManagerRenderMode. + // Also to be consistent to the MenuStrip. + RenderMode = ToolStripRenderMode.ManagerRenderMode; GripStyle = ToolStripGripStyle.Hidden; SetStyle(ControlStyles.ResizeRedraw, true); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripManager.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripManager.cs index f8b37e9aa01..d83dc3e5cdc 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripManager.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripManager.cs @@ -32,7 +32,7 @@ public static partial class ToolStripManager private const int StaticEventDefaultRendererChanged = 0; private const int StaticEventCount = 1; - private static readonly object s_internalSyncObject = new(); + private static readonly Lock s_internalSyncObject = new(); private static void InitializeThread() { @@ -550,12 +550,24 @@ public static bool VisualStylesEnabled internal static ToolStripRenderer CreateRenderer(ToolStripManagerRenderMode renderMode) { - return renderMode switch + switch (renderMode) { - ToolStripManagerRenderMode.System => new ToolStripSystemRenderer(isDefault: true), - ToolStripManagerRenderMode.Professional => new ToolStripProfessionalRenderer(isDefault: true), - _ => new ToolStripSystemRenderer(isDefault: true), - }; + case ToolStripManagerRenderMode.System: + return new ToolStripSystemRenderer(isDefault: true); + case ToolStripManagerRenderMode.Professional: +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled) + { + return new ToolStripProfessionalRenderer(new DarkProfessionalColors()); + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + + return new ToolStripProfessionalRenderer(isDefault: true); + + case ToolStripManagerRenderMode.Custom: + default: + return new ToolStripSystemRenderer(isDefault: true); + } } internal static ToolStripRenderer CreateRenderer(ToolStripRenderMode renderMode) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs index 876d0a9cfb8..f1488042327 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs @@ -8,6 +8,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms.Design; using System.Windows.Forms.Layout; +using static System.Windows.Forms.Control; namespace System.Windows.Forms; @@ -121,7 +122,7 @@ internal ToolStripMenuItem(HMENU hmenu, int nativeMenuCommandId, IWin32Window ta Initialize(); Overflow = ToolStripItemOverflow.Never; _nativeMenuCommandID = nativeMenuCommandId; - _targetWindowHandle = Control.GetSafeHandle(targetWindow); + _targetWindowHandle = GetSafeHandle(targetWindow); _nativeMenuHandle = hmenu; // Since fetching the image and the text is an awful lot of work @@ -197,7 +198,7 @@ protected override AccessibleObject CreateAccessibilityInstance() private void Initialize() { - if (Control.UseComponentModelRegisteredTypes) + if (UseComponentModelRegisteredTypes) { // Register the type with the ComponentModel so as to be trim safe TypeDescriptor.RegisterType(); @@ -718,7 +719,7 @@ private unsafe bool GetNativeMenuItemEnabled() return null; } - // Ee've mapped to a system defined bitmap we know how to draw. + // We've mapped to a system defined bitmap we know how to draw. Bitmap image = new(16, 16); using (Graphics g = Graphics.FromImage(image)) @@ -1041,7 +1042,7 @@ protected override void OnPaint(PaintEventArgs e) } else { - // Toplevel item support, menu items hosted on a plain ToolStrip dropdown + // Top-level item support, menu items hosted on a plain ToolStrip dropdown if ((DisplayStyle & ToolStripItemDisplayStyle.Text) == ToolStripItemDisplayStyle.Text) { renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, InternalLayout.TextRectangle, textColor, Font, InternalLayout.TextFormat)); @@ -1111,7 +1112,7 @@ protected internal override void SetBounds(Rectangle rect) /// this is to support routing to native menu commands internal void SetNativeTargetWindow(IWin32Window window) { - _targetWindowHandle = Control.GetSafeHandle(window); + _targetWindowHandle = GetSafeHandle(window); } /// this is to support routing to native menu commands @@ -1129,7 +1130,7 @@ internal void SetNativeTargetWindow(IWin32Window window) return string.Empty; } - if (!Control.UseComponentModelRegisteredTypes) + if (!UseComponentModelRegisteredTypes) { return TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TrackBar/TrackBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TrackBar/TrackBar.cs index d301a55a920..8e30cb22363 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TrackBar/TrackBar.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TrackBar/TrackBar.cs @@ -54,6 +54,10 @@ public TrackBar() : base() { SetStyle(ControlStyles.UserPaint, false); SetStyle(ControlStyles.UseTextForAccessibility, false); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. _requestedDim = PreferredDimension; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs index ed155b2e55f..e65ccf827f5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs @@ -170,6 +170,9 @@ public TreeView() SetStyle(ControlStyles.UserPaint, false); SetStyle(ControlStyles.StandardClick, false); SetStyle(ControlStyles.UseTextForAccessibility, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } internal override void ReleaseUiaProvider(HWND handle) @@ -1859,7 +1862,7 @@ protected override void OnHandleCreated(EventArgs e) } // Workaround for problem in TreeView where it doesn't recognize the TVS_CHECKBOXES - // style if it is set before the window is created. To get around the problem, + // style if it is set before the window is created. To get around the problem, // we set it here after the window is created, and we make sure we don't set it // in getCreateParams so that this will actually change the value of the bit. // This seems to make the TreeView happy. @@ -1878,19 +1881,21 @@ protected override void OnHandleCreated(EventArgs e) } Color c = BackColor; - if (c != SystemColors.Window) +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (c != SystemColors.Window || Application.IsDarkModeEnabled) { PInvoke.SendMessage(this, PInvoke.TVM_SETBKCOLOR, 0, c.ToWin32()); } c = ForeColor; - if (c != SystemColors.WindowText) + if (c != SystemColors.WindowText || Application.IsDarkModeEnabled) { PInvoke.SendMessage(this, PInvoke.TVM_SETTEXTCOLOR, 0, c.ToWin32()); } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - // Put the linecolor into the native control only if set. + // Put the LineColor into the native control only if set. if (_lineColor != Color.Empty) { PInvoke.SendMessage(this, PInvoke.TVM_SETLINECOLOR, 0, _lineColor.ToWin32()); @@ -2641,7 +2646,10 @@ private void UpdateTreeViewExtendedStyles() // This stops the style from being removed for any derived classes that set it using P/Invoke. if (_treeViewState[TREEVIEWSTATE_doubleBufferedPropertySet]) { - PInvoke.SendMessage(this, PInvoke.TVM_SETEXTENDEDSTYLE, (WPARAM)(nint)PInvoke.TVS_EX_DOUBLEBUFFER, (LPARAM)(nint)(DoubleBuffered ? PInvoke.TVS_EX_DOUBLEBUFFER : 0)); + PInvoke.SendMessage(this, + PInvoke.TVM_SETEXTENDEDSTYLE, + (WPARAM)(nint)PInvoke.TVS_EX_DOUBLEBUFFER, + (LPARAM)(nint)(DoubleBuffered ? PInvoke.TVS_EX_DOUBLEBUFFER : 0)); } } @@ -2830,6 +2838,7 @@ private unsafe void CustomDraw(ref Message m) TreeNodeStates curState = e.State; Font font = node.NodeFont ?? node.TreeView.Font; + Color color = (((curState & TreeNodeStates.Selected) == TreeNodeStates.Selected) && node.TreeView.Focused) ? SystemColors.HighlightText : (node.ForeColor != Color.Empty) ? node.ForeColor : node.TreeView.ForeColor; // Draw the actual node. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.UpDownButtons.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.UpDownButtons.cs index 03fd87e1545..2df89bbdb1b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.UpDownButtons.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.UpDownButtons.cs @@ -35,6 +35,10 @@ internal UpDownButtons(UpDownBase parent) : base() SetStyle(ControlStyles.Opaque | ControlStyles.FixedHeight | ControlStyles.FixedWidth, true); SetStyle(ControlStyles.Selectable, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + _parent = parent; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.cs index add06a6ff4c..029bd300503 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.cs @@ -67,6 +67,10 @@ public UpDownBase() SetStyle(ControlStyles.Opaque | ControlStyles.FixedHeight | ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.StandardClick, false); SetStyle(ControlStyles.UseTextForAccessibility, false); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } [Browsable(false)] diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DarkProfessionalColors.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DarkProfessionalColors.cs new file mode 100644 index 00000000000..399ddefe8f2 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DarkProfessionalColors.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Drawing; + +namespace System.Windows.Forms +{ + internal sealed class DarkProfessionalColors : ProfessionalColorTable + { + public override Color MenuItemPressedGradientBegin + => Color.FromArgb(0xFF, 0x60, 0x60, 0x60); + + public override Color MenuItemPressedGradientMiddle + => Color.FromArgb(0xFF, 0x60, 0x60, 0x60); + + public override Color MenuItemPressedGradientEnd + => Color.FromArgb(0xFF, 0x60, 0x60, 0x60); + + public override Color MenuItemSelected + => SystemColors.ControlText; + + public override Color MenuItemSelectedGradientBegin + => Color.FromArgb(0xFF, 0x40, 0x40, 0x40); + + public override Color MenuItemSelectedGradientEnd + => Color.FromArgb(0xFF, 0x40, 0x40, 0x40); + + public override Color MenuStripGradientBegin + => SystemColors.Control; + + public override Color MenuStripGradientEnd + => SystemColors.Control; + + public override Color StatusStripGradientBegin + => SystemColors.Control; + + public override Color StatusStripGradientEnd + => SystemColors.Control; + + public override Color ToolStripDropDownBackground + => SystemColors.Control; + + public override Color ImageMarginGradientBegin + => SystemColors.Control; + + public override Color ImageMarginGradientMiddle + => SystemColors.Control; + + public override Color ImageMarginGradientEnd + => SystemColors.Control; + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs index 2d759c387ad..d7b8b2d172d 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs @@ -12,6 +12,7 @@ using System.Windows.Forms.VisualStyles; using Windows.Win32.System.Threading; using Windows.Win32.UI.Accessibility; +using Windows.Win32.Graphics.Dwm; namespace System.Windows.Forms; @@ -47,6 +48,10 @@ public partial class Form : ContainerControl private static readonly object s_resizeEndEvent = new(); private static readonly object s_rightToLeftLayoutChangedEvent = new(); private static readonly object s_dpiChangedEvent = new(); + private static readonly object s_formBorderColorChanged = new(); + private static readonly object s_formCaptionBackColorChanged = new(); + private static readonly object s_formCaptionTextColorChanged = new(); + private static readonly object s_formCornerPreferenceChanged = new(); // // The following flags should be used with formState[..] not formStateEx[..] @@ -98,7 +103,7 @@ public partial class Form : ContainerControl private const int SizeGripSize = 16; private static Icon? s_defaultIcon; - private static readonly object s_internalSyncObject = new(); + private static readonly Lock s_internalSyncObject = new(); // Property store keys for properties. The property store allocates most efficiently // in groups of four, so we try to lump properties in groups of four based on how @@ -131,6 +136,7 @@ public partial class Form : ContainerControl private static readonly int s_propOpacity = PropertyStore.CreateKey(); private static readonly int s_propTransparencyKey = PropertyStore.CreateKey(); + private static readonly int s_propFormCornerPreference = PropertyStore.CreateKey(); // Form per instance members // Note: Do not add anything to this list unless absolutely necessary. @@ -199,6 +205,10 @@ public Form() : base() SetState(States.Visible, false); SetState(States.TopLevel, true); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } /// @@ -2333,6 +2343,228 @@ protected override void SetVisibleCore(bool value) } } + /// + /// Sets or gets the rounding style of the corners using the enum. + /// + [DefaultValue(FormCornerPreference.Default)] + [SRCategory(nameof(SR.CatWindowStyle))] + [SRDescription(nameof(SR.FormCornerPreferenceDescr))] + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public FormCornerPreference FormCornerPreference + { + get => Properties.ContainsInteger(s_propFormCornerPreference) + ? (FormCornerPreference)Properties.GetInteger(s_propFormCornerPreference) + : FormCornerPreference.Default; + set + { + if (value == FormCornerPreference) + { + return; + } + + _ = value switch + { + FormCornerPreference.Default => value, + FormCornerPreference.DoNotRound => value, + FormCornerPreference.Round => value, + FormCornerPreference.RoundSmall => value, + _ => throw new ArgumentOutOfRangeException(nameof(value)) + }; + + if (value == FormCornerPreference.Default) + { + Properties.RemoveObject(s_propFormCornerPreference); + } + else + { + Properties.SetInteger(s_propFormCornerPreference, (int)value); + } + + if (IsHandleCreated) + { + SetFormCornerPreferenceInternal(value); + } + + OnFormCornerPreferenceChanged(EventArgs.Empty); + } + } + + /// + /// Raises the event when the + /// property changes. + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + protected virtual void OnFormCornerPreferenceChanged(EventArgs e) + { + if (Events[s_formCornerPreferenceChanged] is EventHandler eventHandler) + { + eventHandler(this, e); + } + } + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + private unsafe void SetFormCornerPreferenceInternal(FormCornerPreference cornerPreference) +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + { + DWM_WINDOW_CORNER_PREFERENCE dwmCornerPreference = cornerPreference switch + { + FormCornerPreference.Default => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DEFAULT, + FormCornerPreference.DoNotRound => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND, + FormCornerPreference.Round => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND, + FormCornerPreference.RoundSmall => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL, + _ => throw new ArgumentOutOfRangeException(nameof(cornerPreference)) + }; + + PInvoke.DwmSetWindowAttribute( + HWND, + DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE, + &dwmCornerPreference, + sizeof(DWM_WINDOW_CORNER_PREFERENCE)); + } + + /// + /// Sets or gets the Form's border color. + /// + [SRCategory(nameof(SR.CatWindowStyle))] + [SRDescription(nameof(SR.FormBorderColorDescr))] + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public Color FormBorderColor + { + get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_BORDER_COLOR); + set + { + if (value == FormBorderColor) + { + return; + } + + if (IsHandleCreated) + { + SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_BORDER_COLOR, value); + } + + OnFormBorderColorChanged(EventArgs.Empty); + } + } + + /// + /// Raises the event when the property changes. + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + protected virtual void OnFormBorderColorChanged(EventArgs e) + { + if (Events[s_formBorderColorChanged] is EventHandler eventHandler) + { + eventHandler(this, e); + } + } + + /// + /// Sets or gets the Form's title bar back color. + /// + [SRCategory(nameof(SR.CatWindowStyle))] + [SRDescription(nameof(SR.FormCaptionBackColorDescr))] + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public Color FormCaptionBackColor + { + get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_CAPTION_COLOR); + set + { + if (value == FormCaptionBackColor) + { + return; + } + + if (IsHandleCreated) + { + SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_CAPTION_COLOR, value); + } + + OnFormCaptionBackColorChanged(EventArgs.Empty); + } + } + + /// + /// Raises the event when the property changes. + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + protected virtual void OnFormCaptionBackColorChanged(EventArgs e) + { + if (Events[s_formCaptionBackColorChanged] is EventHandler eventHandler) + { + eventHandler(this, e); + } + } + + /// + /// Sets or gets the Form's title bar back color. + /// + [SRCategory(nameof(SR.CatWindowStyle))] + [SRDescription(nameof(SR.FormCaptionTextColorDescr))] + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public Color FormCaptionTextColor + { + get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_TEXT_COLOR); + set + { + if (value == FormCaptionTextColor) + { + return; + } + + if (IsHandleCreated) + { + SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_TEXT_COLOR, value); + } + + OnFormCaptionTextColorChanged(EventArgs.Empty); + } + } + + /// + /// Raises the event when the property changes. + /// + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + protected virtual void OnFormCaptionTextColorChanged(EventArgs e) + { + if (Events[s_formCaptionBackColorChanged] is EventHandler eventHandler) + { + eventHandler(this, e); + } + } + + private unsafe Color GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE dmwWindowAttribute) + { + COLORREF colorRef; + + PInvoke.DwmGetWindowAttribute( + HWND, + dmwWindowAttribute, + &colorRef, + (uint)sizeof(COLORREF)); + + return colorRef; + } + + private unsafe void SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE dmwWindowAttribute, Color color) + { + COLORREF colorRef = color; + + PInvoke.DwmSetWindowAttribute( + HWND, + dmwWindowAttribute, + &colorRef, + (uint)sizeof(COLORREF)); + } + /// /// Gets or sets the form's window state. /// @@ -2464,6 +2696,54 @@ public event FormClosingEventHandler? FormClosing remove => Events.RemoveHandler(s_formClosingEvent, value); } + /// + /// Occurs when the property has changed. + /// + [SRCategory(nameof(SR.CatAppearance))] + [SRDescription(nameof(SR.FormBorderColorChangedDescr))] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public event EventHandler? FormBorderColorChanged + { + add => Events.AddHandler(s_formBorderColorChanged, value); + remove => Events.RemoveHandler(s_formBorderColorChanged, value); + } + + /// + /// Occurs when the property has changed. + /// + [SRCategory(nameof(SR.CatAppearance))] + [SRDescription(nameof(SR.FormCaptionBackColorChangedDescr))] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public event EventHandler? FormCaptionBackColorChanged + { + add => Events.AddHandler(s_formCaptionBackColorChanged, value); + remove => Events.RemoveHandler(s_formCaptionBackColorChanged, value); + } + + /// + /// Occurs when the property has changed. + /// + [SRCategory(nameof(SR.CatAppearance))] + [SRDescription(nameof(SR.FormCaptionTextColorChangedDescr))] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public event EventHandler? FormCaptionTextColorChanged + { + add => Events.AddHandler(s_formCaptionTextColorChanged, value); + remove => Events.RemoveHandler(s_formCaptionTextColorChanged, value); + } + + /// + /// Occurs when the property has changed. + /// + [SRCategory(nameof(SR.CatAppearance))] + [SRDescription(nameof(SR.FormCornerPreferenceChangedDescr))] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + public event EventHandler? FormCornerPreferenceChanged + { + add => Events.AddHandler(s_formCornerPreferenceChanged, value); + remove => Events.RemoveHandler(s_formCornerPreferenceChanged, value); + } + /// /// Occurs when the form is closed. /// @@ -2724,7 +3004,8 @@ private void AdjustSystemMenu(HMENU hmenu) UpdateWindowState(); FormWindowState winState = WindowState; FormBorderStyle borderStyle = FormBorderStyle; - bool sizableBorder = borderStyle is FormBorderStyle.SizableToolWindow or FormBorderStyle.Sizable; + bool sizableBorder = (borderStyle is FormBorderStyle.SizableToolWindow + or FormBorderStyle.Sizable); bool showMin = MinimizeBox && winState != FormWindowState.Minimized; bool showMax = MaximizeBox && winState != FormWindowState.Maximized; @@ -4083,6 +4364,13 @@ protected virtual void OnLoad(EventArgs e) // Finally fire the new OnShown(unless the form has already been closed). if (IsHandleCreated) { +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + if (Application.IsDarkModeEnabled) + { + PInvoke.SetWindowTheme(HWND, $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", null); + } +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + BeginInvoke(new MethodInvoker(CallShownEvent)); } } @@ -5816,9 +6104,9 @@ protected override void UpdateDefaultButton() } } - if (containerControl.ActiveControl is IButtonControl buttonControl) + if (containerControl.ActiveControl is IButtonControl control) { - SetDefaultButton(buttonControl); + SetDefaultButton(control); } else { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs new file mode 100644 index 00000000000..0a6cf2eb140 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Windows.Forms.Analyzers.Diagnostics; +using Windows.Win32.Graphics.Dwm; + +namespace System.Windows.Forms; + +/// +/// Specifies the corner preference for a which can be +/// set using the property. +/// +[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] +public enum FormCornerPreference +{ + /// + /// The default corner preference. + /// + Default = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DEFAULT, + + /// + /// Do not round the corners of the form window. + /// + DoNotRound = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND, + + /// + /// Round the corners of the form window. + /// + Round = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND, + + /// + /// Round the corners of the form window with a small radius. + /// + RoundSmall = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MDIClient.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MDIClient.cs index 044baf3cc0d..85dc2ffe392 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MDIClient.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MDIClient.cs @@ -29,7 +29,13 @@ public sealed partial class MdiClient : Control public MdiClient() : base() { SetStyle(ControlStyles.Selectable, false); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); + BackColor = SystemColors.AppWorkspace; +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + Dock = DockStyle.Fill; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Panels/Panel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Panels/Panel.cs index 2def400bf85..f1e03592b92 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Panels/Panel.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Panels/Panel.cs @@ -30,6 +30,10 @@ public Panel() : base() TabStop = false; SetStyle(ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint, false); SetStyle(ControlStyles.SupportsTransparentBackColor, true); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Rendering/TextRenderer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Rendering/TextRenderer.cs index 0f5f47c1a64..d56bbc22a71 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Rendering/TextRenderer.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Rendering/TextRenderer.cs @@ -633,14 +633,14 @@ internal static ApplyGraphicsProperties GetApplyStateFlags(IDeviceContext device // flag when this was originally written. Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.Clipping) - || graphics.Clip is null - || graphics.Clip.GetHrgn(graphics) == IntPtr.Zero, - "Must preserve Graphics clipping region!"); + || graphics.Clip is null + || graphics.Clip.GetHrgn(graphics) == IntPtr.Zero, + "Must preserve Graphics clipping region!"); Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.TranslateTransform) - || graphics.Transform is null - || graphics.Transform.IsIdentity, - "Must preserve Graphics transformation!"); + || graphics.Transform is null + || graphics.Transform.IsIdentity, + "Must preserve Graphics transformation!"); } #endif diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollBar.cs index 23a1d7e0be0..c9b148e2084 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollBar.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollBar.cs @@ -35,6 +35,10 @@ public ScrollBar() : base() SetStyle(ControlStyles.StandardClick, false); SetStyle(ControlStyles.UseTextForAccessibility, false); +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + TabStop = false; if ((CreateParams.Style & (int)SCROLLBAR_CONSTANTS.SB_VERT) != 0) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollableControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollableControl.cs index 4fa91ec96d8..f64b1699c7c 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollableControl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Scrolling/ScrollableControl.cs @@ -27,7 +27,7 @@ public partial class ScrollableControl : Control, IArrangedElement private Rectangle _displayRect = Rectangle.Empty; /// - /// Current margins for autoscrolling. + /// Current margins for auto-scrolling. /// private Size _scrollMargin = Size.Empty; @@ -60,6 +60,10 @@ public ScrollableControl() : base() SetStyle(ControlStyles.ContainerControl, true); SetStyle(ControlStyles.AllPaintingInWmPaint, false); SetScrollState(ScrollStateAutoScrolling, false); + +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + SetStyle(ControlStyles.ApplyThemingImplicitly, true); +#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. } /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs new file mode 100644 index 00000000000..d69eda5cfc3 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Windows.Forms.Analyzers.Diagnostics; + +namespace System.Windows.Forms; + +[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] +public enum SystemColorMode +{ + /// + /// Dark mode for the current context is or should be disabled. + /// + Classic = 0, + + /// + /// The setting for the current system color mode is inherited from the Windows OS. + /// + System = 1, + + /// + /// Dark mode for the current context is enabled. + /// + Dark = 2 +} diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs index 10c0c1e7618..7526e733bf7 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs @@ -121,8 +121,11 @@ public void StatusStrip_Ctor_Default() Assert.Null(control.Region); Assert.NotNull(control.Renderer); Assert.Same(control.Renderer, control.Renderer); - Assert.IsType(control.Renderer); - Assert.Equal(ToolStripRenderMode.ManagerRenderMode, control.RenderMode); + + // TODO: Assume control.Renderer can be either ToolStripSystemRenderer or ToolStripProfessionalRenderer for the Moment. + Assert.True(control.Renderer is ToolStripSystemRenderer or ToolStripProfessionalRenderer, "Renderer is not one of the expected types."); + Assert.True(control.RenderMode is ToolStripRenderMode.System or ToolStripRenderMode.ManagerRenderMode); + Assert.True(control.ResizeRedraw); Assert.Equal(200, control.Right); Assert.Equal(RightToLeft.No, control.RightToLeft); From 0d6ae9a2df6819d1644dbd56ba8090ff34fda421 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Sun, 11 Aug 2024 15:54:04 -0700 Subject: [PATCH 338/342] Apply my feedback to Klaus' dark mode feature - Move Experimental URL to DiagnosticIds - Move special dark mode logic from CreateBrushScope to GetSysColorBrush - Remove unnecessary logic in FindNearestColor - Update brushes and pens by poking SystemEvents static directly --- .../src/Microsoft.VisualBasic.Forms.vbproj | 1 + .../ApplyApplicationDefaultsEventArgs.vb | 2 - .../src/System/Drawing/SystemBrushes.cs | 20 +------- .../src/System/Drawing/SystemPens.cs | 21 +------- .../Resources/SR.resx | 2 +- .../Analyzers/Diagnostics/DiagnosticIDs.cs | 1 - .../src/NativeMethods.txt | 1 + .../Windows/Forms/DeviceContextExtensions.cs | 17 +------ .../src/Windows/Win32/CreateBrushScope.cs | 5 +- .../Windows/Win32/PInvoke.GetSysColorBrush.cs | 12 ++++- .../Win32/PInvoke.SendMessageCallback.cs | 33 ++++++++++++ .../src/System/Windows/Forms/Application.cs | 50 ++++++++++++++++--- .../src/System/Windows/Forms/Control.cs | 4 +- .../src/System/Windows/Forms/ControlStyles.cs | 2 +- .../Controls/ToolStrips/ToolStripMenuItem.cs | 11 ++-- .../Forms/Controls/TreeView/TreeView.cs | 1 - .../src/System/Windows/Forms/Form.cs | 24 ++++----- .../Windows/Forms/FormCornerPreference.cs | 2 +- .../System/Windows/Forms/SystemColorMode.cs | 2 +- .../System/Windows/Forms/StatusStripTests.cs | 1 - 20 files changed, 115 insertions(+), 97 deletions(-) create mode 100644 src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.SendMessageCallback.cs diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj index 0357326ed70..e19ac5de5a2 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft.VisualBasic.Forms.vbproj @@ -10,6 +10,7 @@ true On On + On Latest None diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index f12c6d2f1b0..09cef0076f6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -28,7 +28,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices Me.ColorMode = colorMode End Sub -#Enable Warning WFO5000 #Enable Warning WFO5001 ''' @@ -61,5 +60,4 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property ColorMode As SystemColorMode End Class -#Disable Warning WFO5001 End Namespace diff --git a/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs b/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs index 518b019f8c3..a2fd62f88e1 100644 --- a/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs +++ b/src/System.Drawing.Common/src/System/Drawing/SystemBrushes.cs @@ -5,11 +5,6 @@ namespace System.Drawing; public static class SystemBrushes { -#if NET9_0_OR_GREATER -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - private static bool s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#endif private static readonly object s_systemBrushesKey = new(); public static Brush ActiveBorder => FromSystemColor(SystemColors.ActiveBorder); @@ -62,20 +57,7 @@ public static Brush FromSystemColor(Color c) throw new ArgumentException(SR.Format(SR.ColorNotSystemColor, c.ToString())); } -#if NET9_0_OR_GREATER -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - if (s_colorSetOnLastAccess != SystemColors.UseAlternativeColorSet) - { - s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; - - // We need to clear the SystemBrushes cache, when the ColorMode had changed. - Gdip.ThreadData.Remove(s_systemBrushesKey); - } -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#endif - - if (!Gdip.ThreadData.TryGetValue(s_systemBrushesKey, out object? tempSystemBrushes) - || tempSystemBrushes is not Brush[] systemBrushes) + if (!Gdip.ThreadData.TryGetValue(s_systemBrushesKey, out object? tempSystemBrushes) || tempSystemBrushes is not Brush[] systemBrushes) { systemBrushes = new Brush[(int)KnownColor.WindowText + (int)KnownColor.MenuHighlight - (int)KnownColor.YellowGreen]; Gdip.ThreadData[s_systemBrushesKey] = systemBrushes; diff --git a/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs b/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs index a104c452b12..8e1786d5fac 100644 --- a/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs +++ b/src/System.Drawing.Common/src/System/Drawing/SystemPens.cs @@ -5,12 +5,6 @@ namespace System.Drawing; public static class SystemPens { -#if NET9_0_OR_GREATER -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - private static bool s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#endif - private static readonly object s_systemPensKey = new(); public static Pen ActiveBorder => FromSystemColor(SystemColors.ActiveBorder); @@ -64,20 +58,7 @@ public static Pen FromSystemColor(Color c) throw new ArgumentException(SR.Format(SR.ColorNotSystemColor, c.ToString())); } -#if NET9_0_OR_GREATER -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - if (s_colorSetOnLastAccess != SystemColors.UseAlternativeColorSet) - { - s_colorSetOnLastAccess = SystemColors.UseAlternativeColorSet; - - // We need to clear the SystemBrushes cache, when the ColorMode had changed. - Gdip.ThreadData.Remove(s_systemPensKey); - } -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#endif - - if (!Gdip.ThreadData.TryGetValue(s_systemPensKey, out object? tempSystemPens) - || tempSystemPens is not Pen[] systemPens) + if (!Gdip.ThreadData.TryGetValue(s_systemPensKey, out object? tempSystemPens) || tempSystemPens is not Pen[] systemPens) { systemPens = new Pen[(int)KnownColor.WindowText + (int)KnownColor.MenuHighlight - (int)KnownColor.YellowGreen]; Gdip.ThreadData[s_systemPensKey] = systemPens; diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx index 6c0e0125a53..cf5f0ae9db7 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx @@ -120,4 +120,4 @@ Add DesignerSerializationVisibilityAttribute to property - \ No newline at end of file + diff --git a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs index c57f90e29ad..f1ecc750ba9 100644 --- a/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs +++ b/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/Analyzers/Diagnostics/DiagnosticIDs.cs @@ -19,7 +19,6 @@ internal static class DiagnosticIDs public const string DisposeModalDialog = "WFO2000"; // Experimental, number group 5000+ - public const string ExperimentalVisualStyles = "WFO5000"; public const string ExperimentalDarkMode = "WFO5001"; public const string ExperimentalAsync = "WFO5002"; } diff --git a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt index 20d4e5497ec..35962d9939b 100644 --- a/src/System.Windows.Forms.Primitives/src/NativeMethods.txt +++ b/src/System.Windows.Forms.Primitives/src/NativeMethods.txt @@ -599,6 +599,7 @@ SelectPalette SendDlgItemMessage SendInput SendMessage +SendMessageCallback SendMessageTimeout SetActiveWindow SetBkColor diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs index 8db0598de8e..5e8d271c476 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/DeviceContextExtensions.cs @@ -116,22 +116,7 @@ internal static unsafe void DrawLines(this HDC hdc, HPEN hpen, ReadOnlySpan /// internal static Color FindNearestColor(this HDC hdc, Color color) { -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - if (color.IsSystemColor && SystemColors.UseAlternativeColorSet) - { - // We need to "un-system" the color for nearest color to work correctly in dark mode, - // since GetNearestColor doesn't understand dark mode system colors and internally works - // with the light mode colors. - color = Color.FromArgb(color.ToArgb()); - Debug.Assert(!color.IsSystemColor, "Color should not be a system color."); - } -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - - Color newColor = ColorTranslator.FromWin32( - (int)PInvoke.GetNearestColor( - hdc: hdc, - color: (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value); - + Color newColor = ColorTranslator.FromWin32((int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value); return newColor.ToArgb() == color.ToArgb() ? color : newColor; } diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs index 2988ae0c6ee..cd09e6fc84c 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/CreateBrushScope.cs @@ -28,12 +28,9 @@ internal readonly ref struct CreateBrushScope /// public CreateBrushScope(Color color) { -#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - HBRUSH = color.IsSystemColor && !SystemColors.UseAlternativeColorSet + HBRUSH = color.IsSystemColor ? PInvoke.GetSysColorBrush(color) : PInvoke.CreateSolidBrush(color); -#pragma warning restore SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - ValidateBrushHandle(); } diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.GetSysColorBrush.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.GetSysColorBrush.cs index 56ff7aceb8b..6afc27cf7a8 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.GetSysColorBrush.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.GetSysColorBrush.cs @@ -10,9 +10,19 @@ internal static partial class PInvoke /// public static HBRUSH GetSysColorBrush(Color systemColor) { +#pragma warning disable SYSLIB5002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + bool useSolidBrush = SystemColors.UseAlternativeColorSet; +#pragma warning restore SYSLIB5002 + + if (useSolidBrush) + { + // We don't have a real system color, so we'll just create a solid brush. + return CreateSolidBrush(systemColor); + } + Debug.Assert(systemColor.IsSystemColor); // Extract the COLOR value - return PInvoke.GetSysColorBrush((SYS_COLOR_INDEX)(ColorTranslator.ToOle(systemColor) & 0xFF)); + return GetSysColorBrush((SYS_COLOR_INDEX)(ColorTranslator.ToOle(systemColor) & 0xFF)); } } diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.SendMessageCallback.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.SendMessageCallback.cs new file mode 100644 index 00000000000..e8ee7603420 --- /dev/null +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.SendMessageCallback.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; + +namespace Windows.Win32; + +internal static partial class PInvoke +{ + internal static unsafe BOOL SendMessageCallback( + T hWnd, + MessageId Msg, + Action callback, + WPARAM wParam = default, + LPARAM lParam = default) + where T : IHandle + { + GCHandle gcHandle = GCHandle.Alloc(callback); + BOOL result = SendMessageCallback(hWnd.Handle, Msg, wParam, lParam, &NativeCallback, (nuint)(nint)gcHandle); + GC.KeepAlive(hWnd.Wrapper); + return result; + } + + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])] + private static void NativeCallback(HWND hwnd, uint Msg, nuint dwData, LRESULT lResult) + { + GCHandle gcHandle = (GCHandle)(nint)dwData; + Action action = (Action)gcHandle.Target!; + gcHandle.Free(); + action(); + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index fbe9124ffa7..a249cc47210 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -48,8 +48,6 @@ public sealed partial class Application private static SystemColorMode? s_systemColorMode; #pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - internal const string WinFormsExperimentalUrl = "https://aka.ms/winforms-experimental/{0}"; - private const string DarkModeKeyPath = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; private const string DarkModeKey = "AppsUseLightTheme"; private const int DarkModeNotAvailable = -1; @@ -252,7 +250,7 @@ internal static bool CustomThreadExceptionHandlerAttached /// Gets the default dark mode for the application. This is the SystemColorMode which either has been set /// by or its default value . /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public static SystemColorMode ColorMode => !s_systemColorMode.HasValue ? SystemColorMode.Classic @@ -264,7 +262,7 @@ internal static bool CustomThreadExceptionHandlerAttached /// Sets the default dark mode for the application. /// /// The default dark mode to set. - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public static void SetColorMode(SystemColorMode systemColorMode) { try @@ -278,6 +276,11 @@ public static void SetColorMode(SystemColorMode systemColorMode) _ => throw new ArgumentOutOfRangeException(nameof(systemColorMode)) }; + if (systemColorMode == s_systemColorMode) + { + return; + } + if (GetSystemColorModeInternal() > -1) { s_systemColorMode = systemColorMode; @@ -288,7 +291,40 @@ public static void SetColorMode(SystemColorMode systemColorMode) } finally { - SystemColors.UseAlternativeColorSet = IsDarkModeEnabled; + bool useAlternateColorSet = SystemColors.UseAlternativeColorSet; + bool darkModeEnabled = IsDarkModeEnabled; + + if (useAlternateColorSet != darkModeEnabled) + { + SystemColors.UseAlternativeColorSet = darkModeEnabled; + NotifySystemEventsOfColorChange(); + } + } + + static void NotifySystemEventsOfColorChange() + { + string s_systemTrackerWindow = $".NET-BroadcastEventWindow.{AppDomain.CurrentDomain.GetHashCode():x}.0"; + + HWND hwnd = PInvoke.FindWindow(s_systemTrackerWindow, s_systemTrackerWindow); + if (hwnd.IsNull) + { + // Haven't created the window yet, so no need to notify. + return; + } + + bool complete = false; + bool success = PInvoke.SendMessageCallback(hwnd, PInvoke.WM_SYSCOLORCHANGE + MessageId.WM_REFLECT, () => complete = true); + Debug.Assert(success); + if (!success) + { + return; + } + + while (!complete) + { + DoEvents(); + Thread.Yield(); + } } } @@ -310,7 +346,7 @@ public static void SetColorMode(SystemColorMode systemColorMode) /// SystemColorModes is not supported, if the Windows OS High Contrast Mode has been enabled in the system settings. /// /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public static SystemColorMode SystemColorMode => GetSystemColorModeInternal() == 0 ? SystemColorMode.Dark @@ -349,7 +385,7 @@ private static int GetSystemColorModeInternal() /// Gets a value indicating whether the application is running in a dark system color context. /// Note: In a high contrast mode, this will always return . /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public static bool IsDarkModeEnabled => !SystemInformation.HighContrast && (ColorMode == SystemColorMode.Dark); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index 6aa7d6c9ac1..5b04de6f17b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -716,8 +716,7 @@ internal HBRUSH BackColorBrush Color color = BackColor; HBRUSH backBrush; -#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - if (color.IsSystemColor && !Application.IsDarkModeEnabled) + if (color.IsSystemColor) { backBrush = PInvoke.GetSysColorBrush(color); SetState(States.OwnCtlBrush, false); @@ -727,7 +726,6 @@ internal HBRUSH BackColorBrush backBrush = PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); SetState(States.OwnCtlBrush, true); } -#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle"); Properties.SetObject(s_backBrushProperty, backBrush); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs index b9401a2b66a..9aae5d98031 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs @@ -144,6 +144,6 @@ public enum ControlStyles /// from this setting. Note that using this settings will cause some /// win32 control theming renderers to become inactive for a specific theme. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] ApplyThemingImplicitly = 0x00080000 } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs index f1488042327..803c8b4f751 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripMenuItem.cs @@ -8,7 +8,6 @@ using System.Runtime.InteropServices; using System.Windows.Forms.Design; using System.Windows.Forms.Layout; -using static System.Windows.Forms.Control; namespace System.Windows.Forms; @@ -122,7 +121,7 @@ internal ToolStripMenuItem(HMENU hmenu, int nativeMenuCommandId, IWin32Window ta Initialize(); Overflow = ToolStripItemOverflow.Never; _nativeMenuCommandID = nativeMenuCommandId; - _targetWindowHandle = GetSafeHandle(targetWindow); + _targetWindowHandle = Control.GetSafeHandle(targetWindow); _nativeMenuHandle = hmenu; // Since fetching the image and the text is an awful lot of work @@ -198,7 +197,7 @@ protected override AccessibleObject CreateAccessibilityInstance() private void Initialize() { - if (UseComponentModelRegisteredTypes) + if (Control.UseComponentModelRegisteredTypes) { // Register the type with the ComponentModel so as to be trim safe TypeDescriptor.RegisterType(); @@ -719,7 +718,7 @@ private unsafe bool GetNativeMenuItemEnabled() return null; } - // We've mapped to a system defined bitmap we know how to draw. + // Ee've mapped to a system defined bitmap we know how to draw. Bitmap image = new(16, 16); using (Graphics g = Graphics.FromImage(image)) @@ -1112,7 +1111,7 @@ protected internal override void SetBounds(Rectangle rect) /// this is to support routing to native menu commands internal void SetNativeTargetWindow(IWin32Window window) { - _targetWindowHandle = GetSafeHandle(window); + _targetWindowHandle = Control.GetSafeHandle(window); } /// this is to support routing to native menu commands @@ -1130,7 +1129,7 @@ internal void SetNativeTargetWindow(IWin32Window window) return string.Empty; } - if (!UseComponentModelRegisteredTypes) + if (!Control.UseComponentModelRegisteredTypes) { return TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs index e65ccf827f5..6f968da62b1 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs @@ -2838,7 +2838,6 @@ private unsafe void CustomDraw(ref Message m) TreeNodeStates curState = e.State; Font font = node.NodeFont ?? node.TreeView.Font; - Color color = (((curState & TreeNodeStates.Selected) == TreeNodeStates.Selected) && node.TreeView.Focused) ? SystemColors.HighlightText : (node.ForeColor != Color.Empty) ? node.ForeColor : node.TreeView.ForeColor; // Draw the actual node. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs index d7b8b2d172d..281067c3515 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs @@ -2351,7 +2351,7 @@ protected override void SetVisibleCore(bool value) [SRDescription(nameof(SR.FormCornerPreferenceDescr))] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public FormCornerPreference FormCornerPreference { get => Properties.ContainsInteger(s_propFormCornerPreference) @@ -2395,7 +2395,7 @@ public FormCornerPreference FormCornerPreference /// Raises the event when the /// property changes. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] protected virtual void OnFormCornerPreferenceChanged(EventArgs e) { if (Events[s_formCornerPreferenceChanged] is EventHandler eventHandler) @@ -2431,7 +2431,7 @@ private unsafe void SetFormCornerPreferenceInternal(FormCornerPreference cornerP [SRDescription(nameof(SR.FormBorderColorDescr))] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public Color FormBorderColor { get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_BORDER_COLOR); @@ -2454,7 +2454,7 @@ public Color FormBorderColor /// /// Raises the event when the property changes. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] protected virtual void OnFormBorderColorChanged(EventArgs e) { if (Events[s_formBorderColorChanged] is EventHandler eventHandler) @@ -2470,7 +2470,7 @@ protected virtual void OnFormBorderColorChanged(EventArgs e) [SRDescription(nameof(SR.FormCaptionBackColorDescr))] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public Color FormCaptionBackColor { get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_CAPTION_COLOR); @@ -2493,7 +2493,7 @@ public Color FormCaptionBackColor /// /// Raises the event when the property changes. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] protected virtual void OnFormCaptionBackColorChanged(EventArgs e) { if (Events[s_formCaptionBackColorChanged] is EventHandler eventHandler) @@ -2509,7 +2509,7 @@ protected virtual void OnFormCaptionBackColorChanged(EventArgs e) [SRDescription(nameof(SR.FormCaptionTextColorDescr))] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public Color FormCaptionTextColor { get => GetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_TEXT_COLOR); @@ -2532,7 +2532,7 @@ public Color FormCaptionTextColor /// /// Raises the event when the property changes. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] protected virtual void OnFormCaptionTextColorChanged(EventArgs e) { if (Events[s_formCaptionBackColorChanged] is EventHandler eventHandler) @@ -2701,7 +2701,7 @@ public event FormClosingEventHandler? FormClosing /// [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.FormBorderColorChangedDescr))] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public event EventHandler? FormBorderColorChanged { add => Events.AddHandler(s_formBorderColorChanged, value); @@ -2713,7 +2713,7 @@ public event EventHandler? FormBorderColorChanged /// [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.FormCaptionBackColorChangedDescr))] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public event EventHandler? FormCaptionBackColorChanged { add => Events.AddHandler(s_formCaptionBackColorChanged, value); @@ -2725,7 +2725,7 @@ public event EventHandler? FormCaptionBackColorChanged /// [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.FormCaptionTextColorChangedDescr))] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public event EventHandler? FormCaptionTextColorChanged { add => Events.AddHandler(s_formCaptionTextColorChanged, value); @@ -2737,7 +2737,7 @@ public event EventHandler? FormCaptionTextColorChanged /// [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.FormCornerPreferenceChangedDescr))] - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public event EventHandler? FormCornerPreferenceChanged { add => Events.AddHandler(s_formCornerPreferenceChanged, value); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs index 0a6cf2eb140..7b978054b6b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/FormCornerPreference.cs @@ -10,7 +10,7 @@ namespace System.Windows.Forms; /// Specifies the corner preference for a which can be /// set using the property. /// -[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] +[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public enum FormCornerPreference { /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs index d69eda5cfc3..4f1bd3d3eff 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs @@ -5,7 +5,7 @@ namespace System.Windows.Forms; -[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] +[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)] public enum SystemColorMode { /// diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs index 7526e733bf7..3d117493a78 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs @@ -122,7 +122,6 @@ public void StatusStrip_Ctor_Default() Assert.NotNull(control.Renderer); Assert.Same(control.Renderer, control.Renderer); - // TODO: Assume control.Renderer can be either ToolStripSystemRenderer or ToolStripProfessionalRenderer for the Moment. Assert.True(control.Renderer is ToolStripSystemRenderer or ToolStripProfessionalRenderer, "Renderer is not one of the expected types."); Assert.True(control.RenderMode is ToolStripRenderMode.System or ToolStripRenderMode.ManagerRenderMode); From 382ad3e43a8e9c81fbb738940a33cdc0f6442a59 Mon Sep 17 00:00:00 2001 From: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:03:21 +0800 Subject: [PATCH 339/342] Add a manual test case for clones ListViewItem to WinformsControlsApp (#11785) * Add a manual test case for clones ListViewItem to WinformsControlsApp * Settle comments --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) --- .../WinformsControlsTest/CloneTestListView.cs | 20 ++++++++++++++ .../ListViewTest.Designer.cs | 17 ++++++++++++ .../WinformsControlsTest/ListViewTest.cs | 27 ++++++++++++++++--- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/CloneTestListView.cs diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/CloneTestListView.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/CloneTestListView.cs new file mode 100644 index 00000000000..843a589ffc6 --- /dev/null +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/CloneTestListView.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace WinFormsControlsTest; + +internal class CloneTestListView : ListView +{ + public void InvokeOnItemChecked(ItemCheckedEventArgs e) + { + if (!CheckBoxes) + { + return; + } + + if (e.Item.ListView == this) + { + base.OnItemChecked(e); + } + } +} diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.Designer.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.Designer.cs index 8ae13514c9e..25d8e1591e8 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.Designer.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.Designer.cs @@ -35,6 +35,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new(typeof(ListViewTest)); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.listView1 = new System.Windows.Forms.ListView(); + this.listView3 = new CloneTestListView(); this.columnHeader1 = (System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()); this.columnHeader2 = (System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()); this.imageList2 = new System.Windows.Forms.ImageList(this.components); @@ -81,6 +82,20 @@ private void InitializeComponent() this.listView1.SmallImageList = this.imageList1; this.listView1.TabIndex = 0; this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.Dock = DockStyle.Fill; + // + // listView3 + // + this.listView3.CheckBoxes = true; + this.listView3.HideSelection = false; + this.listView3.Name = "listView1"; + this.listView3.TabIndex = 1; + this.listView3.UseCompatibleStateImageBehavior = false; + this.listView3.VirtualListSize = 3; + this.listView3.VirtualMode = true; + this.listView1.Size = new System.Drawing.Size(439, 40); + this.listView3.Dock = DockStyle.Bottom; + this.listView3.Click += new System.EventHandler(this.listView3_Click); // // imageList2 // @@ -139,6 +154,7 @@ private void InitializeComponent() this.Controls.Add(this.btnLoadImagesListView1); this.Controls.Add(this.btnClearListView1); this.Controls.Add(this.listView1); + this.Controls.Add(this.listView3); this.Name = "ListViewTest"; this.Text = "ListView Test"; this.ResumeLayout(false); @@ -147,6 +163,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.ListView listView1; + private CloneTestListView listView3; private System.Windows.Forms.ImageList imageList1; private System.Windows.Forms.ImageList imageList2; private System.Windows.Forms.ImageList LargeImageList; diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.cs index dcc0c215e2a..df3b58d1eb1 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ListViewTest.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; - namespace WinFormsControlsTest; [DesignerCategory("Default")] @@ -35,6 +34,19 @@ public ListViewTest() AddCollapsibleGroupToListView(); AddGroupTasks(); + + // Manual test for https://github.com/dotnet/winforms/issues/11658 + string[] TestItems = { "Item 1", "Item 2", "Item 3" }; + listView3.RetrieveVirtualItem += (s, e) => + { + e.Item = e.ItemIndex switch + { + 0 => new ListViewItem(TestItems[0]), + 1 => new ListViewItem(TestItems[1]), + 2 => new ListViewItem(TestItems[2]), + _ => throw new ArgumentOutOfRangeException(), + }; + }; } private void CreateMyListView() @@ -190,16 +202,23 @@ private void listView1_GroupTaskLinkClick(object sender, ListViewGroupEventArgs MessageBox.Show(this, $"Task at group index {e.GroupIndex} was clicked", "GroupClick Event"); } - private void listView2_Click(object sender, System.EventArgs e) + private void listView2_Click(object sender, EventArgs e) { Debug.WriteLine(listView1.TileSize); MessageBox.Show(this, "listView2_Click", "event"); } - private void listView2_SelectedIndexChanged(object sender, System.EventArgs e) + private void listView3_Click(object sender, EventArgs e) { - // MessageBox.Show(this, "listView2_SelectedIndexChanged", "event"); + var item = ((ListView)sender).FocusedItem; + var clone = (ListViewItem)item.Clone(); + clone.Checked = true; + listView3.InvokeOnItemChecked(new ItemCheckedEventArgs(clone)); + MessageBox.Show(this, $"Click {clone.Text} in ListView3", "Click Event"); + } + private void listView2_SelectedIndexChanged(object sender, EventArgs e) + { if (sender is not ListView listView2) { return; From 7f2c670854c8da60c41bee3020453e89265514d0 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Aug 2024 19:06:37 -0700 Subject: [PATCH 340/342] Fix Merge conflicts --- .../ApplyApplicationDefaultsEventArgs.vb | 3 +- .../WindowsFormsApplicationBase.vb | 489 ++++++++++-------- .../src/Microsoft/VisualBasic/Interaction.vb | 103 ++-- 3 files changed, 305 insertions(+), 290 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 7a93c9fd036..09cef0076f6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -32,10 +32,11 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. + ''' ''' - ''' When the ApplyApplicationDefault event is raised, this property contains ''' When the ApplyApplicationDefault event is raised, this property contains nothing. A new default Font for the ''' application is applied by setting this property with a value different than nothing. + ''' Public Property Font As Font ''' diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 361aa5bf663..0a2906aa1f0 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -91,59 +91,59 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' How long a subsequent instance will wait for the original instance to get on its feet. Private Const SecondInstanceTimeOut As Integer = 2500 ' milliseconds. - Friend Const MINIMUM_SPLASH_EXPOSURE_DEFAULT As Integer = 2000 ' milliseconds. - Friend Const WinFormsExperimentalUrl As String = "https://aka.ms/winforms-experimental/{0}" + Friend Const MinimumSplashExposureDefault As Integer = 2000 ' milliseconds. + Friend Const WinFormsExperimentalUrl As String = "https://aka.ms/winforms-experimental/{0}" - ''' Private ReadOnly _splashLock As New Object Private ReadOnly _appContext As WinFormsAppContext - ''' + ' Sync object Private ReadOnly _networkAvailabilityChangeLock As New Object - ''' + Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) Private _processingUnhandledExceptionEvent As Boolean - ''' + ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. Private _turnOnNetworkListener As Boolean - ''' + ' Whether we have made it through the processing of OnInitialize. Private _finishedOnInitialize As Boolean - ''' + Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) Private _networkObject As Devices.Network - ' milliseconds. + ' Whether this app runs using Word like instancing behavior. Private _isSingleInstance As Boolean - ''' + ' Defines when the application decides to close. Private _shutdownStyle As ShutdownMode - ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException + ' Whether to use Windows XP styles. Private _enableVisualStyles As Boolean - _unhandledExceptionHandlers.Add(value) + ' We only need to show the splash screen once. ' Protect the user from himself if they are overriding our app model. Private _didSplashScreen As Boolean - ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception + ' For splash screens with a minimum display time, this let's us know when that time ' has expired and it is OK to close the splash screen. Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - RemoveHandler(value As UnhandledExceptionEventHandler) + Private _formLoadWaiter As AutoResetEvent Private _splashScreen As Form + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. Private _minimumSplashExposure As Integer = MinimumSplashExposureDefault - Private _splashTimer As Timers.Timer - Private _appSynchronizationContext As SynchronizationContext + Private _splashTimer As Timers.Timer + Private _appSynchronizationContext As SynchronizationContext - RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) - If _unhandledExceptionHandlers IsNot Nothing Then - - ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyHighDpiMode's Event. ' Informs My.Settings whether to save the settings on exit or not. Private _saveMySettingsOnExit As Boolean - For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers + + ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyApplicationsDefault event. + Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware +#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. + ' The ColorMode (Classic/Light, System, Dark) the user assigned to the ApplyApplicationsDefault event. ' Note: We aim to expose this to the App Designer in later runtime/VS versions. Private _colorMode As SystemColorMode = SystemColorMode.Classic #Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. @@ -151,13 +151,13 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Occurs when the network availability changes. ''' - - ' Now that we are out of the handler, treat exceptions normally again. - ' if the user writes a handler for it. - ' The reason being that it is very expensive to handle and kills our application startup performance. - AddHandler(value As Devices.NetworkAvailableEventHandler) - SyncLock _networkAvailabilityChangeLock - If _networkAvailabilityEventHandlers Is Nothing Then + Public Custom Event NetworkAvailabilityChanged As Devices.NetworkAvailableEventHandler + ' This is a custom event because we want to hook up the NetworkAvailabilityChanged event only + ' if the user writes a handler for it. + ' The reason being that it is very expensive to handle and kills our application startup performance. + AddHandler(value As Devices.NetworkAvailableEventHandler) + SyncLock _networkAvailabilityChangeLock + If _networkAvailabilityEventHandlers Is Nothing Then _networkAvailabilityEventHandlers = New List(Of Devices.NetworkAvailableEventHandler) End If @@ -174,21 +174,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices If _networkObject Is Nothing AndAlso _finishedOnInitialize Then _networkObject = New Devices.Network Dim windowsFormsApplicationBase As WindowsFormsApplicationBase = Me - AddHandler() _networkObject.NetworkAvailabilityChanged, + AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf windowsFormsApplicationBase.NetworkAvailableEventAdaptor End If - End SyncLock - End AddHandler + End SyncLock + End AddHandler - RemoveHandler(value As Devices.NetworkAvailableEventHandler) - If _networkAvailabilityEventHandlers IsNot Nothing AndAlso + RemoveHandler(value As Devices.NetworkAvailableEventHandler) + If _networkAvailabilityEventHandlers IsNot Nothing AndAlso _networkAvailabilityEventHandlers.Count > 0 Then _networkAvailabilityEventHandlers.Remove(value) ' Last one to leave - turn out the lights... If _networkAvailabilityEventHandlers.Count = 0 Then - RemoveHandler() _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor + RemoveHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor If _networkObject IsNot Nothing Then ' Stop listening to network change events because we are going to go away. @@ -197,99 +197,82 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' No sense holding on to this if nobody is listening. _networkObject = Nothing End If - End If - End If - End RemoveHandler - - RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) - If _networkAvailabilityEventHandlers IsNot Nothing Then - For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers - Try - If handler IsNot Nothing Then handler.Invoke(sender, e) + End If + End If + End RemoveHandler + + RaiseEvent(sender As Object, e As Devices.NetworkAvailableEventArgs) + If _networkAvailabilityEventHandlers IsNot Nothing Then + For Each handler As Devices.NetworkAvailableEventHandler In _networkAvailabilityEventHandlers + Try + If handler IsNot Nothing Then handler.Invoke(sender, e) Catch ex As Exception - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then - - ' The user didn't write a handler so throw the error up the chain. - Throw - End If - End Try - Next - End If - End RaiseEvent + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + + ' The user didn't write a handler so throw the error up the chain. + Throw + End If + End Try + Next + End If + End RaiseEvent End Event ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. - ''' - ''' - ''' ''' Occurs when the application encounters an . - ''' + ''' Public Custom Event UnhandledException As UnhandledExceptionEventHandler - Dim version As Version = entry.GetName.Version - ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event - ' if the user is handling this event because the act of listening to Application.ThreadException - ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that - ' the user wrote their own handler to deal with the error instead. - AddHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers Is Nothing Then + + ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException + ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' if the user is handling this event because the act of listening to Application.ThreadException + ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that + ' the user wrote their own handler to deal with the error instead. + AddHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers Is Nothing Then _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) End If - If version IsNot Nothing Then + _unhandledExceptionHandlers.Add(value) - Else - ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception - If _unhandledExceptionHandlers.Count = 1 Then - AddHandler() Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + + ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception + If _unhandledExceptionHandlers.Count = 1 Then + AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor End If - End AddHandler - End If - RemoveHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers IsNot Nothing AndAlso + End AddHandler + + RemoveHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then _unhandledExceptionHandlers.Remove(value) ' Last one to leave, turn out the lights... If _unhandledExceptionHandlers.Count = 0 Then - RemoveHandler() Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor End If - End If - End RemoveHandler - ' run the handler again. - RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) - If _unhandledExceptionHandlers IsNot Nothing Then - For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers + End If + End RemoveHandler + + RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) + If _unhandledExceptionHandlers IsNot Nothing Then + + ' In the case that we throw from the UnhandledException handler, we don't want to + ' run the UnhandledException handler again. + _processingUnhandledExceptionEvent = True + + For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers handler?.Invoke(sender, e) Next ' Now that we are out of the UnhandledException handler, treat exceptions normally again. _processingUnhandledExceptionEvent = False End If - End RaiseEvent + End RaiseEvent End Event ''' ''' Constructs the application Shutdown/Startup model object ''' - ''' - Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) - If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) - End If - End Sub - - ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. - ''' - Private Sub DisplaySplash() - Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - - ''' Constructs the application Shutdown/Startup model object - ''' ''' We have to have a parameterless ctor because the platform specific Application object ''' derives from this one and it doesn't define a ctor because the partial class generated by the @@ -297,17 +280,34 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Sub New() Me.New(AuthenticationMode.Windows) - Try - ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) - ' Will only check THIS caller so you'll always get TRUE. - ''' Constructs the application Shutdown/Startup model object - Catch ex As SecurityException + End Sub + + ''' + ''' Constructs the application Shutdown/Startup model object + ''' Public Sub New(authenticationMode As AuthenticationMode) MyBase.New() ValidateAuthenticationModeEnumValue(authenticationMode, NameOf(authenticationMode)) - End Sub + + ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, + ' before the Network object gets created because the network object will be doing a + ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must + ' have our principal on the thread before that happens. + If authenticationMode = AuthenticationMode.Windows Then + Try + ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) + ' Will only check the THIS caller so you'll always get TRUE. + ' What we need is a way to get to the value of this on a demand basis. + ' So I try/catch instead for now but would rather be able to IF my way around this block. + Thread.CurrentPrincipal = New Principal.WindowsPrincipal(Principal.WindowsIdentity.GetCurrent) + Catch ex As SecurityException + End Try + End If + + _appContext = New WinFormsAppContext(Me) + ' We need to set the WindowsFormsSynchronizationContext because the network object is going to ' get created after this ctor runs (network gets created during event hookup) and we need the ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise @@ -321,26 +321,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Entry point to kick off the VB Startup/Shutdown Application model. ''' ''' The command line from Main(). - ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code - ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) - _appContext = New WinFormsAppContext(Me) - - ' We need to set the WindowsFormsSynchronizationContext because the network object is going to - ' get created after this ctor runs (network gets created during event hookup) and we need the - ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise - ' get created until OnCreateMainForm() when the startup form is created and by then it is too late. - ' When the startup form gets created, WinForms is going to push our context into the previous context - ' and then restore it when Application.Run() exits. - _appSynchronizationContext = AsyncOperationManager.SynchronizationContext - Try - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - ''' Entry point to kick off the VB Startup/Shutdown Application model. - OnShutdown() - ''' The command line from Main(). Public Sub Run(commandLine As String()) - End If + ' Prime the command line args with what we receive from Main() so that Click-Once windows ' apps don't have to do a System.Environment call which would require permissions. InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) @@ -354,7 +337,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' Otherwise, can break single instance. Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) Dim pipeServer As NamedPipeServerStream = Nothing - Throw New CantStartSingleInstanceException() + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then ' --- This is the first instance of a single-instance application to run. @@ -368,15 +351,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices tokenSource.Cancel() End Using Else + + ' --- We are launching a subsequent instance. Dim tokenSource As New CancellationTokenSource() -#Disable Warning BC42358 ' Call is not awaited. - WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) -#Enable Warning BC42358 - DoApplicationModel() - tokenSource.Cancel() - End Using - Else - ''' itself for the first time. + tokenSource.CancelAfter(SecondInstanceTimeOut) + Try + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync( + pipeName:=applicationInstanceID, + args:=commandLine, + cancellationToken:=tokenSource.Token).ConfigureAwait(False) + + awaitable.GetAwaiter().GetResult() + Catch ex As Exception + Throw New CantStartSingleInstanceException() + End Try + End If + End If 'Single-Instance application + End Sub + ''' ''' Returns the collection of forms that are open. We no longer have thread ''' affinity meaning that this is the WinForms collection that contains Forms that may @@ -387,19 +379,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Return Application.OpenForms End Get End Property - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. - ' since this is eating up a LOT of energy and workload, especially on Notebooks and tablets. - Public ReadOnly Property OpenForms() As FormCollection - Get - Return Application.OpenForms - End Get - End Property - If _splashTimer IsNot Nothing Then + ''' ''' Provides access to the main form for this application - + ''' Protected Property MainForm() As Form Get Return _appContext?.MainForm @@ -409,43 +392,43 @@ Namespace Microsoft.VisualBasic.ApplicationServices Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") End If If value Is _splashScreen Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) End If _appContext.MainForm = value End Set End Property - End Sub + ''' ''' Provides access to the splash screen for this application - Dim invoked As Boolean = False + ''' Public Property SplashScreen() As Form Get Return _splashScreen End Get Set(value As Form) - SynchronizationContext. + ' Allow for the case where they set splash screen = nothing and mainForm is currently nothing. If value IsNot Nothing AndAlso value Is _appContext.MainForm Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + End If - _splashScreen = value + _splashScreen = value End Set End Property - ''' - Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) + + ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash ''' screen should be displayed for. When not set then the splash screen is hidden ''' as soon as the main form becomes active. - + ''' ''' The minimum amount of time, in milliseconds, to display the splash screen. - ''' Hide the splash screen. The splash screen was created on another thread + ''' ''' This property, although public, used to be set in an `Overrides Function OnInitialize` _before_ ''' calling `MyBase.OnInitialize`. We want to phase this out, and with the introduction of the ''' ApplyApplicationDefaults events have it handled in that event, rather than as awkwardly ''' as it is currently suggested to be used in the docs. ''' First step for that is to make it hidden in IntelliSense. - ''' This function gets called from the main thread by the app fx. + ''' Public Property MinimumSplashScreenDisplayTime() As Integer Get @@ -455,25 +438,25 @@ Namespace Microsoft.VisualBasic.ApplicationServices _minimumSplashExposure = value End Set End Property - Protected Sub HideSplashScreen() - ''' Use GDI for the text rendering engine by default. + ''' + ''' Use GDI for the text rendering engine by default. ''' The user can shadow this function to return True if they want their app ''' to use the GDI+ render. We read this function in Main() (My template) to ''' determine how to set the text rendering flag on the WinForms application object. - ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) + ''' ''' True - Use GDI+ renderer. False - use GDI renderer. - ' This is to fix the issue where the main form doesn't come to the front after the + Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean Get Return False End Get End Property - ''' A designer will override this method and provide a splash screen if this application has one. - ''' + + ''' ''' Provides the WinForms application context that we are running on - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + Public ReadOnly Property ApplicationContext() As ApplicationContext Get Return _appContext @@ -491,12 +474,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices _saveMySettingsOnExit = value End Set End Property - Protected Overridable Sub OnCreateSplashScreen() - End Sub - ''' Processes all windows messages currently in the message queue + ''' + ''' Processes all windows messages currently in the message queue + ''' Public Sub DoEvents() Application.DoEvents() + End Sub + + ''' + ''' This exposes the first in a series of extensibility points for the Startup process. By default, it shows + ''' the splash screen and does rudimentary processing of the command line to see if /nosplash or its + ''' variants was passed in. + ''' + ''' + ''' Returning True indicates that we should continue on with the application Startup sequence. ''' ''' This extensibility point is exposed for people who want to override ''' the Startup sequence at the earliest possible point to @@ -587,7 +579,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' It is important not to create the network object until the ExecutionContext has everything on it. ' By now the principal will be on the thread so we can create the network object. ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asycnOperationsManager does a CreateOperation() + ' the network changed event to the main thread. The asyncOperationsManager does a CreateOperation() ' which makes a copy of the executionContext. That execution context shows up on your thread during ' the callback so I delay creating the network object (and consequently the capturing of the execution context) ' until the principal has been set on the thread. This avoids the problem where My.User isn't set @@ -607,15 +599,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Function ''' - ''' Extensibility point which raises the StartupNextInstance - ''' - ''' - - - Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) - - RaiseEvent StartupNextInstance(Me, eventArgs) - ''' Extensibility point which raises the StartupNextInstance ''' ''' @@ -636,12 +619,21 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ' Activate the original instance. - If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then - If MainForm.WindowState = FormWindowState.Minimized Then - MainForm.WindowState = FormWindowState.Normal - End If + ''' At this point, the command line args should have been processed and the application will create the + ''' main form and enter the message loop. + ''' + + + Protected Overridable Sub OnRun() + If MainForm Is Nothing Then + + ' A designer overrides OnCreateMainForm() to set the main form we are supposed to use. + OnCreateMainForm() + + If MainForm Is Nothing Then + Throw New NoStartupFormException + End If ' When we have a splash screen that hasn't timed out before the main form is ready to paint, we want to ' block the main form from painting. To do that I let the form get past the Load() event and hold it until @@ -670,38 +662,38 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' The last in a series of extensibility points for the Shutdown process - ''' - - Protected Overridable Sub OnShutdown() - RaiseEvent Shutdown(Me, EventArgs.Empty) - End Sub - - ''' - ''' Extensibility point which raises the Startup event ''' A designer will override this method and provide a splash screen if this application has one. - ''' + ''' ''' ''' For instance, a designer would override this method and emit: Me.Splash = new Splash ''' where Splash was designated in the application designer as being the splash screen for this app ''' Protected Overridable Sub OnCreateSplashScreen() - eventArgs.Cancel = False + End Sub - ' It is important not to create the network object until the ExecutionContext has everything on it. + ''' ''' Provides a hook that designers will override to set the main form. - ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' which makes a copy of the executionContext. That execution context shows up on your thread during + ''' + Protected Overridable Sub OnCreateMainForm() End Sub - RaiseEvent StartupNextInstance(Me, eventArgs) + ''' ''' The last in a series of extensibility points for the Shutdown process - If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then - MainForm.WindowState = FormWindowState.Normal + ''' + Protected Overridable Sub OnShutdown() RaiseEvent Shutdown(Me, EventArgs.Empty) + End Sub + + ''' + ''' Raises the event and exits the application if the event handler indicated + ''' that execution shouldn't continue. + ''' + ''' + ''' True indicates the exception event was raised / False it was not. + Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean ' Does the user have a handler for this event? @@ -912,18 +904,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' we know that the form load event is done and that the form is about to paint ''' itself for the first time. ''' We can now hide the splash screen. - - _splashScreenCompletionSource.SetResult(True) ''' Note that this function gets called from the main thread - the same thread ''' that creates the startup form. ''' - ''' The Load() event happens before the Shown and Paint events. When we get called here - ''' we know that the form load event is done and that the form is about to paint - ''' itself for the first time. - ''' We can now hide the splash screen. - ''' Note that this function gets called from the main thread - the same thread - ''' that creates the startup form. - ''' ''' ''' Private Sub MainFormLoadingDone(sender As Object, e As EventArgs) @@ -948,12 +931,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If HideSplashScreen() - ' Prime the command line args with what we receive from Main() so that Click-Once windows - ' apps don't have to do a System.Environment call which would require permissions. - InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event. - If Not IsSingleInstance Then + End Sub + + ''' + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event. + ''' ''' ''' ''' Our UnHandledException event has a different signature then the Windows.Forms.Application @@ -975,7 +958,7 @@ Namespace Microsoft.VisualBasic.ApplicationServices New ReadOnlyCollection(Of String)(args), bringToForegroundFlag:=True)) End Sub) - Dim pipeServer As NamedPipeServerStream = Nothing + ' If we have a Main form, we need to make sure that we are on _its_ UI thread ' before we call OnStartupNextInstance. If MainForm IsNot Nothing Then @@ -1004,22 +987,90 @@ Namespace Microsoft.VisualBasic.ApplicationServices Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) RaiseEvent NetworkAvailabilityChanged(sender, e) End Sub - ' This is the instance that subsequent instances will attach to. + ''' ''' Runs the user's program through the VB Startup/Shutdown application model ''' Private Sub DoApplicationModel() -#Enable Warning BC42358 + Dim eventArgs As New StartupEventArgs(CommandLineArgs) - tokenSource.Cancel() + ' Only do the try/catch if we aren't running under the debugger. ' If we do try/catch under the debugger the debugger never gets ' a crack at exceptions which breaks the exception helper. If Not Debugger.IsAttached Then + + ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code + ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) + ' need to be mirrored in the ELSE debugger attached clause below. + Try + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If + Catch ex As Exception + + ' This catch is for exceptions that happen during the On* methods above, + ' but have occurred outside of the message pump (which exceptions we would + ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). + If _processingUnhandledExceptionEvent Then + + ' If the UnhandledException handler threw for some reason, throw that error out to the system. + Throw + Else + + ' We had an exception, but not during the OnUnhandledException handler so give the user + ' a chance to look at what happened in the UnhandledException event handler + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + + ' The user didn't write a handler so throw the error out to the system + Throw + End If + End If End Try + Else + ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception + ' will bubble out to the exception helper. + ' We also don't hook up the Application.ThreadException event because WinForms ignores it + ' when we are running under the debugger. + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If End If - End If 'Single-Instance application End Sub + ''' + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. + ''' + ''' + ''' + ''' A string unique to the application that should be the same for versions of + ''' the application that have the same Major and Minor Version Number. + ''' + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String + + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() + + If guidAttrib IsNot Nothing Then + + Dim version As Version = entry.GetName.Version + + If version IsNot Nothing Then + Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" + Else + Return guidAttrib.Value + End If + End If + + Return entry.ManifestModule.ModuleVersionId.ToString() + End Function + End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index 861aa756403..fa0a5276bb6 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -9,7 +9,6 @@ Imports System.Windows.Forms Imports Microsoft.VisualBasic.CompilerServices Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils -Imports VbUtils = Microsoft.VisualBasic.CompilerServices.Utils Imports NativeMethods = Microsoft.VisualBasic.CompilerServices.NativeMethods Namespace Microsoft.VisualBasic @@ -27,11 +26,11 @@ Namespace Microsoft.VisualBasic Dim errorCode As Integer = 0 If (PathName Is Nothing) Then - Throw New ArgumentNullException(VbUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) + Throw New ArgumentNullException(ExUtils.GetResourceString(SR.Argument_InvalidNullValue1, "Pathname")) End If If (Style < 0 OrElse Style > 9) Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValue1, "Style")) End If NativeMethods.GetStartupInfo(startupInfo) @@ -214,7 +213,7 @@ Namespace Microsoft.VisualBasic ' if scan failed, return an error If IntPtr.op_Equality(hwndOwned, IntPtr.Zero) Then - Throw New ArgumentException(VbUtils.GetResourceString(SR.ProcessNotFound, processId)) + Throw New ArgumentException(ExUtils.GetResourceString(SR.ProcessNotFound, processId)) End If ' set active window to the owned one @@ -311,42 +310,6 @@ Namespace Microsoft.VisualBasic box.Dispose() End Function - Private Function GetTitleFromAssembly(callingAssembly As Reflection.Assembly) As String - - Dim title As String - - 'Get the Assembly name of the calling assembly - 'Assembly.GetName requires PathDiscovery permission so we try this first - 'and if it throws we catch the security exception and parse the name - 'from the full assembly name - Try - title = callingAssembly.GetName().Name - Catch ex As SecurityException - Dim fullName As String = callingAssembly.FullName - - 'Find the text up to the first comma. Note, this fails if the assembly has - 'a comma in its name - Dim firstCommaLocation As Integer = fullName.IndexOf(","c) - If firstCommaLocation >= 0 Then - title = fullName.Substring(0, firstCommaLocation) - Else - 'The name is not in the format we're expecting so return an empty string - title = String.Empty - End If - End Try - - Return title - - End Function - - Private Function InternalInputBox(prompt As String, title As String, defaultResponse As String, xPos As Integer, yPos As Integer, parentWindow As IWin32Window) As String - Dim box As VBInputBox = New VBInputBox(prompt, title, defaultResponse, xPos, yPos) - box.ShowDialog(parentWindow) - - Throw New ArgumentException(VbUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) - box.Dispose() - End Function - Public Function MsgBox(Prompt As Object, Buttons As MsgBoxStyle, Title As Object) As MsgBoxResult Dim sPrompt As String = Nothing Dim sTitle As String @@ -374,40 +337,40 @@ Namespace Microsoft.VisualBasic End If Catch ex As StackOverflowException Throw - If (ok <> 0) Then - If Wait Then - ' Is infinite wait okay here ? - ' This is okay since this is marked as requiring the HostPermission with ExternalProcessMgmt rights - ok = NativeMethods.WaitForSingleObject(safeProcessHandle, Timeout) - - If ok = 0 Then 'succeeded - 'Process ran to completion - Shell = 0 - Else - 'Wait timed out - Shell = processInfo.dwProcessId - End If + Catch ex As OutOfMemoryException + Throw + Catch ex As ThreadAbortException + Throw + Catch + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Prompt", "String")) + End Try + + Try + If Title Is Nothing Then + If vbHost Is Nothing Then + sTitle = GetTitleFromAssembly(Reflection.Assembly.GetCallingAssembly()) Else - NativeMethods.WaitForInputIdle(safeProcessHandle, 10000) - Shell = processInfo.dwProcessId + sTitle = vbHost.GetWindowTitle() End If Else - 'Check for a win32 error access denied. If it is, make and throw the exception. - 'If not, throw FileNotFound - Const ERROR_ACCESS_DENIED As Integer = 5 - If errorCode = ERROR_ACCESS_DENIED Then - Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) - End If - - Throw ExUtils.VbMakeException(vbErrors.FileNotFound) - End If - Finally - safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. - safeThreadHandle.Close() - End Try - Finally - startupInfo.Dispose() + sTitle = CStr(Title) 'allows the title to be an expression, e.g. MsgBox(prompt, Title:=1+5) + End If + Catch ex As StackOverflowException + Throw + Catch ex As OutOfMemoryException + Throw + Catch ex As ThreadAbortException + Throw + Catch + Throw New ArgumentException(ExUtils.GetResourceString(SR.Argument_InvalidValueType2, "Title", "String")) End Try + + Return CType(MessageBox.Show(parentWindow, sPrompt, sTitle, + CType(Buttons And &HF, MessageBoxButtons), + CType(Buttons And &HF0, MessageBoxIcon), + CType(Buttons And &HF00, MessageBoxDefaultButton), + CType(Buttons And &HFFFFF000, MessageBoxOptions)), + MsgBoxResult) End Function End Module From d71798eee514b81905793645f55bcdbf5b223398 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Sun, 11 Aug 2024 19:35:09 -0700 Subject: [PATCH 341/342] Redo cleanp after Merge --- .../ApplyApplicationDefaultsEventArgs.vb | 18 +- .../WindowsFormsApplicationBase.vb | 1358 +++++++++-------- .../CompilerServices/ExceptionUtils.vb | 105 +- .../src/Microsoft/VisualBasic/Interaction.vb | 4 +- .../Windows/Forms/ExceptionUtilsTests.vb | 10 +- 5 files changed, 755 insertions(+), 740 deletions(-) diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb index 09cef0076f6..6cc13a79c70 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplyApplicationDefaultsEventArgs.vb @@ -30,6 +30,12 @@ Namespace Microsoft.VisualBasic.ApplicationServices #Enable Warning WFO5001 + ''' + ''' Setting this property inside the event handler determines the for the application. + ''' + + Public Property ColorMode As SystemColorMode + ''' ''' Setting this property inside the event handler causes a new default Font for Forms and UserControls to be set. ''' @@ -39,12 +45,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' Public Property Font As Font - ''' - ''' Setting this Property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. - ''' - Public Property MinimumSplashScreenDisplayTime As Integer = - WindowsFormsApplicationBase.MinimumSplashExposureDefault - ''' ''' Setting this Property inside the event handler determines the general HighDpiMode for the application. ''' @@ -54,10 +54,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Property HighDpiMode As HighDpiMode ''' - ''' Setting this property inside the event handler determines the for the application. + ''' Setting this property inside the event handler determines how long an application's Splash dialog is displayed at a minimum. ''' - - Public Property ColorMode As SystemColorMode + Public Property MinimumSplashScreenDisplayTime As Integer = + WindowsFormsApplicationBase.MinimumSplashExposureDefault End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 0a2906aa1f0..25f44cbef08 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -17,18 +17,6 @@ Imports ExUtils = Microsoft.VisualBasic.CompilerServices.ExceptionUtils Namespace Microsoft.VisualBasic.ApplicationServices - ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). - Public Enum AuthenticationMode - Windows - ApplicationDefined - End Enum - - ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). - Public Enum ShutdownMode - AfterMainFormCloses - AfterAllFormsClose - End Enum - ''' ''' Signature for the ApplyApplicationDefaults event handler. ''' @@ -36,22 +24,22 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub ApplyApplicationDefaultsEventHandler(sender As Object, e As ApplyApplicationDefaultsEventArgs) ''' - ''' Signature for the Startup event handler. + ''' Signature for the Shutdown event handler. ''' - Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) + Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) ''' - ''' Signature for the StartupNextInstance event handler. + ''' Signature for the Startup event handler. ''' - Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) + Public Delegate Sub StartupEventHandler(sender As Object, e As StartupEventArgs) ''' - ''' Signature for the Shutdown event handler. + ''' Signature for the StartupNextInstance event handler. ''' - Public Delegate Sub ShutdownEventHandler(sender As Object, e As EventArgs) + Public Delegate Sub StartupNextInstanceEventHandler(sender As Object, e As StartupNextInstanceEventArgs) ''' ''' Signature for the UnhandledException event handler. @@ -59,94 +47,214 @@ Namespace Microsoft.VisualBasic.ApplicationServices Public Delegate Sub UnhandledExceptionEventHandler(sender As Object, e As UnhandledExceptionEventArgs) + ' Any changes to this enum must be reflected in ValidateAuthenticationModeEnumValue(). + Public Enum AuthenticationMode + Windows + ApplicationDefined + End Enum + + ' Any changes to this enum must be reflected in ValidateShutdownModeEnumValue(). + Public Enum ShutdownMode + AfterMainFormCloses + AfterAllFormsClose + End Enum + ''' ''' Provides the infrastructure for the VB Windows Forms application model. ''' ''' Don't put access on this definition. Partial Public Class WindowsFormsApplicationBase : Inherits ConsoleApplicationBase - ''' - ''' Occurs when the application is ready to accept default values for various application areas. - ''' - Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler + ' How long a subsequent instance will wait for the original instance to get on its feet in milliseconds. + Private Const SecondInstanceTimeOut As Integer = 2500 - ''' - ''' Occurs when the application starts. - ''' - Public Event Startup As StartupEventHandler + Private ReadOnly _appContext As WinFormsAppContext - ''' - ''' Occurs when attempting to start a single-instance application and the application is already active. - ''' - Public Event StartupNextInstance As StartupNextInstanceEventHandler + ' Sync object + Private ReadOnly _networkAvailabilityChangeLock As New Object - ''' - ''' Occurs when the application shuts down. - ''' - Public Event Shutdown As ShutdownEventHandler + Private ReadOnly _splashLock As New Object - ' Used to marshal a call to Dispose on the Splash Screen. - Private Delegate Sub DisposeDelegate() + Private _appSynchronizationContext As SynchronizationContext + +#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. + ' The ColorMode (Classic/Light, System, Dark) the user assigned to the ApplyApplicationsDefault event. + ' Note: We aim to expose this to the App Designer in later runtime/VS versions. + Private _colorMode As SystemColorMode = SystemColorMode.Classic +#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. - ' How long a subsequent instance will wait for the original instance to get on its feet. - Private Const SecondInstanceTimeOut As Integer = 2500 ' milliseconds. + ' We only need to show the splash screen once. + ' Protect the user from himself if they are overriding our app model. + Private _didSplashScreen As Boolean - Friend Const MinimumSplashExposureDefault As Integer = 2000 ' milliseconds. - Friend Const WinFormsExperimentalUrl As String = "https://aka.ms/winforms-experimental/{0}" + ' Whether to use Windows XP styles. + Private _enableVisualStyles As Boolean - Private ReadOnly _splashLock As New Object - Private ReadOnly _appContext As WinFormsAppContext + ' Whether we have made it through the processing of OnInitialize. + Private _finishedOnInitialize As Boolean - ' Sync object - Private ReadOnly _networkAvailabilityChangeLock As New Object + Private _formLoadWaiter As AutoResetEvent - Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) - Private _processingUnhandledExceptionEvent As Boolean + ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyApplicationsDefault event. + Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware - ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. - Private _turnOnNetworkListener As Boolean + ' Whether this app runs using Word like instancing behavior. + Private _isSingleInstance As Boolean - ' Whether we have made it through the processing of OnInitialize. - Private _finishedOnInitialize As Boolean + ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. + Private _minimumSplashExposure As Integer = MinimumSplashExposureDefault Private _networkAvailabilityEventHandlers As List(Of Devices.NetworkAvailableEventHandler) + Private _networkObject As Devices.Network - ' Whether this app runs using Word like instancing behavior. - Private _isSingleInstance As Boolean + Private _processingUnhandledExceptionEvent As Boolean + + ' Informs My.Settings whether to save the settings on exit or not. + Private _saveMySettingsOnExit As Boolean ' Defines when the application decides to close. Private _shutdownStyle As ShutdownMode - ' Whether to use Windows XP styles. - Private _enableVisualStyles As Boolean - - ' We only need to show the splash screen once. - ' Protect the user from himself if they are overriding our app model. - Private _didSplashScreen As Boolean + Private _splashScreen As Form ' For splash screens with a minimum display time, this let's us know when that time ' has expired and it is OK to close the splash screen. Private _splashScreenCompletionSource As TaskCompletionSource(Of Boolean) - Private _formLoadWaiter As AutoResetEvent - Private _splashScreen As Form - - ' Minimum amount of time to show the splash screen. 0 means hide as soon as the app comes up. - Private _minimumSplashExposure As Integer = MinimumSplashExposureDefault Private _splashTimer As Timers.Timer - Private _appSynchronizationContext As SynchronizationContext - ' Informs My.Settings whether to save the settings on exit or not. - Private _saveMySettingsOnExit As Boolean + ' Tracks whether we need to create the network object so we can listen to the NetworkAvailabilityChanged event. + Private _turnOnNetworkListener As Boolean - ' The HighDpiMode the user picked from the AppDesigner or assigned to the ApplyApplicationsDefault event. - Private _highDpiMode As HighDpiMode = HighDpiMode.SystemAware -#Disable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. - ' The ColorMode (Classic/Light, System, Dark) the user assigned to the ApplyApplicationsDefault event. - ' Note: We aim to expose this to the App Designer in later runtime/VS versions. - Private _colorMode As SystemColorMode = SystemColorMode.Classic -#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. + Private _unhandledExceptionHandlers As List(Of UnhandledExceptionEventHandler) + + ' Milliseconds. + Friend Const MinimumSplashExposureDefault As Integer = 2000 + + Friend Const WinFormsExperimentalUrl As String = "https://aka.ms/winforms-experimental/{0}" + + ''' + ''' Constructs the application Shutdown/Startup model object + ''' + ''' + ''' We have to have a parameterless ctor because the platform specific Application object + ''' derives from this one and it doesn't define a ctor because the partial class generated by the + ''' designer does that to configure the application. + ''' + Public Sub New() + Me.New(AuthenticationMode.Windows) + End Sub + + ''' + ''' Constructs the application Shutdown/Startup model object + ''' + + Public Sub New(authenticationMode As AuthenticationMode) + MyBase.New() + + ValidateAuthenticationModeEnumValue(authenticationMode, NameOf(authenticationMode)) + + ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, + ' before the Network object gets created because the network object will be doing a + ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must + ' have our principal on the thread before that happens. + If authenticationMode = AuthenticationMode.Windows Then + Try + ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) + ' Will only check the THIS caller so you'll always get TRUE. + ' What we need is a way to get to the value of this on a demand basis. + ' So I try/catch instead for now but would rather be able to IF my way around this block. + Thread.CurrentPrincipal = New Principal.WindowsPrincipal(Principal.WindowsIdentity.GetCurrent) + Catch ex As SecurityException + End Try + End If + + _appContext = New WinFormsAppContext(Me) + + ' We need to set the WindowsFormsSynchronizationContext because the network object is going to + ' get created after this ctor runs (network gets created during event hookup) and we need the + ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise + ' get created until OnCreateMainForm() when the startup form is created and by then it is too late. + ' When the startup form gets created, WinForms is going to push our context into the previous context + ' and then restore it when Application.Run() exits. + _appSynchronizationContext = AsyncOperationManager.SynchronizationContext + End Sub + + ' Used to marshal a call to Dispose on the Splash Screen. + Private Delegate Sub DisposeDelegate() + + ''' + ''' Occurs when the application is ready to accept default values for various application areas. + ''' + Public Event ApplyApplicationDefaults As ApplyApplicationDefaultsEventHandler + + ''' + ''' Occurs when the application shuts down. + ''' + Public Event Shutdown As ShutdownEventHandler + + ''' + ''' Occurs when the application starts. + ''' + Public Event Startup As StartupEventHandler + + ''' + ''' Occurs when attempting to start a single-instance application and the application is already active. + ''' + Public Event StartupNextInstance As StartupNextInstanceEventHandler + + ''' + ''' Occurs when the application encounters an . + ''' + Public Custom Event UnhandledException As UnhandledExceptionEventHandler + + ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException + ' only if the user writes a handler for this event. We only want to hook the ThreadException event + ' if the user is handling this event because the act of listening to Application.ThreadException + ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that + ' the user wrote their own handler to deal with the error instead. + AddHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers Is Nothing Then + _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) + End If + + _unhandledExceptionHandlers.Add(value) + + ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception + If _unhandledExceptionHandlers.Count = 1 Then + AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End AddHandler + + RemoveHandler(value As UnhandledExceptionEventHandler) + If _unhandledExceptionHandlers IsNot Nothing AndAlso + _unhandledExceptionHandlers.Count > 0 Then + _unhandledExceptionHandlers.Remove(value) + + ' Last one to leave, turn out the lights... + If _unhandledExceptionHandlers.Count = 0 Then + RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor + End If + End If + End RemoveHandler + + RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) + If _unhandledExceptionHandlers IsNot Nothing Then + + ' In the case that we throw from the UnhandledException handler, we don't want to + ' run the UnhandledException handler again. + _processingUnhandledExceptionEvent = True + + For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers + handler?.Invoke(sender, e) + Next + + ' Now that we are out of the UnhandledException handler, treat exceptions normally again. + _processingUnhandledExceptionEvent = False + End If + End RaiseEvent + End Event ''' ''' Occurs when the network availability changes. @@ -219,182 +327,103 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Event ''' - ''' Occurs when the application encounters an . + ''' Use GDI for the text rendering engine by default. + ''' The user can shadow this function to return True if they want their app + ''' to use the GDI+ render. We read this function in Main() (My template) to + ''' determine how to set the text rendering flag on the WinForms application object. ''' - Public Custom Event UnhandledException As UnhandledExceptionEventHandler - - ' This is a custom event because we want to hook up System.Windows.Forms.Application.ThreadException - ' only if the user writes a handler for this event. We only want to hook the ThreadException event - ' if the user is handling this event because the act of listening to Application.ThreadException - ' causes WinForms to snuff exceptions and we only want WinForms to do that if we are assured that - ' the user wrote their own handler to deal with the error instead. - AddHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers Is Nothing Then - _unhandledExceptionHandlers = New List(Of UnhandledExceptionEventHandler) - End If - - _unhandledExceptionHandlers.Add(value) - - ' Only add the listener once so we don't fire the UnHandledException event over and over for the same exception - If _unhandledExceptionHandlers.Count = 1 Then - AddHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End AddHandler - - RemoveHandler(value As UnhandledExceptionEventHandler) - If _unhandledExceptionHandlers IsNot Nothing AndAlso - _unhandledExceptionHandlers.Count > 0 Then - _unhandledExceptionHandlers.Remove(value) - - ' Last one to leave, turn out the lights... - If _unhandledExceptionHandlers.Count = 0 Then - RemoveHandler Application.ThreadException, AddressOf OnUnhandledExceptionEventAdaptor - End If - End If - End RemoveHandler - - RaiseEvent(sender As Object, e As UnhandledExceptionEventArgs) - If _unhandledExceptionHandlers IsNot Nothing Then - - ' In the case that we throw from the UnhandledException handler, we don't want to - ' run the UnhandledException handler again. - _processingUnhandledExceptionEvent = True - - For Each handler As UnhandledExceptionEventHandler In _unhandledExceptionHandlers - handler?.Invoke(sender, e) - Next - - ' Now that we are out of the UnhandledException handler, treat exceptions normally again. - _processingUnhandledExceptionEvent = False - End If - End RaiseEvent - End Event + ''' True - Use GDI+ renderer. False - use GDI renderer. + + Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Get + Return False + End Get + End Property ''' - ''' Constructs the application Shutdown/Startup model object + ''' Gets or sets the ColorMode for the Application. ''' - ''' - ''' We have to have a parameterless ctor because the platform specific Application object - ''' derives from this one and it doesn't define a ctor because the partial class generated by the - ''' designer does that to configure the application. - ''' - Public Sub New() - Me.New(AuthenticationMode.Windows) - End Sub + ''' + ''' The that the application is running in. + ''' + + + Protected Property ColorMode As SystemColorMode + Get + Return _colorMode + End Get + Set(value As SystemColorMode) + _colorMode = value + End Set + End Property ''' - ''' Constructs the application Shutdown/Startup model object + ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. ''' - - Public Sub New(authenticationMode As AuthenticationMode) - MyBase.New() - - ValidateAuthenticationModeEnumValue(authenticationMode, NameOf(authenticationMode)) - - ' Setup Windows Authentication if that's what the user wanted. Note, we want to do this now, - ' before the Network object gets created because the network object will be doing a - ' AsyncOperationsManager.CreateOperation() which captures the execution context. So we must - ' have our principal on the thread before that happens. - If authenticationMode = AuthenticationMode.Windows Then - Try - ' Consider: Sadly, a call to: System.Security.SecurityManager.IsGranted(New SecurityPermission(SecurityPermissionFlag.ControlPrincipal)) - ' Will only check the THIS caller so you'll always get TRUE. - ' What we need is a way to get to the value of this on a demand basis. - ' So I try/catch instead for now but would rather be able to IF my way around this block. - Thread.CurrentPrincipal = New Principal.WindowsPrincipal(Principal.WindowsIdentity.GetCurrent) - Catch ex As SecurityException - End Try - End If - - _appContext = New WinFormsAppContext(Me) - - ' We need to set the WindowsFormsSynchronizationContext because the network object is going to - ' get created after this ctor runs (network gets created during event hookup) and we need the - ' context in place for it to latch on to. The WindowsFormsSynchronizationContext won't otherwise - ' get created until OnCreateMainForm() when the startup form is created and by then it is too late. - ' When the startup form gets created, WinForms is going to push our context into the previous context - ' and then restore it when Application.Run() exits. - _appSynchronizationContext = AsyncOperationManager.SynchronizationContext - End Sub + Protected Property EnableVisualStyles() As Boolean + Get + Return _enableVisualStyles + End Get + Set(value As Boolean) + _enableVisualStyles = value + End Set + End Property ''' - ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' Gets or sets the HighDpiMode for the Application. ''' - ''' The command line from Main(). - - Public Sub Run(commandLine As String()) - - ' Prime the command line args with what we receive from Main() so that Click-Once windows - ' apps don't have to do a System.Environment call which would require permissions. - InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) - - If Not IsSingleInstance Then - DoApplicationModel() - Else - ' This is a Single-Instance application - - ' Note: Must pass the calling assembly from here so we can get the running app. - ' Otherwise, can break single instance. - Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) - Dim pipeServer As NamedPipeServerStream = Nothing - - If TryCreatePipeServer(applicationInstanceID, pipeServer) Then - - ' --- This is the first instance of a single-instance application to run. - ' This is the instance that subsequent instances will attach to. - Using pipeServer - Dim tokenSource As New CancellationTokenSource() -#Disable Warning BC42358 ' Call is not awaited. - WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) -#Enable Warning BC42358 - DoApplicationModel() - tokenSource.Cancel() - End Using - Else + + Protected Property HighDpiMode() As HighDpiMode + Get + Return _highDpiMode + End Get + Set(value As HighDpiMode) + _highDpiMode = value + End Set + End Property - ' --- We are launching a subsequent instance. - Dim tokenSource As New CancellationTokenSource() - tokenSource.CancelAfter(SecondInstanceTimeOut) - Try - Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync( - pipeName:=applicationInstanceID, - args:=commandLine, - cancellationToken:=tokenSource.Token).ConfigureAwait(False) + + Protected Property IsSingleInstance() As Boolean + Get + Return _isSingleInstance + End Get + Set(value As Boolean) + _isSingleInstance = value + End Set + End Property - awaitable.GetAwaiter().GetResult() - Catch ex As Exception - Throw New CantStartSingleInstanceException() - End Try - End If - End If 'Single-Instance application - End Sub + ''' + ''' Determines when this application will terminate (when the main form goes down, all forms) + ''' + Protected Friend Property ShutdownStyle() As ShutdownMode + Get + Return _shutdownStyle + End Get + Set(value As ShutdownMode) + ValidateShutdownModeEnumValue(value, NameOf(value)) + _shutdownStyle = value + End Set + End Property ''' - ''' Returns the collection of forms that are open. We no longer have thread - ''' affinity meaning that this is the WinForms collection that contains Forms that may - ''' have been opened on another thread then the one we are calling in on right now. + ''' Provides the WinForms application context that we are running on ''' - Public ReadOnly Property OpenForms() As FormCollection + + Public ReadOnly Property ApplicationContext() As ApplicationContext Get - Return Application.OpenForms + Return _appContext End Get End Property ''' - ''' Provides access to the main form for this application + ''' Informs My.Settings whether to save the settings on exit or not ''' - Protected Property MainForm() As Form + Public Property SaveMySettingsOnExit() As Boolean Get - Return _appContext?.MainForm + Return _saveMySettingsOnExit End Get - Set(value As Form) - If value Is Nothing Then - Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") - End If - If value Is _splashScreen Then - Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) - End If - _appContext.MainForm = value + Set(value As Boolean) + _saveMySettingsOnExit = value End Set End Property @@ -416,6 +445,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Set End Property + ''' + ''' Provides access to the main form for this application + ''' + Protected Property MainForm() As Form + Get + Return _appContext?.MainForm + End Get + Set(value As Form) + If value Is Nothing Then + Throw ExUtils.GetArgumentNullException("MainForm", SR.General_PropertyNothing, "MainForm") + End If + If value Is _splashScreen Then + Throw New ArgumentException(ExUtils.GetResourceString(SR.AppModel_SplashAndMainFormTheSame)) + End If + _appContext.MainForm = value + End Set + End Property + ''' ''' The splash screen timeout specifies whether there is a minimum time that the splash ''' screen should be displayed for. When not set then the splash screen is hidden @@ -440,46 +487,287 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Property ''' - ''' Use GDI for the text rendering engine by default. - ''' The user can shadow this function to return True if they want their app - ''' to use the GDI+ render. We read this function in Main() (My template) to - ''' determine how to set the text rendering flag on the WinForms application object. + ''' Returns the collection of forms that are open. We no longer have thread + ''' affinity meaning that this is the WinForms collection that contains Forms that may + ''' have been opened on another thread then the one we are calling in on right now. ''' - ''' True - Use GDI+ renderer. False - use GDI renderer. - - Protected Shared ReadOnly Property UseCompatibleTextRendering() As Boolean + Public ReadOnly Property OpenForms() As FormCollection Get - Return False + Return Application.OpenForms End Get End Property ''' - ''' Provides the WinForms application context that we are running on + ''' Generates the name for the remote singleton that we use to channel multiple instances + ''' to the same application model thread. ''' - - Public ReadOnly Property ApplicationContext() As ApplicationContext - Get - Return _appContext - End Get - End Property + ''' + ''' + ''' A string unique to the application that should be the same for versions of + ''' the application that have the same Major and Minor Version Number. + ''' + ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. + Private Shared Function GetApplicationInstanceID(entry As Assembly) As String + + Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() + + If guidAttrib IsNot Nothing Then + + Dim version As Version = entry.GetName.Version + + If version IsNot Nothing Then + Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" + Else + Return guidAttrib.Value + End If + End If + + Return entry.ManifestModule.ModuleVersionId.ToString() + End Function ''' - ''' Informs My.Settings whether to save the settings on exit or not + ''' Validates that the value being passed as an AuthenticationMode enum is a legal value ''' - Public Property SaveMySettingsOnExit() As Boolean - Get - Return _saveMySettingsOnExit - End Get - Set(value As Boolean) - _saveMySettingsOnExit = value - End Set - End Property + ''' + Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) + If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) + End If + End Sub ''' - ''' Processes all windows messages currently in the message queue + ''' Validates that the value being passed as an ShutdownMode enum is a legal value ''' - Public Sub DoEvents() - Application.DoEvents() + ''' + Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) + If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then + Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) + End If + End Sub + + ''' + ''' Displays the splash screen. We get called here from a different thread than what the + ''' main form is starting up on. This allows us to process events for the Splash screen so + ''' it doesn't freeze up while the main form is getting it together. + ''' + Private Sub DisplaySplash() + Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") + + If _splashTimer IsNot Nothing Then + + ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. + ' Enable the timer now that we are about to show the splash screen. + _splashTimer.Enabled = True + End If + + Application.Run(_splashScreen) + End Sub + + ''' + ''' Runs the user's program through the VB Startup/Shutdown application model + ''' + Private Sub DoApplicationModel() + + Dim eventArgs As New StartupEventArgs(CommandLineArgs) + + ' Only do the try/catch if we aren't running under the debugger. + ' If we do try/catch under the debugger the debugger never gets + ' a crack at exceptions which breaks the exception helper. + If Not Debugger.IsAttached Then + + ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code + ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) + ' need to be mirrored in the ELSE debugger attached clause below. + Try + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If + Catch ex As Exception + + ' This catch is for exceptions that happen during the On* methods above, + ' but have occurred outside of the message pump (which exceptions we would + ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). + If _processingUnhandledExceptionEvent Then + + ' If the UnhandledException handler threw for some reason, throw that error out to the system. + Throw + Else + + ' We had an exception, but not during the OnUnhandledException handler so give the user + ' a chance to look at what happened in the UnhandledException event handler + If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + + ' The user didn't write a handler so throw the error out to the system + Throw + End If + End If + End Try + Else + ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception + ' will bubble out to the exception helper. + ' We also don't hook up the Application.ThreadException event because WinForms ignores it + ' when we are running under the debugger. + If OnInitialize(CommandLineArgs) Then + If OnStartup(eventArgs) Then + OnRun() + OnShutdown() + End If + End If + End If + End Sub + + ''' + ''' The Load() event happens before the Shown and Paint events. When we get called here + ''' we know that the form load event is done and that the form is about to paint + ''' itself for the first time. + ''' We can now hide the splash screen. + ''' Note that this function gets called from the main thread - the same thread + ''' that creates the startup form. + ''' + ''' + ''' + Private Sub MainFormLoadingDone(sender As Object, e As EventArgs) + + ' We don't want this event to call us again. + RemoveHandler MainForm.Load, AddressOf MainFormLoadingDone + + ' Now, we don't want to eat up a complete Processor Core just for waiting on the main form, + ' since this is eating up a LOT of energy and workload, especially on Notebooks and tablets. + If _splashScreenCompletionSource IsNot Nothing Then + + _formLoadWaiter = New AutoResetEvent(False) + + Task.Run(Async Function() As Task + Await _splashScreenCompletionSource.Task.ConfigureAwait(False) + _formLoadWaiter.Set() + End Function) + + ' Block until the splash screen time is up. + ' See MinimumSplashExposureTimeIsUp() which releases us. + _formLoadWaiter.WaitOne() + End If + + HideSplashScreen() + End Sub + + ''' + ''' If a splash screen has a minimum time out, then once that is up we check to see whether + ''' we should close the splash screen. If the main form has activated then we close it. + ''' Note that we are getting called on a secondary thread here which isn't necessarily + ''' associated with any form. Don't touch forms from this function. + ''' + Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) + + If _splashTimer IsNot Nothing Then + + 'We only have a timer if there was a minimum timeout on the splash screen. + _splashTimer.Dispose() + _splashTimer = Nothing + End If + + _splashScreenCompletionSource.SetResult(True) + End Sub + + ''' + ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the + ''' NetworkAvailabilityChanged event. + ''' + ''' Contains the Network instance that raised the event. + ''' Contains whether the network is available or not. + Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) + RaiseEvent NetworkAvailabilityChanged(sender, e) + End Sub + + Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) + + Dim invoked As Boolean = False + + Try + Dim handleNextInstance As New Action( + Sub() + invoked = True + OnStartupNextInstance(New StartupNextInstanceEventArgs( + New ReadOnlyCollection(Of String)(args), + bringToForegroundFlag:=True)) + End Sub) + + ' If we have a Main form, we need to make sure that we are on _its_ UI thread + ' before we call OnStartupNextInstance. + If MainForm IsNot Nothing Then + MainForm.Invoke(handleNextInstance) + Else + ' Otherwise, we need to make sure that we are on the thread + ' provided by the SynchronizationContext. + AsyncOperationManager. + SynchronizationContext. + Send(Sub() handleNextInstance(), Nothing) + End If + Catch ex As Exception When Not invoked + ' Only catch exceptions thrown when the UI thread is not available, before + ' the UI thread has been created or after it has been terminated. Exceptions + ' thrown from OnStartupNextInstance() should be allowed to propagate. + End Try + End Sub + + ''' + ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled + ''' exception event. + ''' + ''' + ''' + ''' Our UnHandledException event has a different signature then the Windows.Forms.Application + ''' event so we do the translation here before raising our event. + ''' + Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) + OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) + End Sub + + ''' + ''' Hide the splash screen. The splash screen was created on another thread + ''' thread (main thread) than the one it was run on (secondary thread for the + ''' splash screen so it doesn't block app startup. We need to invoke the close. + ''' This function gets called from the main thread by the app fx. + ''' + + + Protected Sub HideSplashScreen() + + 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. + SyncLock _splashLock + + ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling + ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) + ' This is to fix the issue where the main form doesn't come to the front after the + ' Splash screen disappears. + MainForm?.Activate() + + If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then + Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) + _splashScreen.Invoke(disposeSplashDelegate) + _splashScreen = Nothing + End If + End SyncLock + End Sub + + ''' + ''' Provides a hook that designers will override to set the main form. + ''' + + Protected Overridable Sub OnCreateMainForm() + End Sub + + ''' + ''' A designer will override this method and provide a splash screen if this application has one. + ''' + ''' + ''' For instance, a designer would override this method and emit: Me.Splash = new Splash + ''' where Splash was designated in the application designer as being the splash screen for this app + ''' + + Protected Overridable Sub OnCreateSplashScreen() End Sub ''' @@ -503,9 +791,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ' in a derived class and setting `MyBase.MinimumSplashScreenDisplayTime` there. ' We are picking this (probably) changed value up, and pass it to the ApplyDefaultsEvents ' where it could be modified (again). So event wins over Override over default value (2 seconds). - ' b) We feed the defaults for HighDpiMode, ColorMode, VisualStylesMode to the EventArgs. - ' With the introduction of the HighDpiMode property, we changed Project System the chance to reflect - ' those default values in the App Designer UI and have it code-generated based on a modified + ' b) We feed the defaults for HighDpiMode, ColorMode, VisualStylesMode to the EventArgs. + ' With the introduction of the HighDpiMode property, we changed Project System the chance to reflect + ' those default values in the App Designer UI and have it code-generated based on a modified ' Application.myapp, which would result it to be set in the derived constructor. ' (See the hidden file in the Solution Explorer "My Project\Application.myapp\Application.Designer.vb ' for how those UI-set values get applied.) @@ -548,75 +836,24 @@ Namespace Microsoft.VisualBasic.ApplicationServices End If Debug.Assert(dpiSetResult, "We could net set the HighDpiMode.") - ' Now, let's set VisualStyles and ColorMode: - Application.SetColorMode(_colorMode) - -#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. - - ' We'll handle "/nosplash" for you. - If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then - ShowSplashScreen() - End If - - _finishedOnInitialize = True - - ' We are now at a point where we can allow the network object - ' to be created since the iPrincipal is on the thread by now. - - ' True means to not bail out but keep on running after OnInitialize() finishes - Return True - End Function - - ''' - ''' Extensibility point which raises the Startup event - ''' - ''' - - Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean - - eventArgs.Cancel = False - - ' It is important not to create the network object until the ExecutionContext has everything on it. - ' By now the principal will be on the thread so we can create the network object. - ' The timing is important because the network object has an AsyncOperationsManager in it that marshals - ' the network changed event to the main thread. The asyncOperationsManager does a CreateOperation() - ' which makes a copy of the executionContext. That execution context shows up on your thread during - ' the callback so I delay creating the network object (and consequently the capturing of the execution context) - ' until the principal has been set on the thread. This avoids the problem where My.User isn't set - ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future - ' callback that involved the asyncOperationsManager so this is where we need to create objects that - ' have a asyncOperationsContext in them. - If _turnOnNetworkListener And _networkObject Is Nothing Then - - ' The is-nothing-check is to avoid hooking the object more than once. - _networkObject = New Devices.Network - AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor - End If - - RaiseEvent Startup(Me, eventArgs) + ' Now, let's set VisualStyles and ColorMode: + Application.SetColorMode(_colorMode) - Return Not eventArgs.Cancel - End Function +#Enable Warning WFO5001 ' Type is for evaluation purposes only and is subject to change or removal in future updates. - ''' - ''' Extensibility point which raises the StartupNextInstance - ''' - ''' - - - Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) + ' We'll handle "/nosplash" for you. + If Not (commandLineArgs.Contains("/nosplash") OrElse Me.CommandLineArgs.Contains("-nosplash")) Then + ShowSplashScreen() + End If - RaiseEvent StartupNextInstance(Me, eventArgs) + _finishedOnInitialize = True - ' Activate the original instance. - If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then - If MainForm.WindowState = FormWindowState.Minimized Then - MainForm.WindowState = FormWindowState.Normal - End If + ' We are now at a point where we can allow the network object + ' to be created since the iPrincipal is on the thread by now. - MainForm.Activate() - End If - End Sub + ' True means to not bail out but keep on running after OnInitialize() finishes + Return True + End Function ''' ''' At this point, the command line args should have been processed and the application will create the @@ -661,24 +898,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Try End Sub - ''' - ''' A designer will override this method and provide a splash screen if this application has one. - ''' - ''' - ''' For instance, a designer would override this method and emit: Me.Splash = new Splash - ''' where Splash was designated in the application designer as being the splash screen for this app - ''' - - Protected Overridable Sub OnCreateSplashScreen() - End Sub - - ''' - ''' Provides a hook that designers will override to set the main form. - ''' - - Protected Overridable Sub OnCreateMainForm() - End Sub - ''' ''' The last in a series of extensibility points for the Shutdown process ''' @@ -688,389 +907,178 @@ Namespace Microsoft.VisualBasic.ApplicationServices End Sub ''' - ''' Raises the event and exits the application if the event handler indicated - ''' that execution shouldn't continue. - ''' - ''' - ''' True indicates the exception event was raised / False it was not. - - Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean - - ' Does the user have a handler for this event? - If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then - - ' We don't put a try/catch around the handler event so that exceptions in there will - ' bubble out - else we will have a recursive exception handler. - RaiseEvent UnhandledException(Me, e) - If e.ExitApplication Then Application.Exit() - - ' User handled the event. - Return True - End If - - ' Nobody was listening to the UnhandledException event. - Return False - End Function - - ''' - ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, - ''' displays it. - ''' - - Protected Sub ShowSplashScreen() - If Not _didSplashScreen Then - _didSplashScreen = True - - If _splashScreen Is Nothing Then - - ' If the user specified a splash screen, the designer will have overridden this method to set it. - OnCreateSplashScreen() - End If - - If _splashScreen IsNot Nothing Then - - ' Some splash screens have minimum face time they are supposed to get. - ' We'll set up a time to let us know when we can take it down. - If _minimumSplashExposure > 0 Then - - ' Don't close until the timer expires. - _splashTimer = New Timers.Timer(_minimumSplashExposure) - AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp - _splashTimer.AutoReset = False - - ' We only need this, when we actually need to wait for it. - _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) - - ' We'll enable it in DisplaySplash() once the splash screen thread gets running. - End If - - ' Run the splash screen on another thread so we don't starve it for events and painting - ' while the main form gets its act together. - Task.Run(AddressOf DisplaySplash) - End If - End If - End Sub - - ''' - ''' Hide the splash screen. The splash screen was created on another thread - ''' thread (main thread) than the one it was run on (secondary thread for the - ''' splash screen so it doesn't block app startup. We need to invoke the close. - ''' This function gets called from the main thread by the app fx. - ''' - - - Protected Sub HideSplashScreen() - - 'This ultimately wasn't necessary. I suppose we better keep it for backwards compatibility. - SyncLock _splashLock - - ' .NET Framework 4.0 (Dev10 #590587) - we now activate the main form before calling - ' Dispose on the Splash screen. (we're just swapping the order of the two If blocks.) - ' This is to fix the issue where the main form doesn't come to the front after the - ' Splash screen disappears. - MainForm?.Activate() - - If _splashScreen IsNot Nothing AndAlso Not _splashScreen.IsDisposed Then - Dim disposeSplashDelegate As New DisposeDelegate(AddressOf _splashScreen.Dispose) - _splashScreen.Invoke(disposeSplashDelegate) - _splashScreen = Nothing - End If - End SyncLock - End Sub - - ''' - ''' Determines when this application will terminate (when the main form goes down, all forms) - ''' - Protected Friend Property ShutdownStyle() As ShutdownMode - Get - Return _shutdownStyle - End Get - Set(value As ShutdownMode) - ValidateShutdownModeEnumValue(value, NameOf(value)) - _shutdownStyle = value - End Set - End Property - - ''' - ''' Determines whether this application will use the XP Windows styles for windows, controls, etc. - ''' - Protected Property EnableVisualStyles() As Boolean - Get - Return _enableVisualStyles - End Get - Set(value As Boolean) - _enableVisualStyles = value - End Set - End Property - - ''' - ''' Gets or sets the HighDpiMode for the Application. - ''' - - Protected Property HighDpiMode() As HighDpiMode - Get - Return _highDpiMode - End Get - Set(value As HighDpiMode) - _highDpiMode = value - End Set - End Property - - ''' - ''' Gets or sets the ColorMode for the Application. + ''' Extensibility point which raises the Startup event ''' - ''' - ''' The that the application is running in. - ''' - - - Protected Property ColorMode As SystemColorMode - Get - Return _colorMode - End Get - Set(value As SystemColorMode) - _colorMode = value - End Set - End Property - + ''' - Protected Property IsSingleInstance() As Boolean - Get - Return _isSingleInstance - End Get - Set(value As Boolean) - _isSingleInstance = value - End Set - End Property - - ''' - ''' Validates that the value being passed as an AuthenticationMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateAuthenticationModeEnumValue(value As AuthenticationMode, paramName As String) - If value < AuthenticationMode.Windows OrElse value > AuthenticationMode.ApplicationDefined Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(AuthenticationMode)) - End If - End Sub - - ''' - ''' Validates that the value being passed as an ShutdownMode enum is a legal value - ''' - ''' - Private Shared Sub ValidateShutdownModeEnumValue(value As ShutdownMode, paramName As String) - If value < ShutdownMode.AfterMainFormCloses OrElse value > ShutdownMode.AfterAllFormsClose Then - Throw New InvalidEnumArgumentException(paramName, value, GetType(ShutdownMode)) - End If - End Sub - - ''' - ''' Displays the splash screen. We get called here from a different thread than what the - ''' main form is starting up on. This allows us to process events for the Splash screen so - ''' it doesn't freeze up while the main form is getting it together. - ''' - Private Sub DisplaySplash() - Debug.Assert(_splashScreen IsNot Nothing, "We should have never get here if there is no splash screen") - - If _splashTimer IsNot Nothing Then - - ' We only have a timer if there is a minimum time that the splash screen is supposed to be displayed. - ' Enable the timer now that we are about to show the splash screen. - _splashTimer.Enabled = True - End If - - Application.Run(_splashScreen) - End Sub + Protected Overridable Function OnStartup(eventArgs As StartupEventArgs) As Boolean - ''' - ''' If a splash screen has a minimum time out, then once that is up we check to see whether - ''' we should close the splash screen. If the main form has activated then we close it. - ''' Note that we are getting called on a secondary thread here which isn't necessarily - ''' associated with any form. Don't touch forms from this function. - ''' - Private Sub MinimumSplashExposureTimeIsUp(sender As Object, e As Timers.ElapsedEventArgs) + eventArgs.Cancel = False - If _splashTimer IsNot Nothing Then + ' It is important not to create the network object until the ExecutionContext has everything on it. + ' By now the principal will be on the thread so we can create the network object. + ' The timing is important because the network object has an AsyncOperationsManager in it that marshals + ' the network changed event to the main thread. The asyncOperationsManager does a CreateOperation() + ' which makes a copy of the executionContext. That execution context shows up on your thread during + ' the callback so I delay creating the network object (and consequently the capturing of the execution context) + ' until the principal has been set on the thread. This avoids the problem where My.User isn't set + ' during the NetworkAvailabilityChanged event. This problem would just extend itself to any future + ' callback that involved the asyncOperationsManager so this is where we need to create objects that + ' have a asyncOperationsContext in them. + If _turnOnNetworkListener And _networkObject Is Nothing Then - 'We only have a timer if there was a minimum timeout on the splash screen. - _splashTimer.Dispose() - _splashTimer = Nothing + ' The is-nothing-check is to avoid hooking the object more than once. + _networkObject = New Devices.Network + AddHandler _networkObject.NetworkAvailabilityChanged, AddressOf NetworkAvailableEventAdaptor End If - _splashScreenCompletionSource.SetResult(True) - End Sub + RaiseEvent Startup(Me, eventArgs) + + Return Not eventArgs.Cancel + End Function ''' - ''' The Load() event happens before the Shown and Paint events. When we get called here - ''' we know that the form load event is done and that the form is about to paint - ''' itself for the first time. - ''' We can now hide the splash screen. - ''' Note that this function gets called from the main thread - the same thread - ''' that creates the startup form. + ''' Extensibility point which raises the StartupNextInstance ''' - ''' - ''' - Private Sub MainFormLoadingDone(sender As Object, e As EventArgs) - - ' We don't want this event to call us again. - RemoveHandler MainForm.Load, AddressOf MainFormLoadingDone - - ' Now, we don't want to eat up a complete Processor Core just for waiting on the main form, - ' since this is eating up a LOT of energy and workload, especially on Notebooks and tablets. - If _splashScreenCompletionSource IsNot Nothing Then + ''' + + + Protected Overridable Sub OnStartupNextInstance(eventArgs As StartupNextInstanceEventArgs) - _formLoadWaiter = New AutoResetEvent(False) + RaiseEvent StartupNextInstance(Me, eventArgs) - Task.Run(Async Function() As Task - Await _splashScreenCompletionSource.Task.ConfigureAwait(False) - _formLoadWaiter.Set() - End Function) + ' Activate the original instance. + If eventArgs.BringToForeground AndAlso MainForm IsNot Nothing Then + If MainForm.WindowState = FormWindowState.Minimized Then + MainForm.WindowState = FormWindowState.Normal + End If - ' Block until the splash screen time is up. - ' See MinimumSplashExposureTimeIsUp() which releases us. - _formLoadWaiter.WaitOne() + MainForm.Activate() End If - - HideSplashScreen() End Sub ''' - ''' Handles the Windows.Forms.Application.ThreadException event and raises our Unhandled - ''' exception event. + ''' Raises the event and exits the application if the event handler indicated + ''' that execution shouldn't continue. ''' ''' - ''' - ''' Our UnHandledException event has a different signature then the Windows.Forms.Application - ''' event so we do the translation here before raising our event. - ''' - Private Sub OnUnhandledExceptionEventAdaptor(sender As Object, e As ThreadExceptionEventArgs) - OnUnhandledException(New UnhandledExceptionEventArgs(True, e.Exception)) - End Sub - - Private Sub OnStartupNextInstanceMarshallingAdaptor(args As String()) - - Dim invoked As Boolean = False + ''' True indicates the exception event was raised / False it was not. + + Protected Overridable Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean - Try - Dim handleNextInstance As New Action( - Sub() - invoked = True - OnStartupNextInstance(New StartupNextInstanceEventArgs( - New ReadOnlyCollection(Of String)(args), - bringToForegroundFlag:=True)) - End Sub) + ' Does the user have a handler for this event? + If _unhandledExceptionHandlers IsNot Nothing AndAlso _unhandledExceptionHandlers.Count > 0 Then - ' If we have a Main form, we need to make sure that we are on _its_ UI thread - ' before we call OnStartupNextInstance. - If MainForm IsNot Nothing Then - MainForm.Invoke(handleNextInstance) - Else - ' Otherwise, we need to make sure that we are on the thread - ' provided by the SynchronizationContext. - AsyncOperationManager. - SynchronizationContext. - Send(Sub() handleNextInstance(), Nothing) - End If + ' We don't put a try/catch around the handler event so that exceptions in there will + ' bubble out - else we will have a recursive exception handler. + RaiseEvent UnhandledException(Me, e) + If e.ExitApplication Then Application.Exit() - Catch ex As Exception When Not invoked - ' Only catch exceptions thrown when the UI thread is not available, before - ' the UI thread has been created or after it has been terminated. Exceptions - ' thrown from OnStartupNextInstance() should be allowed to propagate. - End Try - End Sub + ' User handled the event. + Return True + End If - ''' - ''' Handles the Network.NetworkAvailability event (on the correct thread) and raises the - ''' NetworkAvailabilityChanged event. - ''' - ''' Contains the Network instance that raised the event. - ''' Contains whether the network is available or not. - Private Sub NetworkAvailableEventAdaptor(sender As Object, e As Devices.NetworkAvailableEventArgs) - RaiseEvent NetworkAvailabilityChanged(sender, e) - End Sub + ' Nobody was listening to the UnhandledException event. + Return False + End Function ''' - ''' Runs the user's program through the VB Startup/Shutdown application model + ''' Uses the extensibility model to see if there is a splash screen provided for this app and if there is, + ''' displays it. ''' - Private Sub DoApplicationModel() + + Protected Sub ShowSplashScreen() + If Not _didSplashScreen Then + _didSplashScreen = True - Dim eventArgs As New StartupEventArgs(CommandLineArgs) + If _splashScreen Is Nothing Then - ' Only do the try/catch if we aren't running under the debugger. - ' If we do try/catch under the debugger the debugger never gets - ' a crack at exceptions which breaks the exception helper. - If Not Debugger.IsAttached Then + ' If the user specified a splash screen, the designer will have overridden this method to set it. + OnCreateSplashScreen() + End If - ' NO DEBUGGER ATTACHED - we use a catch so that we can run our UnhandledException code - ' Note - Sadly, code changes within this IF (that don't pertain to exception handling) - ' need to be mirrored in the ELSE debugger attached clause below. - Try - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() - End If - End If - Catch ex As Exception + If _splashScreen IsNot Nothing Then - ' This catch is for exceptions that happen during the On* methods above, - ' but have occurred outside of the message pump (which exceptions we would - ' have already seen via our hook of System.Windows.Forms.Application.ThreadException). - If _processingUnhandledExceptionEvent Then + ' Some splash screens have minimum face time they are supposed to get. + ' We'll set up a time to let us know when we can take it down. + If _minimumSplashExposure > 0 Then - ' If the UnhandledException handler threw for some reason, throw that error out to the system. - Throw - Else + ' Don't close until the timer expires. + _splashTimer = New Timers.Timer(_minimumSplashExposure) + AddHandler _splashTimer.Elapsed, AddressOf MinimumSplashExposureTimeIsUp + _splashTimer.AutoReset = False - ' We had an exception, but not during the OnUnhandledException handler so give the user - ' a chance to look at what happened in the UnhandledException event handler - If Not OnUnhandledException(New UnhandledExceptionEventArgs(True, ex)) Then + ' We only need this, when we actually need to wait for it. + _splashScreenCompletionSource = New TaskCompletionSource(Of Boolean) - ' The user didn't write a handler so throw the error out to the system - Throw - End If - End If - End Try - Else - ' DEBUGGER ATTACHED - we don't have an uber catch when debugging so the exception - ' will bubble out to the exception helper. - ' We also don't hook up the Application.ThreadException event because WinForms ignores it - ' when we are running under the debugger. - If OnInitialize(CommandLineArgs) Then - If OnStartup(eventArgs) Then - OnRun() - OnShutdown() + ' We'll enable it in DisplaySplash() once the splash screen thread gets running. End If + + ' Run the splash screen on another thread so we don't starve it for events and painting + ' while the main form gets its act together. + Task.Run(AddressOf DisplaySplash) End If End If End Sub ''' - ''' Generates the name for the remote singleton that we use to channel multiple instances - ''' to the same application model thread. + ''' Processes all windows messages currently in the message queue ''' - ''' - ''' - ''' A string unique to the application that should be the same for versions of - ''' the application that have the same Major and Minor Version Number. - ''' - ''' If GUID Attribute does not exist fall back to unique ModuleVersionId. - Private Shared Function GetApplicationInstanceID(entry As Assembly) As String + Public Sub DoEvents() + Application.DoEvents() + End Sub - Dim guidAttrib As GuidAttribute = entry.GetCustomAttribute(Of GuidAttribute)() + ''' + ''' Entry point to kick off the VB Startup/Shutdown Application model. + ''' + ''' The command line from Main(). + + Public Sub Run(commandLine As String()) - If guidAttrib IsNot Nothing Then + ' Prime the command line args with what we receive from Main() so that Click-Once windows + ' apps don't have to do a System.Environment call which would require permissions. + InternalCommandLine = New ReadOnlyCollection(Of String)(commandLine) - Dim version As Version = entry.GetName.Version + If Not IsSingleInstance Then + DoApplicationModel() + Else + ' This is a Single-Instance application - If version IsNot Nothing Then - Return $"{guidAttrib.Value}{version.Major}.{version.Minor}" + ' Note: Must pass the calling assembly from here so we can get the running app. + ' Otherwise, can break single instance. + Dim applicationInstanceID As String = GetApplicationInstanceID(Assembly.GetCallingAssembly) + Dim pipeServer As NamedPipeServerStream = Nothing + + If TryCreatePipeServer(applicationInstanceID, pipeServer) Then + + ' --- This is the first instance of a single-instance application to run. + ' This is the instance that subsequent instances will attach to. + Using pipeServer + Dim tokenSource As New CancellationTokenSource() +#Disable Warning BC42358 ' Call is not awaited. + WaitForClientConnectionsAsync(pipeServer, AddressOf OnStartupNextInstanceMarshallingAdaptor, cancellationToken:=tokenSource.Token) +#Enable Warning BC42358 + DoApplicationModel() + tokenSource.Cancel() + End Using Else - Return guidAttrib.Value - End If - End If - Return entry.ManifestModule.ModuleVersionId.ToString() - End Function + ' --- We are launching a subsequent instance. + Dim tokenSource As New CancellationTokenSource() + tokenSource.CancelAfter(SecondInstanceTimeOut) + Try + Dim awaitable As ConfiguredTaskAwaitable = SendSecondInstanceArgsAsync( + pipeName:=applicationInstanceID, + args:=commandLine, + cancellationToken:=tokenSource.Token).ConfigureAwait(False) + + awaitable.GetAwaiter().GetResult() + Catch ex As Exception + Throw New CantStartSingleInstanceException() + End Try + End If + End If 'Single-Instance application + End Sub End Class End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb index 63b65abfb60..28cfbbc96df 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/CompilerServices/ExceptionUtils.vb @@ -6,7 +6,7 @@ Imports System.Threading Namespace Microsoft.VisualBasic.CompilerServices - Friend Enum vbErrors + Friend Enum VbErrors None = 0 FileNotFound = 53 PermissionDenied = 70 @@ -15,37 +15,6 @@ Namespace Microsoft.VisualBasic.CompilerServices ' Implements error utilities for Basic Friend Module ExceptionUtils - Friend Function GetResourceString(resourceKey As String, - ParamArray args() As String) As String - Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) - End Function - - Friend Function GetResourceString(resourceId As vbErrors) As String - Dim id As String = $"ID{CStr(resourceId)}" - Return SR.GetResourceString(id, id) - End Function - - Friend Function VbMakeException(resourceId As Integer) As Exception - Dim description As String = String.Empty - - If resourceId > 0 AndAlso resourceId <= &HFFFFI Then - description = GetResourceString(DirectCast(resourceId, vbErrors)) - End If - - Select Case resourceId - - Case vbErrors.FileNotFound - Return New IO.FileNotFoundException(description) - - Case vbErrors.PermissionDenied - Return New IO.IOException(description) - - Case Else - Return New Exception(description) - End Select - - End Function - ''' ''' Returns a new instance of with the message from resource file and the Exception.ArgumentName property set. ''' @@ -54,9 +23,10 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . ''' This is the preferred way to construct an argument exception. - Friend Function GetArgumentExceptionWithArgName(argumentName As String, - resourceID As String, - ParamArray placeHolders() As String) As ArgumentException + Friend Function GetArgumentExceptionWithArgName( + argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentException Return New ArgumentException(GetResourceString(resourceID, placeHolders), argumentName) End Function @@ -78,9 +48,10 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . - Friend Function GetArgumentNullException(argumentName As String, - resourceID As String, - ParamArray placeHolders() As String) As ArgumentNullException + Friend Function GetArgumentNullException( + argumentName As String, + resourceID As String, + ParamArray placeHolders() As String) As ArgumentNullException Return New ArgumentNullException(argumentName, GetResourceString(resourceID, placeHolders)) End Function @@ -91,8 +62,9 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . - Friend Function GetDirectoryNotFoundException(resourceID As String, - ParamArray placeHolders() As String) As IO.DirectoryNotFoundException + Friend Function GetDirectoryNotFoundException( + resourceID As String, + ParamArray placeHolders() As String) As IO.DirectoryNotFoundException Return New IO.DirectoryNotFoundException(GetResourceString(resourceID, placeHolders)) End Function @@ -104,9 +76,10 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . - Friend Function GetFileNotFoundException(fileName As String, - resourceID As String, - ParamArray placeHolders() As String) As IO.FileNotFoundException + Friend Function GetFileNotFoundException( + fileName As String, + resourceID As String, + ParamArray placeHolders() As String) As IO.FileNotFoundException Return New IO.FileNotFoundException(GetResourceString(resourceID, placeHolders), fileName) End Function @@ -117,8 +90,9 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . - Friend Function GetInvalidOperationException(resourceID As String, - ParamArray placeHolders() As String) As InvalidOperationException + Friend Function GetInvalidOperationException( + resourceID As String, + ParamArray placeHolders() As String) As InvalidOperationException Return New InvalidOperationException(GetResourceString(resourceID, placeHolders)) End Function @@ -129,12 +103,23 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' The resource ID. ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . - Friend Function GetIOException(resourceID As String, - ParamArray placeHolders() As String) As IO.IOException + Friend Function GetIOException( + resourceID As String, + ParamArray placeHolders() As String) As IO.IOException Return New IO.IOException(GetResourceString(resourceID, placeHolders)) End Function + Friend Function GetResourceString(resourceKey As String, + ParamArray args() As String) As String + Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args) + End Function + + Friend Function GetResourceString(resourceId As VbErrors) As String + Dim id As String = $"ID{CStr(resourceId)}" + Return SR.GetResourceString(id, id) + End Function + ''' ''' Returns a new instance of with the message from resource file and the last Win32 error. ''' @@ -142,11 +127,33 @@ Namespace Microsoft.VisualBasic.CompilerServices ''' Strings that will replace place holders in the resource string, if any. ''' A new instance of . ''' There is no way to exclude the Win32 error so this function will call Marshal.GetLastWin32Error all the time. - Friend Function GetWin32Exception(resourceID As String, - ParamArray placeHolders() As String) As ComponentModel.Win32Exception + Friend Function GetWin32Exception( + resourceID As String, + ParamArray placeHolders() As String) As ComponentModel.Win32Exception Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), GetResourceString(resourceID, placeHolders)) End Function + Friend Function VbMakeException(resourceId As Integer) As Exception + Dim description As String = String.Empty + + If resourceId > 0 AndAlso resourceId <= &HFFFFI Then + description = GetResourceString(DirectCast(resourceId, VbErrors)) + End If + + Select Case resourceId + + Case VbErrors.FileNotFound + Return New IO.FileNotFoundException(description) + + Case VbErrors.PermissionDenied + Return New IO.IOException(description) + + Case Else + Return New Exception(description) + End Select + + End Function + End Module End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb index fa0a5276bb6..7b8875ffb03 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb @@ -78,10 +78,10 @@ Namespace Microsoft.VisualBasic 'If not, throw FileNotFound Const ERROR_ACCESS_DENIED As Integer = 5 If errorCode = ERROR_ACCESS_DENIED Then - Throw ExUtils.VbMakeException(vbErrors.PermissionDenied) + Throw ExUtils.VbMakeException(VbErrors.PermissionDenied) End If - Throw ExUtils.VbMakeException(vbErrors.FileNotFound) + Throw ExUtils.VbMakeException(VbErrors.FileNotFound) End If Finally safeProcessHandle.Close() ' Close the process handle will not cause the process to stop. diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb index 9a2cdb03db5..d42067d0cc4 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ExceptionUtilsTests.vb @@ -28,7 +28,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetDirectoryNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExUtils.GetResourceString(VbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetDirectoryNotFoundException(resourceString) ex.Should.BeOfType(Of IO.DirectoryNotFoundException)() ex.Message.Should.Be("File not found.") @@ -36,7 +36,7 @@ Namespace Microsoft.VisualBasic.Forms.Tests Public Sub GetFileNotFoundExceptionTest_Succeed() - Dim resourceString As String = ExUtils.GetResourceString(vbErrors.FileNotFound) + Dim resourceString As String = ExUtils.GetResourceString(VbErrors.FileNotFound) Dim ex As Exception = ExUtils.GetFileNotFoundException("Test", resourceString) ex.Should.BeOfType(Of IO.FileNotFoundException)() ex.Message.Should.Be("File not found.") @@ -71,9 +71,9 @@ Namespace Microsoft.VisualBasic.Forms.Tests End Sub - - - + + + Public Sub VbMakeExceptionTest_Succeed(errorCode As Integer, expected As String) ExUtils.VbMakeException(errorCode).Message.Should.Be(expected) End Sub From f12da23b6a72bc6db29fdfaba9f86a7c93af844b Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Mon, 12 Aug 2024 16:32:41 -0700 Subject: [PATCH 342/342] Merge changes from VB-Runtime-TestsOnly-Review-First --- .../Microsoft.VisualBasic.Forms.Tests.vbproj | 10 ++- .../AssemblyPublicKeyIsAsExpectedTest.vb | 28 ++++++++ .../System/Windows/Forms/ControlTests.vb | 41 ++++++----- .../System/Windows/Forms/TimeTests.vb | 62 ++++++++++++++++ .../Windows/Forms/UserTests.UserIdentity.vb | 42 +++++++++++ .../Windows/Forms/UserTests.UserPrincipal.vb | 34 +++++++++ .../System/Windows/Forms/UserTests.vb | 65 +++++++++++++++++ .../VisualBasic/Devices/AudioTests.cs | 31 +++++++- .../MyServices/ClipboardProxyTests.cs | 72 ++++++++++--------- 9 files changed, 329 insertions(+), 56 deletions(-) create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb create mode 100644 src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj index e711e903745..1781f140963 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj @@ -4,11 +4,17 @@ $(TargetFramework) $(TargetFramework)-windows7.0 true - Microsoft.VisualBasic.Forms.Tests + latest true + On + Off + On + WindowsFormsWithCustomSubMain + True + Library - + diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb new file mode 100644 index 00000000000..ca79c88066a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/AssemblyPublicKeyIsAsExpectedTest.vb @@ -0,0 +1,28 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Text +Imports FluentAssertions +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class AssemblyPublicKeyIsAsExpectedTest + Private Const AssemblyPK As String = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293" + + ''' + ''' Test to find out a correct PublicKey in InternalsVisibleTo for assembly under test. + ''' + + Public Sub AssemblyPublicKeyIsAsExpected() + Dim publicKey() As Byte = GetType(ControlTests).Assembly.GetName().GetPublicKey() + Dim sb As New StringBuilder + For Each [byte] As Byte In publicKey + sb.AppendFormat("{0:x2}", [byte]) + Next + + AssemblyPK.Should.Be(sb.ToString()) + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb index 4a044fa8114..21eaa9a503f 100644 --- a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.vb @@ -2,9 +2,11 @@ ' The .NET Foundation licenses this file to you under the MIT license. Imports System.Windows.Forms +Imports FluentAssertions Imports Xunit Namespace Microsoft.VisualBasic.Forms.Tests + Partial Public Class ControlTests Public Shared Function FaultingFunc(a As Integer) As Integer @@ -20,9 +22,12 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Action = AddressOf FaultingMethod - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(AddressOf FaultingMethod) + End Sub + + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -38,8 +43,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Action method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Action method) ") End Using End Sub @@ -48,9 +53,11 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As New MethodInvoker(AddressOf FaultingMethod) - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( - Sub() _control.Invoke(invoker)) + Dim testCode As Action = + Sub() + _control.Invoke(New MethodInvoker(AddressOf FaultingMethod)) + End Sub + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -66,8 +73,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at System.Windows.Forms.Control.Invoke(Delegate method) in ...\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Control.cs:line 6393 ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__1-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 18 - Assert.Contains(NameOf(FaultingMethod), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke(Delegate method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingMethod)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke(Delegate method) ") End Using End Sub @@ -76,11 +83,13 @@ Namespace Microsoft.VisualBasic.Forms.Tests Using _control As New Control _control.CreateControl() - Dim invoker As Func(Of Integer, Integer) = AddressOf FaultingFunc - Dim exception As Exception = Assert.Throws(Of DivideByZeroException)( + Dim testCode As Action = Sub() - Dim result As Integer = _control.Invoke(Function() invoker(19)) - End Sub) + Dim result As Integer = + _control.Invoke(Function() CType(AddressOf FaultingFunc, Func(Of Integer, Integer))(19)) + End Sub + + Dim exception As Exception = Assert.Throws(Of DivideByZeroException)(testCode) ' Expecting something Like the following. ' The first frame must be the this method, followed by MarshaledInvoke at previous location. @@ -94,8 +103,8 @@ Namespace Microsoft.VisualBasic.Forms.Tests ' at Microsoft.VisualBasic.Forms.Tests.Microsoft.VisualBasic.Forms.Tests.ControlTests._Closure$__4-1._Lambda$__0() in ...\winforms\src\Microsoft.VisualBasic.Forms\tests\UnitTests\ControlTests.vb:line 111 ' at Xunit.Assert.RecordException(Action testCode) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\Record.cs:line 27 - Assert.Contains(NameOf(FaultingFunc), exception.StackTrace) - Assert.Contains(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ", exception.StackTrace) + exception.StackTrace.Should.Contain(NameOf(FaultingFunc)) + exception.StackTrace.Should.Contain(" System.Windows.Forms.Control.Invoke[T](Func`1 method) ") End Using End Sub diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb new file mode 100644 index 00000000000..0829e9fed9f --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/TimeTests.vb @@ -0,0 +1,62 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports FluentAssertions +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Public Class TimeTests + Private Const PrecisionTickLimit As Integer = 1000 + + Private Function TimesEqual( + vbTime As Date, + systemTime As Date, + acceptableDifferenceInTicks As Long) As Boolean + + Dim diff As TimeSpan = systemTime - vbTime + Return Math.Abs(diff.TotalMicroseconds) < acceptableDifferenceInTicks + End Function + + + Public Sub SystemTimeNotNew() + Date.Now.Should.BeAfter(New Date) + End Sub + + + + + Public Sub VbTimeCloseToDateUtcNow(systemTime As Date, vbTime As Date) + TimesEqual( + vbTime, + systemTime, + acceptableDifferenceInTicks:=PrecisionTickLimit).Should.BeTrue() + End Sub + + + Public Sub VbTickCountCloseToEnvironmentTickCount() + Dim tickCount As Integer = Math.Abs(Environment.TickCount - My.Computer.Clock.TickCount) + Call (tickCount < PrecisionTickLimit).Should.BeTrue() + End Sub + + + Public Sub VbTimeNotNew() + My.Computer.Clock.LocalTime.Should.BeAfter(New Date) + End Sub + + Protected Friend Class TimeData + Implements IEnumerable(Of Object()) + + Public Iterator Function GetEnumerator() As IEnumerator(Of Object()) Implements IEnumerable(Of Object()).GetEnumerator + Yield {My.Computer.Clock.GmtTime, Date.UtcNow} + Yield {My.Computer.Clock.LocalTime, Date.Now} + End Function + + Public Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator + Return GetEnumerator() + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb new file mode 100644 index 00000000000..a086c0709d1 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserIdentity.vb @@ -0,0 +1,42 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Public Class UserIdentity + Implements IIdentity + + Private ReadOnly _authenticationType As String + Private ReadOnly _name As String + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean) + _authenticationType = authenticationType + _name = name + End Sub + + Public ReadOnly Property AuthenticationType As String Implements IIdentity.AuthenticationType + Get + Return _authenticationType + End Get + End Property + + Public ReadOnly Property IsAuthenticated As Boolean Implements IIdentity.IsAuthenticated + Get + Return True + End Get + End Property + + Public ReadOnly Property Name As String Implements IIdentity.Name + Get + Return _name + End Get + End Property + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb new file mode 100644 index 00000000000..c38fa0e7363 --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.UserPrincipal.vb @@ -0,0 +1,34 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports System.Security.Principal + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + Private NotInheritable Class UserPrincipal + Implements IPrincipal + + Private _role As String + Private _userIdentity As IIdentity + + Public Sub New(authenticationType As String, name As String, isAuthenticated As Boolean, role As String) + _userIdentity = New UserIdentity(authenticationType, name, isAuthenticated) + _role = role + End Sub + + Public ReadOnly Property Identity As IIdentity Implements IPrincipal.Identity + Get + Return _userIdentity + End Get + End Property + + Public Function IsInRole(role As String) As Boolean Implements IPrincipal.IsInRole + Return role = _role + End Function + + End Class + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb new file mode 100644 index 00000000000..8967888036a --- /dev/null +++ b/src/Microsoft.VisualBasic.Forms/tests/UnitTests/System/Windows/Forms/UserTests.vb @@ -0,0 +1,65 @@ +' Licensed to the .NET Foundation under one or more agreements. +' The .NET Foundation licenses this file to you under the MIT license. + +Imports FluentAssertions +Imports Microsoft.VisualBasic.ApplicationServices +Imports Xunit + +Namespace Microsoft.VisualBasic.Forms.Tests + + Partial Public Class UserTests + + + Public Sub UserBaseTest() + Dim testUser As New User + testUser.CurrentPrincipal.Should.BeNull() + Dim userPrincipal As New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + testUser.CurrentPrincipal = userPrincipal + testUser.CurrentPrincipal.Should.NotBeNull() + testUser.CurrentPrincipal.Should.Be(userPrincipal) + userPrincipal.Identity.AuthenticationType.Should.Be("Basic") + End Sub + + + Public Sub UserGetNameTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.Name.Should.Be("Test") + End Sub + + + Public Sub UserIsAuthenticatedTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.IsAuthenticated.Should.BeTrue() + End Sub + + + Public Sub UserIsInRoleTest() + Dim testUser As New User With { + .CurrentPrincipal = New UserPrincipal( + authenticationType:="Basic", + name:="Test", + isAuthenticated:=True, + role:="Guest") + } + testUser.IsInRole("Guest").Should.BeTrue() + testUser.IsInRole("Basic").Should.BeFalse() + End Sub + + End Class +End Namespace diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs index 60d544d8960..3ee404bc0ac 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Devices/AudioTests.cs @@ -1,16 +1,43 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.ComponentModel; +using FluentAssertions; + namespace Microsoft.VisualBasic.Devices.Tests; public class AudioTests { + private static string GetUniqueName() => Guid.NewGuid().ToString("D"); + [Fact] public void Play() { string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); Audio audio = new(); - Assert.Throws(() => audio.Play(location)); + Action testCode = () => audio.Play(location); + testCode.Should().Throw(); + } + + [Fact] + public void PlayInvalidMode_Throws() + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, (AudioPlayMode)(-1)); + testCode.Should().Throw(); + } + + [Theory] + [InlineData(AudioPlayMode.Background)] + [InlineData(AudioPlayMode.BackgroundLoop)] + [InlineData(AudioPlayMode.WaitToComplete)] + public void PlayAllModes_Throws(AudioPlayMode mode) + { + string location = Path.Combine(Path.GetTempPath(), GetUniqueName()); + Audio audio = new(); + Action testCode = () => audio.Play(location, mode); + testCode.Should().Throw(); } // Not tested: @@ -22,6 +49,4 @@ public void Stop() Audio audio = new(); audio.Stop(); } - - private static string GetUniqueName() => Guid.NewGuid().ToString("D"); } diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index 9977d6ec803..dbec3c7cc0e 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; +using FluentAssertions; using Microsoft.VisualBasic.Devices; using DataFormats = System.Windows.Forms.DataFormats; using TextDataFormat = System.Windows.Forms.TextDataFormat; @@ -12,78 +13,79 @@ namespace Microsoft.VisualBasic.MyServices.Tests; [CollectionDefinition("Sequential", DisableParallelization = true)] public class ClipboardProxyTests { + private static string GetUniqueText() => Guid.NewGuid().ToString("D"); + [WinFormsFact] - public void Clear() + public void Audio() { var clipboard = (new Computer()).Clipboard; - string text = GetUniqueText(); - clipboard.SetText(text); - Assert.True(System.Windows.Forms.Clipboard.ContainsText()); - clipboard.Clear(); - Assert.False(System.Windows.Forms.Clipboard.ContainsText()); + clipboard.ContainsAudio().Should().Be(System.Windows.Forms.Clipboard.ContainsAudio()); + + // Not tested: + // Public Function GetAudioStream() As Stream + // Public Sub SetAudio(audioBytes As Byte()) + // Public Sub SetAudio(audioStream As Stream) } [WinFormsFact] - public void Text() + public void Clear() { var clipboard = (new Computer()).Clipboard; string text = GetUniqueText(); - clipboard.SetText(text, TextDataFormat.UnicodeText); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); - Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); - Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.SetText(text); + System.Windows.Forms.Clipboard.ContainsText().Should().BeTrue(); + clipboard.Clear(); + System.Windows.Forms.Clipboard.ContainsText().Should().BeFalse(); } [WinFormsFact] - public void Image() + public void Data() { var clipboard = (new Computer()).Clipboard; - Bitmap image = new(2, 2); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsImage(), clipboard.ContainsImage()); - Assert.Equal(System.Windows.Forms.Clipboard.GetImage(), clipboard.GetImage()); - clipboard.SetImage(image); + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); + Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); + clipboard.SetData(DataFormats.UnicodeText, data); } [WinFormsFact] - public void Audio() + public void DataObject() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsAudio(), clipboard.ContainsAudio()); - // Not tested: - // Public Function GetAudioStream() As Stream - // Public Sub SetAudio(audioBytes As Byte()) - // Public Sub SetAudio(audioStream As Stream) + object data = GetUniqueText(); + Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); + clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); } [WinFormsFact] public void FileDropList() { var clipboard = (new Computer()).Clipboard; - Assert.Equal(System.Windows.Forms.Clipboard.ContainsFileDropList(), clipboard.ContainsFileDropList()); + System.Windows.Forms.Clipboard.ContainsFileDropList().Should().Be(clipboard.ContainsFileDropList()); // Not tested: // Public Function GetFileDropList() As StringCollection // Public Sub SetFileDropList(filePaths As StringCollection) } [WinFormsFact] - public void Data() + public void Image() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.ContainsData(DataFormats.UnicodeText), clipboard.ContainsData(DataFormats.UnicodeText)); - Assert.Equal(System.Windows.Forms.Clipboard.GetData(DataFormats.UnicodeText), clipboard.GetData(DataFormats.UnicodeText)); - clipboard.SetData(DataFormats.UnicodeText, data); + using Bitmap image = new(2, 2); + System.Windows.Forms.Clipboard.ContainsImage().Should().Be(clipboard.ContainsImage()); + System.Windows.Forms.Clipboard.GetImage().Should().Be(clipboard.GetImage()); + clipboard.SetImage(image); } [WinFormsFact] - public void DataObject() + public void Text() { var clipboard = (new Computer()).Clipboard; - object data = GetUniqueText(); - Assert.Equal(System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.UnicodeText), clipboard.GetDataObject().GetData(DataFormats.UnicodeText)); - clipboard.SetDataObject(new System.Windows.Forms.DataObject(data)); + string text = GetUniqueText(); + clipboard.SetText(text, TextDataFormat.UnicodeText); + System.Windows.Forms.Clipboard.ContainsText().Should().Be(clipboard.ContainsText()); + System.Windows.Forms.Clipboard.GetText().Should().Be(clipboard.GetText()); + System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(clipboard.GetText(TextDataFormat.UnicodeText)); + clipboard.GetText(TextDataFormat.UnicodeText).Should().Be(text); } - - private static string GetUniqueText() => Guid.NewGuid().ToString("D"); }