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

📄 mainwindowsetting.cs

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

    public class MainWindowSetting : PropertyDictionary, IUserConfig
    {
        private int _lastHeight;
        private int _lastWidth;
        private int _lastX;
        private int _lastY;
        private bool _ShowMouseTrails;
        private string _TreeExpandStatus = string.Empty;
        public const uint HotKeyShowMainwindowDef = 0xbe0001;

        internal MainWindowSetting()
        {
        }

        internal override void Clear()
        {
            this.ClearUserCfg();
            this.ClearLocalUserCfg();
        }

        public void ClearLocalUserCfg()
        {
        }

        public void ClearUserCfg()
        {
            base.TryRemove("GroupByMode");
            base.TryRemove("DisplayMode");
            base.TryRemove("ShowOnlineContactOnly");
        }

        public void ClearWndCfg()
        {
            base.TryRemove("TopMost");
            base.TryRemove("HotKeyShowMainwindow");
            base.TryRemove("HotKeyHideMainwindow");
            base.TryRemove("AutoPopup");
            base.TryRemove("AutoHide");
            base.TryRemove("AutoHideSeconds");
            base.TryRemove("LastX");
            base.TryRemove("LastY");
            base.TryRemove("LastWidth");
            base.TryRemove("LastHeight");
        }

        public void LoadLocalUserCfg(XmlNode node)
        {
            foreach (XmlNode node2 in node.ChildNodes)
            {
                switch (node2.Name)
                {
                    case "TreeExpandStatus":
                    {
                        this._TreeExpandStatus = node2.InnerText;
                        continue;
                    }
                    case "ShowMouseTrails":
                        break;

                    default:
                    {
                        continue;
                    }
                }
                bool.TryParse(node2.InnerText, ref this._ShowMouseTrails);
            }
        }

        public void LoadWndXml(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                bool flag = false;
                int num = 0;
                switch (node.Name)
                {
                    case "TopMost":
                    {
                        bool.TryParse(node.InnerText, ref flag);
                        this.TopMost = flag;
                        continue;
                    }
                    case "HotKeyShowMainwindow":
                    {
                        uint num2 = 0;
                        uint.TryParse(node.InnerText, ref num2);
                        this.HotKeyShowMainwindow = num2;
                        continue;
                    }
                    case "HotKeyHideMainwindow":
                    {
                        uint num3 = 0;
                        uint.TryParse(node.InnerText, ref num3);
                        this.HotKeyHideMainwindow = num3;
                        continue;
                    }
                    case "AutoPopup":
                    {
                        if (bool.TryParse(node.InnerText, ref flag))
                        {
                            this.AutoPopup = flag;
                        }
                        continue;
                    }
                    case "AutoHide":
                    {
                        bool.TryParse(node.InnerText, ref flag);
                        this.AutoHide = false;
                        continue;
                    }
                    case "AutoHideSeconds":
                    {
                        int.TryParse(node.InnerText, ref num);
                        this.AutoHideSeconds = num;
                        continue;
                    }
                    case "LastX":
                    {
                        int.TryParse(node.InnerText, ref num);
                        this._lastX = num;
                        continue;
                    }
                    case "LastY":
                    {
                        int.TryParse(node.InnerText, ref num);
                        this._lastY = num;
                        continue;
                    }
                    case "LastWidth":
                    {
                        int.TryParse(node.InnerText, ref num);
                        this._lastWidth = num;
                        continue;
                    }
                    case "LastHeight":
                    {
                        int.TryParse(node.InnerText, ref num);
                        this._lastHeight = num;
                        continue;
                    }
                }
            }
        }

        public void LoadXml(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                string name;
                if (((name = node.Name) != null) && ((name == "ShowOnlineContactOnly") || (name == "ShowMoreDetails")))
                {
                    bool flag = false;
                    bool.TryParse(node.InnerText, ref flag);
                    base.InnerSetPropertyValue<ProposedData<bool>>(node.Name, (ProposedData<bool>) flag);
                    continue;
                }
                int num = 0;
                int.TryParse(node.InnerText, ref num);
                base.InnerSetPropertyValue<ProposedData<int>>(node.Name, (ProposedData<int>) num);
            }
        }

        internal void ResetProposedProperties()
        {
            base.InnerResetProposedProperties();
        }

        public string ToLocalUserCfg()
        {
            return ((string.Format("<{0}>", "MainWindowSetting") + string.Format("<{0}><![CDATA[{1}]]></{0}>", "TreeExpandStatus", this.TreeExpandStatus)) + string.Format("<{0}>{1}</{0}>", "ShowMouseTrails", this.ShowMouseTrails) + string.Format("</{0}>", "MainWindowSetting"));
        }

        public override string ToString()
        {
            return (((string.Format("<{0}>", "MainWindowSetting") + string.Format("<{0}>{1}</{0}>", "GroupByMode", this.GroupByMode)) + string.Format("<{0}>{1}</{0}>", "DisplayMode", this.DisplayMode) + string.Format("<{0}>{1}</{0}>", "ShowOnlineContactOnly", this.ShowOnlineContactOnly)) + string.Format("<{0}>{1}</{0}>", "ShowMoreDetails", this.ShowMoreDetails) + string.Format("</{0}>", "MainWindowSetting"));
        }

        public string ToWndXml()
        {
            string text = "<MainWindowSetting>";
            return ((((((text + string.Format("<TopMost>{0}</TopMost>", this.TopMost)) + string.Format("<HotKeyShowMainwindow>{0}</HotKeyShowMainwindow>", this.HotKeyShowMainwindow) + string.Format("<HotKeyHideMainwindow>{0}</HotKeyHideMainwindow>", this.HotKeyHideMainwindow)) + string.Format("<AutoPopup>{0}</AutoPopup>", this.AutoPopup.ToString()) + string.Format("<AutoHide>{0}</AutoHide>", this.AutoHide.ToString())) + string.Format("<AutoHideSeconds>{0}</AutoHideSeconds>", this.AutoHideSeconds) + string.Format("<LastX>{0}</LastX>", this.LastPostionX)) + string.Format("<LastY>{0}</LastY>", this.LastPostionY) + string.Format("<LastWidth>{0}</LastWidth>", this.LastWidth)) + string.Format("<LastHeight>{0}</LastHeight>", this.LastHeight) + string.Format("</MainWindowSetting>", new object[0]));
        }

        public bool AutoHide
        {
            get
            {
                return base.InnerGetPropertyValue<bool>("AutoHide", false);
            }
            set
            {
                base.InnerSetPropertyValue<bool>("AutoHide", value);
            }
        }

        public int AutoHideSeconds
        {
            get
            {
                return base.InnerGetPropertyValue<int>("AutoHideSeconds", 30);
            }
            set
            {
                base.InnerSetPropertyValue<int>("AutoHideSeconds", value);
            }
        }

        public bool AutoPopup
        {
            get
            {
                return base.InnerGetPropertyValue<bool>("AutoPopup", true);
            }
            set
            {
                base.InnerSetPropertyValue<bool>("AutoPopup", value);
            }
        }

        [ConfigCategory(ConfigCategory.User)]
        public ProposedData<int> DisplayMode
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<int>>("DisplayMode", new ProposedData<int>(1));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<int>>("DisplayMode", value);
            }
        }

        [ConfigCategory(ConfigCategory.User)]
        public ProposedData<int> GroupByMode
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<int>>("GroupByMode", new ProposedData<int>(0));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<int>>("GroupByMode", value);
            }
        }

        public uint HotKeyHideMainwindow
        {
            get
            {
                return base.InnerGetPropertyValue<uint>("HotKeyHide", 0);
            }
            set
            {
                base.InnerSetPropertyValue<uint>("HotKeyHide", value);
            }
        }

        public uint HotKeyShowMainwindow
        {
            get
            {
                return base.InnerGetPropertyValue<uint>("HotKey", 0xbe0001);
            }
            set
            {
                base.InnerSetPropertyValue<uint>("HotKey", value);
            }
        }

        public uint HotKeyShowMainwindowFinal
        {
            get
            {
                if (this.HotKeyShowMainwindow != 0)
                {
                    return this.HotKeyShowMainwindow;
                }
                return 0xbe0001;
            }
        }

        public int LastHeight
        {
            get
            {
                return this._lastHeight;
            }
            set
            {
                this._lastHeight = value;
            }
        }

        public int LastPostionX
        {
            get
            {
                return this._lastX;
            }
            set
            {
                this._lastX = value;
            }
        }

        public int LastPostionY
        {
            get
            {
                return this._lastY;
            }
            set
            {
                this._lastY = value;
            }
        }

        public int LastWidth
        {
            get
            {
                return this._lastWidth;
            }
            set
            {
                this._lastWidth = value;
            }
        }

        public string RootNode
        {
            get
            {
                return "MainWindowSetting";
            }
        }

        public ProposedData<bool> ShowMoreDetails
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<bool>>("ShowMoreDetails", new ProposedData<bool>(true));
            }
            set
            {
                base.InnerSetPropertyValue<ProposedData<bool>>("ShowMoreDetails", value);
            }
        }

        [ConfigCategory(ConfigCategory.User)]
        public bool ShowMouseTrails
        {
            get
            {
                return this._ShowMouseTrails;
            }
            set
            {
                this._ShowMouseTrails = value;
            }
        }

        [ConfigCategory(ConfigCategory.User)]
        public ProposedData<bool> ShowOnlineContactOnly
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<bool>>("ShowOnlineContactOnly", new ProposedData<bool>(false));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<bool>>("ShowOnlineContactOnly", value);
            }
        }

        public bool TopMost
        {
            get
            {
                return base.InnerGetPropertyValue<bool>("TopMost", false);
            }
            set
            {
                base.InnerSetPropertyValue<bool>("TopMost", value);
            }
        }

        [ConfigCategory(ConfigCategory.User)]
        public string TreeExpandStatus
        {
            get
            {
                return this._TreeExpandStatus;
            }
            set
            {
                this._TreeExpandStatus = value;
            }
        }
    }
}

⌨️ 快捷键说明

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