ConvertFrom() публичный Метод

Performs the conversion from the given value to an Image object
public ConvertFrom ( ITypeDescriptorContext context, System culture, object value ) : object
context ITypeDescriptorContext Conversion context
culture System Culture to perform the conversion
value object Value to convert to an image
Результат object
Пример #1
0
		public override object ReadJson (Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			if (reader.TokenType == JsonToken.String)
			{
				var val = (string)((JValue)JToken.ReadFrom(reader)).Value;
				var converter = new Eto.Drawing.ImageConverter();
				return converter.ConvertFrom(val);
			}
			throw new JsonSerializationException("Image or Icon must be defined as a resource or file string");
		}
Пример #2
0
 public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     if (reader.TokenType == JsonToken.String)
     {
         var val       = (string)((JValue)JToken.ReadFrom(reader)).Value;
         var converter = new Eto.Drawing.ImageConverter();
         return(converter.ConvertFrom(val));
     }
     throw new JsonSerializationException("Image or Icon must be defined as a resource or file string");
 }