I have the following class as a DataSource
for a ListBox:
class SeparatorChars
{
/// <summary>
/// Text to describe character
/// </summary>
public string Text { get; set; }
/// <summary>
/// Char value of the character
/// </summary>
public char Value { get; set; }
/// <summary>
/// Represent object as string
/// </summary>
/// <returns>String representing object</returns>
public override string ToString()
{
return Text + " '" + Value + "'";
}
}
The problem is, this by default will use the Value
just as a regular character added to a string, for example if I define this class for Tab
like this:
var TabSeparator = new SeparatorChars {Text = "Tab", Value = '\t'}
The string representation will be:
Tab ' '
But I need it to be
Tab '\t'
How to do this?!