Esempio n. 1
0
            /// <summary>
            /// Removes an assembly codebase.
            /// </summary>
            /// <param name="assemblyCodeBase">The assembly codebase to remove.</param>
            /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyCodeBase"/> is null.</exception>
            public void RemoveAssemblyCodeBase(AssemblyCodeBase assemblyCodeBase)
            {
                if (assemblyCodeBase == null)
                {
                    throw new ArgumentNullException("assemblyCodeBase");
                }

                assemblyCodeBases.Remove(assemblyCodeBase);
            }
Esempio n. 2
0
            /// <summary>
            /// Adds an assembly code-base element if a suitable one is not already present.
            /// </summary>
            /// <remarks>
            /// <para>
            /// If another codebase element exists with the same version but perhaps
            /// a different Uri, then we do not add a new codebase since this most
            /// likely indicates that the same assembly can be loaded from multiple locations.
            /// </para>
            /// </remarks>
            /// <param name="version">The assembly version.</param>
            /// <param name="uri">The code base uri.</param>
            /// <returns>The code base element.</returns>
            public AssemblyCodeBase AddAssemblyCodeBase(string version, string uri)
            {
                AssemblyCodeBase assemblyCodeBase = assemblyCodeBases.Find(x => x.Version == version);

                if (assemblyCodeBase == null)
                {
                    assemblyCodeBase = new AssemblyCodeBase(version, uri);
                    assemblyCodeBases.Add(assemblyCodeBase);
                }

                return(assemblyCodeBase);
            }
Esempio n. 3
0
            /// <summary>
            /// Adds an assembly codebase if it is not already in the configuration.
            /// </summary>
            /// <param name="assemblyCodeBase">The assembly codebase to add.</param>
            /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyCodeBase"/> is null.</exception>
            public void AddAssemblyCodeBase(AssemblyCodeBase assemblyCodeBase)
            {
                if (assemblyCodeBase == null)
                {
                    throw new ArgumentNullException("assemblyCodeBase");
                }

                if (!assemblyCodeBases.Contains(assemblyCodeBase))
                {
                    assemblyCodeBases.Add(assemblyCodeBase);
                }
            }
            /// <summary>
            /// Adds an assembly code-base element if a suitable one is not already present.
            /// </summary>
            /// <remarks>
            /// <para>
            /// If another codebase element exists with the same version but perhaps
            /// a different Uri, then we do not add a new codebase since this most
            /// likely indicates that the same assembly can be loaded from multiple locations.
            /// </para>
            /// </remarks>
            /// <param name="version">The assembly version.</param>
            /// <param name="uri">The code base uri.</param>
            /// <returns>The code base element.</returns>
            public AssemblyCodeBase AddAssemblyCodeBase(string version, string uri)
            {
                AssemblyCodeBase assemblyCodeBase = assemblyCodeBases.Find(x => x.Version == version);
                if (assemblyCodeBase == null)
                {
                    assemblyCodeBase = new AssemblyCodeBase(version, uri);
                    assemblyCodeBases.Add(assemblyCodeBase);
                }

                return assemblyCodeBase;
            }
            /// <summary>
            /// Adds an assembly codebase if it is not already in the configuration.
            /// </summary>
            /// <param name="assemblyCodeBase">The assembly codebase to add.</param>
            /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyCodeBase"/> is null.</exception>
            public void AddAssemblyCodeBase(AssemblyCodeBase assemblyCodeBase)
            {
                if (assemblyCodeBase == null)
                    throw new ArgumentNullException("assemblyCodeBase");

                if (!assemblyCodeBases.Contains(assemblyCodeBase))
                    assemblyCodeBases.Add(assemblyCodeBase);
            }
            /// <summary>
            /// Removes an assembly codebase.
            /// </summary>
            /// <param name="assemblyCodeBase">The assembly codebase to remove.</param>
            /// <exception cref="ArgumentNullException">Thrown if <paramref name="assemblyCodeBase"/> is null.</exception>
            public void RemoveAssemblyCodeBase(AssemblyCodeBase assemblyCodeBase)
            {
                if (assemblyCodeBase == null)
                    throw new ArgumentNullException("assemblyCodeBase");

                assemblyCodeBases.Remove(assemblyCodeBase);
            }