C# Class WebSocketSharp.Net.WebHeaderCollection

Inheritance: System.Collections.Specialized.NameValueCollection, ISerializable
Show file Open project: hiddenswitch/Meteor-Unity Class Usage Examples

Private Properties

Property Type Description
Convert string
Convert string
GetObjectData void
ISerializable void
InternalRemove void
InternalSet void
InternalSet void
IsHeaderName bool
IsHeaderValue bool
IsMultiValue bool
ToStringMultiValue string
WebHeaderCollection System
WebHeaderCollection System
add void
addWithoutCheckingName void
addWithoutCheckingNameAndRestricted void
checkColonSeparated int
checkHeaderType HttpHeaderType
checkName string
checkRestricted void
checkState void
checkValue string
convert string
doWithCheckingState void
doWithCheckingState void
doWithoutCheckingName void
getHeaderInfo WebSocketSharp.Net.HttpHeaderInfo
isRestricted bool
removeWithoutCheckingName void
setWithoutCheckingName void

Public Methods

Method Description
Add ( HttpRequestHeader header, string value ) : void

Adds the specified request header with the specified value to the collection.

Add ( HttpResponseHeader header, string value ) : void

Adds the specified response header with the specified value to the collection.

Add ( string header ) : void

Adds the specified header to the collection.

Add ( string name, string value ) : void

Adds a header with the specified name and value to the collection.

Clear ( ) : void

Removes all headers from the collection.

Get ( int index ) : string

Get the value of the header at the specified index in the collection.

Get ( string name ) : string

Get the value of the header with the specified name in the collection.

GetEnumerator ( ) : IEnumerator

Gets the enumerator used to iterate through the collection.

GetKey ( int index ) : string

Get the name of the header at the specified index in the collection.

GetValues ( int index ) : string[]

Gets an array of header values stored in the specified index position of the collection.

GetValues ( string header ) : string[]

Gets an array of header values stored in the specified header.

IsRestricted ( string headerName ) : bool

Determines whether the specified header can be set for the request.

IsRestricted ( string headerName, bool response ) : bool

Determines whether the specified header can be set for the request or the response.

OnDeserialization ( object sender ) : void

Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

Remove ( HttpRequestHeader header ) : void

Removes the specified request header from the collection.

Remove ( HttpResponseHeader header ) : void

Removes the specified response header from the collection.

Remove ( string name ) : void

Removes the specified header from the collection.

Set ( HttpRequestHeader header, string value ) : void

Sets the specified request header to the specified value.

Set ( HttpResponseHeader header, string value ) : void

Sets the specified response header to the specified value.

Set ( string name, string value ) : void

Sets the specified header to the specified value.

ToByteArray ( ) : byte[]

Converts the current WebHeaderCollection to an array of byte.

ToString ( ) : string

Returns a string that represents the current WebHeaderCollection.

this ( HttpRequestHeader header ) : string

Gets or sets the specified request header in the collection.

this ( HttpResponseHeader header ) : string

Gets or sets the specified response header in the collection.

Protected Methods

Method Description
AddWithoutValidate ( string headerName, string headerValue ) : void

Adds a header to the collection without checking if the header is on the restricted header list.

WebHeaderCollection ( SerializationInfo serializationInfo, StreamingContext streamingContext ) : System

Initializes a new instance of the WebHeaderCollection class from the specified SerializationInfo and StreamingContext.

Private Methods

Method Description
Convert ( HttpRequestHeader header ) : string
Convert ( HttpResponseHeader header ) : string
GetObjectData ( SerializationInfo serializationInfo, StreamingContext streamingContext ) : void
ISerializable ( SerializationInfo serializationInfo, StreamingContext streamingContext ) : void
InternalRemove ( string name ) : void
InternalSet ( string header, bool response ) : void
InternalSet ( string name, string value, bool response ) : void
IsHeaderName ( string name ) : bool
IsHeaderValue ( string value ) : bool
IsMultiValue ( string headerName, bool response ) : bool
ToStringMultiValue ( bool response ) : string
WebHeaderCollection ( ) : System
WebHeaderCollection ( HttpHeaderType state, bool internallyUsed ) : System
add ( string name, string value, bool ignoreRestricted ) : void
addWithoutCheckingName ( string name, string value ) : void
addWithoutCheckingNameAndRestricted ( string name, string value ) : void
checkColonSeparated ( string header ) : int
checkHeaderType ( string name ) : HttpHeaderType
checkName ( string name ) : string
checkRestricted ( string name ) : void
checkState ( bool response ) : void
checkValue ( string value ) : string
convert ( string key ) : string
doWithCheckingState ( string>.Action action, string name, string value, bool setState ) : void
doWithCheckingState ( string>.Action action, string name, string value, bool response, bool setState ) : void
doWithoutCheckingName ( string>.Action action, string name, string value ) : void
getHeaderInfo ( string name ) : WebSocketSharp.Net.HttpHeaderInfo
isRestricted ( string name, bool response ) : bool
removeWithoutCheckingName ( string name, string unuse ) : void
setWithoutCheckingName ( string name, string value ) : void

Method Details

Add() public method

Adds the specified request header with the specified value to the collection.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the request . ///
public Add ( HttpRequestHeader header, string value ) : void
header HttpRequestHeader /// One of the enum values, represents /// the request header to add. ///
value string /// A that represents the value of the header to add. ///
return void

Add() public method

Adds the specified response header with the specified value to the collection.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the response . ///
public Add ( HttpResponseHeader header, string value ) : void
header HttpResponseHeader /// One of the enum values, represents /// the response header to add. ///
value string /// A that represents the value of the header to add. ///
return void

Add() public method

Adds the specified header to the collection.
/// is , empty, or the name part of /// is empty. /// /// /// doesn't contain a colon. /// /// /// -or- /// /// /// is a restricted header. /// /// /// -or- /// /// /// The name or value part of contains invalid characters. /// /// /// The length of the value part of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the . ///
public Add ( string header ) : void
header string /// A that represents the header with the name and value separated by /// a colon (':'). ///
return void

Add() public method

Adds a header with the specified name and value to the collection.
/// is or empty. /// /// /// or contains invalid characters. /// /// /// -or- /// /// /// is a restricted header name. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the header . ///
public Add ( string name, string value ) : void
name string /// A that represents the name of the header to add. ///
value string /// A that represents the value of the header to add. ///
return void

AddWithoutValidate() protected method

Adds a header to the collection without checking if the header is on the restricted header list.
/// is or empty. /// /// or contains invalid characters. /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the . ///
protected AddWithoutValidate ( string headerName, string headerValue ) : void
headerName string /// A that represents the name of the header to add. ///
headerValue string /// A that represents the value of the header to add. ///
return void

Clear() public method

Removes all headers from the collection.
public Clear ( ) : void
return void

Get() public method

Get the value of the header at the specified index in the collection.
/// is out of allowable range of indexes for the collection. ///
public Get ( int index ) : string
index int /// An that represents the zero-based index of the header to find. ///
return string

Get() public method

Get the value of the header with the specified name in the collection.
public Get ( string name ) : string
name string /// A that represents the name of the header to find. ///
return string

GetEnumerator() public method

Gets the enumerator used to iterate through the collection.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetKey() public method

Get the name of the header at the specified index in the collection.
/// is out of allowable range of indexes for the collection. ///
public GetKey ( int index ) : string
index int /// An that represents the zero-based index of the header to find. ///
return string

GetValues() public method

Gets an array of header values stored in the specified index position of the collection.
/// is out of allowable range of indexes for the collection. ///
public GetValues ( int index ) : string[]
index int /// An that represents the zero-based index of the header to find. ///
return string[]

GetValues() public method

Gets an array of header values stored in the specified header.
public GetValues ( string header ) : string[]
header string /// A that represents the name of the header to find. ///
return string[]

IsRestricted() public static method

Determines whether the specified header can be set for the request.
/// is or empty. /// /// contains invalid characters. ///
public static IsRestricted ( string headerName ) : bool
headerName string /// A that represents the name of the header to test. ///
return bool

IsRestricted() public static method

Determines whether the specified header can be set for the request or the response.
/// is or empty. /// /// contains invalid characters. ///
public static IsRestricted ( string headerName, bool response ) : bool
headerName string /// A that represents the name of the header to test. ///
response bool /// true if does the test for the response; for the request, false. ///
return bool

OnDeserialization() public method

Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
public OnDeserialization ( object sender ) : void
sender object /// An that represents the source of the deserialization event. ///
return void

Remove() public method

Removes the specified request header from the collection.
/// is a restricted header. /// /// The current instance doesn't allow /// the request . ///
public Remove ( HttpRequestHeader header ) : void
header HttpRequestHeader /// One of the enum values, represents /// the request header to remove. ///
return void

Remove() public method

Removes the specified response header from the collection.
/// is a restricted header. /// /// The current instance doesn't allow /// the response . ///
public Remove ( HttpResponseHeader header ) : void
header HttpResponseHeader /// One of the enum values, represents /// the response header to remove. ///
return void

Remove() public method

Removes the specified header from the collection.
/// is or empty. /// /// /// contains invalid characters. /// /// /// -or- /// /// /// is a restricted header name. /// /// /// The current instance doesn't allow /// the header . ///
public Remove ( string name ) : void
name string /// A that represents the name of the header to remove. ///
return void

Set() public method

Sets the specified request header to the specified value.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the request . ///
public Set ( HttpRequestHeader header, string value ) : void
header HttpRequestHeader /// One of the enum values, represents /// the request header to set. ///
value string /// A that represents the value of the request header to set. ///
return void

Set() public method

Sets the specified response header to the specified value.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the response . ///
public Set ( HttpResponseHeader header, string value ) : void
header HttpResponseHeader /// One of the enum values, represents /// the response header to set. ///
value string /// A that represents the value of the response header to set. ///
return void

Set() public method

Sets the specified header to the specified value.
/// is or empty. /// /// /// or contains invalid characters. /// /// /// -or- /// /// /// is a restricted header name. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the header . ///
public Set ( string name, string value ) : void
name string /// A that represents the name of the header to set. ///
value string /// A that represents the value of the header to set. ///
return void

ToByteArray() public method

Converts the current WebHeaderCollection to an array of byte.
public ToByteArray ( ) : byte[]
return byte[]

ToString() public method

Returns a string that represents the current WebHeaderCollection.
public ToString ( ) : string
return string

WebHeaderCollection() protected method

Initializes a new instance of the WebHeaderCollection class from the specified SerializationInfo and StreamingContext.
/// is . /// /// An element with the specified name isn't found in . ///
protected WebHeaderCollection ( SerializationInfo serializationInfo, StreamingContext streamingContext ) : System
serializationInfo System.Runtime.Serialization.SerializationInfo /// A that contains the serialized object data. ///
streamingContext System.Runtime.Serialization.StreamingContext /// A that specifies the source for the deserialization. ///
return System

this() public method

Gets or sets the specified request header in the collection.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the request . ///
public this ( HttpRequestHeader header ) : string
header HttpRequestHeader /// One of the enum values, represents /// the request header to get or set. ///
return string

this() public method

Gets or sets the specified response header in the collection.
/// /// is a restricted header. /// /// /// -or- /// /// /// contains invalid characters. /// /// /// The length of is greater than 65,535 characters. /// /// The current instance doesn't allow /// the response . ///
public this ( HttpResponseHeader header ) : string
header HttpResponseHeader /// One of the enum values, represents /// the response header to get or set. ///
return string