ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | Properties | List of all members
ImageResizer.Plugins.DiskCache.CleanupStrategy Class Reference
Inheritance diagram for ImageResizer.Plugins.DiskCache.CleanupStrategy:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.DiskCache.CleanupStrategy:
Collaboration graph
[legend]

Public Member Functions

 CleanupStrategy (Node n)
 
void LoadFrom (Node n)
 Loads settings from the specified node. Attribute names and property names must match. More...
 
bool MeetsCleanupCriteria (CachedFileInfo i)
 
bool MeetsOverMaxCriteria (CachedFileInfo i)
 
bool ShouldRemove (string relativePath, CachedFileInfo info, bool isOverMax)
 
override IEnumerable< IIssueGetIssues ()
 Returns a copy of the list of reported issues. More...
 
- Public Member Functions inherited from ImageResizer.Configuration.Issues.IssueSink
 IssueSink (string defaultSource)
 
virtual void AcceptIssue (IIssue i)
 Adds the specified issue to the list unless it is an exact duplicate of another instance. More...
 

Protected Member Functions

void LoadProperty (NameValueCollection data, string key)
 

Properties

TimeSpan StartupDelay [get, set]
 How long to wait before beginning the initial cache indexing and cleanup. More...
 
TimeSpan MinDelay [get, set]
 The minimum amount of time to wait after the most recent BeLazy to begin working again. More...
 
TimeSpan MaxDelay [get, set]
 The maximum amount of time to wait between work segements More...
 
TimeSpan OptimalWorkSegmentLength [get, set]
 The optimal length for a work segment. Not always achieved. More...
 
int TargetItemsPerFolder [get, set]
 The ideal number of cached files per folder. (defaults to 400) Only reached if it can be achieved without volating the AvoidRemoval... limits More...
 
int MaximumItemsPerFolder [get, set]
 The maximum number of cached files per folder. (defaults to 1000) Only reached if it can be achieved without violating the ProhibitRemoval... limits More...
 
TimeSpan AvoidRemovalIfUsedWithin [get, set]
 Please note "LastUsed" values are (initially) only accurate to about a hour, due to delayed write. If a file has been used after the app started running, the the last used date is accurate. More...
 
TimeSpan AvoidRemovalIfCreatedWithin [get, set]
 
TimeSpan ProhibitRemovalIfUsedWithin [get, set]
 Please note "LastUsed" values are (initially) only accurate to about a hour, due to delayed write. If a file has been used after the app started running, the the last used date is accurate. More...
 
TimeSpan ProhibitRemovalIfCreatedWithin [get, set]
 

Additional Inherited Members

- Protected Attributes inherited from ImageResizer.Configuration.Issues.IssueSink
string defaultSource = null
 

Detailed Description

Definition at line 12 of file CleanupStrategy.cs.

Member Function Documentation

override IEnumerable<IIssue> ImageResizer.Plugins.DiskCache.CleanupStrategy.GetIssues ( )
inlinevirtual

Returns a copy of the list of reported issues.

Returns

Reimplemented from ImageResizer.Configuration.Issues.IssueSink.

Definition at line 197 of file CleanupStrategy.cs.

197  {
198  List<IIssue> issues = new List<IIssue>(base.GetIssues());
199  Type t = this.GetType();
200  StringBuilder sb = new StringBuilder();
201  foreach(string s in defaults.Keys){
202  PropertyInfo pi = t.GetProperty(s);
203  object v = pi.GetValue(this,null);
204  if (!v.Equals(defaults[s]))
205  sb.AppendLine(s + " has been changed to " + v.ToString() + " instead of the suggested value, " + defaults[s].ToString());
206  }
207  if (sb.Length > 0)
208  issues.Add(new Issue( "The cleanup strategy settings have been changed. This is not advised, and may have ill effects. " +
209  "\nThe default settings for the cleanup strategy were carefully chosen, and should not be changed except at the suggestion of the author.\n" + sb.ToString(), IssueSeverity.Warning));
210 
211  return issues;
212  }
void ImageResizer.Plugins.DiskCache.CleanupStrategy.LoadFrom ( Node  n)
inline

Loads settings from the specified node. Attribute names and property names must match.

Parameters
n

Definition at line 28 of file CleanupStrategy.cs.

28  {
29  if (n == null) return;
30  foreach (string s in properties)
31  LoadProperty(n.Attrs, s);
32  }
NameValueCollection Attrs
Attributes
Definition: Node.cs:56

Property Documentation

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.AvoidRemovalIfUsedWithin
getset

Please note "LastUsed" values are (initially) only accurate to about a hour, due to delayed write. If a file has been used after the app started running, the the last used date is accurate.

Definition at line 147 of file CleanupStrategy.cs.

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.MaxDelay
getset

The maximum amount of time to wait between work segements

Definition at line 109 of file CleanupStrategy.cs.

int ImageResizer.Plugins.DiskCache.CleanupStrategy.MaximumItemsPerFolder
getset

The maximum number of cached files per folder. (defaults to 1000) Only reached if it can be achieved without violating the ProhibitRemoval... limits

Definition at line 136 of file CleanupStrategy.cs.

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.MinDelay
getset

The minimum amount of time to wait after the most recent BeLazy to begin working again.

Definition at line 101 of file CleanupStrategy.cs.

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.OptimalWorkSegmentLength
getset

The optimal length for a work segment. Not always achieved.

Definition at line 118 of file CleanupStrategy.cs.

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.ProhibitRemovalIfUsedWithin
getset

Please note "LastUsed" values are (initially) only accurate to about a hour, due to delayed write. If a file has been used after the app started running, the the last used date is accurate.

Definition at line 164 of file CleanupStrategy.cs.

TimeSpan ImageResizer.Plugins.DiskCache.CleanupStrategy.StartupDelay
getset

How long to wait before beginning the initial cache indexing and cleanup.

Definition at line 92 of file CleanupStrategy.cs.

int ImageResizer.Plugins.DiskCache.CleanupStrategy.TargetItemsPerFolder
getset

The ideal number of cached files per folder. (defaults to 400) Only reached if it can be achieved without volating the AvoidRemoval... limits

Definition at line 128 of file CleanupStrategy.cs.


The documentation for this class was generated from the following file: