exceptioneventargs.cs
来自「Gibphone is CSharp Program, it can tell 」· CS 代码 · 共 51 行
CS
51 行
using System;
using System.Collections.Generic;
using System.Text;
namespace GPCore
{
/// <summary>
/// An EventArgs that contains an Exception for error handling.
/// </summary>
public class ExceptionEventArgs : EventArgs
{
private Exception e;
/// <summary>
/// The Exception.
/// </summary>
public Exception Exception
{
get { return e; }
}
/// <summary>
/// Create a new <see cref="ExceptionEventArgs"/>.
/// </summary>
/// <param name="e">The Exception to be passed.</param>
public ExceptionEventArgs(Exception e)
{
this.e = e;
}
}
/// <summary>
/// An Exception to be thrown for an invalid password.
/// </summary>
[global::System.Serializable]
public class InvalidPasswordException : ArgumentException
{
/// <summary>
/// Creates a new <see cref="InvalidPasswordException"/>.
/// </summary>
/// <param name="username">The username that tried to log in.</param>
/// <param name="password">The password that was invalid.</param>
public InvalidPasswordException(string username, string password) : base(username, password) { }
/// <summary>
/// Creates a new <see cref="InvalidPasswordException"/>.
/// </summary>
/// <param name="username">The username that tried to log in</param>
/// <param name="password">The password that was invalid</param>
/// <param name="inner">Any inner exceptions that were the cause of this failure.</param>
public InvalidPasswordException(string username, string password, Exception inner) : base(username, password, inner) { }
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?