상속: XamlElement
예제 #1
0
        public override void AddChild(XamlElement child)
        {
            XamlPropertyElement prop = child as XamlPropertyElement;

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

            AddChildObject((XamlObjectElement)child);
        }
예제 #2
0
 private void AddChildProperty(XamlPropertyElement prop)
 {
     prop.DoSet();
 }
예제 #3
0
파일: XamlParser.cs 프로젝트: shana/moon
		private void ParentPropertyElement (XamlElement element, XamlPropertyElement prop)
		{
			XamlObjectElement obj = (XamlObjectElement) element;
		}
예제 #4
0
파일: XamlParser.cs 프로젝트: shana/moon
		private void ParsePropertyElement ()
		{
			Type t = ResolveType ();
			if (t == null)
				throw ParseException ("Unable to find the property {0}.", reader.LocalName);

			XamlPropertySetter setter = null;
			if (CurrentElement != null) {
				XamlObjectElement parent = CurrentElement as XamlObjectElement;

				if (parent == null)
					throw ParseException ("Property {0} does not have a parent.", reader.LocalName);
				if (!t.IsAssignableFrom (parent.Type))
					throw ParseException ("Property {0} is not a descendant if its parent object {1}.", reader.LocalName, parent.Type);
				setter = CurrentElement.LookupProperty (reader);
				if (setter == null)
					throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name);
			}

			XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter);
			OnElementBegin (element);
		}
예제 #5
0
파일: XamlParser.cs 프로젝트: dfr0/moon
		private void ParsePropertyElement ()
		{
			Log ("\tParsePropertyElement {0} {1}", reader.Name, CurrentElement.Name);

			if (reader.ManagedType == null)
				reader.ManagedType = ResolveType ();

			if (reader.ManagedType == null)
				throw ParseException ("Unable to find the property {0}.", reader.LocalName);

			XamlPropertySetter setter = null;
			if (CurrentElement != null) {
				XamlObjectElement parent = CurrentElement as XamlObjectElement;

				if (parent == null)
					throw ParseException ("Property {0} does not have a parent.", reader.LocalName);
				setter = CurrentElement.LookupProperty (reader);
				if (setter == null)
					throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name);
			} else
				throw ParseException ("A property element cannot be at the root of a document.");

			XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter);
			OnElementBegin (element);
		}
예제 #6
0
		private void AddChildProperty (XamlPropertyElement prop)
		{
			prop.DoSet ();
		}
예제 #7
0
파일: XamlParser.cs 프로젝트: snorp/moon
		private void ParsePropertyElement ()
		{
			Type t = ResolveType ();
			if (t == null)
				throw ParseException ("Unable to find the property {0}.", reader.LocalName);

			XamlPropertySetter setter = null;
			if (CurrentElement != null) {
				XamlObjectElement parent = CurrentElement as XamlObjectElement;

				if (parent == null)
					throw ParseException ("Property {0} does not have a parent.", reader.LocalName);
				setter = CurrentElement.LookupProperty (reader);
				if (setter == null)
					throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name);
			} else
				throw ParseException ("A property element cannot be at the root of a document.");

			XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter);
			OnElementBegin (element);

			// This is a self closing element ie <Deployment.Icons />
			if (reader.IsEmptyElement)
				OnElementEnd ();
		}