public DeliveryRuleServerPortCondition(ServerPortMatchConditionDefinition parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            Name       = MatchVariable.ServerPort;
        }
Beispiel #2
0
        internal static DeliveryRuleServerPortCondition DeserializeDeliveryRuleServerPortCondition(JsonElement element)
        {
            ServerPortMatchConditionDefinition parameters = default;
            MatchVariable name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = ServerPortMatchConditionDefinition.DeserializeServerPortMatchConditionDefinition(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = new MatchVariable(property.Value.GetString());
                    continue;
                }
            }
            return(new DeliveryRuleServerPortCondition(name, parameters));
        }
 internal DeliveryRuleServerPortCondition(MatchVariable name, ServerPortMatchConditionDefinition parameters) : base(name)
 {
     Parameters = parameters;
     Name       = name;
 }