/// <summary> /// Removes an assembly qualification. /// </summary> /// <param name="assemblyQualification">The assembly qualification to remove.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyQualification"/> is null.</exception> public void RemoveAssemblyQualification(AssemblyQualification assemblyQualification) { if (assemblyQualification == null) { throw new ArgumentNullException("assemblyQualification"); } assemblyQualifications.Remove(assemblyQualification); }
/// <summary> /// Adds an assembly qualification if it is not already in the configuration. /// </summary> /// <param name="assemblyQualification">The assembly qualification to add.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyQualification"/> is null.</exception> public void AddAssemblyQualification(AssemblyQualification assemblyQualification) { if (assemblyQualification == null) { throw new ArgumentNullException("assemblyQualification"); } if (!assemblyQualifications.Contains(assemblyQualification)) { assemblyQualifications.Add(assemblyQualification); } }
/// <summary> /// Adds an assembly qualification element if a suitable one does not already exist. /// </summary> /// <param name="partialName">The partial name to quality.</param> /// <param name="fullName">The full name.</param> /// <returns>The assembly qualification element.</returns> /// <exception cref="InvalidOperationException">Thrown if an assembly qualification already /// exists for the same partial name but with a different full name.</exception> public AssemblyQualification AddAssemblyQualification(string partialName, string fullName) { AssemblyQualification assemblyQualification = assemblyQualifications.Find(x => x.PartialName == partialName); if (assemblyQualification != null) { if (assemblyQualification.FullName != fullName) { throw new InvalidOperationException(String.Format("The configuration already contains an AssemblyQualification with PartialName='{0}' and FullName='{1}' but the requested qualification has FullName='{2}'.", partialName, assemblyQualification.FullName, fullName)); } } else { assemblyQualifications.Add(new AssemblyQualification(partialName, fullName)); } return(assemblyQualification); }
/// <summary> /// Removes an assembly qualification. /// </summary> /// <param name="assemblyQualification">The assembly qualification to remove.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyQualification"/> is null.</exception> public void RemoveAssemblyQualification(AssemblyQualification assemblyQualification) { if (assemblyQualification == null) throw new ArgumentNullException("assemblyQualification"); assemblyQualifications.Remove(assemblyQualification); }
/// <summary> /// Adds an assembly qualification if it is not already in the configuration. /// </summary> /// <param name="assemblyQualification">The assembly qualification to add.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyQualification"/> is null.</exception> public void AddAssemblyQualification(AssemblyQualification assemblyQualification) { if (assemblyQualification == null) throw new ArgumentNullException("assemblyQualification"); if (!assemblyQualifications.Contains(assemblyQualification)) assemblyQualifications.Add(assemblyQualification); }