private void status_OnDataChanged(object sender, UploadStatusEventArgs e) { //Store the status class to the Cache of the current context. UploadStatus status = sender as UploadStatus; if (e.context.Cache[_cacheContainer] == null) { e.context.Cache.Add(_cacheContainer, status, null, DateTime.Now.AddDays(1), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } else { e.context.Cache[_cacheContainer] = status; } }
private void status_OnDataChanged(object sender, UploadStatusEventArgs e) { // 保存status class到缓存的当前内容. UploadStatus status = sender as UploadStatus; if (e.context.Cache[_cacheContainer] == null) { e.context.Cache.Add(_cacheContainer, status, null, DateTime.Now.AddDays(1), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } else { e.context.Cache[_cacheContainer] = status; } }