Make sure Remaining doesn't return a negative value

This commit is contained in:
Michael Becker 2014-04-20 16:36:26 -04:00
parent 7c3b643a75
commit 9a3db87516

View File

@ -21,7 +21,15 @@ namespace UniversalEditor
private long mvarPosition = 0;
public virtual long Position { get { return mvarPosition; } set { mvarPosition = value; Seek(mvarPosition, SeekOrigin.Begin); } }
public long Remaining { get { return Length - Position; } }
public long Remaining
{
get
{
long r = Length - Position;
if (r <= 0) return 0;
return r;
}
}
public void Seek(int length, SeekOrigin position)
{