AjaxCacheAttribute.cs
上传用户:szgaoree
上传日期:2009-01-05
资源大小:74k
文件大小:1k
- using System;
- namespace AjaxPro
- {
- [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
- public class AjaxServerCacheAttribute : Attribute
- {
- private TimeSpan cacheDuration;
- private bool isCacheEnabled = false;
-
- public AjaxServerCacheAttribute(int seconds)
- {
- if(seconds > 0)
- {
- cacheDuration = new TimeSpan(0, 0, 0, seconds, 0);
- isCacheEnabled = true;
- }
- }
- #region Internal Properties
- internal bool IsCacheEnabled
- {
- get
- {
- return isCacheEnabled;
- }
- }
- internal TimeSpan CacheDuration
- {
- get
- {
- return cacheDuration;
- }
- }
- #endregion
- }
- }