Merge pull request #216 from ilkerde/master
[mono.git] / mcs / class / corlib / System.Security.Cryptography / RNGCryptoServiceProvider.cs
index 71fcdc062f1e0aaaa88826b4c5238ff32b04da39..e0ffb2e8e8b50e5b0ef58b367a8f29fedc23b188 100644 (file)
@@ -40,14 +40,10 @@ using System.Text;
 
 namespace System.Security.Cryptography {
        
-#if NET_1_0
-       public class RNGCryptoServiceProvider : RandomNumberGenerator {
-#else
-       #if NET_2_0
+#if !NET_2_1
        [ComVisible (true)]
-       #endif
-       public sealed class RNGCryptoServiceProvider : RandomNumberGenerator {
 #endif
+       public sealed class RNGCryptoServiceProvider : RandomNumberGenerator {
                private static object _lock;
                private IntPtr _handle;
 
@@ -62,7 +58,7 @@ namespace System.Security.Cryptography {
                        _handle = RngInitialize (null);
                        Check ();
                }
-               
+#if !NET_2_1
                public RNGCryptoServiceProvider (byte[] rgb)
                {
                        _handle = RngInitialize (rgb);
@@ -85,7 +81,7 @@ namespace System.Security.Cryptography {
                                _handle = RngInitialize (Encoding.UTF8.GetBytes (str));
                        Check ();
                }
-
+#endif
                private void Check () 
                {
                        if (_handle == IntPtr.Zero) {
@@ -149,5 +145,12 @@ namespace System.Security.Cryptography {
                                _handle = IntPtr.Zero;
                        }
                }
+
+#if NET_4_0 || MOONLIGHT
+               protected override void Dispose (bool disposing)
+               {
+                       base.Dispose (disposing);
+               }
+#endif
        }
 }