2003-07-02 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
[mono.git] / mcs / class / System / System.ComponentModel / ReferenceConverter.cs
1 //
2 // System.ComponentModel.ReferenceConverter.cs
3 //
4 // Authors:
5 //   Martin Willemoes Hansen (mwh@sysrq.dk)
6 //   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 //
8 // (C) 2003 Martin Willemoes Hansen
9 // (C) 2003 Andreas Nahr
10 //
11
12 using System.Globalization;
13
14 namespace System.ComponentModel
15 {
16         public class ReferenceConverter : TypeConverter
17         {
18
19                 public ReferenceConverter (Type type)
20                 {
21                 }
22
23                 public override bool CanConvertFrom (ITypeDescriptorContext context,
24                                                      Type sourceType)
25                 {
26                         if (sourceType == typeof (string)) 
27                                 return true;
28                         return base.CanConvertFrom (context, sourceType);
29                 }
30
31                 [MonoTODO]
32                 public override object ConvertFrom (ITypeDescriptorContext context,
33                                                     CultureInfo culture,
34                                                     object value)
35                 {
36                         throw new NotImplementedException();
37                 }
38
39                 [MonoTODO]
40                 public override object ConvertTo (ITypeDescriptorContext context,
41                                                   CultureInfo culture,
42                                                   object value,
43                                                   Type destinationType)
44                 {
45                         throw new NotImplementedException();
46                 }
47
48                 [MonoTODO]
49                 public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
50                 {
51                         throw new NotImplementedException();
52                 }
53
54                 public override bool GetStandardValuesExclusive (ITypeDescriptorContext context)
55                 {
56                         return true;
57                 }
58
59                 public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
60                 {
61                         return true;
62                 }
63
64                 protected virtual bool IsValueAllowed (ITypeDescriptorContext context, object value)
65                 {
66                         return true;
67                 }
68         }
69 }