[Modify] Polish it

This commit is contained in:
sta 2015-12-06 17:37:08 +09:00
parent 643cc4552a
commit 97ab72660f

View File

@ -4,7 +4,7 @@
*
* 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
* of this software and associated documentation files (the "Software"), to deal
@ -31,7 +31,7 @@ using System;
namespace WebSocketSharp.Net
{
/// <summary>
/// Provides the credentials for HTTP authentication (Basic/Digest).
/// Provides the credentials for the HTTP authentication (Basic/Digest).
/// </summary>
public class NetworkCredential
{
@ -39,7 +39,7 @@ namespace WebSocketSharp.Net
private string _domain;
private string _password;
private string [] _roles;
private string[] _roles;
private string _username;
#endregion
@ -47,53 +47,60 @@ namespace WebSocketSharp.Net
#region Public Constructors
/// <summary>
/// Initializes a new instance of the <see cref="NetworkCredential"/> class
/// with the specified user name and password.
/// Initializes a new instance of the <see cref="NetworkCredential"/> class with
/// the specified user name and password.
/// </summary>
/// <param name="username">
/// A <see cref="string"/> that represents the user name associated with the
/// credentials.
/// A <see cref="string"/> that represents the user name associated with the credentials.
/// </param>
/// <param name="password">
/// A <see cref="string"/> that represents the password for the user name
/// associated with the credentials.
/// A <see cref="string"/> that represents the password for the user name associated with
/// the credentials.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="username"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="username"/> is <see langword="null"/> or empty.
/// <paramref name="username"/> is empty.
/// </exception>
public NetworkCredential (string username, string password)
: this (username, password, null, new string [0])
: this (username, password, null, new string[0])
{
}
/// <summary>
/// Initializes a new instance of the <see cref="NetworkCredential"/> class
/// with the specified user name, password, domain, and roles.
/// Initializes a new instance of the <see cref="NetworkCredential"/> class with
/// the specified user name, password, domain, and roles.
/// </summary>
/// <param name="username">
/// A <see cref="string"/> that represents the user name associated with the
/// credentials.
/// A <see cref="string"/> that represents the user name associated with the credentials.
/// </param>
/// <param name="password">
/// A <see cref="string"/> that represents the password for the user name
/// associated with the credentials.
/// A <see cref="string"/> that represents the password for the user name associated with
/// the credentials.
/// </param>
/// <param name="domain">
/// A <see cref="string"/> that represents the name of the user domain
/// associated with the credentials.
/// A <see cref="string"/> that represents the name of the user domain associated with
/// the credentials.
/// </param>
/// <param name="roles">
/// An array of <see cref="string"/> that contains the role names to which
/// the user associated with the credentials belongs if any.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="username"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="username"/> is <see langword="null"/> or empty.
/// <paramref name="username"/> is empty.
/// </exception>
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)
throw new ArgumentException ("Must not be null or empty.", "username");
if (username == null)
throw new ArgumentNullException ("username");
if (username.Length == 0)
throw new ArgumentException ("An empty string.", "username");
_username = username;
_password = password;
@ -109,8 +116,8 @@ namespace WebSocketSharp.Net
/// Gets the name of the user domain associated with the credentials.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the name of the user domain
/// associated with the credentials.
/// A <see cref="string"/> that represents the name of the user domain associated with
/// the credentials.
/// </value>
public string Domain {
get {
@ -126,8 +133,8 @@ namespace WebSocketSharp.Net
/// Gets the password for the user name associated with the credentials.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the password for the user name
/// associated with the credentials.
/// A <see cref="string"/> that represents the password for the user name associated with
/// the credentials.
/// </value>
public string Password {
get {
@ -140,14 +147,13 @@ namespace WebSocketSharp.Net
}
/// <summary>
/// Gets the role names to which the user associated with the credentials
/// belongs.
/// Gets the role names to which the user associated with the credentials belongs.
/// </summary>
/// <value>
/// An array of <see cref="string"/> that contains the role names to which
/// the user associated with the credentials belongs.
/// </value>
public string [] Roles {
public string[] Roles {
get {
return _roles;
}
@ -161,8 +167,7 @@ namespace WebSocketSharp.Net
/// Gets the user name associated with the credentials.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the user name associated with the
/// credentials.
/// A <see cref="string"/> that represents the user name associated with the credentials.
/// </value>
public string UserName {
get {