UsingTasks are not collected expectedly when imports are involved.
[mono.git] / mcs / class / Mono.Security / Mono.Security.X509 / X509StoreManager.cs
index 50f45b47b28a7c7af7ae4ad1a1ce803aa1c57e52..db735834acd4ca39c0310cca71612eeadac7a7c9 100644 (file)
@@ -43,6 +43,8 @@ namespace Mono.Security.X509 {
 #endif
        sealed class X509StoreManager {
 
+               static private string _userPath;
+               static private string _localMachinePath;
                static private X509Stores _userStore;
                static private X509Stores _machineStore;
 
@@ -50,30 +52,44 @@ namespace Mono.Security.X509 {
                {
                }
 
-               static public X509Stores CurrentUser {
-                       get { 
-                               if (_userStore == null) {
-                                       string _userPath = Path.Combine (
-                                               Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
-                                               ".mono");
-                                       _userPath = Path.Combine (_userPath, "certs");
+               internal static string CurrentUserPath {
+                       get {
+                               if (_userPath == null) {
+                                       _userPath = Path.Combine(
+                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+                                                       ".mono");
+                                       _userPath = Path.Combine(_userPath, "certs");
+                               }
+                               return _userPath;
+                       }
+               }
 
-                                       _userStore = new X509Stores (_userPath);
+               internal static string LocalMachinePath {
+                       get {
+                               if (_localMachinePath == null) {
+                                       _localMachinePath = Path.Combine (
+                                               Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData),
+                                               ".mono");
+                                       _localMachinePath = Path.Combine (_localMachinePath, "certs");
                                }
+                               return _localMachinePath;
+                       }
+               }
+
+               static public X509Stores CurrentUser {
+                       get { 
+                               if (_userStore == null)
+                                       _userStore = new X509Stores(CurrentUserPath);
+                               
                                return _userStore;
                        }
                }
 
                static public X509Stores LocalMachine {
                        get {
-                               if (_machineStore == null) {
-                                       string _machinePath = Path.Combine (
-                                               Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData),
-                                               ".mono");
-                                       _machinePath = Path.Combine (_machinePath, "certs");
+                               if (_machineStore == null) 
+                                       _machineStore = new X509Stores (LocalMachinePath);
 
-                                       _machineStore = new X509Stores (_machinePath);
-                               }
                                return _machineStore;
                        }
                }