Changeset 2010


Ignore:
Timestamp:
5/1/2010 11:14:15 PM (4 years ago)
Author:
lowjoel
Message:

Fixed regression in r1891, the loading policies of plugins must be stored in the PluginInstance? structure for reference by plugin clients.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Manager/Plugins.cs

    r1981 r2010  
    230230            //loading policy of the plugin. 
    231231            instance.Assembly = Assembly.LoadFrom(filePath); 
    232             LoadingPolicy policy = LoadingPolicy.None; 
    233232            { 
    234233                object[] attr = instance.Assembly.GetCustomAttributes(typeof(LoadingPolicyAttribute), true); 
    235234                if (attr.Length != 0) 
    236235                { 
    237                     policy = ((LoadingPolicyAttribute)attr[0]).Policy; 
     236                    instance.LoadingPolicy = ((LoadingPolicyAttribute)attr[0]).Policy; 
    238237 
    239238                    //If the loading policy is that the plugin is Core, we need to verify 
    240239                    //the public key of the assembly. 
    241                     if (policy == LoadingPolicy.Core && 
     240                    if (instance.LoadingPolicy == LoadingPolicy.Core && 
    242241                        !reflectAssembly.GetName().GetPublicKey().SequenceEqual( 
    243242                            Assembly.GetExecutingAssembly().GetName().GetPublicKey())) 
    244243                    { 
    245                         policy = LoadingPolicy.None; 
     244                        instance.LoadingPolicy = LoadingPolicy.None; 
    246245                    } 
    247246                } 
     
    251250 
    252251            //If the loading policy is such that the plugin is a core plugin, ALWAYS load it. 
    253             if (policy == LoadingPolicy.Core) 
     252            if (instance.LoadingPolicy == LoadingPolicy.Core) 
    254253                loadPlugin = true; 
    255254 
     
    260259            //There's no approval or denial, what is the specified loading policy? 
    261260            else 
    262                 loadPlugin = policy != LoadingPolicy.DefaultOff; 
     261                loadPlugin = instance.LoadingPolicy != LoadingPolicy.DefaultOff; 
    263262 
    264263 
Note: See TracChangeset for help on using the changeset viewer.