[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple = false,
Inherited = true)]
public sealed class StringFormatMethodAttribute : Attribute<AttributeUsageAttribute(AttributeTargets.Constructor Or AttributeTargets.Method, AllowMultiple := false,
Inherited := true)>
Public NotInheritable Class StringFormatMethodAttribute
Inherits Attribute[AttributeUsageAttribute(AttributeTargets::Constructor|AttributeTargets::Method, AllowMultiple = false,
Inherited = true)]
public ref class StringFormatMethodAttribute sealed : public Attribute[<SealedAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple = false,
Inherited = true)>]
type StringFormatMethodAttribute =
class
inherit Attribute
end[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 |
| TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Унаследован от Attribute) |
| Equals | Returns a value that indicates whether this instance is equal to a specified object. (Унаследован от Attribute) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Унаследован от Object) |
| GetHashCode | Returns the hash code for this instance. (Унаследован от Attribute) |
| GetType | Gets the Type of the current instance. (Унаследован от Object) |
| IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Унаследован от Attribute) |
| Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Унаследован от Attribute) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Унаследован от Object) |
| ToString | Returns a string that represents the current object. (Унаследован от Object) |