/// <summary> /// Attempts to load the assembly given its name. /// </summary> /// <returns> /// The loaded assembly, or <see cref="null" /> if the loading failed or /// is not supported. /// </returns> /// <param name="name">The name of the assembly to load.</param> public Assembly this[AssemblyName name] { get { string file = Path.Combine(Loader.BaseDir, string.Concat(name.Name, ".dll")); if (File.Exists(file)) { return(Loader.LoadFromAssemblyPath(file)); } else { return(Assembly.Load(name)); } } }
/// <summary> /// Loads the framework, or optionally a single assembly into the /// currently loaded framework. /// </summary> /// <param name="assembly"> /// An assembly to load, or <see cref="null" /> if the entire framework /// should be loaded. /// </param> public void Load(string assembly = null) { if (assembly == null) { foreach (Assembly asm in Loader.LoadAll()) { LoadAssembly(asm); } } else { LoadAssembly(Loader.LoadFromAssemblyPath(assembly)); } }