Resharper intellisense confusion -


Today I have something strange in my copy of Razor 5. I have a class that looks like this:

  Public class fu {public string username {get; Private set; } Public Fu (String Username) {User Name = Username}; } Public Zero Times () {DuWorks (user name); } Public Zero DoWork (String Username) {}}  

When I start typing Dvask (We get the following from Intelligence:

Notice that this constructor is pulling the argument, and it ends with a colon: userName:

What's going on here?

Edit:

Reid answered as below, this is a new C # 4 feature that is called. This is the purpose that you specify the name of an argument Instead, it's its position in a parameter list instead, so you do not have to remember the status of an argument in the logic to use it (though it is meaningless with intellisense to a large extent). Logic makes it easy to use.

Thanks Read.

it Referrer, for which intellisense support has been provided.

Added support for them in C # 4. Now you can find a defined method like this:

  Public Zero DoWork (int someArgument = 3, string user name = "default") {// ...   

If you want to call it with a different "userName" but leave the default for other parameters, you can do this:

  this.DoWork (userName: "FooUser");  

The Reichter 5 adds support for this syntax in intellisense.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -