Beispiel #1
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Mode"]         = parser.ParseEnum <Mode>("Mode");
            file["MaxValue"]     = parser.ParseInt("MaxValue");
            file["MinValue"]     = parser.ParseInt("MinValue");
            file["Value"]        = parser.ParseInt("Value");
            file["ValueChanged"] = parser.ParseDelegate("ValueChanged");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiSlider.ThumbDrawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable), "ThumbDrawables");
                    break;

                case "UiSlider.TrackDrawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable), "TrackDrawables");
                    break;
                }
            }
        }
Beispiel #2
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Text"]     = parser.ParseString("Text");
            file["Icon"]     = parser.ParseResource <Texture2D>("Icon");
            file["Click"]    = parser.ParseDelegate("Click");
            file["Hold"]     = parser.ParseDelegate("Hold");
            file["Enabled"]  = parser.ParseBoolean("Enabled");
            file["Disabled"] = parser.ParseBoolean("Disabled");

            file["RepeatStart"]    = parser.ParseInt("RepeatStart");
            file["RepeatInterval"] = parser.ParseInt("RepeatInterval");

            file["PushSound"]    = parser.ParseResource <SoundEffect>("PushSound");
            file["ReleaseSound"] = parser.ParseResource <SoundEffect>("ReleaseSound");
            file["ActionSound"]  = parser.ParseResource <SoundEffect>("ActionSound");

            file["GestureMargin"] = parser.ParseLength("GestureMargin");

            file["Mode"] = parser.ParseEnum <UiButtonMode>("Mode");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiButton.Drawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable));
                    break;
                }
            }
        }
Beispiel #3
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Processor"] = Type.GetType(node.Attribute("Processor"));

            file["LinkResolver"] = parser.ParseDelegate("LinkResolver");

            file["ImageNotLoaded"] = parser.ParseResource <Texture2D>("ImageNotLoaded");

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

            file["Text"]        = parser.ParseString("Text");
            file["Font"]        = parser.ValueOrNull("Font");
            file["FontSize"]    = parser.ParseInt("FontSize");
            file["FontSpacing"] = parser.ParseInt("FontSpacing");

            for (int idx = 0; idx < (int)FontType.Count; ++idx)
            {
                FontType type    = (FontType)idx;
                string   font    = string.Format("{0}.Font", type);
                string   spacing = string.Format("{0}.FontSpacing", type);
                string   resize  = string.Format("{0}.FontResize", type);

                file[font]    = parser.ValueOrNull(font);
                file[spacing] = parser.ParseInt(spacing);
                file[resize]  = parser.ParseInt(resize);
            }

            for (int idx = 0; idx < (int)SizeType.Count; ++idx)
            {
                SizeType type = (SizeType)idx;
                string   size = string.Format("{0}.FontSize", type);

                file[size] = parser.ParseInt(size);
            }

            file["LineHeight"]       = parser.ParseInt("LineHeight");
            file["Indent"]           = parser.ParseLength("Indent");
            file["ParagraphSpacing"] = parser.ParseLength("ParagraphSpacing");

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

            file["TextColor"]            = parser.ParseColor("TextColor");
            file["LinkColor"]            = parser.ParseColor("LinkColor");
            file["ActiveLinkColor"]      = parser.ParseColor("ActiveLinkColor");
            file["HorizontalRulerColor"] = parser.ParseColor("HorizontalRulerColor");

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

            file["BulletText"]            = parser.ParseString("BulletText");
            file["HorizontalRulerHeight"] = parser.ParseLength("HorizontalRulerHeight");

            file["ClickMargin"] = parser.ParseLength("ClickMargin");
            file["UrlClick"]    = parser.ParseDelegate("UrlClick");
        }
Beispiel #4
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Sprite"]   = parser.ParseResource <Sprite>("Sprite");
            file["Sequence"] = parser.ParseString("Sequence");
        }
Beispiel #5
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["TopColor"]    = parser.ParseColor("TopColor");
            file["BottomColor"] = parser.ParseColor("BottomColor");
        }
Beispiel #6
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["LeftColor"]  = parser.ParseColor("LeftColor");
            file["RightColor"] = parser.ParseColor("RightColor");
        }
Beispiel #7
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Image"]       = parser.ParseResource <NinePatchImage>("Image");
            file["ScaleByUnit"] = parser.ParseBoolean("ScaleByUnit");
            file["Scale"]       = parser.ParseDouble("Scale");
            file["Color"]       = parser.ParseColor("Color");
        }
Beispiel #8
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Image"]         = parser.ParseResource <Texture2D>("Image");
            file["Stretch"]       = parser.ParseEnum <Stretch>("Stretch");
            file["Color"]         = parser.ParseColor("Color");
            file["RotationSpeed"] = parser.ParseDouble("RotationSpeed");
            file["ScaleByUnit"]   = parser.ParseBoolean("ScaleByUnit");
            file["Scale"]         = parser.ParseDouble("Scale");
        }
Beispiel #9
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);
            var parser = new DefinitionParser(node);

            file["Items"]     = parser.ParseDelegate("Items");
            file["Reversed"]  = parser.ParseBoolean("Reversed");
            file["RowHeight"] = parser.ParseLength("RowHeight");

            file["ExceedRule"]       = parser.ParseEnum <ScrollingService.ExceedRule>("ExceedRule");
            file["WheelScrollSpeed"] = parser.ParseDouble("WheelScrollSpeed");

            file["SeparatorHeight"] = parser.ParseLength("SeparatorHeight");

            file["MaxScrollExceed"] = parser.ParseLength("MaxScrollExceed");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiQuickList.Columns":
                    ParseColumns(cn, file);
                    break;

                case "UiQuickList.Separator":
                {
                    if (cn.Nodes.Count != 1)
                    {
                        string error = node.NodeError("UiQuickList.Separator must have exactly 1 child.");

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


                    DefinitionFile separatorDef = DefinitionFile.LoadFile(cn.Nodes[0]);
                    file["Separator"] = separatorDef;
                }
                break;
                }
            }
        }
Beispiel #10
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Text"]        = parser.ParseString("Text");
            file["Font"]        = parser.ValueOrNull("Font");
            file["FontSize"]    = parser.ParseInt("FontSize");
            file["FontSpacing"] = parser.ParseInt("FontSpacing");
            file["LineHeight"]  = parser.ParseInt("LineHeight");

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

            file["AutoSizeUpdate"] = parser.ParseBoolean("AutoSizeUpdate");
            file["TextRotation"]   = parser.ParseEnum <TextRotation>("TextRotation");

            file["TextMargin"] = parser.ParseMargin("TextMargin");
        }
Beispiel #11
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Text"]        = parser.ParseString("Text");
            file["Font"]        = parser.ValueOrNull("Font");
            file["FontSize"]    = parser.ParseInt("FontSize");
            file["FontSpacing"] = parser.ParseInt("FontSpacing");
            file["LineHeight"]  = parser.ParseInt("LineHeight");
            file["Indent"]      = parser.ParseLength("Indent");

            file["LineWidth"] = parser.ParseLength("LineWidth");

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

            file["TextColor"] = parser.ParseColor("TextColor");
            file["HorizontalContentAlignment"] = parser.ParseEnum <HorizontalContentAlignment>("HorizontalContentAlignment");
            file["VerticalContentAlignment"]   = parser.ParseEnum <VerticalContentAlignment>("VerticalContentAlignment");
        }
Beispiel #12
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

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

            List <DefinitionFile> list = new List <DefinitionFile>();

            foreach (var cn in node.Nodes)
            {
                if (!cn.Tag.Contains("."))
                {
                    list.Add(DefinitionFile.LoadFile(cn));
                }
            }

            if (list.Count > 0)
            {
                file["Children"] = list;
            }
        }
Beispiel #13
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Context"]       = parser.ParseDelegate("Context");
            file["ElementHeight"] = parser.ParseLength("ElementHeight");
            file["Spacing"]       = parser.ParseLength("Spacing");

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

            file["SelectedPositionOffset"] = parser.ParseLength("SelectedPositionOffset");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "ScrollingSelector.ItemDrawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable));
                    break;
                }
            }
        }
Beispiel #14
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Context"]       = parser.ParseString("Context");
            file["Mode"]          = parser.ParseEnum <Mode>("Mode");
            file["AlwaysVisible"] = parser.ParseBoolean("AlwaysVisible");

            foreach (var cn in node.Nodes)
            {
                switch (cn.Tag)
                {
                case "UiScrollBar.ThumbDrawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable), "ThumbDrawables");
                    break;

                case "UiScrollBar.TrackDrawables":
                    ParseDrawables(cn, file, typeof(ButtonDrawable), "TrackDrawables");
                    break;
                }
            }
        }