| ||||||||||||||||||||||||||
FontNamesConverter ClassSystem.Web.UI.WebControls Namespace Converts a string containing a list of font names to an array of strings containing the individual names. Also performs the reverse function.
|
||||||||||||||||||||||||||
| Visibility | Name | Parameters | Return Type |
|---|---|---|---|
| public | CanConvertFrom | ( ITypeDescriptorContext context , Type sourceType ) | Boolean |
| public | ConvertFrom | ( ITypeDescriptorContext context , CultureInfo culture , Object value ) | Object |
| public | ConvertTo | ( ITypeDescriptorContext context , CultureInfo culture , Object value , Type destinationType ) | Object |
Use the ConvertFrom method of this class to convert a single string containing a list of font names to an array of strings containing the individual names. Each font name in the string must be separated by a comma. For example, the string, "arial, times new roman, verdana", converts to an array that contains the strings "arial", "times new roman", and "verdana". Notice the commas are removed along with any white space at the beginning or end of the font name. White space in the middle of a font name is not removed.
The ConvertTo method performs the reverse operation. It converts an array of strings containing the individual font names to a single string containing a list of the names. For example, an array that contains the strings "arial", "times new roman", and "verdana" converts to the string, "arial,times new roman,verdana". Notice commas are automatically inserted between the font names without any white space.
Use the CanConvertFrom method to verify that the conversion can be made before using the ConvertFrom method.
The following example demonstrates how to use the FontNamesConverter class to convert a string with a list of font names to an array of strings containing the individual names. The array of strings is then converted back to a single string and displayed.
System.ComponentModel.TypeConverter
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme