public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
if (context != null && context.Instance != null && provider != null)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = "Logos\\";
dlg.FileName = (string)value;
dlg.CheckFileExists = true;
dlg.CheckPathExists = true;
dlg.Multiselect = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string filename = FileUtils.GenerateRelativePath(dlg.FileName);
if (context.Instance is Array)
{
foreach(ChannelTV channel in context.Instance as Array)
channel.Logo = filename;
}
else
(context.Instance as ChannelTV).Logo = filename;
return filename;
}
}
return null;
}