Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
f7a4110e
Commit
f7a4110e
authored
Mar 11, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: EndPointCollection
parent
6c44a771
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
25 deletions
+22
-25
EndPointCollection.cs
...kExchange.Redis/StackExchange/Redis/EndPointCollection.cs
+22
-25
No files found.
StackExchange.Redis/StackExchange/Redis/EndPointCollection.cs
View file @
f7a4110e
...
@@ -13,35 +13,30 @@ public sealed class EndPointCollection : Collection<EndPoint>
...
@@ -13,35 +13,30 @@ public sealed class EndPointCollection : Collection<EndPoint>
/// <summary>
/// <summary>
/// Create a new EndPointCollection
/// Create a new EndPointCollection
/// </summary>
/// </summary>
public
EndPointCollection
()
:
base
()
public
EndPointCollection
()
{}
{
}
/// <summary>
/// <summary>
/// Create a new EndPointCollection
/// Create a new EndPointCollection
/// </summary>
/// </summary>
public
EndPointCollection
(
IList
<
EndPoint
>
endpoints
)
:
base
(
endpoints
)
/// <param name="endpoints">The endpoints to add to the collection.</param>
{
public
EndPointCollection
(
IList
<
EndPoint
>
endpoints
)
:
base
(
endpoints
)
{}
}
/// <summary>
/// <summary>
/// Format an endpoint
/// Format an endpoint
/// </summary>
/// </summary>
public
static
string
ToString
(
EndPoint
endpoint
)
/// <param name="endpoint">The endpoint to get a string representation for.</param>
{
public
static
string
ToString
(
EndPoint
endpoint
)
=>
Format
.
ToString
(
endpoint
);
return
Format
.
ToString
(
endpoint
);
}
/// <summary>
/// <summary>
/// Attempt to parse a string into an EndPoint
/// Attempt to parse a string into an EndPoint
/// </summary>
/// </summary>
public
static
EndPoint
TryParse
(
string
endpoint
)
/// <param name="endpoint">The endpoint string to parse.</param>
{
public
static
EndPoint
TryParse
(
string
endpoint
)
=>
Format
.
TryParseEndPoint
(
endpoint
);
return
Format
.
TryParseEndPoint
(
endpoint
);
}
/// <summary>
/// <summary>
/// Adds a new endpoint to the list
/// Adds a new endpoint to the list
/// </summary>
/// </summary>
/// <param name="hostAndPort">The host:port string to add an endpoint for to the collection.</param>
public
void
Add
(
string
hostAndPort
)
public
void
Add
(
string
hostAndPort
)
{
{
var
endpoint
=
Format
.
TryParseEndPoint
(
hostAndPort
);
var
endpoint
=
Format
.
TryParseEndPoint
(
hostAndPort
);
...
@@ -50,24 +45,24 @@ public void Add(string hostAndPort)
...
@@ -50,24 +45,24 @@ public void Add(string hostAndPort)
}
}
/// <summary>
/// <summary>
/// Adds a new endpoint to the list
/// Adds a new endpoint to the list
.
/// </summary>
/// </summary>
public
void
Add
(
string
host
,
int
port
)
/// <param name="host">The host to add.</param>
{
/// <param name="port">The port for <paramref name="host"/> to add.</param>
Add
(
Format
.
ParseEndPoint
(
host
,
port
));
public
void
Add
(
string
host
,
int
port
)
=>
Add
(
Format
.
ParseEndPoint
(
host
,
port
));
}
/// <summary>
/// <summary>
/// Adds a new endpoint to the list
/// Adds a new endpoint to the list
.
/// </summary>
/// </summary>
public
void
Add
(
IPAddress
host
,
int
port
)
/// <param name="host">The host to add.</param>
{
/// <param name="port">The port for <paramref name="host"/> to add.</param>
Add
(
new
IPEndPoint
(
host
,
port
));
public
void
Add
(
IPAddress
host
,
int
port
)
=>
Add
(
new
IPEndPoint
(
host
,
port
));
}
/// <summary>
/// <summary>
/// See Collection<T>.InsertItem()
/// See Collection<T>.InsertItem()
/// </summary>
/// </summary>
/// <param name="index">The index to add <paramref name="item"/> into the collection at.</param>
/// <param name="item">The item to insert at <paramref name="index"/>.</param>
protected
override
void
InsertItem
(
int
index
,
EndPoint
item
)
protected
override
void
InsertItem
(
int
index
,
EndPoint
item
)
{
{
if
(
item
==
null
)
throw
new
ArgumentNullException
(
nameof
(
item
));
if
(
item
==
null
)
throw
new
ArgumentNullException
(
nameof
(
item
));
...
@@ -77,6 +72,8 @@ protected override void InsertItem(int index, EndPoint item)
...
@@ -77,6 +72,8 @@ protected override void InsertItem(int index, EndPoint item)
/// <summary>
/// <summary>
/// See Collection<T>.SetItem()
/// See Collection<T>.SetItem()
/// </summary>
/// </summary>
/// <param name="index">The index to replace an endpoint at.</param>
/// <param name="item">The item to replace the existing endpoint at <paramref name="index"/>.</param>
protected
override
void
SetItem
(
int
index
,
EndPoint
item
)
protected
override
void
SetItem
(
int
index
,
EndPoint
item
)
{
{
if
(
item
==
null
)
throw
new
ArgumentNullException
(
nameof
(
item
));
if
(
item
==
null
)
throw
new
ArgumentNullException
(
nameof
(
item
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment