//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//------------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System.ComponentModel;
using System.Globalization;
using System.Security.Permissions;
///
/// Converts an object to String.Empty so it looks better in the designer property grid.
///
internal sealed class EmptyStringExpandableObjectConverter : ExpandableObjectConverter {
///
/// Returns String.Empty so the object looks better in the designer property grid.
///
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) {
if (destinationType == typeof(string)) {
return String.Empty;
}
throw GetConvertToException(value, destinationType);
}
}
}