Esempio n. 1
0
 /// <summary>
 /// Convert from a string value to a <see cref="System.IO.Stream"/> instance.
 /// </summary>
 /// <param name="context">
 /// A <see cref="System.ComponentModel.ITypeDescriptorContext"/>
 /// that provides a format context.
 /// </param>
 /// <param name="culture">
 /// The <see cref="System.Globalization.CultureInfo"/> to use
 /// as the current culture.
 /// </param>
 /// <param name="val">
 /// The value that is to be converted.
 /// </param>
 /// <returns>
 /// A <see cref="System.IO.Stream"/> if successful.
 /// </returns>
 public override object ConvertFrom(
     ITypeDescriptorContext context,
     CultureInfo culture, object val)
 {
     if (val is string)
     {
         IResource resource = (IResource)resourceConverter.ConvertFrom(context, culture, val);
         return(resource.InputStream);
     }
     return(base.ConvertFrom(context, culture, val));
 }