00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.Drawing;
00005 using System.Drawing.Design;
00006 using System.ComponentModel;
00007 using System.Windows.Forms;
00008 using System.Globalization;
00009
00010 namespace DXGfxLib
00011 {
00012 public class FileNameConverter : StringConverter
00013 {
00014 public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
00015 {
00016 return true;
00017 }
00018
00019 public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
00020 {
00021 string current = context.Instance as string;
00022
00023 if (current == null)
00024 {
00025 current = "N/A";
00026 }
00027
00028 Button selectBtn = new Button();
00029
00030 return new StandardValuesCollection(new Object[] { current, selectBtn });
00031 }
00032
00033 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
00034 {
00035 return base.ConvertTo(context, culture, value, destinationType);
00036 }
00037 }
00038 }