iauthenticate.cs

来自「Gibphone is CSharp Program, it can tell 」· CS 代码 · 共 56 行

CS
56
字号
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 + =
减小字号Ctrl + -
显示快捷键?