Skip to content
Snippets Groups Projects
Select Git revision
  • 88e737d080e7a1bd3335a032a5bed56d1954ae8e
  • master default
  • dependabot/nuget/source/Sample/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/MasterDevs.ChromeDevTools.Tests/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ProtocolGenerator/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/System.Net.Http-4.3.4
  • revert-29-revert-24-protocol_62
  • revert-24-protocol_62
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 1.0.0.40915
13 results

Protocol.cs

Blame
  • user avatar
    Georgios Diamantopoulos authored
    88e737d0
    History
    Protocol.cs 860 B
    using System.Collections.ObjectModel;
    using System.Linq;
    
    namespace MasterDevs.ChromeDevTools.ProtocolGenerator
    {
        public class Protocol
        {
            public Collection<string> Compatible { get; set; } = new Collection<string>();
    
            public Version Version { get; set; }
    
            public Collection<Domain> Domains { get; set; } = new Collection<Domain>();
    
            public string[] SourceFiles { get; set; }
    
            public string Alias { get; set; }
    
            public Domain GetDomain(string name)
            {
                return Domains.SingleOrDefault(d => string.Equals(d.Name, name, System.StringComparison.OrdinalIgnoreCase));
            }
    
            public override string ToString()
            {
                if (SourceFiles?.Any() == true)
                    return $"{Alias} ({string.Join(", ", SourceFiles)})";
    
                return Alias;
            }
        }
    }