Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] use file scoped namespaces in templates (#6512)
Context: https://docs.microsoft.com/dotnet/csharp/whats-new/csharp-10#file-scoped-namespace-declaration In 7fb7c81, I implemented most C# 10 features in templates, but I forgot about file scoped namespaces. To match the other .NET 6 templates, we should have: namespace AndroidApp1; And remove one level of indentation from these files.
- Loading branch information
1 parent
4f03653
commit f2cb33c
Showing
3 changed files
with
19 additions
and
22 deletions.
There are no files selected for viewing
15 changes: 7 additions & 8 deletions
15
src/Microsoft.Android.Templates/android-activity/Activity1.cs
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
namespace AndroidApp1 | ||
namespace AndroidApp1; | ||
|
||
[Activity(Label = "@string/app_name", MainLauncher = true)] | ||
public class Activity1 : Activity | ||
{ | ||
[Activity(Label = "@string/app_name", MainLauncher = true)] | ||
public class Activity1 : Activity | ||
protected override void OnCreate(Bundle? savedInstanceState) | ||
{ | ||
protected override void OnCreate(Bundle? savedInstanceState) | ||
{ | ||
base.OnCreate(savedInstanceState); | ||
base.OnCreate(savedInstanceState); | ||
|
||
// Create your application here | ||
} | ||
// Create your application here | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
namespace AndroidApp1 | ||
namespace AndroidApp1; | ||
|
||
[Activity(Label = "@string/app_name", MainLauncher = true)] | ||
public class MainActivity : Activity | ||
{ | ||
[Activity(Label = "@string/app_name", MainLauncher = true)] | ||
public class MainActivity : Activity | ||
protected override void OnCreate(Bundle? savedInstanceState) | ||
{ | ||
protected override void OnCreate(Bundle? savedInstanceState) | ||
{ | ||
base.OnCreate(savedInstanceState); | ||
base.OnCreate(savedInstanceState); | ||
|
||
// Set our view from the "main" layout resource | ||
SetContentView(Resource.Layout.activity_main); | ||
} | ||
// Set our view from the "main" layout resource | ||
SetContentView(Resource.Layout.activity_main); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
namespace AndroidLib1 | ||
namespace AndroidLib1; | ||
|
||
public class Class1 | ||
{ | ||
public class Class1 | ||
{ | ||
} | ||
} | ||
} |