public DeliveryRuleSocketAddressCondition(SocketAddressMatchConditionDefinition parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            Name       = MatchVariable.SocketAddr;
        }
Пример #2
0
        internal static DeliveryRuleSocketAddressCondition DeserializeDeliveryRuleSocketAddressCondition(JsonElement element)
        {
            SocketAddressMatchConditionDefinition parameters = default;
            MatchVariable name = default;

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