Click or drag to resize

AssemblyCollection Class

A collection of Assembly.
Inheritance Hierarchy
SystemObject
  AGI.Parallel.ClientAssemblyCollection

Namespace:  AGI.Parallel.Client
Assembly:  AGI.Parallel.Client (in AGI.Parallel.Client.dll) Version: 2.9.0.1601 (2.9.0.1601)
Syntax
[SerializableAttribute]
public sealed class AssemblyCollection : IList<Assembly>, 
	ICollection<Assembly>, IEnumerable<Assembly>, IEnumerable

The AssemblyCollection type exposes the following members.

Constructors
  NameDescription
Public methodAssemblyCollection
Initializes a new instance of the AssemblyCollection class.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of elements contained in the ICollectionT.
Public propertyIsReadOnly
Gets a value indicating whether the ICollectionT is read-only.
Public propertyItem
Gets or sets the element at the specified index.
Top
Methods
  NameDescription
Public methodAdd(Assembly)
Adds an item to the AssemblyCollection.
Public methodAdd(AssemblyName)
Adds the assembly name to the collection.
Public methodAdd(String)
Adds the assembly located at the specified path.
Public methodAddFromAssemblyName
Adds the assembly name to the collection.
Public methodAddRange
Adds the elements of the specified collection to the end of the AssemblyCollection.
Public methodAsAssemblyNameList
Returns the assemblies in the collection as a list of assembly names.
Public methodClear
Removes all items from the ICollectionT.
Public methodContains
Determines whether the ICollectionT contains a specific value.
Public methodCopyTo
Copies the elements of the ICollectionT to an Array, starting at a particular Array index.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf
Determines the index of a specific item in the AssemblyCollection.
Public methodInsert
Inserts an item to the AssemblyCollection at the specified index.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove
Removes the first occurrence of a specific object from the ICollectionT.
Public methodRemoveAt
Removes the assembly item at the specified index.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
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
     */
}
See Also

Reference

System.ReflectionAssembly
System.ReflectionAssemblyName

STK Parallel Computing Server 2.9 API for .NET