Esempio n. 1
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["Mode"]    = parser.ParseEnum <Mode>("Mode");
            file["Spacing"] = parser.ParseLength("Spacing", false);
            file["Padding"] = parser.ParseLength("Padding", false);
            file["NotifyParentOnResize"] = parser.ParseBoolean("NotifyParentOnResize");

            file["ExpandTime"]   = parser.ParseInt("ExpandTime");
            file["CollapseTime"] = parser.ParseInt("CollapseTime");
            file["Expanded"]     = parser.ParseBoolean("Expanded");

            file["Wrap"] = parser.ParseBoolean("Wrap");

            file["HorizontalContentAlignment"] = parser.ParseEnum <HorizontalContentAlignment>("HorizontalContentAlignment");
            file["VerticalContentAlignment"]   = parser.ParseEnum <VerticalContentAlignment>("VerticalContentAlignment");

            file["CollapseFinished"] = parser.ParseDelegate("CollapseFinished");
            file["ExpandFinished"]   = parser.ParseDelegate("ExpandFinished");

            file["ExpandStarted"] = parser.ParseDelegate("ExpandStarted");
        }
Esempio n. 2
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["SelectedIndex"]  = parser.ParseInt("SelectedIndex");
            file["TransitionTime"] = parser.ParseDouble("TransitionTime");
            file["Cycle"]          = parser.ParseBoolean("Cycle");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiContentSlider.ShowTransitionEffect":
                case "UiContentSlider.HideTransitionEffect":
                case "UiContentSlider.ShowTransitionEffectNext":
                case "UiContentSlider.HideTransitionEffectNext":
                case "UiContentSlider.ShowTransitionEffectPrev":
                case "UiContentSlider.HideTransitionEffectPrev":
                    ParseTransitionEffect(cn, file);
                    break;
                }
            }
        }
Esempio n. 3
0
 public void OutsideViewInitialize(UiContainer parent)
 {
     Parent = parent;
     RegisterView();
     ViewAdded();
     ViewUpdate(0);
 }
Esempio n. 4
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["Page"] = parser.ParseString("Page");
        }
Esempio n. 5
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["FitChildren"] = parser.ParseBoolean("FitChildren");
        }
Esempio n. 6
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["TouchOutsideToHide"] = parser.ParseBoolean("TouchOutsideToHide");
            file["ClickOutside"]       = parser.ParseDelegate("ClickOutside");
        }
Esempio n. 7
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["Mode"]         = parser.ParseEnum <Mode>("Mode");
            file["Position"]     = parser.ParseLength("Position");
            file["SplitterSize"] = parser.ParseLength("SplitterSize");
        }
Esempio n. 8
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Mode"]             = parser.ParseEnum <Scroller.Mode>("Mode");
            file["WheelScrollSpeed"] = parser.ParseDouble("WheelScrollSpeed");
            file["ExceedRule"]       = parser.ParseEnum <ScrollingService.ExceedRule>("ExceedRule");
        }
Esempio n. 9
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["PageController"] = file["Controller"];
            file["Controller"]     = null;

            file["PageShown"] = parser.ParseBoolean("PageShown");
        }
Esempio n. 10
0
 public new static void Parse(XNode node, DefinitionFile file)
 {
     UiContainer.Parse(node, file);
 }
Esempio n. 11
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiContainer.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["Items"]            = parser.ParseDelegate("Items");
            file["Mode"]             = parser.ParseEnum <Mode>("Mode");
            file["Reverse"]          = parser.ParseBoolean("Reverse");
            file["MaxAddFirstTime"]  = parser.ParseInt("MaxAddFirstTime");
            file["MaxAddOneTime"]    = parser.ParseInt("MaxAddOneTime");
            file["ExceedRule"]       = parser.ParseEnum <ScrollingService.ExceedRule>("ExceedRule");
            file["WheelScrollSpeed"] = parser.ParseDouble("WheelScrollSpeed");
            file["MaxScrollExceed"]  = parser.ParseLength("MaxScrollExceed");

            Dictionary <Type, DefinitionFile> additionalTemplates = new Dictionary <Type, DefinitionFile>();

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiListBox.ItemTemplate":
                {
                    if (cn.Nodes.Count != 1)
                    {
                        string error = node.NodeError("UiListBox.ItemTemplate must have exactly 1 child.");

                        if (DefinitionParser.EnableCheckMode)
                        {
                            ConsoleEx.WriteLine(error);
                        }
                        else
                        {
                            throw new Exception(error);
                        }
                    }

                    if (string.IsNullOrEmpty(cn.Attribute("DataType")))
                    {
                        if (file["Template"] != null)
                        {
                            string error = node.NodeError("UiListBox default template already defined.");

                            if (DefinitionParser.EnableCheckMode)
                            {
                                ConsoleEx.WriteLine(error);
                            }
                            else
                            {
                                throw new Exception(error);
                            }
                        }

                        file["Template"] = DefinitionFile.LoadFile(cn.Nodes[0]);
                    }
                    else
                    {
                        Type type = Type.GetType(cn.Attribute("DataType"));

                        if (type == null)
                        {
                            string error = node.NodeError("Cannot find type: {0}", cn.Attribute("DataType"));

                            if (DefinitionParser.EnableCheckMode)
                            {
                                ConsoleEx.WriteLine(error);
                            }
                            else
                            {
                                throw new Exception(error);
                            }
                        }

                        additionalTemplates.Add(type, DefinitionFile.LoadFile(cn.Nodes[0]));
                    }
                }
                break;
                }
            }

            if (additionalTemplates.Count > 0)
            {
                file["AdditionalTemplates"] = additionalTemplates;
            }
        }