mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 17:02:10 -10:00
* ISite.cs: Fixed attributes, fixed header * ITypeDescriptorContext.cs: Fixed attributes, formatting corrections * WarningException.cs: Fixed attributes, formatting corrections * AttributeCollection.cs: Fixed attributes * DesignerSerializationVisibility.cs: Fixed attributes * TypeConverter.cs: Fixed attributes * MarshalByValueComponent.cs: * IComponent.cs: Fixed attributes, supports .Net 1.0 and 1.1 * DescriptionAttribute.cs: * DesignerCategoryAttribute.cs: * DoubleConverter.cs: * EditorBrowsableAttribute.cs: * EventDescriptorCollection.cs: * PropertyChangedEventHandler.cs: * RefreshEventArgs.cs: * StringConverter.cs: * DefaultValueAttribute.cs: Reformatted following style guidelines * License.cs: Removed unused MonoTODOs * LicenseContext.cs: Implemented * LicenseException.cs: Implemented * LicenseProvider.cs: Removed unused MonoTODOs and unneccesary Finalizer * LicenseUsageMode.cs: Fixed enum * RefreshProperties.cs: Fixed enum * LicFileLicenseProvider.cs: Implementation added * ExtenderProvidedPropertyAttribute.cs: Implementation added, formatting corrections * ExpandableObjectConverter.cs: Implemented * ComponentConverter.cs: Implemented svn path=/trunk/mcs/; revision=15865
42 lines
807 B
C#
42 lines
807 B
C#
//
|
|
// System.ComponentModel.StringConverter.cs
|
|
//
|
|
// 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);
|
|
}
|
|
}
|
|
}
|
|
|