Skip to content
Snippets Groups Projects
Commit 9a48b90e authored by Frederik Carlier's avatar Frederik Carlier
Browse files

MethodTypeMap: Allow the caller to specify which alias (Chrome/iOS) is being targetted

parent 0f224d88
No related branches found
No related tags found
No related merge requests found
......@@ -12,17 +12,25 @@ namespace MasterDevs.ChromeDevTools
private readonly Dictionary<string, Type> _eventTypes = new Dictionary<string, Type>();
public MethodTypeMap()
: this("Chrome")
{
LoadMethodTypeMap();
}
private void LoadMethodTypeMap()
public MethodTypeMap(string alias)
{
LoadMethodTypeMap(alias);
}
private void LoadMethodTypeMap(string alias)
{
var assembly = Assembly.GetExecutingAssembly();
var assemblyTypes = assembly.GetTypes();
foreach (var type in assemblyTypes)
{
if (!type.IsClass) continue;
if (!type.Namespace.StartsWith($"MasterDevs.ChromeDevTools.Protocol.{alias}")) continue;
if (type.Name.EndsWith("CommandResponse"))
{
var methodName = GetMethodName<CommandResponseAttribute>(type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment