[Modify] Polish it
This commit is contained in:
parent
643cc4552a
commit
97ab72660f
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License
|
* The MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 sta.blockhead
|
* Copyright (c) 2014-2015 sta.blockhead
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -31,7 +31,7 @@ using System;
|
|||||||
namespace WebSocketSharp.Net
|
namespace WebSocketSharp.Net
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides the credentials for HTTP authentication (Basic/Digest).
|
/// Provides the credentials for the HTTP authentication (Basic/Digest).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NetworkCredential
|
public class NetworkCredential
|
||||||
{
|
{
|
||||||
@ -47,19 +47,21 @@ namespace WebSocketSharp.Net
|
|||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="NetworkCredential"/> class
|
/// Initializes a new instance of the <see cref="NetworkCredential"/> class with
|
||||||
/// with the specified user name and password.
|
/// the specified user name and password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="username">
|
/// <param name="username">
|
||||||
/// A <see cref="string"/> that represents the user name associated with the
|
/// A <see cref="string"/> that represents the user name associated with the credentials.
|
||||||
/// credentials.
|
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="password">
|
/// <param name="password">
|
||||||
/// A <see cref="string"/> that represents the password for the user name
|
/// A <see cref="string"/> that represents the password for the user name associated with
|
||||||
/// associated with the credentials.
|
/// the credentials.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <exception cref="ArgumentNullException">
|
||||||
|
/// <paramref name="username"/> is <see langword="null"/>.
|
||||||
|
/// </exception>
|
||||||
/// <exception cref="ArgumentException">
|
/// <exception cref="ArgumentException">
|
||||||
/// <paramref name="username"/> is <see langword="null"/> or empty.
|
/// <paramref name="username"/> is empty.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public NetworkCredential (string username, string password)
|
public NetworkCredential (string username, string password)
|
||||||
: this (username, password, null, new string[0])
|
: this (username, password, null, new string[0])
|
||||||
@ -67,33 +69,38 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="NetworkCredential"/> class
|
/// Initializes a new instance of the <see cref="NetworkCredential"/> class with
|
||||||
/// with the specified user name, password, domain, and roles.
|
/// the specified user name, password, domain, and roles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="username">
|
/// <param name="username">
|
||||||
/// A <see cref="string"/> that represents the user name associated with the
|
/// A <see cref="string"/> that represents the user name associated with the credentials.
|
||||||
/// credentials.
|
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="password">
|
/// <param name="password">
|
||||||
/// A <see cref="string"/> that represents the password for the user name
|
/// A <see cref="string"/> that represents the password for the user name associated with
|
||||||
/// associated with the credentials.
|
/// the credentials.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="domain">
|
/// <param name="domain">
|
||||||
/// A <see cref="string"/> that represents the name of the user domain
|
/// A <see cref="string"/> that represents the name of the user domain associated with
|
||||||
/// associated with the credentials.
|
/// the credentials.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="roles">
|
/// <param name="roles">
|
||||||
/// An array of <see cref="string"/> that contains the role names to which
|
/// An array of <see cref="string"/> that contains the role names to which
|
||||||
/// the user associated with the credentials belongs if any.
|
/// the user associated with the credentials belongs if any.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <exception cref="ArgumentNullException">
|
||||||
|
/// <paramref name="username"/> is <see langword="null"/>.
|
||||||
|
/// </exception>
|
||||||
/// <exception cref="ArgumentException">
|
/// <exception cref="ArgumentException">
|
||||||
/// <paramref name="username"/> is <see langword="null"/> or empty.
|
/// <paramref name="username"/> is empty.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public NetworkCredential (
|
public NetworkCredential (
|
||||||
string username, string password, string domain, params string[] roles)
|
string username, string password, string domain, params string[] roles)
|
||||||
{
|
{
|
||||||
if (username == null || username.Length == 0)
|
if (username == null)
|
||||||
throw new ArgumentException ("Must not be null or empty.", "username");
|
throw new ArgumentNullException ("username");
|
||||||
|
|
||||||
|
if (username.Length == 0)
|
||||||
|
throw new ArgumentException ("An empty string.", "username");
|
||||||
|
|
||||||
_username = username;
|
_username = username;
|
||||||
_password = password;
|
_password = password;
|
||||||
@ -109,8 +116,8 @@ namespace WebSocketSharp.Net
|
|||||||
/// Gets the name of the user domain associated with the credentials.
|
/// Gets the name of the user domain associated with the credentials.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="string"/> that represents the name of the user domain
|
/// A <see cref="string"/> that represents the name of the user domain associated with
|
||||||
/// associated with the credentials.
|
/// the credentials.
|
||||||
/// </value>
|
/// </value>
|
||||||
public string Domain {
|
public string Domain {
|
||||||
get {
|
get {
|
||||||
@ -126,8 +133,8 @@ namespace WebSocketSharp.Net
|
|||||||
/// Gets the password for the user name associated with the credentials.
|
/// Gets the password for the user name associated with the credentials.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="string"/> that represents the password for the user name
|
/// A <see cref="string"/> that represents the password for the user name associated with
|
||||||
/// associated with the credentials.
|
/// the credentials.
|
||||||
/// </value>
|
/// </value>
|
||||||
public string Password {
|
public string Password {
|
||||||
get {
|
get {
|
||||||
@ -140,8 +147,7 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the role names to which the user associated with the credentials
|
/// Gets the role names to which the user associated with the credentials belongs.
|
||||||
/// belongs.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// An array of <see cref="string"/> that contains the role names to which
|
/// An array of <see cref="string"/> that contains the role names to which
|
||||||
@ -161,8 +167,7 @@ namespace WebSocketSharp.Net
|
|||||||
/// Gets the user name associated with the credentials.
|
/// Gets the user name associated with the credentials.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="string"/> that represents the user name associated with the
|
/// A <see cref="string"/> that represents the user name associated with the credentials.
|
||||||
/// credentials.
|
|
||||||
/// </value>
|
/// </value>
|
||||||
public string UserName {
|
public string UserName {
|
||||||
get {
|
get {
|
||||||
|
Loading…
Reference in New Issue
Block a user