Changeset 2511


Ignore:
Timestamp:
Jan 28, 2011, 1:29:29 AM (10 years ago)
Author:
Sven Rech
Message:

plugin loading can be disabled in settings now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypCore/PluginManager.cs

    r2058 r2511  
    1616
    1717using System;
     18using System.Collections;
    1819using System.Collections.Generic;
    1920using System.Reflection;
     
    2728    public class PluginManager
    2829    {
     30        private readonly HashSet<string> disabledAssemblies = new HashSet<string>();
     31
    2932        /// <summary>
    3033        /// Counter for the dll files that were found
     
    7780        /// cTor
    7881        /// </summary>
    79         public PluginManager()
    80         {
     82        public PluginManager(HashSet<string> disabledAssemblies)
     83        {
     84            this.disabledAssemblies = disabledAssemblies;
     85           
    8186            this.customPluginStore = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), PluginDirecory);
    8287            this.globalPluginStore = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), PluginDirecory);
    8388            this.loadedAssemblies = new Dictionary<string, Assembly>();
    8489            this.loadedTypes = new Dictionary<string, Type>();         
    85         }
    86 
    87         public PluginManager(string path)
    88         {
    89           this.customPluginStore = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), PluginDirecory);
    90           this.globalPluginStore = path;
    91           this.loadedAssemblies = new Dictionary<string, Assembly>();
    92           this.loadedTypes = new Dictionary<string, Type>();
    9390        }
    9491
     
    155152            foreach (FileInfo fileInfo in directory.GetFiles("*.dll"))
    156153            {
     154                if (disabledAssemblies != null && disabledAssemblies.Contains(fileInfo.Name))
     155                    continue;
     156
    157157                currentPosition++;
    158158                try
Note: See TracChangeset for help on using the changeset viewer.