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

Commit

Permalink
Correct XML comment syntax
Browse files Browse the repository at this point in the history
- fix problems at least with Roslyn compiler and VS IntelliSense or the Object Browser
 - `<see langref="keyword"/>` generates nothing
 - `<example>` at top level (outside `<summary>`) generates nothing
 - curly braces don't become angle brackets outside `<see cref="reference"/>` references
  - yeah, a point @yishaigalatzer asked about in a previous PR
- `<see href="reference"/>` is not valid
- correct some invalid use of angle brackets and remove useless empty elements
- correct unresolved XML comment references; generally, add namespace prefix

Symptoms for some of the above issues included
- generated XML comments such as `<!-- Badly formed XML comment ... -->`, usually indicating an unclosed element
- generated XML attributes such as `cref="!:..."`, indicating a broken reference
 - in a couple of cases we had `<typeparamref cref="TOption"/>`; attribute should be `"name"`

Few wording changes beyond
- `"opening </form> tag"` -> `"<form> start tag"`
- `"closing </form> tag"` -> `"</form> end tag"`

Also correct two typos in `HtmlHelper`

Will create a unit test to ensure XML syntax doesn't degrade going forward.  Separate PR.
- for now, check using `dir -r *.xml | sls '!'`
  • Loading branch information
dougbu committed Aug 5, 2014
1 parent eaee277 commit 8ab11bc
Show file tree
Hide file tree
Showing 25 changed files with 136 additions and 119 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Mvc.Core/ExpiringFileInfoCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.AspNet.Mvc.Core
{
/// <summary>
/// A default implementation for the <see cref="IFileInfoCache" interface./>
/// A default implementation for the <see cref="IFileInfoCache"/> interface.
/// </summary>
public class ExpiringFileInfoCache : IFileInfoCache
{
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.AspNet.Mvc.Core/FormContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.Rendering;

namespace Microsoft.AspNet.Mvc
{
Expand All @@ -14,8 +13,8 @@ public class FormContext
private Dictionary<string, object> _formData;

/// <summary>
/// Property bag for any information you wish to associate with a {form/} in an <see cref="IHtmlHelper"/>
/// implementation or extension method.
/// Property bag for any information you wish to associate with a &lt;form/&gt; in an
/// <see cref="Rendering.IHtmlHelper"/> implementation or extension method.
/// </summary>
public IDictionary<string, object> FormData
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ public static MediaTypeWithQualityHeaderValueComparer QualityComparer
get { return _mediaTypeComparer; }
}

/// <summary>
/// Compares two <see cref="MediaTypeWithQualityHeaderValue"/> based on their quality value
/// (a.k.a their "q-value"). Values with identical q-values are considered equal (i.e the result is 0)
/// with the exception that sub-type wild-cards are considered less than specific media types and full
/// wild-cards are considered less than sub-type wild-cards. This allows to sort a sequence of
/// <see cref="MediaTypeWithQualityHeaderValue"/> following their q-values in the order of specific
/// media types, sub-type wildcards, and last any full wild-cards.
/// </summary>
/// <param name="mediaType1">The first <see cref="MediaTypeWithQualityHeaderValue"/> to compare.</param>
/// <param name="mediaType2">The second <see cref="MediaTypeWithQualityHeaderValue"/> to compare.</param>
/// <returns></returns>
/// <inheritdoc />
/// <remarks>
/// Performs comparisons based on the arguments' quality values
/// (aka their "q-value"). Values with identical q-values are considered equal (i.e. the result is 0)
/// with the exception that subtype wildcards are considered less than specific media types and full
/// wildcards are considered less than subtype wildcards. This allows callers to sort a sequence of
/// <see cref="MediaTypeWithQualityHeaderValue"/> following their q-values in the order of specific
/// media types, subtype wildcards, and last any full wildcards.
/// </remarks>
public int Compare(MediaTypeWithQualityHeaderValue mediaType1, MediaTypeWithQualityHeaderValue mediaType2)
{
if (object.ReferenceEquals(mediaType1, mediaType2))
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Mvc.Core/IExpiringFileInfoCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface IFileInfoCache
/// Returns a cached <see cref="IFileInfo" /> for a given path.
/// </summary>
/// <param name="virtualPath">The virtual path.</param>
/// <returns></returns>
/// <returns>The cached <see cref="IFileInfo"/>.</returns>
IFileInfo GetFileInfo(string virtualPath);
}
}
13 changes: 8 additions & 5 deletions src/Microsoft.AspNet.Mvc.Core/MvcOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public AntiForgeryOptions AntiForgeryOptions
}

public List<OutputFormatterDescriptor> OutputFormatters { get; private set; }

/// <summary>
/// Provides programmatic configuration for the default <see cref="IViewEngine" />.
/// Provides programmatic configuration for the default <see cref="Rendering.IViewEngine" />.
/// </summary>
public RazorViewEngineOptions ViewEngineOptions
{
Expand All @@ -75,17 +75,20 @@ public RazorViewEngineOptions ViewEngineOptions
}

/// <summary>
/// Get a list of the <see cref="ModelBinderDescriptor" /> used by the <see cref="CompositeModelBinder" />.
/// Get a list of the <see cref="ModelBinderDescriptor" /> used by the
/// <see cref="ModelBinding.CompositeModelBinder" />.
/// </summary>
public List<ModelBinderDescriptor> ModelBinders { get; private set; }

/// <summary>
/// Gets a list of descriptors that represent <see cref="IViewEngine"/> used by this application.
/// Gets a list of descriptors that represent <see cref="Rendering.IViewEngine"/> used
/// by this application.
/// </summary>
public List<ViewEngineDescriptor> ViewEngines { get; private set; }

/// <summary>
/// Gets a list of descriptors that represent <see cref="IValueProviderFactory"/> used by this application.
/// Gets a list of descriptors that represent
/// <see cref="ModelBinding.IValueProviderFactory"/> used by this application.
/// </summary>
public List<ValueProviderFactoryDescriptor> ValueProviderFactories { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ModelBinderDescriptor : OptionDescriptor<IModelBinder>
/// <summary>
/// Creates a new instance of <see cref="ModelBinderDescriptor"/>.
/// </summary>
/// <param name="type">A type that represents a <see cref="IModelBinder"/>.
/// <param name="type">A type that represents a <see cref="IModelBinder"/>.</param>
public ModelBinderDescriptor([NotNull] Type type)
: base(type)
{
Expand All @@ -23,7 +23,7 @@ public ModelBinderDescriptor([NotNull] Type type)
/// <summary>
/// Creates a new instance of <see cref="ModelBinderDescriptor"/> with the specified instance.
/// </summary>
/// <param name="option">An instance of <see cref="IModelBinder"/>.
/// <param name="option">An instance of <see cref="IModelBinder"/>.</param>
public ModelBinderDescriptor([NotNull] IModelBinder binder)
: base(binder)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class OptionDescriptor<TOption>
/// <summary>
/// Creates a new instance of <see cref="OptionDescriptor{TOption}"/>.
/// </summary>
/// <param name="type">A type that represents <typeparamref name="TOption"/>.
/// <param name="type">A type that represents <typeparamref name="TOption"/>.</param>
public OptionDescriptor([NotNull] Type type)
{
var optionType = typeof(TOption);
Expand All @@ -31,15 +31,15 @@ public OptionDescriptor([NotNull] Type type)
/// <summary>
/// Creates a new instance of <see cref="OptionDescriptor{TOption}"/> with the specified instance.
/// </summary>
/// <param name="option">An instance of <typeparamref cref="TOption"/> that the descriptor represents.</param>
/// <param name="option">An instance of <typeparamref name="TOption"/> that the descriptor represents.</param>
public OptionDescriptor([NotNull] TOption option)
{
Instance = option;
OptionType = option.GetType();
}

/// <summary>
/// Gets the type of the <typeparamref cref="TOption"/> described by this
/// Gets the type of the <typeparamref name="TOption"/> described by this
/// <see cref="OptionDescriptor{TOption}"/>.
/// </summary>
public Type OptionType
Expand All @@ -49,7 +49,7 @@ public Type OptionType
}

/// <summary>
/// Gets the instance of <typeparamref cref="TOption"/> described by this
/// Gets the instance of <typeparamref name="TOption"/> described by this
/// <see cref="OptionDescriptor{TOption}"/>.
/// </summary>
public TOption Instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class OutputFormatterDescriptor : OptionDescriptor<IOutputFormatter>
/// <summary>
/// Creates a new instance of <see cref="OutputFormatterDescriptor"/>.
/// </summary>
/// <param name="type">A <see cref="IOutputFormatter/> type that the descriptor represents.
/// <param name="type">A <see cref="IOutputFormatter"/> type that the descriptor represents.
/// </param>
public OutputFormatterDescriptor([NotNull] Type type)
: base(type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ValueProviderFactoryDescriptor : OptionDescriptor<IValueProviderFac
/// <summary>
/// Creates a new instance of <see cref="ValueProviderFactoryDescriptor"/>.
/// </summary>
/// <param name="type">The <see cref="IValueProviderFactory/> type that the descriptor represents.</param>
/// <param name="type">The <see cref="IValueProviderFactory"/> type that the descriptor represents.</param>
public ValueProviderFactoryDescriptor([NotNull] Type type)
: base(type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ViewEngineDescriptor : OptionDescriptor<IViewEngine>
/// <summary>
/// Creates a new instance of <see cref="ViewEngineDescriptor"/>.
/// </summary>
/// <param name="type">The <see cref="IViewEngine/> type that the descriptor represents.</param>
/// <param name="type">The <see cref="IViewEngine"/> type that the descriptor represents.</param>
public ViewEngineDescriptor([NotNull] Type type)
: base(type)
{
Expand Down
10 changes: 6 additions & 4 deletions src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace Microsoft.AspNet.Mvc.Rendering
{
/// <summary>
/// Default implementation of non-generic portions of <see cref="IHtmlHelper{T}">.
/// Default implementation of non-generic portions of <see cref="IHtmlHelper{TModel}"/>.
/// </summary>
public class HtmlHelper : IHtmlHelper, ICanHasViewContext
{
Expand Down Expand Up @@ -125,11 +125,11 @@ public HtmlString ActionLink(
///
/// If the object is already an <see cref="IDictionary{string, object}"/> instance, then it is
/// returned as-is.
/// </summary>
/// <example>
/// <c>new { property_name = "value" }</c> will translate to the entry <c>{ "property_name" , "value" }</c>
/// in the resulting dictionary.
/// </example>
/// </summary>
/// <param name="obj">The object to be converted.</param>
/// <returns>The created dictionary of property names and property values.</returns>
public static IDictionary<string, object> ObjectToDictionary(object obj)
Expand Down Expand Up @@ -628,7 +628,7 @@ protected virtual HtmlString GenerateEditor(ModelMetadata metadata, string htmlF
}

/// <summary>
/// Writes an opening <form> tag to the response. When the user submits the form,
/// Renders a &lt;form&gt; start tag to the response. When the user submits the form,
/// the request will be processed by an action method.
/// </summary>
/// <param name="actionName">The name of the action method.</param>
Expand All @@ -640,7 +640,9 @@ protected virtual HtmlString GenerateEditor(ModelMetadata metadata, string htmlF
/// <param name="method">The HTTP method for processing the form, either GET or POST.</param>
/// <param name="htmlAttributes">An <see cref="IDictionary{string, object}"/> instance containing HTML
/// attributes to set for the element.</param>
/// <returns>An <see cref="MvcForm"/> instance which emits the closing {form} tag when disposed.</returns>
/// <returns>
/// An <see cref="MvcForm"/> instance which emits the &lt;/form&gt; end tag when disposed.
/// </returns>
protected virtual MvcForm GenerateForm(string actionName, string controllerName, object routeValues,
FormMethod method, IDictionary<string, object> htmlAttributes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class HtmlHelperDisplayNameExtensions
/// Returns the display name for the current model.
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <returns>A <see langref="string"/> containing the display name.</returns>
/// <returns>A <see cref="String"/> containing the display name.</returns>
public static string DisplayNameForModel([NotNull] this IHtmlHelper htmlHelper)
{
return htmlHelper.DisplayName(string.Empty);
Expand All @@ -27,12 +27,12 @@ public static string DisplayNameForModel([NotNull] this IHtmlHelper htmlHelper)
/// if the current model represents a collection.
/// </summary>
/// <param name="htmlHelper">
/// The <see cref="IHtmlHelper{IEnumerable<TModelItem>}"/> instance this method extends.
/// The <see cref="IHtmlHelper{IEnumerable{TModelItem}}"/> instance this method extends.
/// </param>
/// <param name="expression">The expression to be evaluated against an item in the current model.</param>
/// <typeparam name="TModelItem">The <see cref="Type"/> of items in the model collection.</typeparam>
/// <typeparam name="TValue">The <see cref="Type"/> of the <param name="expression"> result.</typeparam>
/// <returns>A <see langref="string"/> containing the display name.</returns>
/// <typeparam name="TModelItem">The type of items in the model collection.</typeparam>
/// <typeparam name="TValue">The type of the <paramref name="expression"/> result.</typeparam>
/// <returns>A <see cref="String"/> containing the display name.</returns>
public static string DisplayNameFor<TModelItem, TValue>(
[NotNull] this IHtmlHelper<IEnumerable<TModelItem>> htmlHelper,
[NotNull] Expression<Func<TModelItem, TValue>> expression)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class HtmlHelperNameExtensions
/// Returns the full HTML element name for the current model.
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <returns>A <see langref="string"/> containing the element name.</returns>
/// <returns>A <see cref="System.String"/> containing the element name.</returns>
public static string NameForModel([NotNull] this IHtmlHelper htmlHelper)
{
return htmlHelper.Name(string.Empty);
Expand All @@ -22,7 +22,7 @@ public static string NameForModel([NotNull] this IHtmlHelper htmlHelper)
/// Returns the HTML element Id for the current model.
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <returns>A <see langref="string"/> containing the element Id.</returns>
/// <returns>A <see cref="System.String"/> containing the element Id.</returns>
public static string IdForModel([NotNull] this IHtmlHelper htmlHelper)
{
return htmlHelper.Id(string.Empty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static class HtmlHelperValueExtensions
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <param name="name">Expression name, relative to the current model.</param>
/// <returns>A <see langref="string"/> containing the formatted value.</returns>
/// <returns>A <see cref="String"/> containing the formatted value.</returns>
/// <remarks>
/// Converts the expression <paramref name="name"/> result to a <see langref="string"/> directly.
/// Converts the expression <paramref name="name"/> result to a <see cref="String"/> directly.
/// </remarks>
public static string Value([NotNull] this IHtmlHelper htmlHelper, string name)
{
Expand All @@ -30,11 +30,11 @@ public static string Value([NotNull] this IHtmlHelper htmlHelper, string name)
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper{TModel}"/> instance this method extends.</param>
/// <param name="expression">The expression to be evaluated against the current model.</param>
/// <typeparam name="TModel">The <see cref="Type"/> of the model.</typeparam>
/// <typeparam name="TProperty">The <see cref="Type"/> of the <param name="expression"> result.</typeparam>
/// <returns>A <see langref="string"/> containing the formatted value.</returns>
/// <typeparam name="TModel">The type of the model.</typeparam>
/// <typeparam name="TProperty">The type of the <paramref name="expression"/> result.</typeparam>
/// <returns>A <see cref="String"/> containing the formatted value.</returns>
/// <remarks>
/// Converts the <paramref name="expression"/> result to a <see langref="string"/> directly.
/// Converts the <paramref name="expression"/> result to a <see cref="String"/> directly.
/// </remarks>
public static string ValueFor<TModel, TProperty>(
[NotNull] this IHtmlHelper<TModel> htmlHelper,
Expand All @@ -47,9 +47,9 @@ public static string ValueFor<TModel, TProperty>(
/// Returns the formatted value for the current model.
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <returns>A <see langref="string"/> containing the formatted value.</returns>
/// <returns>A <see cref="String"/> containing the formatted value.</returns>
/// <remarks>
/// Converts the model value to a <see langref="string"/> directly.
/// Converts the model value to a <see cref="String"/> directly.
/// </remarks>
public static string ValueForModel([NotNull] this IHtmlHelper htmlHelper)
{
Expand All @@ -61,12 +61,12 @@ public static string ValueForModel([NotNull] this IHtmlHelper htmlHelper)
/// </summary>
/// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
/// <param name="format">
/// The composite format <see langref="string"/> (see http://msdn.microsoft.com/en-us/library/txafckwd.aspx).
/// The composite format <see cref="String"/> (see http://msdn.microsoft.com/en-us/library/txafckwd.aspx).
/// </param>
/// <returns>A <see langref="string"/> containing the formatted value.</returns>
/// <returns>A <see cref="String"/> containing the formatted value.</returns>
/// <remarks>
/// Converts the model value to a <see langref="string"/> directly if
/// <paramref name="format"/> is <see langref="null"/> or empty.
/// Converts the model value to a <see cref="String"/> directly if
/// <paramref name="format"/> is <c>null</c> or empty.
/// </remarks>
public static string ValueForModel([NotNull] this IHtmlHelper htmlHelper, string format)
{
Expand Down
Loading

0 comments on commit 8ab11bc

Please sign in to comment.