⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miscstyle.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Pc
{
    using Imps.Client.Pc.Theme;
    using Imps.Client.Utils;
    using Imps.Utils;
    using System;
    using System.Drawing;
    using System.Xml;

    public class MiscStyle : EStyleBase
    {
        private Bitmap _contactTipTitle;
        private Bitmap _folderBg;
        private static MiscStyle _instance = new MiscStyle();
        private Bitmap _sendButtonBg;
        private Bitmap _sendButtonBgDisable;
        private Bitmap _sendButtonBgDown;
        private Bitmap _sendButtonBgHover;
        private Imps.Client.Utils.RGB _transParentColor;

        public override void ChangeColor(int hue, double sat, double lum)
        {
            if (this._folderBg != null)
            {
                HSLFilter.ChangeImageColor(ref this._folderBg, hue, sat, lum, this.TransParentColor);
            }
            if (this._sendButtonBg != null)
            {
                HSLFilter.ChangeImageColor(ref this._sendButtonBg, hue, sat, lum, this.TransParentColor);
            }
            if (this._sendButtonBgHover != null)
            {
                HSLFilter.ChangeImageColor(ref this._sendButtonBgHover, hue, sat, lum, this.TransParentColor);
            }
            if (this._sendButtonBgDown != null)
            {
                HSLFilter.ChangeImageColor(ref this._sendButtonBgDown, hue, sat, lum, this.TransParentColor);
            }
            if (this._sendButtonBgDisable != null)
            {
                HSLFilter.ChangeImageColor(ref this._sendButtonBgDisable, hue, sat, lum, this.TransParentColor);
            }
            if (this._contactTipTitle != null)
            {
                HSLFilter.ChangeImageColor(ref this._contactTipTitle, hue, sat, lum, this.TransParentColor);
            }
        }

        private void LoadDefault()
        {
            this._folderBg = null;
            this._sendButtonBg = null;
            this._sendButtonBgDisable = this._sendButtonBgHover = (Bitmap) (this._sendButtonBgDown = null);
            this._contactTipTitle = null;
        }

        protected override void LoadStyle(XmlElement elem)
        {
            this.LoadDefault();
            string fileName = XmlHelper.ReadXmlAttributeString(elem, "folderBackground");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._folderBg = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            fileName = XmlHelper.ReadXmlAttributeString(elem, "sendButtonBackground");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._sendButtonBg = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            fileName = XmlHelper.ReadXmlAttributeString(elem, "sendButtonBackgroundDown");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._sendButtonBgDown = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            fileName = XmlHelper.ReadXmlAttributeString(elem, "sendButtonBackgroundHover");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._sendButtonBgHover = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            fileName = XmlHelper.ReadXmlAttributeString(elem, "sendButtonBackgroundDisable");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._sendButtonBgDisable = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            fileName = XmlHelper.ReadXmlAttributeString(elem, "contactTipTitle");
            if (!string.IsNullOrEmpty(fileName))
            {
                this._contactTipTitle = (Bitmap) Image.FromFile(ThemeManager.GetImagePath(fileName));
            }
            int? nullable = null;
            if (elem.HasAttribute("transColor"))
            {
                nullable = new int?(Convert.ToInt32(elem.GetAttribute("transColor"), 0x10));
            }
            if (nullable.get_HasValue())
            {
                this._transParentColor = new Imps.Client.Utils.RGB(Color.FromArgb(0xff, Color.FromArgb(nullable.get_Value())));
            }
        }

        public Image ContactTipTitle
        {
            get
            {
                return this._contactTipTitle;
            }
        }

        public Image FolderBg
        {
            get
            {
                return this._folderBg;
            }
        }

        public static MiscStyle Instance
        {
            get
            {
                return _instance;
            }
        }

        public Image SendButtonBgDisable
        {
            get
            {
                return this._sendButtonBgDisable;
            }
        }

        public Image SendButtonBgDown
        {
            get
            {
                return this._sendButtonBgDown;
            }
        }

        public Image SendButtonBgHover
        {
            get
            {
                return this._sendButtonBgHover;
            }
        }

        public Image SendButtonBgNormal
        {
            get
            {
                return this._sendButtonBg;
            }
        }

        public Imps.Client.Utils.RGB TransParentColor
        {
            get
            {
                return this._transParentColor;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -