internal MediaGraphParameterDeclaration(string name, MediaGraphParameterType type, string description, string @default)
 {
     Name        = name;
     Type        = type;
     Description = description;
     Default     = @default;
 }
Beispiel #2
0
        internal static MediaGraphParameterDeclaration DeserializeMediaGraphParameterDeclaration(JsonElement element)
        {
            string name = default;
            MediaGraphParameterType type        = default;
            Optional <string>       description = default;
            Optional <string>       @default    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new MediaGraphParameterType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("default"))
                {
                    @default = property.Value.GetString();
                    continue;
                }
            }
            return(new MediaGraphParameterDeclaration(name, type, description.Value, @default.Value));
        }
        public MediaGraphParameterDeclaration(string name, MediaGraphParameterType type)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name = name;
            Type = type;
        }
Beispiel #4
0
 public static string ToSerialString(this MediaGraphParameterType value) => value switch
 {