views:

65

answers:

1

Let's say I have a function that takes an object as a parameter and returns a string...

public string Foo(object values) { // return a string }

When working in Visual Studio 2008 (ASP.NET MVC Web Application), I try to pass an object intializer to this function like so:

string x = Foo(new { x = 1, y = 2 });

While I'm typing this out, the intellisense takes over after I type "new " (without quotes) and I end up with "new object " before I can type the opening curly brace.

I imagine the intellisense is trying to help out by assuming I'm going to create something that matches the function declaration, but in this specific case it's annoying. Is there a way I can turn this off for object?

A: 

I don't know which of the settings that does this, but I always turn off "Auto list members" and "Parameter information" in the "Text Editor" settings in the options, and it doesn't do that for me.

To get the behaviour that you mention I now have to press Ctrl+Space.

Guffa