Skip to content

Commit 4ba283e

Browse files
committed
Code documentation
1 parent fdd4494 commit 4ba283e

File tree

6 files changed

+69
-2
lines changed

6 files changed

+69
-2
lines changed

DevTrends.MvcDonutCaching/CacheSettingsManager.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public class CacheSettingsManager : ICacheSettingsManager
1212
private const string AspnetInternalProviderName = "AspNetInternalProvider";
1313
private readonly OutputCacheSection _outputCacheSection;
1414

15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="CacheSettingsManager"/> class.
17+
/// </summary>
1518
public CacheSettingsManager()
1619
{
1720
try
@@ -29,13 +32,28 @@ public CacheSettingsManager()
2932
}
3033
}
3134

35+
/// <summary>
36+
/// Returns the output cache provider settings.
37+
/// </summary>
38+
/// <returns>
39+
/// A <see cref="ProviderSettings" /> instance.
40+
/// </returns>
3241
public ProviderSettings RetrieveOutputCacheProviderSettings()
3342
{
3443
return _outputCacheSection.DefaultProviderName == AspnetInternalProviderName
3544
? null
3645
: _outputCacheSection.Providers[_outputCacheSection.DefaultProviderName];
3746
}
3847

48+
/// <summary>
49+
/// Returns an output cache profile for the asked <see cref="cacheProfileName" />.
50+
/// </summary>
51+
/// <param name="cacheProfileName">Name of the cache profile.</param>
52+
/// <returns>
53+
/// A <see cref="OutputCacheProfile" /> instance.
54+
/// </returns>
55+
/// <exception cref="System.Security.SecurityException">MvcDonutCaching does not have permission to read web.config section 'OutputCacheSettingsSection'.</exception>
56+
/// <exception cref="System.Web.HttpException"></exception>
3957
public OutputCacheProfile RetrieveOutputCacheProfile(string cacheProfileName)
4058
{
4159
OutputCacheSettingsSection outputCacheSettingsSection;
@@ -62,6 +80,12 @@ public OutputCacheProfile RetrieveOutputCacheProfile(string cacheProfileName)
6280
throw new HttpException(string.Format("The '{0}' cache profile is not defined. Please define it in the configuration file.", cacheProfileName));
6381
}
6482

83+
/// <summary>
84+
/// Return a value indicating whether caching is globally enabled.
85+
/// </summary>
86+
/// <value>
87+
/// <c>true</c> if caching is globally enabled; otherwise, <c>false</c>.
88+
/// </value>
6589
public bool IsCachingEnabledGlobally
6690
{
6791
get { return _outputCacheSection.EnableOutputCache; }

DevTrends.MvcDonutCaching/DonutOutputCacheAttribute.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ public class DonutOutputCacheAttribute : ActionFilterAttribute, IExceptionFilter
2222
private bool? _noStore;
2323
private OutputCacheOptions? _options;
2424

25+
/// <summary>
26+
/// Initializes a new instance of the <see cref="DonutOutputCacheAttribute"/> class.
27+
/// </summary>
2528
public DonutOutputCacheAttribute() : this(new KeyBuilder()) { }
2629

30+
/// <summary>
31+
/// Initializes a new instance of the <see cref="DonutOutputCacheAttribute"/> class.
32+
/// </summary>
33+
/// <param name="keyBuilder">The key builder.</param>
2734
public DonutOutputCacheAttribute(IKeyBuilder keyBuilder) :
2835
this(
2936
new KeyGenerator(keyBuilder),
@@ -34,6 +41,14 @@ public DonutOutputCacheAttribute(IKeyBuilder keyBuilder) :
3441
)
3542
{ }
3643

44+
/// <summary>
45+
/// Initializes a new instance of the <see cref="DonutOutputCacheAttribute"/> class.
46+
/// </summary>
47+
/// <param name="keyGenerator">The key generator.</param>
48+
/// <param name="outputCacheManager">The output cache manager.</param>
49+
/// <param name="donutHoleFiller">The donut hole filler.</param>
50+
/// <param name="cacheSettingsManager">The cache settings manager.</param>
51+
/// <param name="cacheHeadersHelper">The cache headers helper.</param>
3752
protected DonutOutputCacheAttribute(
3853
IKeyGenerator keyGenerator, IReadWriteOutputCacheManager outputCacheManager,
3954
IDonutHoleFiller donutHoleFiller, ICacheSettingsManager cacheSettingsManager, ICacheHeadersHelper cacheHeadersHelper

DevTrends.MvcDonutCaching/HtmlHelperExtensions.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ public static class HtmlHelperExtensions
99
{
1010
private static IActionSettingsSerialiser _serialiser;
1111

12+
/// <summary>
13+
/// Gets or sets the serialiser.
14+
/// </summary>
15+
/// <value>
16+
/// The serialiser.
17+
/// </value>
1218
public static IActionSettingsSerialiser Serialiser
1319
{
1420
get
@@ -206,4 +212,4 @@ private static string GetSerialisedActionSettings(string actionName, string cont
206212
return Serialiser.Serialise(actionSettings);
207213
}
208214
}
209-
}
215+
}

DevTrends.MvcDonutCaching/MemoryCacheProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ IEnumerator IEnumerable.GetEnumerator()
4040
return GetEnumerator();
4141
}
4242
}
43-
}
43+
}

DevTrends.MvcDonutCaching/OutputCache.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ private OutputCache()
3838
{
3939
}
4040

41+
/// <summary>
42+
/// Gets the current <see cref="OutputCacheManager"/> instance.
43+
/// </summary>
4144
public static OutputCacheProvider Instance
4245
{
4346
get;

DevTrends.MvcDonutCaching/OutputCacheManager.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,35 @@ public OutputCacheManager(OutputCacheProvider outputCacheProvider, IKeyBuilder k
2323
_keyBuilder = keyBuilder;
2424
}
2525

26+
/// <summary>
27+
/// Gets the key builder.
28+
/// </summary>
29+
/// <value>
30+
/// The key builder.
31+
/// </value>
2632
public IKeyBuilder KeyBuilder
2733
{
2834
get { return _keyBuilder; }
2935
}
3036

37+
/// <summary>
38+
/// Add sthe given <see cref="cacheItem" /> in the cache.
39+
/// </summary>
40+
/// <param name="key">The cache key to add.</param>
41+
/// <param name="cacheItem">The cache item to add.</param>
42+
/// <param name="utcExpiry">The cache item UTC expiry date and time.</param>
3143
public void AddItem(string key, CacheItem cacheItem, DateTime utcExpiry)
3244
{
3345
_outputCacheProvider.Add(key, cacheItem, utcExpiry);
3446
}
3547

48+
/// <summary>
49+
/// Retrieves a cache item the given the <see cref="key" />.
50+
/// </summary>
51+
/// <param name="key">The key.</param>
52+
/// <returns>
53+
/// A <see cref="CacheItem" /> instance on cache hit, null otherwise.
54+
/// </returns>
3655
public CacheItem GetItem(string key)
3756
{
3857
return _outputCacheProvider.Get(key) as CacheItem;

0 commit comments

Comments
 (0)