Skip to content

Commit 8d7ba22

Browse files
committed
Adding support for ReSharper AspMvc annotations.
1 parent 64acafb commit 8d7ba22

File tree

5 files changed

+595
-13
lines changed

5 files changed

+595
-13
lines changed

DevTrends.MvcDonutCaching/HtmlHelperExtensions.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Web.Mvc;
22
using System.Web.Mvc.Html;
33
using System.Web.Routing;
4+
using DevTrends.MvcDonutCaching.Annotations;
45

56
namespace DevTrends.MvcDonutCaching
67
{
@@ -27,7 +28,7 @@ public static IActionSettingsSerialiser Serialiser
2728
/// <param name="actionName">The name of the action method to invoke.</param>
2829
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
2930
/// <returns>The child action result as an HTML string.</returns>
30-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, bool excludeFromParentCache)
31+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, bool excludeFromParentCache)
3132
{
3233
return htmlHelper.Action(actionName, null, null, excludeFromParentCache);
3334
}
@@ -40,7 +41,7 @@ public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName
4041
/// <param name="routeValues">An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
4142
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
4243
/// <returns>The child action result as an HTML string.</returns>
43-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, object routeValues, bool excludeFromParentCache)
44+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
4445
{
4546
return htmlHelper.Action(actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
4647
}
@@ -53,7 +54,7 @@ public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName
5354
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
5455
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
5556
/// <returns>The child action result as an HTML string.</returns>
56-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
57+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
5758
{
5859
return htmlHelper.Action(actionName, null, routeValues, excludeFromParentCache);
5960
}
@@ -66,7 +67,7 @@ public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName
6667
/// <param name="controllerName">The name of the controller that contains the action method.</param>
6768
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
6869
/// <returns>The child action result as an HTML string.</returns>
69-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, bool excludeFromParentCache)
70+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
7071
{
7172
return htmlHelper.Action(actionName, controllerName, null, excludeFromParentCache);
7273
}
@@ -80,7 +81,7 @@ public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName
8081
/// <param name="routeValues">An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
8182
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
8283
/// <returns>The child action result as an HTML string.</returns>
83-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, bool excludeFromParentCache)
84+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
8485
{
8586
return htmlHelper.Action(actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
8687
}
@@ -92,7 +93,7 @@ public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName
9293
/// <param name="actionName">The name of the child action method to invoke.</param>
9394
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
9495

95-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, bool excludeFromParentCache)
96+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, bool excludeFromParentCache)
9697
{
9798
RenderAction(htmlHelper, actionName, null, null, excludeFromParentCache);
9899
}
@@ -105,7 +106,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, b
105106
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
106107
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
107108

108-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, object routeValues, bool excludeFromParentCache)
109+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
109110
{
110111
RenderAction(htmlHelper, actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
111112
}
@@ -117,7 +118,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, o
117118
/// <param name="actionName">The name of the child action method to invoke.</param>
118119
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
119120
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
120-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
121+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
121122
{
122123
RenderAction(htmlHelper, actionName, null, routeValues, excludeFromParentCache);
123124
}
@@ -129,7 +130,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, R
129130
/// <param name="actionName">The name of the child action method to invoke.</param>
130131
/// <param name="controllerName">The name of the controller that contains the action method.</param>
131132
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
132-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, bool excludeFromParentCache)
133+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
133134
{
134135
RenderAction(htmlHelper, actionName, controllerName, null, excludeFromParentCache);
135136
}
@@ -142,7 +143,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, s
142143
/// <param name="controllerName">The name of the controller that contains the action method.</param>
143144
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
144145
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
145-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, bool excludeFromParentCache)
146+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
146147
{
147148
RenderAction(htmlHelper, actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
148149
}
@@ -155,7 +156,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, s
155156
/// <param name="controllerName">The name of the controller that contains the action method.</param>
156157
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
157158
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
158-
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
159+
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
159160
{
160161
if (excludeFromParentCache)
161162
{
@@ -181,7 +182,7 @@ public static void RenderAction(this HtmlHelper htmlHelper, string actionName, s
181182
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
182183
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
183184
/// <returns>The child action result as an HTML string.</returns>
184-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
185+
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
185186
{
186187
if (excludeFromParentCache)
187188
{

DevTrends.MvcDonutCaching/MvcDonutCaching.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<Compile Include="MemoryCacheProvider.cs" />
8888
<Compile Include="OutputCache.cs" />
8989
<Compile Include="OutputCacheManager.cs" />
90+
<Compile Include="Properties\Annotations.cs" />
9091
<Compile Include="Properties\AssemblyInfo.cs" />
9192
</ItemGroup>
9293
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Interfaces/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Interfaces/@EntryIndexedValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Properties/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)