mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
* 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
42 lines
784 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
|