Example #1
0
		void ReadPropertyDictionaryStart()
		{
			short identifier = reader.ReadInt16();

			PropertyDeclaration pd = this.GetPropertyDeclaration(identifier);
			XmlBamlElement element = elements.Peek();
			XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.Dictionary, pd);
			elements.Push(property);
			nodes.Enqueue(property);
		}
Example #2
0
		void ReadPropertyComplexStart()
		{
			short identifier = reader.ReadInt16();

			PropertyDeclaration pd = this.GetPropertyDeclaration(identifier);
			XmlBamlElement element = FindXmlBamlElement();

			XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.Complex, pd);
			elements.Push(property);
			nodes.Enqueue(property);
			complexPropertyOpened++;
		}
Example #3
0
		void ReadKeyElementStart()
		{
			short typeIdentifier = reader.ReadInt16();
			byte valueIdentifier = reader.ReadByte();
			// TODO: handle shared
			//bool shared = (valueIdentifier & 1) != 0;
			//bool sharedSet = (valueIdentifier & 2) != 0;
			int position = reader.ReadInt32();
			reader.ReadBoolean();
			reader.ReadBoolean();

			TypeDeclaration declaration = this.GetTypeDeclaration(typeIdentifier);

			XmlBamlPropertyElement property = new XmlBamlPropertyElement(elements.Peek(), PropertyType.Key, new PropertyDeclaration("Key", declaration));
			property.Position = position;
			elements.Push(property);
			nodes.Enqueue(property);
			complexPropertyOpened++;
		}
Example #4
0
		void EnqueueProperty(short identifier, string text)
		{
			PropertyDeclaration pd = this.GetPropertyDeclaration(identifier);
			XmlBamlElement element = FindXmlBamlElement();
			// if we've already read a nested element for the current element, this property must be a nested element as well
			if (HaveSeenNestedElement())
			{
				XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.Complex, pd);
				
				nodes.Enqueue(property);
				nodes.Enqueue(new XmlBamlText(text));
				nodes.Enqueue(new XmlBamlEndElement(property));
			}
			else
			{
				XmlBamlProperty property = new XmlBamlProperty(element, PropertyType.Value, pd);
				property.Value = text;
				
				nodes.Enqueue(property);
			}
		}