Redesigned the Collection framework to incorporate a more general variant of the ObservableCollection<> class; ParentingCollection class now makes use of this new inbetween class; ParentingCollection now has a cleaner way to dispose its members than the original InternalDispose() method

git-svn-id: file:///srv/devel/repo-conversion/nusu@37 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2007-07-10 19:25:18 +00:00
parent 4933604495
commit ba1cee917d
10 changed files with 218 additions and 163 deletions

View file

@ -174,7 +174,7 @@ namespace Nuclex.Support.Collections {
// stream to contain the remainder of the data.
if(count > linearAvailable) {
if(count > (linearAvailable + this.startIndex))
throw new OverflowException("Data does not fit in Ringbuffer");
throw new OverflowException("Data does not fit in buffer");
this.ringBuffer.Position = this.endIndex;
this.ringBuffer.Write(buffer, offset, linearAvailable);
@ -197,7 +197,7 @@ namespace Nuclex.Support.Collections {
// to write cannot be fragmented. Example: |#####>-------<#####|
} else {
if(count > (this.startIndex - this.endIndex))
throw new OverflowException("Data does not fit in Ringbuffer");
throw new OverflowException("Data does not fit in buffer");
// Because the gap isn't fragmented, we can be sure that a single
// write call will suffice.
@ -241,9 +241,9 @@ namespace Nuclex.Support.Collections {
/// <remarks>
/// This field is required to differentiate between the ring buffer being
/// filled to the limit and being totally empty in the case that
/// the start index and the end index are the same.
/// the start index and the end index are the same.
/// </remarks>
bool empty;
private bool empty;
}