// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// Purpose: Converter for the Axes array.
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
namespace FastReport.DataVisualization.Charting
{
///
/// Converter object of axes array
///
internal class AxesArrayConverter : TypeConverter
{
#region Converter methods
///
/// Subproperties NOT suported.
///
/// Descriptor context.
/// Always false.
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
return false;
}
///
/// Overrides the ConvertTo method of TypeConverter.
///
/// Descriptor context.
/// Culture information.
/// Value.
/// Destination type.
/// Converted object.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
// Convert collection to string
if (destinationType == typeof(string))
{
return (new CollectionConverter()).ConvertToString(new ArrayList());
}
return base.ConvertTo(context, culture, value, destinationType);
}
#endregion
}
}