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

📄 messagevalue.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.CommLayer.Common
{
    using Imps.Base.Sipc;
    using Imps.Client.Base;
    using System;
    using System.IO;
    using System.Text;

    internal class MessageValue
    {
        private MemoryStream _BodyParts;
        private SipMessageBase _message;
        private int _RetryTimes;
        private int _timerCounter;

        public MessageValue(SipMessageBase message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }
            this.Message = message;
            this._RetryTimes = message.RetryTimes;
        }

        public void AppendBodyPart(SipcMessage messge)
        {
            byte[] bodyBuffer = messge.BodyBuffer;
            if (bodyBuffer != null)
            {
                if (this._BodyParts == null)
                {
                    this._BodyParts = new MemoryStream();
                }
                this._BodyParts.Write(bodyBuffer, 0, bodyBuffer.Length);
            }
        }

        public string GetFullBody(SipcMessage message)
        {
            if (this._BodyParts == null)
            {
                return message.Body;
            }
            using (MemoryStream stream = this._BodyParts)
            {
                this.AppendBodyPart(message);
                return Encoding.UTF8.GetString(this._BodyParts.GetBuffer(), 0, (int) this._BodyParts.Length);
            }
        }

        public int GrowTimerCounter()
        {
            int num;
            this.TimerCounter = num = this.TimerCounter + 1;
            return num;
        }

        public static explicit operator MessageValue(SipMessageBase message)
        {
            if (message == null)
            {
                return null;
            }
            return new MessageValue(message);
        }

        public static explicit operator SipMessageBase(MessageValue messageValue)
        {
            if (messageValue == null)
            {
                return null;
            }
            return messageValue.Message;
        }

        public void ResetTimerCounter()
        {
            this.TimerCounter = 0;
        }

        public override string ToString()
        {
            if (this._message == null)
            {
                return string.Empty;
            }
            return this._message.ToString();
        }

        public SipMessageBase Message
        {
            get
            {
                return this._message;
            }
            private set
            {
                this._message = value;
            }
        }

        public int RetryTimes
        {
            get
            {
                return this._RetryTimes;
            }
            set
            {
                this._RetryTimes = value;
            }
        }

        public int TimerCounter
        {
            get
            {
                return this._timerCounter;
            }
            private set
            {
                this._timerCounter = value;
            }
        }
    }
}

⌨️ 快捷键说明

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