Fixed infinite loop problem in IsDirty and IsValid
This commit is contained in:
@@ -247,11 +247,30 @@ namespace VEPROMS.CSLA.Library
|
||||
private byte[] _LastChanged = new byte[8];//timestamp
|
||||
public override bool IsDirty
|
||||
{
|
||||
get { return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirty) || (_MyROFst == null ? false : _MyROFst.IsDirty); }
|
||||
get
|
||||
{
|
||||
if ( base.IsDirty )
|
||||
return true;
|
||||
return IsDirtyList(new List<object>());
|
||||
}
|
||||
}
|
||||
public bool IsDirtyList(List<object> list)
|
||||
{
|
||||
if (base.IsDirty || list.Contains(this))
|
||||
return base.IsDirty;
|
||||
list.Add(this);
|
||||
return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirtyList(list)) || (_MyROFst == null ? false : _MyROFst.IsDirtyList(list));
|
||||
}
|
||||
public override bool IsValid
|
||||
{
|
||||
get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); }
|
||||
get { return IsValidList(new List<object>()); }
|
||||
}
|
||||
public bool IsValidList(List<object> list)
|
||||
{
|
||||
if(list.Contains(this))
|
||||
return (IsNew && !IsDirty) ? true : base.IsValid;
|
||||
list.Add(this);
|
||||
return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid);
|
||||
}
|
||||
// TODO: Replace base Association.ToString function as necessary
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user