Ejemplo n.º 1
0
		public override object Clone()
		{
			var newElse = new Else();
			newElse.Label = Label;

			foreach (var node in Nodes)
				newElse.Nodes.Add((ThemeNode)node.Clone());

			return newElse;
		}
Ejemplo n.º 2
0
        public override void ReadXml(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
                if (!TryReadXmlAttribute(reader))
                    MapXmlReader.HandleUnexpectedAttribute(reader.LocalName);

            reader.MoveToElement();
            if (!reader.IsEmptyElement)
            {
                var isElsePresent = false;
                reader.Read();
                while (reader.MoveToContent() != XmlNodeType.EndElement)
                    if (reader.IsStartElement(When.ElementName) && !isElsePresent)
                    {
                        var when = new When();
                        Nodes.Add(when);
                        when.ReadXml(reader);
                    }
                    else if (reader.IsStartElement(Else.ElementName))
                    {
                        var elseNode = new Else();
                        Nodes.Add(elseNode);
                        elseNode.ReadXml(reader);
                        isElsePresent = true;
                    }
                    else MapXmlReader.HandleUnexpectedElement(reader.LocalName);
            }
            reader.Read();
        }