예제 #1
0
        public void AddExtensionFromDisk(string extensionPath)
        {
            try
            {
                IExtensibleFrameworkInterface efi = null;

                Assembly assembly = Assembly.LoadFile(extensionPath);
                Type[]   types    = assembly.GetTypes();

                for (int i = 0; i < types.Length; i++)
                {
                    if (types[i].GetInterface(typeof(IExtensibleFrameworkInterface).FullName) != null)
                    {
                        efi = (IExtensibleFrameworkInterface)Activator.CreateInstance(types[i]);
                        break;
                    }
                }

                AddExtension(efi);
            }
            catch (Exception ex)
            {
                throw new Exception("An implementation for 'IExtensibleFrameworkInterface' could not be found in the specified assembly.");
            }
        }
예제 #2
0
 public void EnableExtension(IExtensibleFrameworkInterface extension)
 {
     if (Extensions == null)
     {
         Extensions = new List <IExtensibleFrameworkInterface>();
     }
     Extensions.Add(extension);
 }
 /// <summary>
 /// Enable the loading of a framework extension (EFI) as soon as the server core is booted
 /// </summary>
 /// <param name="extension"></param>
 protected void EnableExtension(IExtensibleFrameworkInterface extension)
 {
     Services.GetService <IEFIManager>().AddExtension(extension);
 }
예제 #4
0
 public void AddExtension(IExtensibleFrameworkInterface extension)
 {
     Extensions.Add(extension);
 }