/// <summary>
 /// Writes code for the given <paramref name="chunk"/>.
 /// </summary>
 /// <param name="chunk">The <see cref="SetLayoutChunk"/> to render.</param>
 /// <remarks>
 /// Unconditionally adds a <see cref="RazorError"/> to inform user of unexpected <c>@layout</c> directive.
 /// </remarks>
 protected override void Visit(SetLayoutChunk chunk)
 {
     Context.ErrorSink.OnError(
         chunk.Association.Start,
         RazorResources.FormatTagHelpers_Directives_NotSupported_InAttributes(
             SyntaxConstants.CSharp.LayoutKeyword),
         chunk.Association.Length);
 }
Esempio n. 2
0
 protected override void Visit(SetLayoutChunk chunk)
 {
     if (!Context.Host.DesignTimeMode && !String.IsNullOrEmpty(Context.Host.GeneratedClassContext.LayoutPropertyName))
     {
         Writer.Write(Context.Host.GeneratedClassContext.LayoutPropertyName)
         .Write(" = ")
         .WriteStringLiteral(chunk.Layout)
         .WriteLine(";");
     }
 }
 protected override void Visit(SetLayoutChunk chunk)
 {
 }