Skip to content

Commit

Permalink
Add template for IsExternalInit file (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kralizek committed Jan 22, 2021
1 parent 380f468 commit 5e66208
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions content/IsExternalInit/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Insight Architectures",
"classifications": ["IA", "IsExternalInit"],
"name": "[IA] IsExternalInit",
"identity": "InsightArchitectures.Templates.Items.IsExternalInit",
"groupIdentity": "InsightArchitectures.Templates.Items.IsExternalInit.CSharp",
"shortName": "isexternalinit",
"tags": {
"language": "C#",
"type": "item"
},
"defaultName": "IsExternalInit",
"description": "This templates creates a IsExternalInit file that adds low-level support for init-only properties in runtimes prior to .NET 5.0."
}
26 changes: 26 additions & 0 deletions content/IsExternalInit/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//-:cnd:noEmit
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// See: https://github.com/dotnet/roslyn/issues/45510

#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NETCOREAPP3_0 || NETCOREAPP3_1 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48

using System.ComponentModel;

// ReSharper disable once CheckNamespace
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This class should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class IsExternalInit
{
}
}

#endif
//+:cnd:noEmit

0 comments on commit 5e66208

Please sign in to comment.