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

📄 soundsetting.cs

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

    public class SoundSetting : PropertyDictionary, IUserConfig
    {
        private const string _defaultLudgeFileName = "ludge.wav";
        private const string _defaultNewMsgFileName = "newmessage.wav";
        private const string _defaultOnlineWaveFileName = "online.wav";
        private const string _defaultSysWaveFileName = "sys.wav";
        private const string _initSoundsDir = "Sounds";
        private static string _ludgeWavePath = Path.Combine(Path.Combine(ImpsPathInfo.StartupPath, "Sounds"), "ludge.wav");
        private static string _newMsgWavePath = Path.Combine(Path.Combine(ImpsPathInfo.StartupPath, "Sounds"), "newmessage.wav");
        private static string _onlineWavePath = Path.Combine(Path.Combine(ImpsPathInfo.StartupPath, "Sounds"), "online.wav");
        private static string _sysWavePath = Path.Combine(Path.Combine(ImpsPathInfo.StartupPath, "Sounds"), "sys.wav");

        internal SoundSetting()
        {
        }

        public void ClearLocalUserCfg()
        {
        }

        public void ClearUserCfg()
        {
        }

        public void ClearWndCfg()
        {
        }

        public void LoadLocalUserCfg(XmlNode node)
        {
        }

        public void LoadWndXml(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                if (((node.Name == "SoundEnabled") || (node.Name == "OnlineEnabled")) || (((node.Name == "MsgEnabled") || (node.Name == "SysEnabled")) || (node.Name == "LudgeEnabled")))
                {
                    bool val = false;
                    bool.TryParse(node.InnerText, ref val);
                    base.InnerSetPropertyValue<ProposedData<bool>>(node.Name, new ProposedData<bool>(val));
                    continue;
                }
                base.InnerSetPropertyValue<ProposedData<string>>(node.Name, new ProposedData<string>(node.InnerXml));
            }
        }

        public void LoadXml(XmlNode xmlNode)
        {
        }

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

        public string ToLocalUserCfg()
        {
            return string.Empty;
        }

        public override string ToString()
        {
            return string.Empty;
        }

        public string ToWndXml()
        {
            string text = "<SoundSetting>";
            text = ((text + string.Format("<SoundEnabled>{0}</SoundEnabled>", this.SoundEnabled.ToString())) + string.Format("<OnlineEnabled>{0}</OnlineEnabled>", this.OnlineEnabled.ToString()) + string.Format("<MsgEnabled>{0}</MsgEnabled>", this.MsgEnabled.ToString())) + string.Format("<SysEnabled>{0}</SysEnabled>", this.SysEnabled.ToString()) + string.Format("<LudgeEnabled>{0}</LudgeEnabled>", this.NudgeEnabled.ToString());
            if (!object.Equals(this.OnlineNotify.Value, _onlineWavePath))
            {
                text = text + string.Format("<SoundOnlineNotify>{0}</SoundOnlineNotify>", this.OnlineNotify);
            }
            if (!object.Equals(this.MsgNotify.Value, _newMsgWavePath))
            {
                text = text + string.Format("<SoundMsgNotify>{0}</SoundMsgNotify>", this.MsgNotify);
            }
            if (!object.Equals(this.SysNotify.Value, _sysWavePath))
            {
                text = text + string.Format("<SoundSysNotify>{0}</SoundSysNotify>", this.SysNotify);
            }
            if (!object.Equals(this.NudgeNotify.Value, _ludgeWavePath))
            {
                text = text + string.Format("<SoundLudgeNotify>{0}</SoundLudgeNotify>", this.NudgeNotify);
            }
            return (text + "</SoundSetting>");
        }

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

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<string> MsgNotify
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<string>>("SoundMsgNotify", new ProposedData<string>(File.Exists(_newMsgWavePath) ? _newMsgWavePath : string.Empty));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<string>>("SoundMsgNotify", value);
            }
        }

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<bool> NudgeEnabled
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<bool>>("LudgeEnabled", new ProposedData<bool>(true));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<bool>>("LudgeEnabled", value);
            }
        }

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<string> NudgeNotify
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<string>>("SoundLudgeNotify", new ProposedData<string>(File.Exists(_ludgeWavePath) ? _ludgeWavePath : string.Empty));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<string>>("SoundLudgeNotify", value);
            }
        }

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

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<string> OnlineNotify
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<string>>("SoundOnlineNotify", new ProposedData<string>(File.Exists(_onlineWavePath) ? _onlineWavePath : string.Empty));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<string>>("SoundOnlineNotify", value);
            }
        }

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

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<bool> SoundEnabled
        {
            get
            {
                return new ProposedData<bool>(true);
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<bool>>("SoundEnabled", value);
            }
        }

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

        [ConfigCategory(ConfigCategory.LocalWindowsAccount)]
        public ProposedData<string> SysNotify
        {
            get
            {
                return base.InnerGetPropertyValue<ProposedData<string>>("SoundSysNotify", new ProposedData<string>(File.Exists(_sysWavePath) ? _sysWavePath : string.Empty));
            }
            internal set
            {
                base.InnerSetPropertyValue<ProposedData<string>>("SoundSysNotify", value);
            }
        }
    }
}

⌨️ 快捷键说明

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