Comments and constructor visibility.
This commit is contained in:
@@ -7,25 +7,43 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace NSspi
|
namespace NSspi
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The exception that is thrown when a problem occurs hwen using the SSPI system.
|
||||||
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class SSPIException : Exception
|
public class SSPIException : Exception
|
||||||
{
|
{
|
||||||
private SecurityStatus errorCode;
|
private SecurityStatus errorCode;
|
||||||
private string message;
|
private string message;
|
||||||
|
|
||||||
public SSPIException( SerializationInfo info, StreamingContext context )
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the SSPIException class with the given message and status.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">A message explaining what part of the system failed.</param>
|
||||||
|
/// <param name="errorCode">The error code observed during the failure.</param>
|
||||||
|
public SSPIException( string message, SecurityStatus errorCode )
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
this.errorCode = errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the SSPIException class from serialization data.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="info"></param>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected SSPIException( SerializationInfo info, StreamingContext context )
|
||||||
: base( info, context )
|
: base( info, context )
|
||||||
{
|
{
|
||||||
this.message = info.GetString( "messsage" );
|
this.message = info.GetString( "messsage" );
|
||||||
this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" );
|
this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public SSPIException( string message, SecurityStatus errorCode )
|
/// <summary>
|
||||||
{
|
/// Serializes the exception.
|
||||||
this.message = message;
|
/// </summary>
|
||||||
this.errorCode = errorCode;
|
/// <param name="info"></param>
|
||||||
}
|
/// <param name="context"></param>
|
||||||
|
|
||||||
public override void GetObjectData( SerializationInfo info, StreamingContext context )
|
public override void GetObjectData( SerializationInfo info, StreamingContext context )
|
||||||
{
|
{
|
||||||
base.GetObjectData( info, context );
|
base.GetObjectData( info, context );
|
||||||
@@ -34,6 +52,9 @@ namespace NSspi
|
|||||||
info.AddValue( "errorCode", this.errorCode );
|
info.AddValue( "errorCode", this.errorCode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The error code that was observed during the SSPI call.
|
||||||
|
/// </summary>
|
||||||
public SecurityStatus ErrorCode
|
public SecurityStatus ErrorCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -42,6 +63,9 @@ namespace NSspi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A human-readable message indicating the nature of the exception.
|
||||||
|
/// </summary>
|
||||||
public override string Message
|
public override string Message
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user