42 lines
No EOL
1.3 KiB
C#
42 lines
No EOL
1.3 KiB
C#
using System.ComponentModel;
|
|
using System.Globalization;
|
|
|
|
namespace JD.Serialization
|
|
{
|
|
|
|
#region TypeConverter
|
|
public class SoundDescriptor_TemplateConverter : UAFObjectConverter
|
|
{
|
|
public override bool CanConvertTo(ITypeDescriptorContext context,
|
|
System.Type destinationType)
|
|
{
|
|
if (destinationType == typeof(SoundDescriptor_Template))
|
|
return true;
|
|
|
|
return base.CanConvertTo(context, destinationType);
|
|
}
|
|
public override object ConvertTo(ITypeDescriptorContext context,
|
|
CultureInfo culture,
|
|
object value,
|
|
System.Type destinationType)
|
|
{
|
|
if (destinationType == typeof(System.String) &&
|
|
value is SoundDescriptor_Template)
|
|
{
|
|
|
|
SoundDescriptor_Template desc = (SoundDescriptor_Template)value;
|
|
|
|
return desc.Name.ToString();// +" " + GetTableInfo(value);
|
|
}
|
|
return base.ConvertTo(context, culture, value, destinationType);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
[TypeConverter(typeof(SoundDescriptor_TemplateConverter))]
|
|
public partial class SoundDescriptor_Template
|
|
{
|
|
|
|
}
|
|
} |