Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Microsoft",
"classifications": ["Common", "WinForms"],
"classifications": [ "Common", "WinForms" ],
"name": "Windows Forms App",
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating a .NET Windows Forms (WinForms) App.",
Expand Down Expand Up @@ -49,14 +49,6 @@
"defaultValue": "net6.0",
"displayName": "Framework"
},
"UseWindowsDesktopSdk": {
"type": "computed",
"value": "(Framework == \"netcoreapp3.1\")"
},
"UseApplicationBoilerplate": {
"type": "computed",
"value": "(Framework == \"net5.0\")"
},
"langVersion": {
"type": "parameter",
"datatype": "text",
Expand All @@ -82,6 +74,23 @@
"defaultValue": "true",
"description": "Whether to enable nullable reference types for this project.",
"displayName": "Enable nullable"
},
"csharp10orLater": {
"type": "generated",
"generator": "regexMatch",
"datatype": "bool",
"parameters": {
"pattern": "^(|10\\.0|10|preview|latest|default|latestMajor)$",
"source": "langVersion"
}
},
"csharpFeature_ImplicitUsings": {
"type": "computed",
"value": "Framework == \"net6.0\" && csharp10orLater == \"true\""
},
"csharpFeature_FileScopedNamespaces": {
"type": "computed",
"value": "(Framework == \"net6.0\" || langVersion != \"\") && csharp10orLater == \"true\""
}
},
"primaryOutputs": [
Expand All @@ -93,37 +102,19 @@
],
"sources": [
{
"exclude": [ "**/[Bb]in/**", "**/[Oo]bj/**", ".template.config/**/*", "**/*.filelist", "**/*.lock.json" ],
"modifiers": [
{
"condition": "(UseWindowsDesktopSdk)",
"exclude": [
"Company.WinFormsApplication1.csproj",
"Program.cs"
],
"rename": {
"Company.WinFormsApplication3x1.csproj": "Company.WinFormsApplication1.csproj",
"Program.boilerplate.cs": "Program.cs"
}
},
{
"condition": "(!UseWindowsDesktopSdk && UseApplicationBoilerplate)",
"exclude": [
"Company.WinFormsApplication3x1.csproj",
"Program.cs"
],
"rename": {
"Program.boilerplate.cs": "Program.cs"
}
},
{
"condition": "(!UseWindowsDesktopSdk && !UseApplicationBoilerplate)",
"exclude": [
"Company.WinFormsApplication3x1.csproj",
"Program.boilerplate.cs"
]
}
]
"condition": "Framework == \"netcoreapp3.1\"",
"source": "./netcoreapp3.1",
"target": "./"
},
{
"condition": "Framework == \"net5.0\"",
"source": "./net5.0",
"target": "./"
},
{
"condition": "Framework == \"net6.0\"",
"source": "./net6.0",
"target": "./"
}
],
"defaultName": "WinFormsApp1",
Expand All @@ -142,7 +133,7 @@
"id": "open-file",
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens Form1.cs in the editor",
"manualInstructions": [ ],
"manualInstructions": [],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "1"
Expand Down

This file was deleted.

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">FrameworkParameter-windows</TargetFramework>
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride-windows</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WinFormsApplication1</RootNamespace>
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion>
<Nullable Condition="'$(Nullable)' == 'true'">enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings Condition="'$(csharpFeature_ImplicitUsings)' == 'true'">enable</ImplicitUsings>
</PropertyGroup>

</Project>

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#if (!csharpFeature_ImplicitUsings)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

#endif
#if (csharpFeature_FileScopedNamespaces)
namespace Company.WinFormsApplication1;

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
#else
namespace Company.WinFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#if (!csharpFeature_ImplicitUsings)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

#endif
#if (csharpFeature_FileScopedNamespaces)
namespace Company.WinFormsApplication1;

static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
#else
namespace Company.WinFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}
#endif

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Company.WinFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ static class Program
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
Expand Down
Loading