/* * $Id$ * Copyright 2008-2010 The Eraser Project * Original Author: Joel Low * Modified By: * * This file is part of Eraser. * * Eraser is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * A copy of the GNU General Public License can be found at * . */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Eraser.Plugins { /// /// Loading policies applicable for a given plugin. /// public enum PluginLoadingPolicy { /// /// The host decides the best policy for loading the plugin. /// None, /// /// The host will enable the plugin by default. /// DefaultOn, /// /// The host will disable the plugin by default. /// DefaultOff, /// /// The host must always load the plugin. /// /// This policy does not have an effect when declared in the /// attribute and will be equivalent /// to . Core } /// /// Declares the loading policy for the assembly containing the plugin. Only /// plugins signed with an Authenticode signature will be trusted and have /// this attribute checked at initialisation. /// [AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)] public sealed class PluginLoadingPolicyAttribute : Attribute { /// /// Constructor. /// /// The policy used for loading the plugin. public PluginLoadingPolicyAttribute(PluginLoadingPolicy policy) { Policy = policy; } /// /// The loading policy to be applied to the assembly. /// public PluginLoadingPolicy Policy { get; set; } } }