private NameValueItem SaveRule(IEnvironment eEnviornment, TrafficSplitterRule trRule) { NameValueItem nviRule = null; ISubPlugInDefinition <TrafficSplitterRule> ruleDefinition = GetRuleDefinitionForName(eEnviornment, trRule.Name); if (ruleDefinition != null) { nviRule = new NameValueItem("rule", ""); nviRule.AddChildItem(new NameValueItem("ruleKey", ruleDefinition.PluginKey)); nviRule.AddChildRange(ruleDefinition.GetConfiguration(trRule)); foreach (TrafficSplitterRule tsrChild in trRule.ChildRules) { NameValueItem nvi = SaveRule(eEnviornment, tsrChild); if (nvi != null) { nviRule.AddChildItem(nvi); } } } return(nviRule); }
private NameValueItem SaveCondition(IEnvironment eEnviornment, HTTPStreamModifierCondition cCondition) { NameValueItem nviRule = null; ISubPlugInDefinition <HTTPStreamModifierCondition> ispConditionDefinition = null; ispConditionDefinition = GetConditionefinitionForName(eEnviornment, cCondition.Name); if (ispConditionDefinition != null) { nviRule = new NameValueItem("condition", ""); nviRule.AddChildItem(new NameValueItem("conditionKey", ispConditionDefinition.PluginKey)); nviRule.AddChildRange(ispConditionDefinition.GetConfiguration(cCondition)); foreach (HTTPStreamModifierCondition cChild in cCondition.ChildRules) { NameValueItem nvi = SaveCondition(eEnviornment, cChild); if (nvi != null) { nviRule.AddChildItem(nvi); } } } return(nviRule); }