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

📄 ssthemecontrol.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Pc.Options
{
    using Imps.Client.Core;
    using Imps.Client.Pc;
    using Imps.Client.Pc.Theme;
    using Imps.Client.Pc.XControl;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class SsThemeControl : OptionsControlBase
    {
        private IFrameworkWindow _iFrameworkWnd;
        private CheckBox cbHiddenBanner;
        private CheckBox cbHiddenMsgType;
        private CheckBox cbHiddenTab;
        private IContainer components;
        private XImageListButton dlThemes;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private PictureBox pbPreview;

        public SsThemeControl(IFrameworkWindow frmWnd)
        {
            this._iFrameworkWnd = frmWnd;
            this.InitializeComponent();
            this.LoadResource();
            this.InitThemeList();
            this.handleUIEvent();
            this.dlThemes.SelectedChanged += new EventHandler(this.dlThemes_SelectedIndexChanged);
        }

        public override bool CheckUserInput()
        {
            return true;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void dlThemes_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.pbPreview.Image = ThemeManager.GetPreviewImage(ThemeManager.Themes.get_Item(this.dlThemes.Items[this.dlThemes.SelectedIndex].Key));
            this.EnableControl();
        }

        private void EnableControl()
        {
            this.cbHiddenTab.Enabled = ThemeManagerTemp.CanHideChanel(ThemeManager.Themes.get_Item(this.dlThemes.Items[this.dlThemes.SelectedIndex].Key));
            this.cbHiddenBanner.Enabled = ThemeManagerTemp.CanHideAdv(ThemeManager.Themes.get_Item(this.dlThemes.Items[this.dlThemes.SelectedIndex].Key));
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {
        }

        private void handleUIEvent()
        {
            this.cbHiddenBanner.CheckedChanged += new EventHandler(this.uiData_Changed);
            this.cbHiddenMsgType.CheckedChanged += new EventHandler(this.uiData_Changed);
            this.cbHiddenTab.CheckedChanged += new EventHandler(this.uiData_Changed);
            this.dlThemes.SelectedChanged += new EventHandler(this.uiData_Changed);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(SsThemeControl));
            this.pbPreview = new PictureBox();
            this.groupBox1 = new GroupBox();
            this.dlThemes = new XImageListButton();
            this.groupBox2 = new GroupBox();
            this.cbHiddenMsgType = new CheckBox();
            this.cbHiddenBanner = new CheckBox();
            this.cbHiddenTab = new CheckBox();
            this.pbPreview.BeginInit();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            base.SuspendLayout();
            this.pbPreview.set_BackgroundImageLayout(4);
            this.pbPreview.set_ErrorImage(null);
            this.pbPreview.set_InitialImage(null);
            this.pbPreview.Location = new System.Drawing.Point(40, 0x94);
            this.pbPreview.Name = "pbPreview";
            this.pbPreview.Size = new Size(0x14d, 0x89);
            this.pbPreview.TabIndex = 9;
            this.pbPreview.TabStop = false;
            this.groupBox1.Controls.Add(this.pbPreview);
            this.groupBox1.Controls.Add(this.dlThemes);
            this.groupBox1.Location = new System.Drawing.Point(3, 3);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x19e, 0x139);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "界面风格";
            this.groupBox1.Enter += new EventHandler(this.groupBox1_Enter);
            this.dlThemes.BackColor = Color.Transparent;
            this.dlThemes.ImageBackground = (Image) manager.GetObject("dlThemes.ImageBackground");
            this.dlThemes.Location = new System.Drawing.Point(40, 20);
            this.dlThemes.Name = "dlThemes";
            this.dlThemes.SelectedImageBackground = (Image) manager.GetObject("dlThemes.SelectedImageBackground");
            this.dlThemes.SelectedIndex = -1;
            this.dlThemes.Size = new Size(0x14d, 0x42);
            this.dlThemes.SplitWidth = 10;
            this.dlThemes.TabIndex = 0;
            this.dlThemes.TabStop = false;
            this.groupBox2.Controls.Add(this.cbHiddenMsgType);
            this.groupBox2.Controls.Add(this.cbHiddenBanner);
            this.groupBox2.Controls.Add(this.cbHiddenTab);
            this.groupBox2.Location = new System.Drawing.Point(3, 0x142);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0x19e, 0x56);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "其他";
            this.cbHiddenMsgType.set_AutoSize(true);
            this.cbHiddenMsgType.Location = new System.Drawing.Point(0x11, 0x40);
            this.cbHiddenMsgType.Name = "cbHiddenMsgType";
            this.cbHiddenMsgType.Size = new Size(0xa8, 0x10);
            this.cbHiddenMsgType.TabIndex = 2;
            this.cbHiddenMsgType.Text = "隐藏会话界面消息类型图标";
            this.cbHiddenMsgType.set_UseVisualStyleBackColor(true);
            this.cbHiddenBanner.set_AutoSize(true);
            this.cbHiddenBanner.Location = new System.Drawing.Point(0x11, 0x2a);
            this.cbHiddenBanner.Name = "cbHiddenBanner";
            this.cbHiddenBanner.Size = new Size(120, 0x10);
            this.cbHiddenBanner.TabIndex = 1;
            this.cbHiddenBanner.Text = "隐藏主界面广告栏";
            this.cbHiddenBanner.set_UseVisualStyleBackColor(true);
            this.cbHiddenTab.set_AutoSize(true);
            this.cbHiddenTab.Location = new System.Drawing.Point(0x11, 20);
            this.cbHiddenTab.Name = "cbHiddenTab";
            this.cbHiddenTab.Size = new Size(0x90, 0x10);
            this.cbHiddenTab.TabIndex = 0;
            this.cbHiddenTab.Text = "隐藏主界面左侧标签栏";
            this.cbHiddenTab.set_UseVisualStyleBackColor(true);
            base.set_AutoScaleDimensions(new SizeF(6f, 12f));
            base.set_AutoScaleMode(1);
            base.Controls.Add(this.groupBox2);
            base.Controls.Add(this.groupBox1);
            base.Name = "SsThemeControl";
            base.Size = new Size(420, 480);
            base.Load += new EventHandler(this.SsThemeControl_Load);
            this.pbPreview.EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            base.ResumeLayout(false);
        }

        private void InitThemeList()
        {
            int num = -1;
            int num2 = 0;
            Dictionary<string, string>.Enumerator enumerator = ThemeManager.Themes.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair<string, string> pair = enumerator.get_Current();
                    string themeName = pair.get_Value();
                    XImageListButton.ImageItem item = new XImageListButton.ImageItem();
                    item.Key = pair.get_Key();
                    item.Image = ThemeManager.GetButtonImage(themeName);
                    if (pair.get_Value() == "default")
                    {
                        this.dlThemes.Items.Insert(0, item);
                    }
                    else
                    {
                        this.dlThemes.Items.Add(item);
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
            for (num2 = 0; num2 < this.dlThemes.Items.Count; num2++)
            {
                string text2 = this._user.Configuration.UserSetting.SkinSetting.CurrentSkinName.Value.ToLower();
                if (ThemeManager.Themes.get_Item(this.dlThemes.Items[num2].Key).ToLower() == text2.ToLower())
                {
                    num = num2;
                    break;
                }
            }
            if (num == -1)
            {
                num = 0;
            }
            this.dlThemes.SelectedIndex = num;
            this.pbPreview.Image = ThemeManager.GetPreviewImage(ThemeManager.Themes.get_Item(this.dlThemes.Items[num].Key));
        }

        private void LoadResource()
        {
        }

        private void SsThemeControl_Load(object sender, EventArgs e)
        {
            this.EnableControl();
        }

        private void uiData_Changed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._iFrameworkWnd, delegate {
                base.Modified = true;
            });
        }

        public override bool UpdateData(bool update)
        {
            if (update)
            {
                if (!this.CheckUserInput())
                {
                    return false;
                }
                string themeName = ThemeManager.Themes.get_Item(this.dlThemes.Items[this.dlThemes.SelectedIndex].Key);
                if (themeName != ThemeManager.ThemeName)
                {
                    ThemeManagerTemp.ApplyTheme(themeName);
                    this._user.Configuration.UserSetting.SkinSetting.CurrentSkinName.ProposedValue = themeName;
                    this._user.Configuration.UserSetting.ColorSetting = "默认颜色";
                }
                this._user.Configuration.UserSetting.HiddenBanner = this.cbHiddenBanner.Checked;
                this._user.Configuration.UserSetting.HiddenMsgType = this.cbHiddenMsgType.Checked;
                this._user.Configuration.UserSetting.HiddenTab = this.cbHiddenTab.Checked;
                ThemeManagerTemp.HideChanelAndAdvertisement(this.cbHiddenTab.Checked, this.cbHiddenBanner.Checked);
            }
            else
            {
                if ((this.dlThemes.SelectedIndex >= ThemeManager.Themes.get_Count()) || (this.dlThemes.SelectedIndex < 0))
                {
                    this.dlThemes.SelectedIndex = 0;
                }
                this.pbPreview.Image = ThemeManager.GetPreviewImage(ThemeManager.Themes.get_Item(this.dlThemes.Items[this.dlThemes.SelectedIndex].Key));
                this.cbHiddenBanner.Checked = this._user.Configuration.UserSetting.HiddenBanner;
                this.cbHiddenMsgType.Checked = this._user.Configuration.UserSetting.HiddenMsgType;
                this.cbHiddenTab.Checked = this._user.Configuration.UserSetting.HiddenTab;
            }
            base.Modified = false;
            return true;
        }

        private User _user
        {
            get
            {
                return this._iFrameworkWnd.AccountManager.CurrentUser;
            }
        }
    }
}

⌨️ 快捷键说明

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