171 lines
8.3 KiB
C#
171 lines
8.3 KiB
C#
using System;
|
||
|
||
namespace System.Net.Cache
|
||
{
|
||
/// <summary>Defines an application's caching requirements for resources obtained by using <see cref="T:System.Net.HttpWebRequest" /> objects.</summary>
|
||
// Token: 0x02000132 RID: 306
|
||
public class HttpRequestCachePolicy : RequestCachePolicy
|
||
{
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class. </summary>
|
||
// Token: 0x06000A72 RID: 2674 RVA: 0x0001D918 File Offset: 0x0001BB18
|
||
public HttpRequestCachePolicy()
|
||
{
|
||
}
|
||
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class using the specified cache synchronization date.</summary>
|
||
/// <param name="cacheSyncDate">A <see cref="T:System.DateTime" /> object that specifies the time when resources stored in the cache must be revalidated.</param>
|
||
// Token: 0x06000A73 RID: 2675 RVA: 0x0001D920 File Offset: 0x0001BB20
|
||
public HttpRequestCachePolicy(DateTime cacheSyncDate)
|
||
{
|
||
this.cacheSyncDate = cacheSyncDate;
|
||
}
|
||
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class using the specified cache policy.</summary>
|
||
/// <param name="level">An <see cref="T:System.Net.Cache.HttpRequestCacheLevel" /> value. </param>
|
||
// Token: 0x06000A74 RID: 2676 RVA: 0x0001D930 File Offset: 0x0001BB30
|
||
public HttpRequestCachePolicy(HttpRequestCacheLevel level)
|
||
{
|
||
this.level = level;
|
||
}
|
||
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class using the specified age control and time values. </summary>
|
||
/// <param name="cacheAgeControl">One of the following <see cref="T:System.Net.Cache.HttpCacheAgeControl" /> enumeration values: <see cref="F:System.Net.Cache.HttpCacheAgeControl.MaxAge" />, <see cref="F:System.Net.Cache.HttpCacheAgeControl.MaxStale" />, or <see cref="F:System.Net.Cache.HttpCacheAgeControl.MinFresh" />.</param>
|
||
/// <param name="ageOrFreshOrStale">A <see cref="T:System.TimeSpan" /> value that specifies an amount of time. See the Remarks section for more information. </param>
|
||
/// <exception cref="T:System.ArgumentException">The value specified for the <paramref name="cacheAgeControl" /> parameter cannot be used with this constructor.</exception>
|
||
// Token: 0x06000A75 RID: 2677 RVA: 0x0001D940 File Offset: 0x0001BB40
|
||
public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan ageOrFreshOrStale)
|
||
{
|
||
switch (cacheAgeControl)
|
||
{
|
||
case HttpCacheAgeControl.MinFresh:
|
||
this.minFresh = ageOrFreshOrStale;
|
||
return;
|
||
case HttpCacheAgeControl.MaxAge:
|
||
this.maxAge = ageOrFreshOrStale;
|
||
return;
|
||
case HttpCacheAgeControl.MaxStale:
|
||
this.maxStale = ageOrFreshOrStale;
|
||
return;
|
||
}
|
||
throw new ArgumentException("ageOrFreshOrStale");
|
||
}
|
||
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class using the specified maximum age, age control value, and time value.</summary>
|
||
/// <param name="cacheAgeControl">An <see cref="T:System.Net.Cache.HttpCacheAgeControl" /> value. </param>
|
||
/// <param name="maxAge">A <see cref="T:System.TimeSpan" /> value that specifies the maximum age for resources.</param>
|
||
/// <param name="freshOrStale">A <see cref="T:System.TimeSpan" /> value that specifies an amount of time. See the Remarks section for more information. </param>
|
||
/// <exception cref="T:System.ArgumentException">The value specified for the <paramref name="cacheAgeControl" /> parameter is not valid.</exception>
|
||
// Token: 0x06000A76 RID: 2678 RVA: 0x0001D9A4 File Offset: 0x0001BBA4
|
||
public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale)
|
||
{
|
||
this.maxAge = maxAge;
|
||
switch (cacheAgeControl)
|
||
{
|
||
case HttpCacheAgeControl.MinFresh:
|
||
this.minFresh = freshOrStale;
|
||
return;
|
||
case HttpCacheAgeControl.MaxStale:
|
||
this.maxStale = freshOrStale;
|
||
return;
|
||
}
|
||
throw new ArgumentException("freshOrStale");
|
||
}
|
||
|
||
/// <summary>Initializes a new instance of the <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> class using the specified maximum age, age control value, time value, and cache synchronization date.</summary>
|
||
/// <param name="cacheAgeControl">An <see cref="T:System.Net.Cache.HttpCacheAgeControl" /> value. </param>
|
||
/// <param name="maxAge">A <see cref="T:System.TimeSpan" /> value that specifies the maximum age for resources.</param>
|
||
/// <param name="freshOrStale">A <see cref="T:System.TimeSpan" /> value that specifies an amount of time. See the Remarks section for more information. </param>
|
||
/// <param name="cacheSyncDate">A <see cref="T:System.DateTime" /> object that specifies the time when resources stored in the cache must be revalidated.</param>
|
||
// Token: 0x06000A77 RID: 2679 RVA: 0x0001DA00 File Offset: 0x0001BC00
|
||
public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale, DateTime cacheSyncDate)
|
||
: this(cacheAgeControl, maxAge, freshOrStale)
|
||
{
|
||
this.cacheSyncDate = cacheSyncDate;
|
||
}
|
||
|
||
/// <summary>Gets the cache synchronization date for this instance.</summary>
|
||
/// <returns>A <see cref="T:System.DateTime" /> value set to the date specified when this instance was created. If no date was specified, this property's value is <see cref="F:System.DateTime.MinValue" />.</returns>
|
||
// Token: 0x170002A5 RID: 677
|
||
// (get) Token: 0x06000A78 RID: 2680 RVA: 0x0001DA14 File Offset: 0x0001BC14
|
||
public DateTime CacheSyncDate
|
||
{
|
||
get
|
||
{
|
||
return this.cacheSyncDate;
|
||
}
|
||
}
|
||
|
||
/// <summary>Gets the <see cref="T:System.Net.Cache.HttpRequestCacheLevel" /> value that was specified when this instance was created.</summary>
|
||
/// <returns>A <see cref="T:System.Net.Cache.HttpRequestCacheLevel" /> value that specifies the cache behavior for resources that were obtained using <see cref="T:System.Net.HttpWebRequest" /> objects.</returns>
|
||
// Token: 0x170002A6 RID: 678
|
||
// (get) Token: 0x06000A79 RID: 2681 RVA: 0x0001DA1C File Offset: 0x0001BC1C
|
||
public new HttpRequestCacheLevel Level
|
||
{
|
||
get
|
||
{
|
||
return this.level;
|
||
}
|
||
}
|
||
|
||
/// <summary>Gets the maximum age permitted for a resource returned from the cache.</summary>
|
||
/// <returns>A <see cref="T:System.TimeSpan" /> value that is set to the maximum age value specified when this instance was created. If no date was specified, this property's value is <see cref="F:System.DateTime.MinValue" />.</returns>
|
||
// Token: 0x170002A7 RID: 679
|
||
// (get) Token: 0x06000A7A RID: 2682 RVA: 0x0001DA24 File Offset: 0x0001BC24
|
||
public TimeSpan MaxAge
|
||
{
|
||
get
|
||
{
|
||
return this.maxAge;
|
||
}
|
||
}
|
||
|
||
/// <summary>Gets the maximum staleness value that is permitted for a resource returned from the cache.</summary>
|
||
/// <returns>A <see cref="T:System.TimeSpan" /> value that is set to the maximum staleness value specified when this instance was created. If no date was specified, this property's value is <see cref="F:System.DateTime.MinValue" />.</returns>
|
||
// Token: 0x170002A8 RID: 680
|
||
// (get) Token: 0x06000A7B RID: 2683 RVA: 0x0001DA2C File Offset: 0x0001BC2C
|
||
public TimeSpan MaxStale
|
||
{
|
||
get
|
||
{
|
||
return this.maxStale;
|
||
}
|
||
}
|
||
|
||
/// <summary>Gets the minimum freshness that is permitted for a resource returned from the cache.</summary>
|
||
/// <returns>A <see cref="T:System.TimeSpan" /> value that specifies the minimum freshness specified when this instance was created. If no date was specified, this property's value is <see cref="F:System.DateTime.MinValue" />.</returns>
|
||
// Token: 0x170002A9 RID: 681
|
||
// (get) Token: 0x06000A7C RID: 2684 RVA: 0x0001DA34 File Offset: 0x0001BC34
|
||
public TimeSpan MinFresh
|
||
{
|
||
get
|
||
{
|
||
return this.minFresh;
|
||
}
|
||
}
|
||
|
||
/// <summary>Returns a string representation of this instance.</summary>
|
||
/// <returns>A <see cref="T:System.String" /> value that contains the property values for this instance.</returns>
|
||
// Token: 0x06000A7D RID: 2685 RVA: 0x0001DA3C File Offset: 0x0001BC3C
|
||
[global::System.MonoTODO]
|
||
public override string ToString()
|
||
{
|
||
throw new NotImplementedException();
|
||
}
|
||
|
||
// Token: 0x04000AE9 RID: 2793
|
||
private DateTime cacheSyncDate;
|
||
|
||
// Token: 0x04000AEA RID: 2794
|
||
private HttpRequestCacheLevel level;
|
||
|
||
// Token: 0x04000AEB RID: 2795
|
||
private TimeSpan maxAge;
|
||
|
||
// Token: 0x04000AEC RID: 2796
|
||
private TimeSpan maxStale;
|
||
|
||
// Token: 0x04000AED RID: 2797
|
||
private TimeSpan minFresh;
|
||
}
|
||
}
|