Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Rename Microsoft.AspNet.Razor.Runtime.TagHelpers.
Browse files Browse the repository at this point in the history
- Changed non-ser facing type names to `Microsoft.AspNet.Razor.TagHelpers`.
- Updated folder structure to reflect new namespaces.
- Updated generated code files to reflect new runtime type namespaces.

#578
  • Loading branch information
NTaylorMullen committed Oct 21, 2015
1 parent 6352b36 commit a8dfd3f
Show file tree
Hide file tree
Showing 117 changed files with 485 additions and 447 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
internal static class Constants
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Text;
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.WebEncoders;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Used to override an <see cref="ITagHelper"/> property's HTML attribute name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Indicates the associated <see cref="ITagHelper"/> property should not be bound to HTML attributes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Provides an <see cref="ITagHelper"/>'s target.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// A read-only HTML tag helper attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Threading.Tasks;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Contract used to filter matching HTML elements.
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.AspNet.Razor.Runtime/TagHelpers/ITypeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public interface ITypeInfo : IMemberInfo, IEquatable<ITypeInfo>
/// Gets <see cref="IPropertyInfo"/>s for all properties of the current type excluding indexers.
/// </summary>
/// <remarks>
/// Indexers in this context refer to the CLR notion of an indexer (<c>this [string name]</c>
/// and does not overlap with the semantics of
/// <see cref="Razor.Compilation.TagHelperAttributeDescriptor.IsIndexer"/>.
/// Indexers in this context refer to the CLR notion of an indexer (<c>this [string name]</c>
/// and does not overlap with the semantics of
/// <see cref="Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor.IsIndexer"/>.
/// </remarks>
IEnumerable<IPropertyInfo> Properties { get; }

Expand Down Expand Up @@ -62,7 +62,7 @@ public interface ITypeInfo : IMemberInfo, IEquatable<ITypeInfo>
/// parameters if the type implements <see cref="IDictionary{TKey, TValue}"/>, otherwise <c>null</c>.
/// </returns>
/// <remarks>
/// For open generic types, <see cref="ITypeInfo" /> for generic type parameters is <c>null</c>.
/// For open generic types, <see cref="ITypeInfo" /> for generic type parameters is <c>null</c>.
/// </remarks>
ITypeInfo[] GetGenericDictionaryParameters();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Provides a hint of the <see cref="ITagHelper"/>'s output element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Linq;
using Microsoft.Extensions.Internal;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// A read-only collection of <typeparamref name="TAttribute"/>s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Restricts children of the <see cref="ITagHelper"/>'s element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
/// <summary>
/// <see cref="IPropertyInfo"/> adapter for <see cref="PropertyInfo"/> instances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.Extensions.Internal;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Razor.Runtime/TagHelpers/TagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Threading.Tasks;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Class used to filter matching HTML elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// An HTML tag helper attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

using System;
using System.Collections.Generic;
using Microsoft.AspNet.Razor.Runtime;
using Microsoft.Extensions.Internal;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// A collection of <see cref="TagHelperAttribute"/>s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.Extensions.WebEncoders;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Abstract class used to buffer content returned by <see cref="ITagHelper"/>s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Contains information related to the execution of <see cref="ITagHelper"/>s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Reflection;
using System.Text.RegularExpressions;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.AspNet.Razor.Parser;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down Expand Up @@ -116,16 +115,16 @@ public IEnumerable<TagHelperDescriptor> Resolve(TagHelperDescriptorResolutionCon
}

/// <summary>
/// Resolves all <see cref="TagHelperDescriptor"/>s for <see cref="ITagHelper"/>s from the given
/// <paramref name="assemblyName"/>.
/// Resolves all <see cref="TagHelperDescriptor"/>s for <see cref="Razor.TagHelpers.ITagHelper"/>s from the
/// given <paramref name="assemblyName"/>.
/// </summary>
/// <param name="assemblyName">
/// The name of the assembly to resolve <see cref="TagHelperDescriptor"/>s from.
/// </param>
/// <param name="documentLocation">The <see cref="SourceLocation"/> of the directive.</param>
/// <param name="errorSink">Used to record errors found when resolving <see cref="TagHelperDescriptor"/>s
/// within the given <paramref name="assemblyName"/>.</param>
/// <returns><see cref="TagHelperDescriptor"/>s for <see cref="ITagHelper"/>s from the given
/// <returns><see cref="TagHelperDescriptor"/>s for <see cref="Razor.TagHelpers.ITagHelper"/>s from the given
/// <paramref name="assemblyName"/>.</returns>
// This is meant to be overridden by tooling to enable assembly level caching.
protected virtual IEnumerable<TagHelperDescriptor> ResolveDescriptorsInAssembly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Linq;
using System.Reflection;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
namespace Microsoft.AspNet.Razor.TagHelpers
{
/// <summary>
/// Class used to represent the output of an <see cref="ITagHelper"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.Extensions.Internal;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Text;
using System.Xml.Linq;

namespace Microsoft.AspNet.Razor.Runtime
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
/// <summary>
/// Extracts summary and remarks XML documentation from an XML documentation file.
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Razor/Chunks/TagHelperChunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;

namespace Microsoft.AspNet.Razor.Chunks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Linq;
using Microsoft.AspNet.Razor.Chunks;
using Microsoft.AspNet.Razor.CodeGenerators.Visitors;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;

namespace Microsoft.AspNet.Razor.CodeGenerators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ namespace Microsoft.AspNet.Razor.CodeGenerators.Visitors
{
public class CSharpUsingVisitor : CodeVisitor<CSharpCodeWriter>
{
private const string TagHelpersRuntimeNamespace = "Microsoft.AspNet.Razor.Runtime.TagHelpers";
private static readonly string[] TagHelpersRuntimeNamespaces = new[]
{
"Microsoft.AspNet.Razor.TagHelpers",
"Microsoft.AspNet.Razor.Runtime.TagHelpers"
};

private bool _foundTagHelpers;

Expand All @@ -28,10 +32,10 @@ public CSharpUsingVisitor(CSharpCodeWriter writer, CodeGeneratorContext context)
throw new ArgumentNullException(nameof(context));
}

ImportedUsings = new List<string>();
ImportedUsings = new HashSet<string>(StringComparer.Ordinal);
}

public IList<string> ImportedUsings { get; set; }
public HashSet<string> ImportedUsings { get; set; }

/// <inheritdoc />
public override void Accept(Chunk chunk)
Expand Down Expand Up @@ -89,15 +93,23 @@ protected override void Visit(UsingChunk chunk)

protected override void Visit(TagHelperChunk chunk)
{
if (Context.Host.DesignTimeMode)
{
return;
}

if (!_foundTagHelpers)
{
_foundTagHelpers = true;

if (!ImportedUsings.Contains(TagHelpersRuntimeNamespace))
foreach (var tagHelperRuntimeNamespace in TagHelpersRuntimeNamespaces)
{
// If we find TagHelpers then we need to add the TagHelper runtime namespace to our list of usings.
Writer.WriteUsing(TagHelpersRuntimeNamespace);
ImportedUsings.Add(TagHelpersRuntimeNamespace);
if (ImportedUsings.Add(tagHelperRuntimeNamespace))
{
// If we find TagHelpers then we need to add the TagHelper runtime namespaces to our list of
// usings.
Writer.WriteUsing(tagHelperRuntimeNamespace);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;

namespace Microsoft.AspNet.Razor.Compilation.TagHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Globalization;
using System.Linq;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.Extensions.Internal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Collections.Generic;
using Microsoft.AspNet.Razor.Chunks.Generators;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;

namespace Microsoft.AspNet.Razor.Parser.TagHelpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Linq;
using Microsoft.AspNet.Razor.Chunks.Generators;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.AspNet.Razor.Tokenizer.Symbols;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Diagnostics;
using System.Linq;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.Razor.TagHelpers;
using Microsoft.AspNet.Razor.Compilation.TagHelpers;
using Microsoft.AspNet.Razor.Tokenizer.Symbols;

Expand Down
Loading

0 comments on commit a8dfd3f

Please sign in to comment.