Skip to content
Snippets Groups Projects
Domain.cs 1.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • Frederik Carlier's avatar
    Frederik Carlier committed
    using System;
    
    Frederik Carlier's avatar
    Frederik Carlier committed
    using System.Linq;
    
    
    namespace MasterDevs.ChromeDevTools.ProtocolGenerator
    {
    
    Frederik Carlier's avatar
    Frederik Carlier committed
        public class Domain : ProtocolItem
    
            public Domain()
            {
                this.Types = new Collection<Type>();
                this.Events = new Collection<Event>();
                this.Commands = new Collection<Command>();
            }
    
    
            [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;
            }
    
    Frederik Carlier's avatar
    Frederik Carlier committed
    
            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));
            }