﻿<?xml version="1.0" encoding="utf-8"?><Type Name="FinalizersShouldBeProtectedRule" FullName="Gendarme.Rules.Design.FinalizersShouldBeProtectedRule"><TypeSignature Language="C#" Value="public class FinalizersShouldBeProtectedRule : Gendarme.Framework.Rule, Gendarme.Framework.ITypeRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FinalizersShouldBeProtectedRule extends Gendarme.Framework.Rule implements class Gendarme.Framework.IRule, class Gendarme.Framework.ITypeRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Design</AssemblyName><AssemblyVersion>4.2.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Framework.Rule</BaseTypeName></Base><Interfaces><Interface><InterfaceName>Gendarme.Framework.ITypeRule</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Usage", "CA2221:FinalizersShouldBeProtected")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("The finalizer for this type isn't protected (family) and can therefore be called by user level code.")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("Change the finalizer visibility to protected (family).")</AttributeName></Attribute></Attributes><Docs><summary>
             This rule verifies that finalizers are only visible to the type's family (e.g. protected in C#).
             If they are not family then they can be called from user code which could lead to
             problems. Note that this restriction is enforced by the C# and VB.NET compilers
             but other compilers may not do so.
             </summary><remarks>To be added.</remarks><example>
             Bad example (IL):
             <code>
             .class family auto ansi beforefieldinit BadPublicFinalizer extends
             [mscorlib]System.Object
             {
            	.method public hidebysig instance void Finalize() cil managed
            	{
            		// ...
            	}
             }
             </code></example><example>
             Good example (C#):
             <code>
             public class GoodProtectedFinalizer {
            	// compiler makes it protected
            	~GoodProtectedFinalizer ()
            	{
            	}
             }
             </code></example><example>
             Good example (IL):
             <code>
             .class family auto ansi beforefieldinit GoodProtectedFinalizer extends
             [mscorlib]System.Object
             {
            	.method family hidebysig instance void Finalize() cil managed
            	{
            		// ...
            	}
             }
             </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public FinalizersShouldBeProtectedRule ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>4.2.0.0</AssemblyVersion></AssemblyInfo><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="CheckType"><MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckType (Mono.Cecil.TypeDefinition type);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckType(class Mono.Cecil.TypeDefinition type) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.2.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gendarme.Framework.RuleResult</ReturnType></ReturnValue><Parameters><Parameter Name="type" Type="Mono.Cecil.TypeDefinition" /></Parameters><Docs><param name="type">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member></Members></Type>