mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
//
|
|
// System.ComponentModel.ArrayConverter
|
|
//
|
|
// Authors:
|
|
// Martin Willemoes Hansen ([email protected])
|
|
// Andreas Nahr ([email protected])
|
|
//
|
|
// (C) 2003 Martin Willemoes Hansen
|
|
// (C) 2003 Andreas Nahr
|
|
//
|
|
|
|
using System.Globalization;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
public class ArrayConverter : CollectionConverter
|
|
{
|
|
public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value,
|
|
Type destinationType)
|
|
{
|
|
if (destinationType == null)
|
|
throw new ArgumentNullException ("destinationType");
|
|
|
|
if (destinationType == typeof (string) && (value is Array))
|
|
return "(Array)";
|
|
|
|
return base.ConvertTo (context, culture, value, destinationType);
|
|
}
|
|
|
|
public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
|
|
object value, Attribute[] attributes)
|
|
{
|
|
// LAMESPEC MS seems to always parse an PropertyDescriptorCollection without any PropertyDescriptors
|
|
return PropertyDescriptorCollection.Empty;
|
|
}
|
|
|
|
public override bool GetPropertiesSupported (ITypeDescriptorContext context)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|