public void OnLayoutRebuilt(IXmlLayout layout)
        {
            this.layout = layout;
            template    = layout.GetElementById("row-template").GameObject;
            var spinner = layout.GetElementById <SpinnerScript>("overload-spinner");

            elements = new Dictionary <string, XElement>();
            spinner.Values.Clear();
            foreach (var el in _xml.DescendantsAndSelf())
            {
                string name = el.Name.LocalName;
                if (spinner.Values.Contains(name))
                {
                    int i = 2;
                    while (spinner.Values.Contains(name + " " + i))
                    {
                        i++;
                    }
                    name = name + " " + i;
                }
                elements.Add(name, el);
                spinner.Values.Add(name);
            }
            spinner.Value           = _xml.Name.LocalName;
            spinner.OnValueChanged += OnSpinnerChange;
            rows.Clear();
            OnSpinnerChange(_xml.Name.LocalName);
        }
Ejemplo n.º 2
0
 public void OnLayoutRebuilt(IXmlLayout xmlLayout)
 {
     XmlLayout    = xmlLayout;
     ButtonObject = xmlLayout.GetElementById <XmlElement> ("ColorPickerButton");
 }
Ejemplo n.º 3
0
 public HomeController(IXmlLayout _service, IRazorLayout _rservice)
 {
     // unity throws an exception if DI missing in the confing file.
     service  = _service;
     rservice = _rservice;
 }
Ejemplo n.º 4
0
 public void OnLayoutRebuilt(IXmlLayout xmlLayout)
 {
     XmlLayout    = xmlLayout;
     ButtonObject = xmlLayout.GetElementById("overload-button").GameObject;
 }
Ejemplo n.º 5
0
        public static Panel LoadLayoutChildren(XmlNode LayoutFirstNode, Panel rootPanel, Dictionary <String, IXmlComponent> idList, String Namespace, IXmlLayout layout)
        {
            Panel targetPanel;

            if (LayoutFirstNode.Name.Equals("Panel"))
            {
                targetPanel = rootPanel;
            }
            else if (LayoutFirstNode.Name.Equals("Flow"))
            {
                targetPanel      = new FlowLayoutPanel();
                targetPanel.Dock = DockStyle.Fill;
                rootPanel.Controls.Add(targetPanel);
            }
            else
            {
                throw new Exception("올바른 Layout 태그가 아닙니다. <Panel> 이나 <Flow> 중 하나를 자식으로 가져야 합니다.");
            }



            XmlNode xPanel = LayoutFirstNode;

            foreach (XmlNode xCom in xPanel.ChildNodes)
            {
                //XmlNode xCom = xPanel.ChildNodes[i];
                if (xCom.NodeType != XmlNodeType.Element)
                {
                    continue;                                       //주석을 거른다.
                }
                if (xCom.Name.Equals("Component") == false)
                {
                    continue;                                         //오직 자식으로는 Component만을 가진다.
                }
                XmlComponent xCompo = new XmlComponent(targetPanel, idList, Namespace);
                xCompo.LoadXml(layout.Interface.Document, xCom);
                layout.Components.Add(xCompo);
            }

            return(targetPanel);
        }