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

Definition

Пространство имён: Tessa.Properties.Resharper
Сборка: Tessa (в Tessa.dll) Версия: 3.6.0.22
C#
[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple = false, 
	Inherited = true)]
public sealed class StringFormatMethodAttribute : Attribute
Inheritance
Object    Attribute    StringFormatMethodAttribute

Пример

C#
[StringFormatMethod("message")]
public void ShowError(string message, params object[] args)
{
  //Do something
}
public void Foo()
{
  ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
}

Конструкторы

StringFormatMethodAttribute Initializes a new instance of the StringFormatMethodAttribute class. Initializes new instance of StringFormatMethodAttribute

Свойства

FormatParameterName Gets format parameter name
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Унаследован от Attribute)

Методы

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Унаследован от Attribute)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Унаследован от Object)
GetHashCodeReturns the hash code for this instance.
(Унаследован от Attribute)
GetTypeGets the Type of the current instance.
(Унаследован от Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Унаследован от Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Унаследован от Attribute)
MemberwiseCloneCreates a shallow copy of the current Object.
(Унаследован от Object)
ToStringReturns a string that represents the current object.
(Унаследован от Object)

Методы расширения

Get
(Определяется ComHelper)
InternalMarkerCanvas Возвращает маркер аннотации
(Определяется AnnotationInternalsAccessor)
Invoke
(Определяется ComHelper)
Set
(Определяется ComHelper)

См. также