forked from NetCoreStack/WebSockets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocketsOptions.cs
More file actions
31 lines (27 loc) · 864 Bytes
/
Copy pathSocketsOptions.cs
File metadata and controls
31 lines (27 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using NetCoreStack.WebSockets.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
namespace NetCoreStack.WebSockets
{
public class SocketsOptions
{
internal readonly List<WebSocketCommandMap> Map;
public List<Type> Invocators { get; }
public SocketsOptions()
{
Map = new List<WebSocketCommandMap>();
Invocators = new List<Type>();
}
protected void Registry(Type invocatorType, WebSocketCommands commands)
{
Invocators.Add(invocatorType);
var values = commands.GetUniqueFlags().OfType<WebSocketCommands>().ToList();
foreach (var value in values)
{
var commandMap = new WebSocketCommandMap(value, invocatorType);
Map.Add(commandMap);
}
}
}
}