A collection of Assembly.
Namespace: AGI.Parallel.Client
Assembly: AGI.Parallel.Client (in AGI.Parallel.Client.dll) Version: 1.2.0.275 (1.2.0.275)

Syntax

C#
[SerializableAttribute]
public sealed class AssemblyCollection : IList<Assembly>, 
        ICollection<Assembly>, IEnumerable<Assembly>, IEnumerable
Visual Basic
<SerializableAttribute> _
Public NotInheritable Class AssemblyCollection _
        Implements IList(Of Assembly), ICollection(Of Assembly),  _
        IEnumerable(Of Assembly), IEnumerable

Examples

  Copy imageCopy
public static void ConfigureAssemblyCollection(AssemblyCollection assemblyCollection)
{
    // Add from file
    assemblyCollection.Add("C:\\Assemblies\\YourAssemblyA.dll");

    // Add assembly object
    assemblyCollection.Add(Assembly.GetExecutingAssembly());
    assemblyCollection.Add(Assembly.ReflectionOnlyLoadFrom("C:\\Assemblies\\YourAssemblyB.dll"));

    // Add from assembly name
    assemblyCollection.AddFromAssemblyName("YourAssemblyC, Version=2.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao");

    // Add from range
    assemblyCollection.AddRange(new List<Assembly> { Assembly.LoadFrom("YourAssemblyD"), Assembly.LoadFrom("YouAssemblyE") });

    Console.WriteLine("\nCount: {0}\n", assemblyCollection.Count);
    foreach (Assembly assembly in assemblyCollection)
    {
        Console.WriteLine(assembly.FullName);
    }

    /*
     * The output of the code example should resemble:
     * Count: 6
     * YourAssemblyA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     * AssemblyCollectionExample, Version=2.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     * YourAssemblyB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     * YourAssemblyC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     * YourAssemblyD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     * YourAssemblyE, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46f7a65aaf1b26ao
     */
}

Inheritance Hierarchy

System..::..Object
  AGI.Parallel.Client..::..AssemblyCollection

See Also