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

📄 iauthenticate.cs

📁 Gibphone is CSharp Program, it can tell you how to design p2p chat.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using GPCore.Args;

namespace GPCore.Protocols
{
    /// <summary>
    /// An interface to extend IProtocol to require authentication.
    /// </summary>
    public interface IAuthenticate : IProtocol
    {
        /// <summary>
        /// The password of the person connecting to this protocol.
        /// </summary>
        string Password { set;}
        /// <summary>
        /// True if the password of this Protocol is already set or needs
        /// to be queried to sign on.
        /// </summary>
        bool PasswordSet { get;}
        /// <summary>
        /// Called to change the server password of this Protocol.
        /// </summary>
        /// <param name="OldPassword">The old password.</param>
        /// <param name="NewPassword">The new password.</param>
        /// <param name="RepeatPassword">The new password again, for verification.</param>
        /// <returns>True if OldPassword matches the current password; otherwise false.</returns>
        [GPArgumentMethod("Change Password",typeof(User),"Old Password",typeof(string),"New Password", typeof(string),"Repeat Password",typeof(string))]
        bool ChangePassword(string OldPassword, string NewPassword,string RepeatPassword);
        /// <summary>
        /// Signs on to this protocol.
        /// </summary>
        [GPStateMethod("Sign On",typeof(User),"Connected",false,"get_Connected")]
        void SignOn();
        /// <summary>
        /// Signs off.
        /// </summary>
        [GPStateMethod("Sign Off",typeof(User),"Connected",true,"get_Connected")]
        void SignOff();
        /// <summary>
        /// An event that is fired when this IProtocol signs on.
        /// </summary>
        // event NotifyCore onSignOn;
        /// <summary>
        /// An event that is fired when this IProtocol signs off.
        /// </summary>
        // event NotifyCore onSignOff;
    }
    public static class Authenticate
    {
        public static Event<IAuthenticate, EventArgs> SignOn = new Event<IAuthenticate, EventArgs>("SignOn");
        public static Event<IAuthenticate, EventArgs> SignOff = new Event<IAuthenticate, EventArgs>("SignOff");
    }
}

⌨️ 快捷键说明

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