﻿<?xml version="1.0" encoding="utf-8"?><Type Name="AvoidMethodWithUnusedGenericTypeRule" FullName="Gendarme.Rules.Design.Generic.AvoidMethodWithUnusedGenericTypeRule"><TypeSignature Language="C#" Value="public class AvoidMethodWithUnusedGenericTypeRule : Gendarme.Rules.Design.Generic.GenericsBaseRule, Gendarme.Framework.IMethodRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AvoidMethodWithUnusedGenericTypeRule extends Gendarme.Rules.Design.Generic.GenericsBaseRule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Design.Generic</AssemblyName><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Rules.Design.Generic.GenericsBaseRule</BaseTypeName></Base><Interfaces><Interface><InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("One or more generic type parameters are not used in the formal parameter list.")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("This prevents the compiler from inferring types when the method is used which results in hard to use API definitions.")</AttributeName></Attribute></Attributes><Docs><summary>
            This method will fire if a generic method does not use all of its generic type parameters
            in the formal parameter list. This usually means that either the type parameter is not used at
            all in which case it should be removed or that it's used only for the return type which
            is problematic because that prevents the compiler from inferring the generic type
            when the method is called which is confusing to many developers.
            </summary><remarks>This rule applies only to assemblies targeting .NET 2.0 and later.</remarks><example>
            Bad example:
            <code>
            public class Bad {
            	public string ToString&lt;T&gt; ()
            	{
            		return typeof (T).ToString ();
            	}
            	static void Main ()
            	{
            		// the compiler can't infer int so we need to supply it ourselves
            		Console.WriteLine (ToString&lt;int&gt; ());
            	}
            }
            </code></example><example>
            Good example:
            <code>
            public class Good {
            	public string ToString&lt;T&gt; (T obj)
            	{
            		return obj.GetType ().ToString ();
            	}
            	static void Main ()
            	{
            		Console.WriteLine (ToString (2));
            	}
            }
            </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public AvoidMethodWithUnusedGenericTypeRule ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>3.10.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>3.10.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>