ACR_AssemblyLoader.AssemblyLoader.PopulateKnownAssemblies C# (CSharp) Method

PopulateKnownAssemblies() public method

This method loads known assemblies and prepopulates them in the known assembly cache. Note that these assembles must be loaded in the proper order, that is, base assemblies before dependant assemblies.
public PopulateKnownAssemblies ( ) : void
return void
        void PopulateKnownAssemblies()
        {
            Assembly ALFA_Shared;

            //
            // Load additional support assemblies.  The order to add these can
            // be discovered by going to Tools, NuGet Package Manager,
            // Package Visualizer.  The graph must be added in bottom up order.
            //

            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Microsoft_Data_Edm));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.System_Spatial));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Microsoft_Data_OData));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Microsoft_Data_Services_Client));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Microsoft_WindowsAzure_ConfigurationManager));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Newtonsoft_Json));
            KnownAssemblies.Add(Assembly.Load(Properties.Resources.Microsoft_WindowsAzure_Storage));

            //
            // Load ALFA.Shared.dll from the byte array attached to the
            // assembly resources, and add it to the known assembly cache.
            //

            KnownAssemblies.Add(ALFA_Shared = Assembly.Load(Properties.Resources.ALFA_Shared));

            KnownResources.Add("SGTatham_Plink", Properties.Resources.SGTatham_Plink);

            //
            // Export KnownAssemblies and KnownResources to ALFA.Shared for
            // other components to use.  Note that since ALFA.Shared is loaded
            // by the AssemblyLoader, the AssemblyLoader itself cannot contain
            // a static bound reference to ALFA.Shared; instead, the references
            // must be dynamically satisfied via Reflection.
            //

            Type ModuleLinkage = ALFA_Shared.GetType("ALFA.Shared.ModuleLinkage", true);

            ModuleLinkage.GetProperty("KnownAssemblies").SetValue(null, KnownAssemblies, null);
            ModuleLinkage.GetProperty("KnownResources").SetValue(null, KnownResources, null);
        }