Example #1
0
        private static string GetValueOrEmptyString(Dictionary <IptableRule.MatchConditions, string> ruleRuleMatchConditions,
                                                    IptableRule.MatchConditions matchConditions)
        {
            ruleRuleMatchConditions.TryGetValue(matchConditions, out string val);

            return(val ?? string.Empty);
        }
Example #2
0
        private static string GetConcatenatedValues(Dictionary <IptableRule.MatchConditions, string> ruleRuleMatchConditions,
                                                    IptableRule.MatchConditions matchConditions, IptableRule.MatchConditions matchConditions2)
        {
            var values = new List <string>();

            ruleRuleMatchConditions.TryGetValue(matchConditions, out string val);
            values.Add(val);
            ruleRuleMatchConditions.TryGetValue(matchConditions2, out val);
            values.Add(val);

            return(string.Join(",", values.Where(str => str != null)));
        }