Changeset 2298


Ignore:
Timestamp:
1/4/2011 7:58:21 AM (4 years ago)
Author:
lowjoel
Message:

Fix parsing of attributes from reflection-only assemblies.

Location:
branches/eraser6/pluginsRewrite/Eraser.Plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Host.cs

    r2295 r2298  
    112112 
    113113        /// <summary> 
    114         /// Event callback executor for the OnPluginLoad Event 
     114        /// Event callback executor for the OnPluginLoad event. 
     115        /// </summary> 
     116        /// <param name="sender"></param> 
     117        /// <param name="e"></param> 
     118        internal void OnPluginLoad(object sender, PluginLoadEventArgs e) 
     119        { 
     120            if (PluginLoad != null) 
     121                PluginLoad(sender, e); 
     122        } 
     123 
     124        /// <summary> 
     125        /// Event callback executor for the OnPluginLoaded vent 
    115126        /// </summary> 
    116127        internal void OnPluginLoaded(object sender, PluginLoadedEventArgs e) 
     
    293304            //is a phony 
    294305            if (CorePlugins.Count(x => x == info.Assembly.GetName().Name) == 0) 
     306            { 
     307                info.LoadingPolicy = LoadingPolicy.None; 
    295308                return LoadNonCorePlugin(info); 
     309            } 
    296310 
    297311            //Check for the presence of a valid signature: Core plugins must have the same 
     
    318332        { 
    319333            PluginLoadEventArgs e = new PluginLoadEventArgs(info); 
    320             if (PluginLoad != null) 
    321                 PluginLoad(this, e); 
     334            OnPluginLoad(this, e); 
    322335             
    323336            if (e.Load) 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/PluginInfo.cs

    r2295 r2298  
    113113                    else if (attr.Constructor.DeclaringType == typeof(AssemblyCompanyAttribute)) 
    114114                        info.Author = (string)attr.ConstructorArguments[0].Value; 
    115                     else if (attr.Constructor.DeclaringType == typeof(LoadingPolicyAttribute)) 
    116                     { 
     115                    else if (attr.Constructor.DeclaringType.GUID == typeof(LoadingPolicyAttribute).GUID) 
    117116                        LoadingPolicy = (LoadingPolicy)attr.ConstructorArguments[0].Value; 
    118                         if (LoadingPolicy == LoadingPolicy.Core) 
    119                             LoadingPolicy = LoadingPolicy.None; 
    120                     } 
    121117 
    122118                this.AssemblyInfo = info; 
     
    138134        /// therefore cannot be disabled.) 
    139135        /// </summary> 
    140         public LoadingPolicy LoadingPolicy { get; private set; } 
     136        public LoadingPolicy LoadingPolicy { get; internal set; } 
    141137 
    142138        /// <summary> 
Note: See TracChangeset for help on using the changeset viewer.