LogConverter.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // System.Diagnostics.Design.LogConverter
  3. //
  4. // Authors:
  5. // Gert Driesen ([email protected])
  6. //
  7. // (C) 2004 Novell
  8. //
  9. using System.ComponentModel;
  10. using System.Globalization;
  11. namespace System.Diagnostics.Design
  12. {
  13. public class LogConverter : TypeConverter
  14. {
  15. public LogConverter ()
  16. {
  17. }
  18. public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
  19. {
  20. if (sourceType == typeof(string))
  21. return true;
  22. return base.CanConvertFrom (context, sourceType);
  23. }
  24. public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
  25. {
  26. if ((value as string) != null)
  27. return ((string) value).Trim ();
  28. return base.ConvertFrom (context, culture, value);
  29. }
  30. [MonoTODO]
  31. public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
  32. {
  33. throw new NotImplementedException ();
  34. }
  35. public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
  36. {
  37. return true;
  38. }
  39. }
  40. }