public static bool DisableOverride(MethodInfo method)
    {
        OverrideManager manager = new OverrideManager();
        OverrideWrapper value   = manager.Overrides.First((KeyValuePair <OverrideAttribute, OverrideWrapper> a) => a.Value.Original == method).Value;

        return(value != null && value.Revert());
    }
Esempio n. 2
0
        /// <summary>
        /// Disables the override of a method(WARNING: The method needs to have been overridden atleast once!)
        /// </summary>
        /// <param name="method">The original method that was Overrideed</param>
        /// <returns>If the Override was disabled successfully</returns>
        public static bool DisableOverride(MethodInfo method)
        {
            // Set the variables
            OverrideWrapper wrapper = OverrideManager.Overrides.First(a => a.Value.Original == method).Value;

            // Do the checks
            return(wrapper != null && wrapper.Revert());
        }