Exemplo n.º 1
0
 public static void ReadFrame(Region frame, XmlNode node,
                              Region uiParent, Layer layer)
 {
     frame.UiParent = uiParent;
     frame.ReadNode(node);
     if (frame.Name == null)
         frame.GenerateName(null);
     if (!frame.Name.StartsWith("$parent")) {
         if (frame.IsVirtual)
             UiSystem.VirtualFrameMap[frame.Name] = frame;
         else {
             Debug.Assert(!UiSystem.FrameMap.ContainsKey(frame.Name),
                          string.Format("Newly generated frame '{0}' conflicts with existing frame", frame.Name));
             log.InfoFormat("Adding to FrameMap: {0}", frame.Name);
             UiSystem.FrameMap[frame.Name] = frame;
         }
     }
     if (frame == null)
         return;
     if (layer != null) {
         layer.AddElement(frame);
         return;
     }
     if (frame.UiParent != null) {
         Debug.Assert(frame.UiParent is Frame);
         ((Frame)frame.UiParent).AddElement(frame);
     }
 }