Comments and constructor visibility.

This commit is contained in:
antiduh
2014-07-07 19:15:05 +00:00
parent 239d651ec6
commit 4186938ebc

View File

@@ -7,25 +7,43 @@ using System.Threading.Tasks;
namespace NSspi
{
/// <summary>
/// The exception that is thrown when a problem occurs hwen using the SSPI system.
/// </summary>
[Serializable]
public class SSPIException : Exception
{
private SecurityStatus errorCode;
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 )
{
this.message = info.GetString( "messsage" );
this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" );
}
public SSPIException( string message, SecurityStatus errorCode )
{
this.message = message;
this.errorCode = errorCode;
}
/// <summary>
/// Serializes the exception.
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public override void GetObjectData( SerializationInfo info, StreamingContext context )
{
base.GetObjectData( info, context );
@@ -34,6 +52,9 @@ namespace NSspi
info.AddValue( "errorCode", this.errorCode );
}
/// <summary>
/// The error code that was observed during the SSPI call.
/// </summary>
public SecurityStatus ErrorCode
{
get
@@ -42,6 +63,9 @@ namespace NSspi
}
}
/// <summary>
/// A human-readable message indicating the nature of the exception.
/// </summary>
public override string Message
{
get