* OleDbParameterCollectionTest.cs: Fix compile error in 1.1 profile.
[mono.git] / mcs / class / System.Messaging / System.Messaging / MessageQueueEnumerator.cs
index bf99bc640404aa7530c6a4662339cfbb1b89014a..e76e7596b54a4748952291a2efc2472565914940 100644 (file)
 //\r
 // (C) 2003 Peter Van Isacker\r
 //\r
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;\r
 using System.Collections;\r
 \r
-namespace System.Messaging \r
+namespace System.Messaging\r
 {\r
-       public class MessageQueueEnumerator: MarshalByRefObject, IEnumerator, IDisposable \r
+       public class MessageQueueEnumerator : MarshalByRefObject, IEnumerator, IDisposable\r
        {\r
-        // To avoid multiple disposals\r
-        private bool disposed = false;\r
+               private bool disposed;\r
                private ArrayList queueList;\r
                private int currentIndex;\r
-               \r
-               internal MessageQueueEnumerator(ArrayList queueList)\r
+\r
+               internal MessageQueueEnumerator (ArrayList queueList)\r
                {\r
                        this.queueList = queueList;\r
                        this.currentIndex = -1;\r
                }\r
 \r
-               public MessageQueue Current \r
+               public MessageQueue Current\r
                {\r
-                       get \r
+                       get\r
                        {\r
-                               if (currentIndex < 0 ||\r
-                                       currentIndex >= queueList.Count)\r
+                               if (currentIndex < 0 || currentIndex >= queueList.Count)\r
                                        return null;\r
-                               return (MessageQueue)queueList[currentIndex];\r
+                               return (MessageQueue) queueList[currentIndex];\r
                        }\r
                }\r
-               \r
-               object IEnumerator.Current \r
+\r
+               object IEnumerator.Current\r
                {\r
-                       get \r
+                       get\r
                        {\r
-                               if (currentIndex < 0 ||\r
-                                       currentIndex >= queueList.Count)\r
+                               if (currentIndex < 0 || currentIndex >= queueList.Count)\r
                                        return null;\r
                                return queueList[currentIndex];\r
                        }\r
                }\r
-               \r
-               public IntPtr LocatorHandle \r
+\r
+               public IntPtr LocatorHandle\r
                {\r
                        [MonoTODO]\r
-                       get {throw new NotImplementedException();}\r
+                       get\r
+                       {\r
+                               throw new NotImplementedException ();\r
+                       }\r
                }\r
-               \r
-               public void Close()\r
+\r
+               [MonoTODO]\r
+               public void Close ()\r
                {\r
-                       Dispose();\r
                }\r
-               \r
-               public void Dispose()\r
+\r
+               public void Dispose ()\r
                {\r
-            // Do this only at the first time\r
-            if (!this.disposed)\r
-                               Dispose(true);\r
-            disposed = true;         \r
-            // Take this object off the finalization queue \r
-            //GC.SuppressFinalize(this);\r
+                       Dispose (true);\r
+                       GC.SuppressFinalize (this);\r
                }\r
-               \r
-               protected virtual void Dispose(bool disposing)\r
+\r
+               protected virtual void Dispose (bool disposing)\r
                {\r
-                       // do nothing\r
+                       Close ();\r
+                       disposed = true;\r
                }\r
-               \r
-               public bool MoveNext()\r
+\r
+               public bool MoveNext ()\r
                {\r
-                       return (++currentIndex) < queueList.Count;                      \r
+                       return (++currentIndex) < queueList.Count;\r
                }\r
-               \r
-               public void Reset()\r
+\r
+               public void Reset ()\r
                {\r
                        currentIndex = -1;\r
                }\r
-               \r
-               ~MessageQueueEnumerator()\r
+\r
+               ~MessageQueueEnumerator ()\r
                {\r
-               if (!this.disposed)\r
-                               Dispose(false);         \r
+                       if (!disposed)\r
+                               Dispose (false);\r
                }\r
        }\r
 }\r