Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs')
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs62
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
- }
- }
- }
-}