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

📄 systemsetting.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace Imps.Client.Core
{
    using System;
    using System.Text;
    using System.Xml;

    public class SystemSetting : PropertyDictionary
    {
        private Imps.Client.Core.BuddyListSetting _buddyListSetting;
        private Imps.Client.Core.CarrierSetting _carrierSetting;
        private string _clientVersion = string.Empty;
        private Imps.Client.Core.FileShareSetting _fileShareSetting;
        private Imps.Client.Core.GroupMsgSetting _groupMsgSetting;
        private Imps.Client.Core.HintsSetting _hintsSetting;
        private Imps.Client.Core.IvrSetting _ivrSetting;
        private Imps.Client.Core.MsgHistorySetting _msgHistorySetting;
        private Imps.Client.Core.PermissionSetting _permissionSetting;
        private Imps.Client.Core.PortraitSetting _portraitSetting;
        private bool _recordeMyLog;
        private Imps.Client.Core.ServerUriSetting _serverUriSetting;
        private Imps.Client.Core.SvcNoSetting _svcNoSetting;
        private SysClientConfig _sysClientSetting;
        private Imps.Client.Core.SysConversationSetting _sysConversationSetting;
        private Imps.Client.Core.SysSmsSetting _sysSmsSetting;

        internal SystemSetting()
        {
            this._serverUriSetting = new Imps.Client.Core.ServerUriSetting(this);
            this._fileShareSetting = new Imps.Client.Core.FileShareSetting(this);
            this._portraitSetting = new Imps.Client.Core.PortraitSetting(this);
            this._svcNoSetting = new Imps.Client.Core.SvcNoSetting(this);
            this._hintsSetting = new Imps.Client.Core.HintsSetting(this);
            this._msgHistorySetting = new Imps.Client.Core.MsgHistorySetting(this);
            this._ivrSetting = new Imps.Client.Core.IvrSetting(this);
            this._sysSmsSetting = new Imps.Client.Core.SysSmsSetting(this);
            this._sysConversationSetting = new Imps.Client.Core.SysConversationSetting(this);
            this._buddyListSetting = new Imps.Client.Core.BuddyListSetting(this);
            this._permissionSetting = Imps.Client.Core.PermissionSetting.Instance;
            this._carrierSetting = new Imps.Client.Core.CarrierSetting(this);
            this._sysClientSetting = new SysClientConfig(this);
            this._groupMsgSetting = new Imps.Client.Core.GroupMsgSetting(this);
            FuncLimitedSetting.SystemSetting = this;
        }

        internal override void Clear()
        {
            base.Clear();
            this._clientVersion = string.Empty;
        }

        private string GetHttpSvrUriXml()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(string.Format("<http-applications version=\"{0}\">", this.HttpAppUriVerion));
            builder.Append(string.Format("<get-portrait>{0}</get-portrait>", this.PortraitSetting.UriDownloadPortrait));
            builder.Append(string.Format("<set-portrait>{0}</set-portrait>", this.PortraitSetting.UriSetPortrait));
            builder.Append(string.Format("<del-portrait>del-portrait-value</del-portrait>", this.PortraitSetting.UriDelPortrait));
            builder.Append(string.Format("<upload-share-content>{0}</upload-share-content>", this.FileShareSetting.BlockUploadUri));
            builder.Append(string.Format("<relay-upload-share-content>{0}</relay-upload-share-content>", this.FileShareSetting.RelayUploadUri));
            builder.Append(string.Format("<query-msg-history>{0}</query-msg-history>", this.MsgHistorySetting.UriQueryMsgHistory));
            builder.Append(string.Format("<delete-msg-history>{0}</delete-msg-history>", this.MsgHistorySetting.UriDelMsgHistory));
            builder.Append(string.Format("<get-ad>{0}</get-ad>", this.ServerUriSetting.UriGetAD));
            builder.Append(string.Format("<set-personal-info>{0}</set-personal-info>", this.ServerUriSetting.UriInitProfile));
            builder.Append(string.Format("<get-personal-ext-info>{0}</get-personal-ext-info>", this.ServerUriSetting.UriGetPersonalExInfo));
            builder.Append(string.Format("<crbt-common-access>{0}</crbt-common-access>", this.ServerUriSetting.UriCrbtCommonAccess));
            builder.Append(string.Format("<set-tone-info>{0}</set-tone-info>", this.ServerUriSetting.UriSetToneInfo));
            builder.Append(string.Format("<get-tab-info>{0}</get-tab-info>", this.ServerUriSetting.UriGetTabInfo));
            builder.Append(string.Format("<check-emotion-pic-url>{0}</check-emotion-pic-url>", this._sysConversationSetting.UriCheckEmotion));
            builder.Append(string.Format("<set-emotion-pic-url>{0}</set-emotion-pic-url>", this._sysConversationSetting.UriSetEmotion));
            builder.Append(string.Format("<get-emotion-pic-url>{0}</get-emotion-pic-url>", this._sysConversationSetting.UriGetEmotion));
            builder.Append("</http-applications>");
            return builder.ToString();
        }

        private string GetParametersXml()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(string.Format("<parameters version=\"{0}\">", this.ParamsVerion));
            builder.Append(string.Format("<max-buddies>{0}</max-buddies>", this._buddyListSetting.MaxBuddyNum));
            builder.Append(string.Format("<max-blacklist>{0}</max-blacklist>", this._buddyListSetting.MaxBlackList));
            builder.Append(string.Format("<max-chat-buddies>{0}</max-chat-buddies>", this._buddyListSetting.MaxChatFriendNum));
            builder.Append(string.Format("<max-buddy-list>{0}</max-buddy-list>", this._buddyListSetting.MaxGroupNum));
            builder.Append(string.Format("<max-msg-length>{0}</max-msg-length>", this._sysSmsSetting.MaxMsgLenOnline));
            builder.Append(string.Format("<max-sms-length>{0}</max-sms-length>", this._sysSmsSetting.MaxMsgLenSmsOnline));
            builder.Append(string.Format("<max-msg-convert-sms>{0}</max-msg-convert-sms>", this._sysSmsSetting.MaxSmsNumPerMsg));
            builder.Append(string.Format("<max-sms-unicode>{0}</max-sms-unicode>", this._sysSmsSetting.MaxUnicodeSmsLen));
            builder.Append(string.Format("<batch-sms-max-receivers>{0}</batch-sms-max-receivers>", this._sysSmsSetting.MaxFriendsNumBatchSms));
            builder.Append(string.Format("<max-ivr-participants>{0}</max-ivr-participants>", this._ivrSetting.MaxNumForIVR));
            builder.Append(string.Format("<ivr-invite-timeout>{0}</ivr-invite-timeout>", this._ivrSetting.TimeoutForIVRInvite));
            builder.Append(string.Format("<portrait-file-type>{0}</portrait-file-type>", this._portraitSetting.PortraitFileType));
            builder.Append(string.Format("<forbidden-share-content-type>{0}</forbidden-share-content-type>", this._fileShareSetting.ForbiddenShareContentType));
            builder.Append(string.Format("<max-share-content-size>{0}</max-share-content-size>", this._fileShareSetting.MaxShareContentSize));
            builder.Append(string.Format("<offline-max-share-content-size>{0}</offline-max-share-content-size>", this._fileShareSetting.MaxSizeWhenOffline));
            builder.Append(string.Format("<temp-group-max-share-content-size>{0}</temp-group-max-share-content-size>", this._fileShareSetting.MaxSizeWhenMultiConversation));
            builder.Append(string.Format("<groupcategory-version>{0}</groupcategory-version>", this._groupMsgSetting.GroupCategoryVersion));
            builder.Append(string.Format("<max-superadmin-count>{0}</max-superadmin-count>", this._groupMsgSetting.MaxSuperadminCount));
            builder.Append(string.Format("<max-joingroup-count>{0}</max-joingroup-count>", this._groupMsgSetting.MaxJoingroupCount));
            builder.Append(string.Format("<max-groupadmin-count>{0}</max-groupadmin-count>", this._groupMsgSetting.MaxGroupadminCount));
            builder.Append(string.Format("<max-groupuser-count>{0}</max-groupuser-count>", this._groupMsgSetting.MaxGroupuserCount));
            builder.Append(string.Format("<max-joingroup-invite-count>{0}</max-joingroup-invite-count>", this._groupMsgSetting.MaxJoinGroupInviteCount));
            builder.Append(string.Format("<max-daily-sms-time>{0}</max-daily-sms-time>", this._groupMsgSetting.MaxDailySMSTime));
            builder.Append(string.Format("<max-month-sms-time>{0}</max-month-sms-time>", this._groupMsgSetting.MaxMonthSMSTime));
            builder.Append(string.Format("<searchgroup-pagesize>{0}</searchgroup-pagesize>", this._groupMsgSetting.SearchGroupPageSize));
            builder.Append(string.Format("<max-emotion-pic-size>{0}</max-emotion-pic-size>", this._sysConversationSetting.MaxEmotionPicSize));
            builder.Append(string.Format("<max-emotion-pic-rect>{0}</max-emotion-pic-rect>", this._sysConversationSetting.MaxEmotionPicRect));
            builder.Append("</parameters>");
            return builder.ToString();
        }

        internal T GetPropertyValue<T>(string propertyKey)
        {
            return base.InnerGetPropertyValue<T>(propertyKey);
        }

        internal T GetPropertyValue<T>(string propertyKey, T defaultValue)
        {
            return base.InnerGetPropertyValue<T>(propertyKey, defaultValue);
        }

        public void InitHintsSetting(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                base.InnerSetPropertyValue<string>(node.Name, node.InnerText);
            }
            int propertyValue = 0;
            if (xmlNode.Attributes.Count > 0)
            {
                string text = xmlNode.Attributes["version"].Value;
                if (text != null)
                {
                    int.TryParse(text, ref propertyValue);
                }
            }
            base.InnerSetPropertyValue<int>("HintsVer", propertyValue);
        }

        public void InitHttpSvrUriSetting(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                base.InnerSetPropertyValue<string>(node.Name, node.InnerXml);
            }
            int propertyValue = 0;
            if (xmlNode.Attributes.Count > 0)
            {
                string text = xmlNode.Attributes["version"].Value;
                if (text != null)
                {
                    int.TryParse(text, ref propertyValue);
                }
            }
            base.InnerSetPropertyValue<int>("HttpAppUriVerion", propertyValue);
        }

        public void InitParameters(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                string name;
                if (((name = node.Name) != null) && (((name == "portrait-file-type") || (name == "forbidden-share-content-type")) || (name == "max-emotion-pic-rect")))
                {
                    base.InnerSetPropertyValue<string>(node.Name, node.InnerXml);
                    continue;
                }
                int propertyValue = 0;
                int.TryParse(node.InnerText, ref propertyValue);
                base.InnerSetPropertyValue<int>(node.Name, propertyValue);
            }
            int num2 = 0;
            if ((xmlNode.Attributes.Count > 0) && (xmlNode.Attributes["version"] != null))
            {
                string text = xmlNode.Attributes["version"].Value;
                if (text != null)
                {
                    int.TryParse(text, ref num2);
                }
            }
            base.InnerSetPropertyValue<int>("ParamsVerion", num2);
        }

        public void InitSvcNo(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                long propertyValue = 0;
                long.TryParse(node.InnerText, ref propertyValue);
                base.InnerSetPropertyValue<long>(node.Name, propertyValue);
            }
            int num2 = 0;
            if ((xmlNode.Attributes.Count > 0) && (xmlNode.Attributes["version"] != null))
            {
                string text = xmlNode.Attributes["version"].Value;
                if (text != null)
                {
                    int.TryParse(text, ref num2);
                }
            }
            base.InnerSetPropertyValue<int>("SvcNoVer", num2);
        }

        internal void InitSvrUriSetting(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                base.InnerSetPropertyValue<string>(node.Name, node.InnerXml);
            }
            int propertyValue = 0;
            if (xmlNode.Attributes.Count > 0)
            {
                string text = xmlNode.Attributes["version"].Value;
                if (text != null)
                {
                    int.TryParse(text, ref propertyValue);
                }
            }
            base.InnerSetPropertyValue<int>("SvrUriVer", propertyValue);
        }

        internal void InitSysClientConfig(XmlNode xmlNode)
        {
            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                XmlAttribute attribute = node.Attributes["key"];
                XmlAttribute attribute2 = node.Attributes["value"];
                if ((attribute != null) && (attribute2 != null))
                {
                    base.InnerSetPropertyValue<string>(attribute.Value, attribute2.Value);
                }
            }
            int propertyValue = 0;
            if (xmlNode.Attributes.Count > 0)
            {
                string text = xmlNode.Attributes["version"].Value;
                if (!string.IsNullOrEmpty(text))
                {
                    int.TryParse(text, ref propertyValue);
                }
            }
            base.InnerSetPropertyValue<int>("client-config-version", propertyValue);
        }

⌨️ 快捷键说明

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