예제 #1
0
        private XamlPropertySetter LookupReflectionProperty(IXamlNode reader)
        {
            XamlPropertySetter prop = XamlReflectionPropertyForName(Type, reader.LocalName);

            if (prop != null)
            {
                return(prop);
            }

            object        target = Object;
            MutableObject obj    = Object as MutableObject;

            if (obj != null)
            {
                target = obj.Object;
            }

            XamlPropertySetter evnt = XamlReflectionEventForName(target, reader.LocalName);

            if (evnt != null)
            {
                return(evnt);
            }

            XamlPropertySetter attached = XamlImplicitAttachedPropertyForName(target, reader.LocalName);

            if (attached != null)
            {
                return(attached);
            }

            return(null);
        }
예제 #2
0
        public override XamlPropertySetter LookupProperty(IXamlNode reader)
        {
            if (IsNameProperty(reader))
            {
                return(new XamlNamePropertySetter(this, (DependencyObject)Object));
            }

            XamlPropertySetter prop = LookupAttachedProperty(reader);

            if (prop != null)
            {
                return(prop);
            }

            prop = LookupReflectionProperty(reader);

            return(prop);
        }
예제 #3
0
        public XamlPropertyElement(XamlParser parser, string name, XamlPropertySetter setter) : base(parser, name)
        {
            Setter = setter;

            DetermineIfSetOnAdd();
        }
예제 #4
0
파일: XamlParser.cs 프로젝트: shana/moon
		private object ParseAttributeValue (XamlObjectElement element, XamlPropertySetter property)
		{
			object value = null;

			if (IsMarkupExpression (reader.Value))
				value = ParseAttributeMarkup (element, property);
			else {
				value = XamlTypeConverter.ConvertObject (this, element, property.Type, property.Converter, property.Name, reader.Value);
			}

			return value;
		}
예제 #5
0
파일: XamlParser.cs 프로젝트: shana/moon
		private object ParseAttributeMarkup (XamlObjectElement element, XamlPropertySetter property)
		{
			MarkupExpressionParser parser = new SL4MarkupExpressionParser (element.Object, property.Name, this, element);

			string expression = reader.Value;
			object o = parser.ParseExpression (ref expression);
			return o;
		}
예제 #6
0
파일: XamlParser.cs 프로젝트: dfr0/moon
		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);
		}
예제 #7
0
파일: XamlParser.cs 프로젝트: dfr0/moon
		private object ParseAttributeValue (XamlObjectElement element, XamlPropertySetter property, XamlAttribute ai)
		{
			object value = null;

			if (IsMarkupExpression (ai.Value))
				value = ParseAttributeMarkup (element, property, ai);
			else {
				try {
					value = property.ConvertTextValue (ai.Value);
				} catch (Exception ex) {
					throw ParseException ("Could not convert attribute value '{0}' on element {1} for property {2}.", ai.Value, element.Name, property.Name);
				}
			}
			return value;
		}
예제 #8
0
		public XamlPropertyElement (XamlParser parser, string name, XamlPropertySetter setter) : base (parser, name)
		{
			Setter = setter;

			DetermineIfSetOnAdd ();
		}
예제 #9
0
파일: XamlParser.cs 프로젝트: kangaroo/moon
		private object ParseAttributeValue (XamlObjectElement element, XamlPropertySetter property)
		{
			object value = null;

			if (IsMarkupExpression (reader.Value))
				value = ParseAttributeMarkup (element, property);
			else {
				value = property.ConvertTextValue (reader.Value);
			}

			return value;
		}
예제 #10
0
파일: XamlElement.cs 프로젝트: shana/moon
		public XamlPropertyElement (XamlParser parser, string name, XamlPropertySetter setter) : base (parser, name)
		{
			Setter = setter;
		}