Newer
Older
Frederik Carlier
committed
using Newtonsoft.Json;
Frederik Carlier
committed
using System.Collections.ObjectModel;
Frederik Carlier
committed
namespace MasterDevs.ChromeDevTools.ProtocolGenerator
{
Frederik Carlier
committed
{
Frederik Carlier
committed
public Domain()
{
this.Types = new Collection<Type>();
this.Events = new Collection<Event>();
this.Commands = new Collection<Command>();
}
Frederik Carlier
committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[JsonProperty(PropertyName = "domain")]
public override string Name
{
get;
set;
}
public Collection<Type> Types
{
get;
set;
}
public Collection<Command> Commands
{
get;
set;
}
public Collection<Event> Events
{
get;
set;
}
public string Availability
{
get;
set;
}
public string FeatureGuard
{
get;
set;
}
public Command GetCommand(string name)
{
return this.Commands.SingleOrDefault(c => string.Equals(c.Name, name, StringComparison.OrdinalIgnoreCase));
}
public Type GetType(string name)
{
return this.Types.SingleOrDefault(t => string.Equals(t.Name, name, StringComparison.OrdinalIgnoreCase));
}