* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / corlib / Mono.Security.X509 / X509Extensions.cs
index 49ce3a2eeab6947997abaa78fbf8861c433bbd0e..da2de3c0d09ca65e1af8d1d1b9fd2d5609395aeb 100644 (file)
@@ -8,6 +8,29 @@
 // (C) 2004 Novell (http://www.novell.com)
 //
 
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// 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;
 using System.Collections;
 
@@ -47,45 +70,45 @@ namespace Mono.Security.X509 {
 
                public int Add (X509Extension extension) 
                {
-                       if (extension == null)\r
-                               throw new ArgumentNullException ("extension");\r
+                       if (extension == null)
+                               throw new ArgumentNullException ("extension");
                        if (readOnly)
                                throw new NotSupportedException ("Extensions are read only");
-               \r
-                       return InnerList.Add (extension);\r
+               
+                       return InnerList.Add (extension);
                }
 
-               public void AddRange (X509Extension[] extension) \r
-               {\r
-                       if (extension == null)\r
-                               throw new ArgumentNullException ("extension");\r
+               public void AddRange (X509Extension[] extension) 
+               {
+                       if (extension == null)
+                               throw new ArgumentNullException ("extension");
                        if (readOnly)
                                throw new NotSupportedException ("Extensions are read only");
-\r
-                       for (int i = 0; i < extension.Length; i++) \r
-                               InnerList.Add (extension [i]);\r
-               }\r
-       \r
-               public void AddRange (X509ExtensionCollection collection) \r
-               {\r
-                       if (collection == null)\r
-                               throw new ArgumentNullException ("collection");\r
+
+                       for (int i = 0; i < extension.Length; i++) 
+                               InnerList.Add (extension [i]);
+               }
+       
+               public void AddRange (X509ExtensionCollection collection) 
+               {
+                       if (collection == null)
+                               throw new ArgumentNullException ("collection");
                        if (readOnly)
                                throw new NotSupportedException ("Extensions are read only");
-\r
-                       for (int i = 0; i < collection.InnerList.Count; i++) \r
-                               InnerList.Add (collection [i]);\r
-               }\r
-\r
-               public bool Contains (X509Extension extension) \r
-               {\r
-                       return (IndexOf (extension) != -1);\r
-               }\r
-
-               public bool Contains (string oid) \r
-               {\r
-                       return (IndexOf (oid) != -1);\r
-               }\r
+
+                       for (int i = 0; i < collection.InnerList.Count; i++) 
+                               InnerList.Add (collection [i]);
+               }
+
+               public bool Contains (X509Extension extension) 
+               {
+                       return (IndexOf (extension) != -1);
+               }
+
+               public bool Contains (string oid) 
+               {
+                       return (IndexOf (oid) != -1);
+               }
 
                public void CopyTo (X509Extension[] extensions, int index) 
                {
@@ -95,9 +118,9 @@ namespace Mono.Security.X509 {
                        InnerList.CopyTo (extensions, index);
                }
 
-               public int IndexOf (X509Extension extension) \r
-               {\r
-                       if (extension == null)\r
+               public int IndexOf (X509Extension extension) 
+               {
+                       if (extension == null)
                                throw new ArgumentNullException ("extension");
 
                        for (int i=0; i < InnerList.Count; i++) {
@@ -106,51 +129,51 @@ namespace Mono.Security.X509 {
                                        return i;
                        }
                        return -1;
-               }\r
+               }
 
-               public int IndexOf (string oid) \r
-               {\r
-                       if (oid == null)\r
+               public int IndexOf (string oid) 
+               {
+                       if (oid == null)
                                throw new ArgumentNullException ("oid");
-\r
+
                        for (int i=0; i < InnerList.Count; i++) {
                                X509Extension ex = (X509Extension) InnerList [i];
                                if (ex.Oid == oid)
                                        return i;
                        }
                        return -1;
-               }\r
+               }
 
-               public void Insert (int index, X509Extension extension) \r
-               {\r
-                       if (extension == null)\r
+               public void Insert (int index, X509Extension extension) 
+               {
+                       if (extension == null)
                                throw new ArgumentNullException ("extension");
 
-                       InnerList.Insert (index, extension);\r
-               }\r
-\r
-               public void Remove (X509Extension extension) \r
-               {\r
-                       if (extension == null)\r
+                       InnerList.Insert (index, extension);
+               }
+
+               public void Remove (X509Extension extension) 
+               {
+                       if (extension == null)
                                throw new ArgumentNullException ("extension");
-\r
-                       InnerList.Remove (extension);\r
-               }\r
 
-               public void Remove (string oid) \r
-               {\r
-                       if (oid == null)\r
+                       InnerList.Remove (extension);
+               }
+
+               public void Remove (string oid) 
+               {
+                       if (oid == null)
                                throw new ArgumentNullException ("oid");
 
                        int index = IndexOf (oid);
                        if (index != -1)
-                               InnerList.RemoveAt (index);\r
-               }\r
+                               InnerList.RemoveAt (index);
+               }
 
-               IEnumerator IEnumerable.GetEnumerator () \r
-               {\r
-                       return InnerList.GetEnumerator ();\r
-               }\r
+               IEnumerator IEnumerable.GetEnumerator () 
+               {
+                       return InnerList.GetEnumerator ();
+               }
 
                public X509Extension this [int index] {
                        get { return (X509Extension) InnerList [index]; }