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

📄 configuration.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
                                string name;
                                if ((((name = attribute.Name) != null) && (name != "experience")) && (name != "save-mms"))
                                {
                                    if (name == "version")
                                    {
                                        int num = 0;
                                        int.TryParse(attribute.Value, ref num);
                                        this._userSetting.CfgVersion = num;
                                    }
                                    else if (name == "save-message")
                                    {
                                        goto Label_016A;
                                    }
                                }
                                continue;
                            Label_016A:
                                val = Imps.Client.Core.UserSetting.String2Boolean(attribute.Value);
                                this._userSetting.ConversationSetting.SaveMessages = (bool) new ProposedData<bool>(val);
                            }
                            continue;
                        }
                        case "custom-config":
                        {
                            if (node.Attributes["version"] != null)
                            {
                                int num2 = 0;
                                int.TryParse(node.Attributes["version"].Value, ref num2);
                                this._userSetting.CustomerCfgVersion = num2;
                            }
                            node.InnerXml = GZipHelper.DecompressString(node.InnerText);
                            this.InitCustomerCfgNode(node);
                            continue;
                        }
                        case "local-config":
                        {
                            this.InitLocalCfgNode(node);
                            continue;
                        }
                        case "SkinName":
                        {
                            this._userSetting.SkinSetting.CurrentSkinName = new ProposedData<string>(node.InnerText);
                            continue;
                        }
                        case "HiddenTab":
                        {
                            try
                            {
                                this._userSetting.HiddenTab = bool.Parse(node.InnerText);
                            }
                            catch
                            {
                                this._userSetting.HiddenTab = false;
                            }
                            continue;
                        }
                        case "HiddenMsgType":
                        {
                            try
                            {
                                this._userSetting.HiddenMsgType = bool.Parse(node.InnerText);
                            }
                            catch
                            {
                                this._userSetting.HiddenMsgType = false;
                            }
                            continue;
                        }
                        case "HiddenBanner":
                        {
                            try
                            {
                                this._userSetting.HiddenBanner = bool.Parse(node.InnerText);
                            }
                            catch
                            {
                                this._userSetting.HiddenBanner = false;
                            }
                            continue;
                        }
                        case "ColorSetting":
                        {
                            try
                            {
                                this._userSetting.ColorSetting = node.InnerText;
                            }
                            catch
                            {
                                this._userSetting.ColorSetting = string.Empty;
                            }
                            continue;
                        }
                    }
                }
            }
        }

        private void LoadWindowsUserSetting(XmlNode wndNode)
        {
            if (wndNode != null)
            {
                foreach (XmlNode node in wndNode.ChildNodes)
                {
                    switch (node.Name)
                    {
                        case "MainWindowSetting":
                        {
                            this._userSetting.MainWindowSetting.LoadWndXml(node);
                            continue;
                        }
                        case "ConversationSetting":
                        {
                            this._userSetting.ConversationSetting.LoadWndXml(node);
                            continue;
                        }
                        case "NetworkSetting":
                        {
                            this._userSetting.NetworkSetting.LoadXml(node);
                            continue;
                        }
                        case "SoundSetting":
                        {
                            this._userSetting.SoundSetting.LoadWndXml(node);
                            continue;
                        }
                        case "SystemSetting":
                            break;

                        default:
                        {
                            continue;
                        }
                    }
                    this._sysSetting.RecordMyLog = XmlHelper.ReadXmlAttributeBoolean(node, "record-log", false);
                }
            }
        }

        public void LoadWndUserCfg()
        {
            this._owner.PersistentManager.LoadWindowsUserCfg(new PersistentDelegate(this.LoadWindowsUserSetting));
        }

        public void SaveAll()
        {
            this.SaveSysCfg();
            this.SaveUserCfg();
            this.SaveWndUserCfg();
        }

        public void SaveSysCfg()
        {
            if (this._owner.PersistentManager == null)
            {
                throw new NullReferenceException();
            }
            this._owner.PersistentManager.SaveSystemConfig(delegate (XmlNode xmlNode) {
                if (xmlNode != null)
                {
                    XmlHelper.SetNodeAttribute(xmlNode, "Navigator", this._sysSetting.NavigatorServerUri);
                    if (string.IsNullOrEmpty(this._sysSetting.ClientVersion))
                    {
                        this._sysSetting.ClientVersion = FixedClientSetting.Version;
                    }
                    XmlHelper.SetNodeAttribute(xmlNode, "ClientVersion", this._sysSetting.ClientVersion);
                    xmlNode.InnerXml = this._sysSetting.ToString();
                }
            });
        }

        public void SaveUserCfg()
        {
            if (this._owner.PersistentManager == null)
            {
                throw new NullReferenceException();
            }
            this._owner.PersistentManager.SaveImpsUserConfig(delegate (XmlNode xmlNode) {
                if (xmlNode != null)
                {
                    xmlNode.InnerXml = this._userSetting.LocalToString();
                }
            });
        }

        public void SaveWndUserCfg()
        {
            if (this._owner.PersistentManager == null)
            {
                throw new NullReferenceException();
            }
            this._owner.PersistentManager.SaveWindowsUserCfg(delegate (XmlNode xmlNode) {
                if (xmlNode != null)
                {
                    StringBuilder builder = new StringBuilder();
                    builder.Append(this._userSetting.ToWndUserXml());
                    if (this._sysSetting.RecordMyLog)
                    {
                        builder.AppendFormat("<{0} {1}=\"{2}\"/>", "SystemSetting", "record-log", this._sysSetting.RecordMyLog);
                    }
                    xmlNode.InnerXml = builder.ToString();
                }
            });
        }

        public static Imps.Client.Core.FixedClientSetting FixedClientSetting
        {
            get
            {
                return _fixedClientSetting;
            }
        }

        public Imps.Client.Core.SystemSetting SystemSetting
        {
            get
            {
                return this._sysSetting;
            }
        }

        public Imps.Client.Core.UserSetting UserSetting
        {
            get
            {
                return this._userSetting;
            }
        }
    }
}

⌨️ 快捷键说明

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