示例#1
0
		public static void ProcessChildren(XamlContext ctx, BamlBlockNode node, BamlElement nodeElem) {
			ctx.XmlNs.PushScope(nodeElem);
			if (nodeElem.Xaml.Element != null)
				nodeElem.Xaml.Element.AddAnnotation(ctx.XmlNs.CurrentScope);
			foreach (var child in node.Children) {
				var handler = LookupHandler(child.Type);
				if (handler == null) {
					Debug.WriteLine("BAML Handler {0} not implemented.", child.Type);
					continue;
				}
				var elem = handler.Translate(ctx, (BamlNode)child, nodeElem);
				if (elem != null) {
					nodeElem.Children.Add(elem);
					elem.Parent = nodeElem;
				}

				ctx.CancellationToken.ThrowIfCancellationRequested();
			}
			ctx.XmlNs.PopScope();
		}
示例#2
0
 public void PushScope(BamlElement element)
 {
     CurrentScope = new XmlnsScope(CurrentScope, element);
 }
示例#3
0
 public XmlnsScope(XmlnsScope prev, BamlElement elem)
 {
     PreviousScope = prev;
     Element       = elem;
 }