-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add @code directive support for Blazor * do the needful
- Loading branch information
Showing
420 changed files
with
948 additions
and
809 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Razor/src/Microsoft.AspNetCore.Razor.Language/Components/ComponentCodeDirective.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.AspNetCore.Razor.Language.Components | ||
{ | ||
public static class ComponentCodeDirective | ||
{ | ||
public static readonly DirectiveDescriptor Directive = DirectiveDescriptor.CreateDirective( | ||
"code", | ||
DirectiveKind.CodeBlock, | ||
builder => | ||
{ | ||
builder.Description = Resources.FunctionsDirective_Description; | ||
}); | ||
|
||
public static void Register(RazorProjectEngineBuilder builder) | ||
{ | ||
if (builder == null) | ||
{ | ||
throw new ArgumentNullException(nameof(builder)); | ||
} | ||
|
||
builder.AddDirective(Directive, FileKinds.Component); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.