如果这些参数可以添加或删除? [英] Should these arguments be added or removed?

查看:84
本文介绍了如果这些参数可以添加或删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ReSharper的与自己认为,一个人如何知道给予更多的信任哪个角色?

When Resharper argues with itself, how does one know which persona to give more credence?

我想我已经找到了一些code,做混淆ReSharper的(这显然是一个极不寻常的情况 - 在使用它一天之后,我觉得ReSharper的是蜜蜂的膝盖/因为液化面包最伟大的事情,等等。 )。

I think I have found some code that does confuse Resharper (this is apparently a very unusual case - after using it for a day, I think Resharper is the bee's knees/the greatest thing since liquified bread, etc.).

通过此行code的:

ICryptoTransform Encryptor = RijndaelCipher.CreateEncryptor(SecretKey.GetBytes(32), SecretKey.GetBytes(16));

ReSharper的告诉我的添加参数名rgbkey'的,然后的添加参数名rgbIV'

因此​​,该行是则:

ICryptoTransform Encryptor = RijndaelCipher.CreateEncryptor(rgbKey: SecretKey.GetBytes(32), rgbIV: SecretKey.GetBytes(16));

当我再次运行ReSharper的,但是,它说:

When I run Resharper again, though, it says,

冗余参数名称规范 - 删除参数名称规格(rgbkey)的(然后rgbIV)

"Redundant argument name specification" - "Remove argument name specification" (rgbkey) (and then rgbIV).

这似乎无论哪种方式工作得很好,但...

It seems either way works fine, though...

推荐答案

显式参数命名为强制性参数可选的,因此这两种形式都是正确的,问题是哪个你更喜欢?像vcsjones说,ReSharper的只是给你一些重构选项以满足您的preferences。

Explicit parameter naming is optional on mandatory parameters, so both forms are "correct," the question is which do you like better? Like vcsjones said, Resharper is just giving you some refactoring options to suit your preferences.

这篇关于如果这些参数可以添加或删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆