Esempio n. 1
0
 /// <summary>
 /// Deletes the key associated with the handle specified in <paramref name="request"/>.
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public virtual NativeResultCode DeleteKey(RegistryRequest request)
 {
     using (_keysSynchronizationLock.EnterDisposableWriteLock())
     {
         request.Handle = EnsureHandleIsNoAlias(request.Handle);
         if (!_keys.ContainsKey(request.Handle))
         {
             return(NativeResultCode.InvalidHandle);
         }
         RemoveAliasesFor(request.Handle);
         _keys.Remove(request.Handle);
     }
     _indexGenerator.Release(request.Handle);
     return(NativeResultCode.Success);
 }
Esempio n. 2
0
 /// <summary>
 /// Detaches the specified <see cref="IIndexUser"/> from the current <see cref="IndexGenerator"/>.
 /// This means that new indices, generated with <see cref="Next"/>, will not be verified anymore
 /// from <paramref name="indexUser"/> and may thereby be simultaneously used by the detached object.
 /// </summary>
 /// <param name="indexUser">The <see cref="IIndexUser"/> to detach.</param>
 /// <returns>
 /// True if the specified <see cref="IIndexUser"/> was successfully detached from the <see cref="IndexGenerator"/>; otherwise, false.
 /// This method also returns false if the <paramref name="indexUser"/> is not found to be registered with the current <see cref="IndexGenerator"/>.
 /// </returns>
 public bool Detach(IIndexUser indexUser)
 {
     using (_usersLock.EnterDisposableWriteLock())
         return(_users.Remove(indexUser));
 }
Esempio n. 3
0
 /// <summary>
 /// Removes the engine rule matching the given <paramref name="identifier"/> and <paramref name="rule"/>
 /// from the current <see cref="EngineRuleCollection"/>.
 /// </summary>
 /// <param name="identifier"></param>
 /// <param name="rule"></param>
 /// <returns></returns>
 public bool RemoveRule(string identifier, VirtualizationType rule)
 {
     using (_rulesLock.EnterDisposableWriteLock())
         return(_rules.Remove(new EngineRule(identifier, rule)));
 }