MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
CsvConverter.cs
1using System;
2using System.Collections.Generic;
4using System.Globalization;
5using System.Linq;
6using System.Text;
7using System.Threading.Tasks;
8
10{
14 public class CsvConverter : TypeConverter
15 {
24 public override object ConvertTo(ITypeDescriptorContext context,
25 CultureInfo culture, object value, Type destinationType)
26 {
27 List<String> v = value as List<String>;
28
29 if (destinationType == typeof(string) && v != null)
30 {
31 return String.Join(",", v.ToArray());
32 }
33
34 return base.ConvertTo(context, culture, value, destinationType);
35 }
36 }
37}
The CsvConverter is used to display string lists on a single line in a property grid.
Definition: CsvConverter.cs:15
override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Overrides the ConvertTo method of TypeConverter.
Definition: CsvConverter.cs:24