StringFormatMethodAttribute - конструктор
Indicates that the marked method builds string by format pattern and (optional) arguments.
Parameter, which contains format string, should be given in constructor.
The format string should be in
Format(IFormatProvider, String, Object) -like form
Пространство имён: Tessa.Properties.ResharperСборка: Tessa (в Tessa.dll) Версия: 4.2.0+ffad8363f63902f18b3b3f4cfa533a14b2fb19a6
public StringFormatMethodAttribute(
[InvokerParameterNameAttribute] string formatParameterName
)
Public Sub New (
<InvokerParameterNameAttribute> formatParameterName As String
)
public:
StringFormatMethodAttribute(
[InvokerParameterNameAttribute] String^ formatParameterName
)
new :
[<InvokerParameterNameAttribute>] formatParameterName : string -> StringFormatMethodAttribute
Параметры
- formatParameterName String
-
Specifies which parameter of an annotated method should be treated as format-string
[StringFormatMethod(nameof(message))]
public void ShowError(string message, params object[] args)
{
//Do something
}
public void Foo()
{
ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
}