internal void SetCacheDependencyChanged(ICacheDependencyChanged objNotify) { this._bits[0x20] = true; if (!this._bits[8]) { this._objNotify = objNotify; } }
internal void SetCacheDependencyChanged(ICacheDependencyChanged objNotify) { throw new NotImplementedException(); //_bits[32] = true; //if (!_bits[8]) //{ // _objNotify = objNotify; //} }
// // Add/remove an NotifyDependencyChanged notification. // internal void SetCacheDependencyChanged(ICacheDependencyChanged objNotify) { Debug.Assert(_objNotify == null, "_objNotify == null"); // Set this bit just in case our derived ctor forgot to call FinishInit() _bits[DERIVED_INIT] = true; if (!_bits[BASE_DISPOSED]) { _objNotify = objNotify; } }
protected void NotifyDependencyChanged(object sender, EventArgs e) { if (this._bits.ChangeValue(4, true)) { this._utcLastModified = DateTime.UtcNow; ICacheDependencyChanged changed = this._objNotify; if ((changed != null) && !this._bits[8]) { changed.DependencyChanged(sender, e); } this.DisposeInternal(); } }
private void DisposeOurself() { object obj2 = this._depFileInfos; object obj3 = this._entries; this._objNotify = null; this._depFileInfos = null; this._entries = null; if (obj2 != null) { FileChangesMonitor fileChangesMonitor = HttpRuntime.FileChangesMonitor; DepFileInfo info = obj2 as DepFileInfo; if (info != null) { fileChangesMonitor.StopMonitoringPath(info._filename, this); } else { DepFileInfo[] infoArray = (DepFileInfo[])obj2; foreach (DepFileInfo info2 in infoArray) { string alias = info2._filename; if (alias != null) { fileChangesMonitor.StopMonitoringPath(alias, this); } } } } if (obj3 != null) { CacheEntry entry = obj3 as CacheEntry; if (entry != null) { entry.RemoveCacheDependencyNotify(this); } else { CacheEntry[] entryArray = (CacheEntry[])obj3; foreach (CacheEntry entry2 in entryArray) { if (entry2 != null) { entry2.RemoveCacheDependencyNotify(this); } } } } }
// // This object has changed, so fire the NotifyDependencyChanged event. // We only allow this event to be fired once. // protected void NotifyDependencyChanged(Object sender, EventArgs e) { if (_bits.ChangeValue(CHANGED, true)) { _utcLastModified = DateTime.UtcNow; ICacheDependencyChanged objNotify = _objNotify; if (objNotify != null && !_bits[BASE_DISPOSED]) { Debug.Trace("CacheDependencyNotifyDependencyChanged", "change occurred"); objNotify.DependencyChanged(sender, e); } DisposeInternal(); } }
void DisposeOurself() { // guarantee that we execute only once if an exception // is thrown from this function by nulling fields before // we access them object l_depFileInfos = _depFileInfos; object l_entries = _entries; _objNotify = null; _depFileInfos = null; _entries = null; // stop monitoring files if (l_depFileInfos != null) { FileChangesMonitor fmon = HttpRuntime.FileChangesMonitor; DepFileInfo oneDepFileInfo = l_depFileInfos as DepFileInfo; if (oneDepFileInfo != null) { fmon.StopMonitoringPath(oneDepFileInfo._filename, this); } else { DepFileInfo[] depFileInfos = (DepFileInfo[]) l_depFileInfos; foreach (DepFileInfo depFileInfo in depFileInfos) { // ensure that we handle partially contructed // objects by checking filename for null string filename = depFileInfo._filename; if (filename != null) { fmon.StopMonitoringPath(filename, this); } } } } // stop monitoring cache items if (l_entries != null) { CacheEntry oneEntry = l_entries as CacheEntry; if (oneEntry != null) { oneEntry.RemoveCacheDependencyNotify(this); } else { CacheEntry[] entries = (CacheEntry[]) l_entries; foreach (CacheEntry entry in entries) { // ensure that we handle partially contructed // objects by checking entry for null if (entry != null) { entry.RemoveCacheDependencyNotify(this); } } } } #if USE_MEMORY_CACHE if (_fileChangeMonitor != null) { _fileChangeMonitor.Dispose(); } if (_entryChangeMonitor != null) { _entryChangeMonitor.Dispose(); } #endif }
void DisposeOurself() { // guarantee that we execute only once if an exception // is thrown from this function by nulling fields before // we access them object l_depFileInfos = _depFileInfos; object l_entries = _entries; _objNotify = null; _depFileInfos = null; _entries = null; // stop monitoring files if (l_depFileInfos != null) { FileChangesMonitor fmon = HttpRuntime.FileChangesMonitor; DepFileInfo oneDepFileInfo = l_depFileInfos as DepFileInfo; if (oneDepFileInfo != null) { fmon.StopMonitoringPath(oneDepFileInfo._filename, this); } else { DepFileInfo[] depFileInfos = (DepFileInfo[])l_depFileInfos; foreach (DepFileInfo depFileInfo in depFileInfos) { // ensure that we handle partially contructed // objects by checking filename for null string filename = depFileInfo._filename; if (filename != null) { fmon.StopMonitoringPath(filename, this); } } } } // stop monitoring cache items if (l_entries != null) { CacheEntry oneEntry = l_entries as CacheEntry; if (oneEntry != null) { oneEntry.RemoveCacheDependencyNotify(this); } else { CacheEntry[] entries = (CacheEntry[])l_entries; foreach (CacheEntry entry in entries) { // ensure that we handle partially contructed // objects by checking entry for null if (entry != null) { entry.RemoveCacheDependencyNotify(this); } } } } #if USE_MEMORY_CACHE if (_fileChangeMonitor != null) { _fileChangeMonitor.Dispose(); } if (_entryChangeMonitor != null) { _entryChangeMonitor.Dispose(); } #endif }
private void DisposeOurself() { object obj2 = this._depFileInfos; object obj3 = this._entries; this._objNotify = null; this._depFileInfos = null; this._entries = null; if (obj2 != null) { FileChangesMonitor fileChangesMonitor = HttpRuntime.FileChangesMonitor; DepFileInfo info = obj2 as DepFileInfo; if (info != null) { fileChangesMonitor.StopMonitoringPath(info._filename, this); } else { DepFileInfo[] infoArray = (DepFileInfo[]) obj2; foreach (DepFileInfo info2 in infoArray) { string alias = info2._filename; if (alias != null) { fileChangesMonitor.StopMonitoringPath(alias, this); } } } } if (obj3 != null) { CacheEntry entry = obj3 as CacheEntry; if (entry != null) { entry.RemoveCacheDependencyNotify(this); } else { CacheEntry[] entryArray = (CacheEntry[]) obj3; foreach (CacheEntry entry2 in entryArray) { if (entry2 != null) { entry2.RemoveCacheDependencyNotify(this); } } } } }