Class ValueFormatAttribute
Custom attribute for formatting values in a specific way.
Namespace: CapyKit.Attributes
Assembly: CapyKit.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class ValueFormatAttribute : Attribute
Constructors
ValueFormatAttribute()
Default constructor. Initializes a new instance of the ValueFormatAttribute class with an empty format string.
Declaration
public ValueFormatAttribute()
ValueFormatAttribute(string)
Constructor. Initializes a new instance of the ValueFormatAttribute class with the specified format string.
Declaration
public ValueFormatAttribute(string format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | The format string used to format the value. |
Properties
Format
Gets or sets the format to use for formatting the value.
Declaration
public string Format { get; }
Property Value
| Type | Description |
|---|---|
| string | The format string used to format the value. |
Methods
GetFormatParameterizedString(int)
Gets a parameterized formatted string for the specified index.
Declaration
public string GetFormatParameterizedString(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | (Optional) Zero-based index of the item in the string to format. |
Returns
| Type | Description |
|---|---|
| string | A formatted string with the specified index and format. |