void IConfigureRazorParserOptionsFeature.Configure(RazorParserOptionsBuilder options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } options.Directives.Clear(); foreach (var directive in Directives) { options.Directives.Add(directive); } if (options.FileKind != null && DirectivesByFileKind.TryGetValue(options.FileKind, out var directives)) { foreach (var directive in directives) { // Replace any non-file-kind-specific directives var replaces = options.Directives.Where(d => string.Equals(d.Directive, directive.Directive, StringComparison.Ordinal)).ToArray(); foreach (var replace in replaces) { options.Directives.Remove(replace); } options.Directives.Add(directive); } } }
void IConfigureRazorParserOptionsFeature.Configure(RazorParserOptionsBuilder options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } options.Directives.Clear(); foreach (var directive in Directives) { options.Directives.Add(directive); } }
void IConfigureRazorParserOptionsFeature.Configure(RazorParserOptionsBuilder options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } options.Directives.Clear(); var fileKind = options.FileKind ?? FileKinds.Legacy; if (DirectivesByFileKind.TryGetValue(fileKind, out var directives)) { foreach (var directive in directives) { options.Directives.Add(directive); } } }
private void ConfigureDesignTimeParserOptions(RazorParserOptionsBuilder builder) { builder.SetDesignTime(true); }
private void ConfigureParserOptions(RazorParserOptionsBuilder builder) { }
public void Configure(RazorParserOptionsBuilder options) { options.Directives.Add(DirectiveDescriptor.CreateDirective("test", DirectiveKind.SingleLine)); }
public void Configure(RazorParserOptionsBuilder options) { options.SetDesignTime(_designTime); }