message.cs

来自「飞信的收发使用csharp进行开发」· CS 代码 · 共 134 行

CS
134
字号
namespace Imps.Client.Pc
{
    using Imps.Client.Core;
    using System;

    public class Message
    {
        private string _content;
        private string _date;
        private string _from;
        private string _fromUri;
        private string _messageId;
        private Contact _ownerContact;
        private string _time;
        private string _to;

        public string Content
        {
            get
            {
                return this._content;
            }
            set
            {
                this._content = value;
            }
        }

        public string Date
        {
            get
            {
                return this._date;
            }
            set
            {
                this._date = value;
            }
        }

        public string From
        {
            get
            {
                return this._from;
            }
            set
            {
                this._from = value;
            }
        }

        public string FromUri
        {
            get
            {
                return this._fromUri;
            }
            set
            {
                this._fromUri = value;
            }
        }

        public string MessageId
        {
            get
            {
                return this._messageId;
            }
            set
            {
                this._messageId = value;
            }
        }

        public DateTime MsgDateTime
        {
            get
            {
                try
                {
                    DateTime time;
                    if (DateTime.TryParse(this._date + " " + this._time, out time))
                    {
                        return time;
                    }
                }
                catch (Exception)
                {
                }
                return DateTime.Now;
            }
        }

        public Contact OwnerContact
        {
            get
            {
                return this._ownerContact;
            }
            set
            {
                this._ownerContact = value;
            }
        }

        public string Time
        {
            get
            {
                return this._time;
            }
            set
            {
                this._time = value;
            }
        }

        public string To
        {
            get
            {
                return this._to;
            }
            set
            {
                this._to = value;
            }
        }
    }
}

⌨️ 快捷键说明

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