Files
mono/mcs/class/System/System.ComponentModel/StringConverter.cs
T
Gonzalo Paniagua Javier f08d92fb2c 2002-08-23 Gonzalo Paniagua Javier <[email protected]>
* System.ComponentModel/BindableSupport.cs:
	* System.ComponentModel/Component.cs:
	* System.ComponentModel/EventDescriptorCollection.cs:
	* System.ComponentModel/ITypeDescriptorContext.cs:
	* System.ComponentModel/TypeConverter.cs:
	* System.ComponentModel/TypeDescriptor.cs:
	* System.Diagnostics/Process.cs: more class status based fixes.

	* System.ComponentModel/StringConverter.cs: implemented a couple of
	methods.

svn path=/trunk/mcs/; revision=6929
2002-08-23 05:37:58 +00:00

42 lines
784 B
C#

//
// System.ComponentModel.StringConverter
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.Globalization;
namespace System.ComponentModel {
public class StringConverter : TypeConverter
{
public StringConverter ()
{
}
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(String))
return true;
return base.CanConvertFrom (context, sourceType);
}
public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value == null)
return String.Empty;
if (value is string)
return (string) value;
return base.ConvertFrom (context, culture, value);
}
}
}