public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (edSvc != null)
{
OpenFileDialog open = new OpenFileDialog();
open.FileName = Path.GetFileName((string)value);
try
{
open.InitialDirectory = Path.GetDirectoryName((string)value);
}
catch (Exception)
{
}
if (open.ShowDialog() == DialogResult.OK)
{
return open.FileName;
}
}
return value;
}