eventarg.cs

来自「使用C#的UDP组件制作的UDP双机通讯程序」· CS 代码 · 共 76 行

CS
76
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Net;

namespace Th.ChatLib
{
    public class ReceiveDataEventArgs : EventArgs
    {
        private IPEndPoint m_From;

        public IPAddress FromIPAdderss
        {
            get { return m_From.Address; }
        }
        public int FromPort
        {
            get { return m_From.Port; }
        }
        private string m_ChatString;

        public string ChatString
        {
            get { return m_ChatString; }
        }
        private Color m_ChatColor;

        public Color ChatColor
        {
            get { return m_ChatColor; }
        }
        public ReceiveDataEventArgs(IPEndPoint from, string chatString, Color chatColor)
        {
            m_From = from;
            m_ChatString = chatString;
            m_ChatColor = chatColor;
        }
    }

    public class ServerStateEventArgs : EventArgs
    {
        private bool m_RemoteOnline;
        public bool RemoteOnline
        {
            get { return m_RemoteOnline; }
        }
        private IPAddress m_RemoteIp;
        public IPAddress RemoteIp
        {
            get { return m_RemoteIp; }
        }
        public ServerStateEventArgs(IPAddress remoteIp, bool isOnline)
        {
            m_RemoteIp = remoteIp;
            m_RemoteOnline = isOnline;
        }
    }

    public class SendStateEventArgs : EventArgs
    {
        private bool m_Complete;

        public bool Complete
        {
            get { return m_Complete; }
            set { m_Complete = value; }
        }

        public SendStateEventArgs(bool complete)
        {
            m_Complete = complete;
        }
    }
}

⌨️ 快捷键说明

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