Skip to content

Commit f2cb33c

Browse files
[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.
1 parent 4f03653 commit f2cb33c

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
namespace AndroidApp1
1+
namespace AndroidApp1;
2+
3+
[Activity(Label = "@string/app_name", MainLauncher = true)]
4+
public class Activity1 : Activity
25
{
3-
[Activity(Label = "@string/app_name", MainLauncher = true)]
4-
public class Activity1 : Activity
6+
protected override void OnCreate(Bundle? savedInstanceState)
57
{
6-
protected override void OnCreate(Bundle? savedInstanceState)
7-
{
8-
base.OnCreate(savedInstanceState);
8+
base.OnCreate(savedInstanceState);
99

10-
// Create your application here
11-
}
10+
// Create your application here
1211
}
1312
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
namespace AndroidApp1
1+
namespace AndroidApp1;
2+
3+
[Activity(Label = "@string/app_name", MainLauncher = true)]
4+
public class MainActivity : Activity
25
{
3-
[Activity(Label = "@string/app_name", MainLauncher = true)]
4-
public class MainActivity : Activity
6+
protected override void OnCreate(Bundle? savedInstanceState)
57
{
6-
protected override void OnCreate(Bundle? savedInstanceState)
7-
{
8-
base.OnCreate(savedInstanceState);
8+
base.OnCreate(savedInstanceState);
99

10-
// Set our view from the "main" layout resource
11-
SetContentView(Resource.Layout.activity_main);
12-
}
10+
// Set our view from the "main" layout resource
11+
SetContentView(Resource.Layout.activity_main);
1312
}
1413
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
namespace AndroidLib1
1+
namespace AndroidLib1;
2+
3+
public class Class1
24
{
3-
public class Class1
4-
{
5-
}
6-
}
5+
}

0 commit comments

Comments
 (0)