This commit is contained in:
2011-03-01 16:34:27 +00:00
parent 9d2f4faa33
commit 089c50befa
4 changed files with 656 additions and 119 deletions

View File

@@ -132,12 +132,15 @@ namespace VEPROMS.CSLA.Library
while (_CacheList.Count > 0) // Move Content(s) from temporary _CacheList to _CacheByPrimaryKey
{
Content tmp = _CacheList[0]; // Get the first Content
string pKey = tmp.ContentID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey))
if (!tmp.Disposed)
{
_CacheByPrimaryKey[pKey] = new List<Content>(); // Add new list for PrimaryKey
string pKey = tmp.ContentID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey))
{
_CacheByPrimaryKey[pKey] = new List<Content>(); // Add new list for PrimaryKey
}
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
}
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first Content
}
}
@@ -842,6 +845,13 @@ namespace VEPROMS.CSLA.Library
{/* require use of factory methods */
AddToCache(this);
}
private bool _Disposed = false;
public bool Disposed
{
get { return _Disposed; }
set { _Disposed = value; }
}
public void Dispose()
{
if (_MyGrid != null)
@@ -849,6 +859,7 @@ namespace VEPROMS.CSLA.Library
_MyGrid.Dispose();
_MyGrid = null;
}
Disposed = true;
RemoveFromDictionaries();
}
private void RemoveFromDictionaries()