| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // System.Web.UI.Design.DataFieldConverter
- //
- // Authors:
- // Gert Driesen ([email protected])
- //
- // (C) 2004 Novell
- //
- using System.ComponentModel;
- using System.Globalization;
- namespace System.Web.UI.Design
- {
- public class DataFieldConverter : TypeConverter
- {
- public DataFieldConverter ()
- {
- }
- public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
- {
- return (sourceType == typeof(string));
- }
- public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if (value == null)
- return string.Empty;
- if (value.GetType () == typeof(string))
- return ((string) value);
- throw base.GetConvertFromException (value);
- }
- [MonoTODO]
- public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
- public override bool GetStandardValuesExclusive (ITypeDescriptorContext context)
- {
- return false;
- }
- public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
- {
- return ((context.Instance as IComponent) != null);
- }
- }
- }
|