diff options
Diffstat (limited to 'mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs')
-rwxr-xr-x | mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs b/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs deleted file mode 100755 index c2821892a26..00000000000 --- a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// System.Runtime.Serialization.ObjectIDGenerator.cs -// -// Author: Duncan Mak (duncan@ximian.com) -// -// (C) Ximian, Inc. -// - -using System; -using System.Collections; -using System.Runtime.Serialization; - -namespace System.Runtime.Serialization -{ - [Serializable] - public class ObjectIDGenerator - { - // Private field - Hashtable table; - long current; // this is the current ID, starts at 1 - - // constructor - public ObjectIDGenerator () - : base () - { - table = new Hashtable (); - current = 1; - } - - // Methods - public virtual long GetId (object obj, out bool firstTime) - { - if (obj == null) - throw new ArgumentNullException ("The obj parameter is null."); - - if (table.ContainsKey (obj)) { - firstTime = false; - return (long) table [obj]; - - } else { - firstTime = true; - table.Add (obj, current); - return current ++; - } - } - - public virtual long HasId (object obj, out bool firstTime) - { - if (obj == null) - throw new ArgumentNullException ("The obj parameter is null."); - - if (table.ContainsKey (obj)) { - firstTime = false; - return (long) table [obj]; - - } else { - firstTime = true; - return 0L; // 0 is the null ID - } - } - } -} |