public RegistryRequest(RegistryRequest request) { _accessMechanism = request.VirtualizationType; _handle = request.Handle; _hive = request.Hive; _keyFullName = request.KeyFullName; _keyFullPath = request.KeyFullPath; }
/// <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); } }
/// <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; } } }
/// <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() { _handle = 0; _keyFullPath = string.Empty; _accessMechanism = VirtualizationType.Virtual; }
/// <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))); }