コード例 #1
0
 public SUIButton(object inContent)
     : base(inContent)
 {
     // At this point we check what content
     // The button should have. We could also
     // choose to support an Image as a button
     // interior
     if (inContent is string)
     {
         Label = new SUILabel(inContent);
         Label.setMargin(30, 10, 0, 0);
         Children.Add(Label);
     }
 }
コード例 #2
0
        private static SUIElement PARSE_XML_OBJECT(XmlNode inNode)
        {
            SUIElement currentElement;

            switch (inNode.Name)
            {
            default:
            case "body":
            case "div":

                currentElement = new SUIDivPanel(null);

                break;

            case "button":

                currentElement = new SUIButton(inNode.InnerText);

                break;

            case "label":

                currentElement = new SUILabel(inNode.InnerText);

                break;
            }

            if (inNode.Attributes != null)
            {
                if (inNode.Attributes["style"] != null)
                {
                    currentElement.Style = PARSE_STYLE(inNode.Attributes["style"].Value);
                }
            }


            foreach (XmlNode node in inNode.ChildNodes)
            {
                SUIElement element = PARSE_XML_OBJECT(node);

                if (element != null)
                {
                    currentElement.Children.Add(element);
                }
            }

            return(currentElement);
        }