示例#1
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            ButtonDrawable.Parse(node, file);

            var parser = new DefinitionParser(node);

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

            foreach (var cn in node.Nodes)
            {
                if (cn.Tag == "TransformGroup.TransitionEffect")
                {
                    if (cn.Nodes.Count != 1)
                    {
                        string error = node.NodeError("TransformGroup.TransitionEffect must have exactly 1 child.");
                        if (DefinitionParser.EnableCheckMode)
                        {
                            ConsoleEx.WriteLine(error);
                        }
                        else
                        {
                            throw new Exception(error);
                        }
                    }

                    file["TransitionEffect"] = DefinitionFile.LoadFile(cn.Nodes[0]);
                }
                else if (cn.Tag == "TransformGroup.Drawables")
                {
                    UiView.ParseDrawables(cn, file, typeof(ButtonDrawable));
                }
            }
        }
示例#2
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            ButtonDrawable.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["HorizontalContentAlignment"] = parser.ParseEnum <HorizontalContentAlignment>("HorizontalContentAlignment");
            file["VerticalContentAlignment"]   = parser.ParseEnum <VerticalContentAlignment>("VerticalContentAlignment");
            file["Scale"]   = parser.ParseDouble("Scale");
            file["Stretch"] = parser.ParseEnum <Stretch>("Stretch");
        }
示例#3
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            ButtonDrawable.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Image"] = parser.ParseResource <Texture2D>("Image");
            file["Scale"] = parser.ParseScale("Scale");
            file["HorizontalContentAlignment"] = parser.ParseEnum <HorizontalContentAlignment>("HorizontalContentAlignment");
            file["VerticalContentAlignment"]   = parser.ParseEnum <VerticalContentAlignment>("VerticalContentAlignment");
        }
        public new static void Parse(XNode node, DefinitionFile file)
        {
            ButtonDrawable.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["ImagePushed"]   = parser.ParseResource <NinePatchImage>("ImagePushed");
            file["ImageReleased"] = parser.ParseResource <NinePatchImage>("Image");
            file["ImageDisabled"] = parser.ParseResource <NinePatchImage>("ImageDisabled");
            file["ScaleByUnit"]   = parser.ParseBoolean("ScaleByUnit");

            file["Scale"] = parser.ParseDouble("Scale");
        }
示例#5
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            ButtonDrawable.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Font"]        = parser.Value("Font");
            file["FontSize"]    = parser.ParseInt("FontSize");
            file["FontSpacing"] = parser.ParseInt("FontSpacing");
            file["LineHeight"]  = parser.ParseInt("LineHeight");
            file["HorizontalContentAlignment"] = parser.ParseEnum <HorizontalContentAlignment>("HorizontalContentAlignment");
            file["VerticalContentAlignment"]   = parser.ParseEnum <VerticalContentAlignment>("VerticalContentAlignment");
            file["Text"]         = parser.ParseString("Text");
            file["TextRotation"] = parser.ParseEnum <TextRotation>("TextRotation");
        }
示例#6
0
 public new static void Parse(XNode node, DefinitionFile file)
 {
     ButtonDrawable.Parse(node, file);
 }