protected override void Init(Controllers.UiController controller, object binding, DefinitionFile definition)
        {
            base.Init(controller, binding, definition);

            DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(TransformGroup));

            _reverse = DefinitionResolver.Get <bool>(controller, binding, file["Reverse"], false);

            List <DefinitionFile> drawableFiles = file["Drawables"] as List <DefinitionFile>;

            if (drawableFiles != null)
            {
                foreach (var def in drawableFiles)
                {
                    ButtonDrawable drawable = def.CreateInstance(controller, binding) as ButtonDrawable;

                    if (drawable != null)
                    {
                        _drawables.Add(drawable);
                    }
                }
            }

            _transitionPushed = (file["TransitionEffect"] as DefinitionFile).CreateInstance(controller, binding) as TransitionEffect;
        }
        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));
                }
            }
        }
Exemple #3
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");
        }
Exemple #4
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");
        }
Exemple #6
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");
        }
Exemple #7
0
 public new static void Parse(XNode node, DefinitionFile file)
 {
     ButtonDrawable.Parse(node, file);
 }