forked from dotnet/winforms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
345 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
29 changes: 29 additions & 0 deletions
29
src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ApplicationEvents.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
31 changes: 31 additions & 0 deletions
31
src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.Designer.vb
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/Form1.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
37 changes: 37 additions & 0 deletions
37
....Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.Designer.vb
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/My Project/Application.myapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<MySubMain>true</MySubMain> | ||
<MainForm>Form1</MainForm> | ||
<SingleInstance>false</SingleInstance> | ||
<ShutdownMode>0</ShutdownMode> | ||
<EnableVisualStyles>true</EnableVisualStyles> | ||
<AuthenticationMode>0</AuthenticationMode> | ||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit> | ||
</MyApplicationData> |
35 changes: 35 additions & 0 deletions
35
src/System.Windows.Forms/tests/IntegrationTests/ScratchProjectVB/ScratchProjectVB.vbproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>ScratchProjectVB</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<!-- These are needed to suppress the localization step picked up from Arcade targets --> | ||
<LangVersion>15.0</LangVersion> | ||
<EnableXlfLocalization>false</EnableXlfLocalization> | ||
<UpdateXlfOnBuild>false</UpdateXlfOnBuild> | ||
<StartupObject>ScratchProjectVB.Form1</StartupObject> | ||
<TargetFramework>net8.0-windows7.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<!-- These normally come from $(UseWindowsForms) when $(ImplicitUsings) is enabled --> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\..\Microsoft.VisualBasic.Forms\src\Microsoft.VisualBasic.Forms.vbproj" /> | ||
<ProjectReference Include="..\..\..\..\System.Drawing.Common\src\System.Drawing.Common.csproj" /> | ||
<ProjectReference Include="..\..\..\src\System.Windows.Forms.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Import Include="System.Drawing" /> | ||
<Import Include="System.Windows.Forms" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="My Project\Application.myapp"> | ||
<Generator>MyApplicationCodeGenerator</Generator> | ||
<LastGenOutput>Application.Designer.vb</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |