// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
-#if NET_2_0
using System;
using System.Collections.Specialized;
bool modified;
bool readOnly;
+ int originalStringHash = 0;
public bool IsModified {
- get { return modified; }
+ get {
+ if (modified)
+ return true;
+
+ string str = ToString ();
+ if (str == null)
+ return false;
+
+ return str.GetHashCode () != originalStringHash;
+ }
}
public new bool IsReadOnly {
CopyTo (contents, 0);
col.AddRange (contents);
+ col.originalStringHash = originalStringHash;
return col;
}
return String.Join (",", contents);
}
+
+ internal void UpdateStringHash ()
+ {
+ string str = ToString ();
+ if (str == null)
+ originalStringHash = 0;
+ else
+ originalStringHash = str.GetHashCode ();
+ }
}
}
-
-#endif