public override ITypeParameter AddTypeParameter(IDeclaration declaration) { var methodDeclaration = declaration as IMethodDeclaration; if (methodDeclaration != null) { CSharpElementFactory factory = CSharpElementFactory.GetInstance(declaration.GetPsiModule()); ITypeParameterOfMethodDeclaration parameter = methodDeclaration.AddTypeParameterBefore( factory.CreateTypeParameterOfMethodDeclaration(Workflow.TypeParameterName), null); return(parameter.DeclaredElement); } return(null); }