Mono.Addins.RuntimeAddin.LoadModule C# (CSharp) Method

LoadModule() private method

private LoadModule ( ModuleDescription module, ArrayList asmList ) : void
module Mono.Addins.Description.ModuleDescription
asmList System.Collections.ArrayList
return void
        void LoadModule(ModuleDescription module, ArrayList asmList)
        {
            // Load the assemblies
            foreach (string s in module.Assemblies) {
                Assembly asm = null;

                // don't load the assembly if it's already loaded
                string asmPath = Path.Combine (baseDirectory, s);
                foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies ()) {
                    // Sorry, you can't load addins from
                    // dynamic assemblies as get_Location
                    // throws a NotSupportedException
                    if (a is System.Reflection.Emit.AssemblyBuilder) {
                        continue;
                    }

                    if (a.Location == asmPath) {
                        asm = a;
                        break;
                    }
                }

                if (asm == null) {
                    asm = Assembly.LoadFrom (asmPath);
                }

                asmList.Add (asm);
            }
        }