ConvertValue() public méthode

public ConvertValue ( Type type, object value ) : object
type System.Type
value object
Résultat object
Exemple #1
0
		private object ParseAttributeMarkup (XamlObjectElement element, XamlPropertySetter property, XamlAttribute ai)
		{
			MarkupExpressionParser parser = new SL4MarkupExpressionParser (element.Object, property.Name, this, element);

			string expression = ai.Value;
			object o = null;

			try {
				o = parser.ParseExpression (ref expression);
			} catch (Exception e) {
				throw ParseException ("Could not convert attribute value '{0}' on element {1} for property {2}.", ai.Value, element.Name, property.Name);
			}

			if (o == null && !MarkupExpressionParser.IsExplicitNull (expression))
				throw ParseException ("Unable to convert attribute value: '{0}'.", ai.Value);

			return property.ConvertValue (property.Type, o);
		}