// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Collections;
throw new Exception ("Could not get root for dir " + dir);
}
+ public static void Drop (RegistryKey rkey)
+ {
+ lock (typeof (KeyHandler)) {
+ KeyHandler k = (KeyHandler) key_to_handler [rkey];
+ if (k == null)
+ return;
+ key_to_handler.Remove (rkey);
+
+ // remove cached KeyHandler if no other keys reference it
+ int refCount = 0;
+ foreach (DictionaryEntry de in key_to_handler)
+ if (de.Value == k)
+ refCount++;
+ if (refCount == 0)
+ dir_to_handler.Remove (k.Dir);
+ }
+ }
+
public static void Drop (string dir)
{
lock (typeof (KeyHandler)) {
public void Close (RegistryKey rkey)
{
+ KeyHandler.Drop (rkey);
}
public object GetValue (RegistryKey rkey, string name, object default_value, RegistryValueOptions options)
}
}
-#endif // NET_2_1
+#endif // MOBILE