Skip to content
Snippets Groups Projects
Select Git revision
  • 241474961bc2a823daab637635d22017a87d5a34
  • 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

Domain.cs

Blame
  • user avatar
    Georgios Diamantopoulos authored
    88e737d0
    History
    Domain.cs 1.60 KiB
    using Newtonsoft.Json;
    using System;
    using System.Collections.ObjectModel;
    using System.Linq;
    using Newtonsoft.Json.Linq;
    
    namespace MasterDevs.ChromeDevTools.ProtocolGenerator
    {
        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;
            }
    
            [JsonProperty("experimental")]
            public bool IsExperimental { get; set; }
    
            [JsonProperty("deprecated")]
            public bool IsDeprecated { get; set; }
    
    
            public string[] Dependencies { 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));
            }
        }
    }