﻿<?xml version="1.0" encoding="utf-8"?><Type Name="AvoidUnnecessarySpecializationRule" FullName="Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule"><TypeSignature Language="C#" Value="public class AvoidUnnecessarySpecializationRule : Gendarme.Framework.Rule, Gendarme.Framework.IMethodRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AvoidUnnecessarySpecializationRule extends Gendarme.Framework.Rule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Maintainability</AssemblyName><AssemblyVersion>4.2.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Framework.Rule</BaseTypeName></Base><Interfaces><Interface><InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("This method has a parameter whose type is more specialized than necessary. This can make it difficult to reuse the method in other contexts.")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("Replace the parameter type with the most general type which will work or make use of the specifics of the formal parameter type.")</AttributeName></Attribute></Attributes><Docs><summary>
             This rule checks methods for over specialized parameters - i.e. parameter types
             that are unnecessarily specialized with respect to what the method needs to 
             perform its job. This often impairs the reusability of the method. If a problem
             is found the rule will suggest the most general type, or interface, required for the
             method to work.
             </summary><remarks>This rule is available since Gendarme 2.0</remarks><example>
             Bad example:
             <code>
             public class DefaultEqualityComparer : IEqualityComparer {
             	public int GetHashCode (object obj)
             	{
             		return o.GetHashCode ();
             	}
             }
             
             public int Bad (DefaultEqualityComparer ec, object o)
             {
            	return ec.GetHashCode (o);
             }
             </code></example><example>
             Good example:
             <code>
             public class DefaultEqualityComparer : IEqualityComparer {
             	public int GetHashCode (object obj)
             	{
             		return o.GetHashCode ();
             	}
             }
             
             public int Good (IEqualityComparer ec, object o)
             {
            	return ec.GetHashCode (o);
             }
             </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public AvoidUnnecessarySpecializationRule ();" /><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="CheckMethod"><MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckMethod (Mono.Cecil.MethodDefinition method);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckMethod(class Mono.Cecil.MethodDefinition method) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.2.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gendarme.Framework.RuleResult</ReturnType></ReturnValue><Parameters><Parameter Name="method" Type="Mono.Cecil.MethodDefinition" /></Parameters><Docs><param name="method">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member></Members></Type>