Newer
Older
Frederik Carlier
committed
using System.Collections.ObjectModel;
Frederik Carlier
committed
namespace MasterDevs.ChromeDevTools.ProtocolGenerator
{
Frederik Carlier
committed
{
public Protocol()
{
this.Compatible = new Collection<string>();
this.Domains = new Collection<Domain>();
}
Frederik Carlier
committed
public Collection<string> Compatible
{
get;
set;
}
public Version Version
{
get;
set;
}
public Collection<Domain> Domains
{
get;
set;
}
public string SourceFile
{
get;
set;
}
public string Alias
{
get;
set;
}
public Domain GetDomain(string name)
{
return this.Domains.SingleOrDefault(d => string.Equals(d.Name, name, System.StringComparison.OrdinalIgnoreCase));
}
public override string ToString()
{
if(this.SourceFile != null)
{
return $"{this.Alias} ({this.SourceFile})";
}
else
{
return this.Alias;
}
}