Mono.Xaml.XamlTypeConverter.ConvertFrom C# (CSharp) Method

ConvertFrom() public method

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
return object
		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
		{
			string str_value = value as string;

			if (str_value != null) {
				object o = ConvertFromString (context, culture, str_value);
				if (o != null)
					return o;
			}

			return base.ConvertFrom (context, culture, value);
		}

Usage Example

Beispiel #1
0
        protected override PropertyPath ParsePropertyPath(string piece)
        {
            var converter = new XamlTypeConverter(parser, target_element, AttributeName, typeof(PropertyPath));
            var path      = converter.ConvertFrom(piece) as PropertyPath;

            if (path == null)
            {
                Console.Error.WriteLine("Error parsing property path: '{0}'.", piece);
                return(null);
            }

            return(path);
        }
All Usage Examples Of Mono.Xaml.XamlTypeConverter::ConvertFrom