示例#1
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        private void LoadColors(bool inherited, XElement e, ref SkinStates <Color> colors)
        {
            if (e != null)
            {
                ReadAttributeColor(ref colors.Enabled, inherited, e.Element("Colors").Element("Enabled"), "Color", Color.White, false);
                ReadAttributeColor(ref colors.Hovered, inherited, e.Element("Colors").Element("Hovered"), "Color", colors.Enabled, false);
                ReadAttributeColor(ref colors.Pressed, inherited, e.Element("Colors").Element("Pressed"), "Color", colors.Enabled, false);
                ReadAttributeColor(ref colors.Focused, inherited, e.Element("Colors").Element("Focused"), "Color", colors.Enabled, false);
                ReadAttributeColor(ref colors.Disabled, inherited, e.Element("Colors").Element("Disabled"), "Color", colors.Enabled, false);
            }
        }
示例#2
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        public SkinText(SkinText source)
            : base(source)
        {
            if (source != null)
            {
                this.Font      = new SkinFont(source.Font);
                this.OffsetX   = source.OffsetX;
                this.OffsetY   = source.OffsetY;
                this.Alignment = source.Alignment;
                this.Colors    = source.Colors;
            }
        }
示例#3
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        public SkinLayer(SkinLayer source)
            : base(source)
        {
            if (source != null)
            {
                this.Image          = new SkinImage(source.Image);
                this.Width          = source.Width;
                this.Height         = source.Height;
                this.OffsetX        = source.OffsetX;
                this.OffsetY        = source.OffsetY;
                this.Alignment      = source.Alignment;
                this.SizingMargins  = source.SizingMargins;
                this.ContentMargins = source.ContentMargins;
                this.States         = source.States;
                this.Overlays       = source.Overlays;
                this.Text           = new SkinText(source.Text);
                this.Attributes     = new SkinList <SkinAttribute>(source.Attributes);
            }
            else
            {
                throw new Exception("Parameter for SkinLayer copy constructor cannot be null.");
            }
        }