Пример #1
0
 public RegistryRequest(RegistryRequest request)
 {
     _accessMechanism = request.VirtualizationType;
     _handle          = request.Handle;
     _hive            = request.Hive;
     _keyFullName     = request.KeyFullName;
     _keyFullPath     = request.KeyFullPath;
 }
Пример #2
0
 /// <summary>
 /// Determines whether a rule for the specified <see cref="identifier"/> is defined
 /// in the current <see cref="EngineRuleCollection"/>.
 /// </summary>
 /// <param name="identifier">
 /// The value to determine the existence of an associated <see cref="VirtualizationType"/> for.
 /// </param>
 /// <param name="rule">
 /// The first <see cref="VirtualizationType"/> associated to the given value.
 /// </param>
 /// <returns></returns>
 public bool HasRule(string identifier, out VirtualizationType rule)
 {
     rule = default(VirtualizationType);
     using (_rulesLock.EnterDisposableReadLock())
     {
         var i = GetRuleIndex(identifier);
         if (i == -1)
         {
             return(false);
         }
         rule = _rules[i].VirtualizationType;
         return(true);
     }
 }
Пример #3
0
 /// <summary>
 /// Associates a <see cref="VirtualizationType"/> to the specified value.
 /// </summary>
 /// <remarks>
 /// If a <see cref="VirtualizationType"/> is already defined for <paramref name="identifier"/>,
 /// the old <see cref="VirtualizationType"/> is overwritten with <paramref name="rule"/>.
 /// Otherwise, a new association is added to the collection.</remarks>
 /// <param name="identifier">The value to set a <see cref="VirtualizationType"/> for.</param>
 /// <param name="rule"> The <see cref="VirtualizationType"/> to associate to <paramref name="identifier"/>.</param>
 public void SetRule(string identifier, VirtualizationType rule)
 {
     using (_rulesLock.EnterDisposableWriteLock())
     {
         var i = GetRuleIndex(identifier);
         if (i == -1)
         {
             _rules.Add(new EngineRule(identifier, rule));
         }
         else
         {
             _rules[i].VirtualizationType = rule;
         }
     }
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of <see cref="EngineRule"/>.
 /// </summary>
 /// <param name="identifier">The identifier of the new <see cref="EngineRule"/>.</param>
 /// <param name="virtualizationType">The <see cref="VirtualizationType"/> representing the engine rule.</param>
 public EngineRule(string identifier, VirtualizationType virtualizationType)
 {
     Identifier         = identifier;
     VirtualizationType = virtualizationType;
 }
 public RegistryRequest(RegistryRequest request)
 {
   _accessMechanism = request.VirtualizationType;
   _handle = request.Handle;
   _hive = request.Hive;
   _keyFullName = request.KeyFullName;
   _keyFullPath = request.KeyFullPath;
 }
 public RegistryRequest()
 {
   _handle = 0;
   _keyFullPath = string.Empty;
   _accessMechanism = VirtualizationType.Virtual;
 }
Пример #7
0
 public RegistryRequest()
 {
     _handle          = 0;
     _keyFullPath     = string.Empty;
     _accessMechanism = VirtualizationType.Virtual;
 }
Пример #8
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)));
 }